diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 630b5b0c..870244e2 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -2,7 +2,7 @@ module shuffle go 1.13 -replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared +//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared //replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi @@ -22,7 +22,7 @@ require ( github.com/docker/go-units v0.4.0 // indirect github.com/elastic/go-elasticsearch/v7 v7.13.1 // indirect github.com/frikky/kin-openapi v0.39.0 - github.com/frikky/shuffle-shared v0.0.93 + github.com/frikky/shuffle-shared v0.0.95 github.com/fsouza/go-dockerclient v1.7.2 github.com/ghodss/yaml v1.0.0 github.com/go-git/go-billy/v5 v5.0.0 diff --git a/backend/go-app/walkoff.go b/backend/go-app/walkoff.go index 0eef90ac..892e6031 100644 --- a/backend/go-app/walkoff.go +++ b/backend/go-app/walkoff.go @@ -3667,25 +3667,6 @@ func IterateAppGithubFolders(ctx context.Context, fs billy.Filesystem, dir []os. continue } - readmeNames := []string{"readme", "readme.md"} - for _, readmeName := range readmeNames { - readmePath := fmt.Sprintf("%s/%s", extra, readmeName) - readmeInfo, err := fs.Open(readmePath) - if err != nil { - log.Printf("[WARNING] Failed to read README path %s", readmePath) - continue - } - - dockerfileData, err := ioutil.ReadAll(dockerfile) - if err != nil { - log.Printf("[WARNING] Failed to read readme file at %s", readmePath) - continue - } else { - log.Printf("[INFO] Found file with name %s", readmeName) - break - } - } - combined := []byte{} combined = append(combined, appfileData...) combined = append(combined, appPythonData...) @@ -3703,6 +3684,49 @@ func IterateAppGithubFolders(ctx context.Context, fs billy.Filesystem, dir []os. newName := workflowapp.Name newName = strings.ReplaceAll(newName, " ", "-") + readmeNames := []string{"README.md", "README", "readme", "readme.md", "README.MD"} + for _, readmeName := range readmeNames { + readmePath := fmt.Sprintf("%s%s", extra, readmeName) + readmeInfo, err := fs.Open(readmePath) + if err != nil { + //log.Printf("[WARNING] Failed to read README path %s", readmePath) + continue + } + + fileData, err := ioutil.ReadAll(readmeInfo) + if err != nil { + log.Printf("[WARNING] Failed to read readme file at %s", readmePath) + continue + } else { + workflowapp.Documentation = string(fileData) + log.Printf("[INFO] Found %s (README) file of length %d for %s:%s", readmePath, len(workflowapp.Documentation), newName, workflowapp.AppVersion) + break + } + } + + if len(workflowapp.Documentation) == 0 { + for _, readmeName := range readmeNames { + readmePath := fmt.Sprintf("%s../%s", extra, readmeName) + readmeInfo, err := fs.Open(readmePath) + if err != nil { + //log.Printf("[WARNING] Failed to read README path %s", readmePath) + continue + } + + fileData, err := ioutil.ReadAll(readmeInfo) + if err != nil { + log.Printf("[WARNING] Failed to read readme file at %s", readmePath) + continue + } else { + workflowapp.Documentation = string(fileData) + log.Printf("[INFO] Found %s (README) file of length %d for %s:%s", readmePath, len(workflowapp.Documentation), newName, workflowapp.AppVersion) + break + } + } + } + + workflowapp.ReferenceInfo.GithubUrl = fmt.Sprintf("https://github.com/frikky/shuffle-apps/tree/master/%s/%s", strings.ToLower(newName), workflowapp.AppVersion) + tags := []string{ fmt.Sprintf("%s:%s_%s", baseDockerName, strings.ToLower(newName), workflowapp.AppVersion), } diff --git a/docker-compose.yml b/docker-compose.yml index 6e1cc561..89a8c331 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: frontend: - #build: ./frontend + build: ./frontend image: ghcr.io/frikky/shuffle-frontend:nightly container_name: shuffle-frontend hostname: shuffle-frontend @@ -16,7 +16,7 @@ services: depends_on: - backend backend: - #build: ./backend + build: ./backend image: ghcr.io/frikky/shuffle-backend:nightly container_name: shuffle-backend hostname: ${BACKEND_HOSTNAME} diff --git a/frontend/src/components/Oauth2Auth.jsx b/frontend/src/components/Oauth2Auth.jsx index 321cd811..0c680713 100644 --- a/frontend/src/components/Oauth2Auth.jsx +++ b/frontend/src/components/Oauth2Auth.jsx @@ -176,6 +176,7 @@ const AuthenticationOauth2 = (props) => { //console.log( return (
+
Authentication for {selectedApp.name}
Oauth2 requires a client ID and secret to authenticate. This is usually made in the remote system. diff --git a/frontend/src/components/ParsedAction.jsx b/frontend/src/components/ParsedAction.jsx index 31f0019c..d8dffc18 100644 --- a/frontend/src/components/ParsedAction.jsx +++ b/frontend/src/components/ParsedAction.jsx @@ -9,7 +9,7 @@ import NestedMenuItem from "material-ui-nested-menu-item"; //import NestedMenuItem from "./NestedMenu.jsx"; import {Popper, TextField, TextareaAutosize, Drawer, Button, Paper, Grid, Tabs, InputAdornment, Tab, ButtonBase, Tooltip, Select, MenuItem, Divider, Dialog, Modal, DialogActions, DialogTitle, InputLabel, DialogContent, FormControl, IconButton, Menu, Input, FormGroup, FormControlLabel, Typography, Checkbox, Breadcrumbs, CircularProgress, Switch, Fade} from '@material-ui/core'; -import {GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons'; +import {HelpOutline as HelpOutlineIcon, Description as DescriptionIcon, GetApp as GetAppIcon, Search as SearchIcon, ArrowUpward as ArrowUpwardIcon, Visibility as VisibilityIcon, Done as DoneIcon, Close as CloseIcon, Error as ErrorIcon, FindReplace as FindreplaceIcon, ArrowLeft as ArrowLeftIcon, Cached as CachedIcon, DirectionsRun as DirectionsRunIcon, Add as AddIcon, Polymer as PolymerIcon, FormatListNumbered as FormatListNumberedIcon, Create as CreateIcon, PlayArrow as PlayArrowIcon, AspectRatio as AspectRatioIcon, MoreVert as MoreVertIcon, Apps as AppsIcon, Schedule as ScheduleIcon, FavoriteBorder as FavoriteBorderIcon, Pause as PauseIcon, Delete as DeleteIcon, AddCircleOutline as AddCircleOutlineIcon, Save as SaveIcon, KeyboardArrowLeft as KeyboardArrowLeftIcon, KeyboardArrowRight as KeyboardArrowRightIcon, ArrowBack as ArrowBackIcon, Settings as SettingsIcon, LockOpen as LockOpenIcon, ExpandMore as ExpandMoreIcon, VpnKey as VpnKeyIcon} from '@material-ui/icons'; import Autocomplete from '@material-ui/lab/Autocomplete'; import CodeMirror from '@uiw/react-codemirror'; @@ -1459,7 +1459,7 @@ const ParsedAction = (props) => {

{(selectedAction.app_name.charAt(0).toUpperCase()+selectedAction.app_name.substring(1)).replaceAll("_", " ")}

-
+
{ console.log("FIND EXAMPLE RESULTS FOR ", selectedAction) if (workflowExecutions.length > 0) { @@ -1488,15 +1488,20 @@ const ParsedAction = (props) => { - - What are actions? - {selectedAction.errors !== undefined && selectedAction.errors !== null && selectedAction.errors.length > 0 ? -
- Errors: {selectedAction.errors.join("\n")} -
- : null - } -
+ { + setAuthenticationModalOpen(true) + }}> + + + + + {}}> + + + + + +
diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 85944ac7..030a1da7 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -8,6 +8,7 @@ import { Prompt } from 'react-router' import { useBeforeunload } from 'react-beforeunload'; import ReactJson from 'react-json-view' import NestedMenuItem from "material-ui-nested-menu-item"; +import ReactMarkdown from 'react-markdown'; import {TextField, Drawer, Button, Paper, Grid, Tabs, InputAdornment, Tab, ButtonBase, Tooltip, Select, MenuItem, Divider, Dialog, Modal, DialogActions, DialogTitle, InputLabel, DialogContent, FormControl, IconButton, Menu, Input, FormGroup, FormControlLabel, Typography, Checkbox, Breadcrumbs, CircularProgress, Switch, Fade} from '@material-ui/core'; @@ -336,6 +337,38 @@ const AngularWorkflow = (props) => { }); } + + function OuterLink(props) { + if (props.href.includes("http") || props.href.includes("mailto")) { + return {props.children} + } + return {props.children} + } + + function Img(props) { + return {props.alt} + } + + function CodeHandler(props) { + return ( +
+				
+					{props.value}
+				
+			
+ ) + } + + function Heading(props) { + const element = React.createElement(`h${props.level}`, {style: {marginTop: 40}}, props.children) + return ( + + {props.level !== 1 ? : null} + {element} + + ) + } + const generateApikey = () => { fetch(globalUrl+"/api/v1/generateapikey", { method: 'GET', @@ -8794,12 +8827,14 @@ const AngularWorkflow = (props) => { active: true, }) - if (selectedApp.authentication === undefined) { - return null - } - - if (selectedApp.authentication.parameters === null || selectedApp.authentication.parameters === undefined || selectedApp.authentication.parameters.length === 0) { - return null + if (selectedApp.authentication === undefined || selectedApp.authentication.parameters === null || selectedApp.authentication.parameters === undefined || selectedApp.authentication.parameters.length === 0) { + return ( + + + {selectedApp.name} does not require authentication + + + ) } authenticationOption.app.actions = [] @@ -8883,6 +8918,7 @@ const AngularWorkflow = (props) => { //console.log( return (
+
Authentication for {selectedApp.name}
What is app authentication?
These are required fields for authenticating with {selectedApp.name} @@ -9044,7 +9080,7 @@ const AngularWorkflow = (props) => { // This whole part is redundant. Made it part of Arguments instead. - //console.log("TYPE: ", authenticationType) + console.log(selectedApp) const authenticationModal = authenticationModalOpen ? { style: { backgroundColor: surfaceColor, color: "white", - minWidth: 600, + minWidth: 1100, + minHeight: 700, + maxHeight: 700, padding: 15, + overflow: "hidden", }, }} > - { +
+ {selectedApp.reference_info === undefined || selectedApp.reference_info === null || selectedApp.reference_info.github_url === undefined || selectedApp.reference_info.github_url === null || selectedApp.reference_info.github_url.length === 0 ? + + {`Documentation + + : + + {`Documentation + + } +
+ { setAuthenticationModalOpen(false) if (configureWorkflowModalOpen) { setSelectedAction({}) @@ -9072,12 +9122,56 @@ const AngularWorkflow = (props) => { }}> -
Authentication for {selectedApp.name}
- {authenticationType.type === "oauth2" ? - - : - - } +
+
+ {authenticationType.type === "oauth2" ? + + : + + } +
+
+ {selectedApp.documentation === undefined || selectedApp.documentation === null || selectedApp.documentation.length === 0 ? + + + There is currently no documentation for this app. + + + Want help with this app? Join the Discord! + + + + Want to help change this app? + + {selectedApp.reference_info === undefined || selectedApp.reference_info === null || selectedApp.reference_info.github_url === undefined || selectedApp.reference_info.github_url === null || selectedApp.reference_info.github_url.length === 0 ? + + + Check it out on Github! + + + : + + + Check it out on Github! + + + } + + : + + } +
+
: null //const loadedCheck = isLoaded && isLoggedIn && workflowDone ?