From 41945f79b2116c8e7a3475c28a7bb6509dbccd67 Mon Sep 17 00:00:00 2001 From: frikky Date: Mon, 22 Aug 2022 15:50:07 +0200 Subject: [PATCH] Minor fixes to e.g. creator grid --- backend/app_sdk/build.sh | 2 +- frontend/src/components/CreatorGrid.jsx | 63 ++++++++++----- frontend/src/components/EditWorkflow.jsx | 77 +++++++++++++------ frontend/src/components/Oauth2Auth.jsx | 5 +- frontend/src/components/Searchfield.js | 8 +- frontend/src/components/ShuffleCodeEditor.jsx | 8 +- frontend/src/views/AngularWorkflow.jsx | 2 +- frontend/src/views/Docs.jsx | 38 ++++----- 8 files changed, 132 insertions(+), 71 deletions(-) diff --git a/backend/app_sdk/build.sh b/backend/app_sdk/build.sh index daf51e84..f3d0265b 100644 --- a/backend/app_sdk/build.sh +++ b/backend/app_sdk/build.sh @@ -2,7 +2,7 @@ ### DEFAULT NAME=shuffle-app_sdk -VERSION=1.0.5 +VERSION=1.0.6 docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force docker build . -f Dockerfile -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION -t ghcr.io/frikky/$NAME:nightly diff --git a/frontend/src/components/CreatorGrid.jsx b/frontend/src/components/CreatorGrid.jsx index e92153bd..e1007749 100644 --- a/frontend/src/components/CreatorGrid.jsx +++ b/frontend/src/components/CreatorGrid.jsx @@ -26,6 +26,11 @@ import { CardActionArea, } from '@material-ui/core'; +import { + Avatar, + AvatarGroup, +} from "@mui/material" + import { SkipNext as SkipNextIcon, SkipPrevious as SkipPreviousIcon, @@ -143,7 +148,6 @@ const CreatorGrid = props => { marginTop: 5, } - var workflowDelay = -50 const Hits = ({ hits }) => { const [mouseHoverIndex, setMouseHoverIndex] = useState(-1) var counted = 0 @@ -151,8 +155,6 @@ const CreatorGrid = props => { return ( {hits.map((data, index) => { - workflowDelay += 50 - if (counted === 12/xs*rowHandler) { return null } @@ -160,16 +162,48 @@ const CreatorGrid = props => { counted += 1 return ( - + - - + + - - {data.username} - +
+ {"Creator + + @{data.username} + +
+ + 10 apps 23 workflows + + {data.specialized_apps !== undefined && data.specialized_apps !== null && data.specialized_apps.length > 0 ? + + {data.specialized_apps.map((app, index) => { + // Putting all this in secondary of ListItemText looked weird. + return ( +
{ + console.log("Click") + //navigate("/apps/"+app.id) + }} + > + + + +
+ ) + })} +
+ : + null}
- {"Creator
@@ -251,15 +285,6 @@ const CreatorGrid = props => { : null } - - - - Search by - - - Algolia logo - - ) } diff --git a/frontend/src/components/EditWorkflow.jsx b/frontend/src/components/EditWorkflow.jsx index 786fc3b5..b7fefd3a 100644 --- a/frontend/src/components/EditWorkflow.jsx +++ b/frontend/src/components/EditWorkflow.jsx @@ -15,7 +15,6 @@ import { Divider, Button, TextField, - FormControl, IconButton, Menu, MenuItem, @@ -32,6 +31,11 @@ import { OutlinedInput, Checkbox, ListItemText, + Radio, + RadioGroup, + FormControl, + FormLabel, + } from "@material-ui/core"; import { @@ -107,6 +111,7 @@ const EditWorkflow = (props) => { required margin="dense" defaultValue={innerWorkflow.name} + label="Name" autoFocus fullWidth /> @@ -124,6 +129,7 @@ const EditWorkflow = (props) => { defaultValue={innerWorkflow.description} placeholder="Description" multiline + label="Description" margin="dense" fullWidth /> @@ -206,30 +212,50 @@ const EditWorkflow = (props) => { {showMoreClicked === true ? - { - if (event.target.value.toLowerCase() === "test") { - innerWorkflow.status = "test" - } else if (event.target.value.toLowerCase() === "production" || event.target.value.toLowerCase() === "prod") { - innerWorkflow.status = "production" - } else { - innerWorkflow.status = "test" - } - setInnerWorkflow(innerWorkflow) - }} - InputProps={{ - style: { - color: "white", - }, - }} - color="primary" - defaultValue={innerWorkflow.status} - placeholder="The status of the workflow. Can be test or production." - rows="1" - margin="dense" - fullWidth - /> + + Status + { + console.log("Data: ", e.target.value) + + innerWorkflow.workflow_type = e.target.value + setInnerWorkflow(innerWorkflow) + }} + > + } label="Test" /> + } label="Production" /> + + + +
+ + + Type + { + console.log("Data: ", e.target.value) + + innerWorkflow.workflow_type = e.target.value + setInnerWorkflow(innerWorkflow) + }} + > + } label="Trigger" /> + } label="Subflow" /> + } label="Standalone" /> + + + + + { innerWorkflow.blogpost = event.target.value @@ -244,6 +270,7 @@ const EditWorkflow = (props) => { defaultValue={innerWorkflow.blogpost} placeholder="A blogpost or other reference for how this work workflow was built, and what it's for." rows="1" + label="blogpost" margin="dense" fullWidth /> @@ -261,6 +288,7 @@ const EditWorkflow = (props) => { defaultValue={innerWorkflow.video} placeholder="A youtube or loom link to the video" rows="1" + label="Video" margin="dense" fullWidth /> @@ -279,6 +307,7 @@ const EditWorkflow = (props) => { placeholder="Default return value (used for Subflows if the subflow fails)" rows="3" multiline + label="Default return value" margin="dense" fullWidth /> diff --git a/frontend/src/components/Oauth2Auth.jsx b/frontend/src/components/Oauth2Auth.jsx index ffae024d..14810c94 100644 --- a/frontend/src/components/Oauth2Auth.jsx +++ b/frontend/src/components/Oauth2Auth.jsx @@ -59,6 +59,7 @@ const registeredApps = [ "webex", "zoho_desk", "outlook_graph", + "outlook_office365", "microsoft_teams", "microsoft_teams_user_access", ] @@ -367,9 +368,9 @@ const AuthenticationOauth2 = (props) => { // Hardcode some stuff? // This could prolly be added to the app itself with a "default" client ID console.log("APP: ", selectedApp) - if (selectedApp.name.toLowerCase() == "outlook_graph") { + if (selectedApp.name.toLowerCase() == "outlook_graph" || selectedApp.name.toLowerCase() == "outlook_office365") { handleOauth2Request( - "bb4bff85-0d0b-4f5d-8a69-3cee8029b11a", + "efe4c3fe-84a1-4821-a84f-23a6cfe8e72d", "", "https://graph.microsoft.com", ["Mail.ReadWrite"], diff --git a/frontend/src/components/Searchfield.js b/frontend/src/components/Searchfield.js index 4b2aad0d..a15ff5f3 100644 --- a/frontend/src/components/Searchfield.js +++ b/frontend/src/components/Searchfield.js @@ -535,7 +535,8 @@ const SearchField = props => { } var name = hit.name === undefined ? - hit.filename.charAt(0).toUpperCase() + hit.filename.slice(1).replaceAll("_", " ") + " - " + hit.title : + hit.filename.charAt(0).toUpperCase() + hit.filename.slice(1).replaceAll("_", " ") + " - " + hit.title + : (hit.name.charAt(0).toUpperCase()+hit.name.slice(1)).replaceAll("_", " ") if (name.length > 30) { @@ -552,6 +553,11 @@ const SearchField = props => { var parsedUrl = hit.urlpath !== undefined ? hit.urlpath : "" parsedUrl += `?queryID=${hit.__queryID}` + if (parsedUrl.includes("/apps/")) { + const extraHash = hit.url_hash === undefined ? "" : `#${hit.url_hash}` + + parsedUrl = `/apps/${hit.filename}?tab=docs&queryID=${hit.__queryID}${extraHash}` + } return ( { diff --git a/frontend/src/components/ShuffleCodeEditor.jsx b/frontend/src/components/ShuffleCodeEditor.jsx index 86ab37c4..62066735 100644 --- a/frontend/src/components/ShuffleCodeEditor.jsx +++ b/frontend/src/components/ShuffleCodeEditor.jsx @@ -379,10 +379,10 @@ const CodeEditor = (props) => { const expectedOutput = (input) => { const found = input.match(/[$]{1}([a-zA-Z0-9_-]+\.?){1}([a-zA-Z0-9#_-]+\.?){0,}/g) - if (found === null || found === undefined) { - console.log("No output found!") - return - } + //if (found === null || found === undefined) { + // console.log("No output found!") + // return + //} //console.log(found) diff --git a/frontend/src/views/AngularWorkflow.jsx b/frontend/src/views/AngularWorkflow.jsx index 37f874c5..edacd411 100644 --- a/frontend/src/views/AngularWorkflow.jsx +++ b/frontend/src/views/AngularWorkflow.jsx @@ -11277,7 +11277,7 @@ const AngularWorkflow = (defaultprops) => { group: "nodes", data: { id: newId, - label: "Your comment :)", + label: "Click to write a comment", type: "COMMENT", is_valid: true, decorator: true, diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx index 376ac40b..d475bbfc 100644 --- a/frontend/src/views/Docs.jsx +++ b/frontend/src/views/Docs.jsx @@ -29,7 +29,6 @@ const Body = { //minWidth: 768, maxWidth: "100%", minWidth: "100%", - margin: "auto", display: "flex", height: "100%", color: "white", @@ -105,17 +104,19 @@ const Docs = (defaultprops) => { padding: 30, paddingTop: 15, marginTop: 15, - minHeight: "50vh", + minHeight: "80vh", //height: "50vh", }; const SideBar = { minWidth: 250, maxWidth: 300, - position: "absolute", - top: 15, + borderRight: "1px solid rgba(255,255,255,0.3)", left: 0, - maxHeight: "83vh", + position: "sticky", + top: 50, + minHeight: "90vh", + maxHeight: "90vh", overflowX: "hidden", overflowY: "auto", zIndex: 1000, @@ -155,7 +156,11 @@ const Docs = (defaultprops) => { .then((responseJson) => { if (responseJson.success) { setData(responseJson.reason); - document.title = "Shuffle " + docId + " documentation"; + if (docId === undefined) { + document.title = "Shuffle documentation introduction"; + } else { + document.title = "Shuffle " + docId + " documentation"; + } if (responseJson.reason !== undefined && responseJson.reason !== null && responseJson.reason.includes("404: Not Found")) { navigate("/docs") @@ -349,11 +354,8 @@ const Docs = (defaultprops) => { const markdownStyle = { color: "rgba(255, 255, 255, 0.65)", - maxWidth: mobile ? "100%" : 750, overflow: "hidden", paddingBottom: 100, - maxWidth: 750, - minWidth: 750, margin: "auto", }; @@ -419,7 +421,7 @@ const Docs = (defaultprops) => { display: "flex", }} > -