diff --git a/.github/workflows/sdk-publish.yml b/.github/workflows/sdk-publish.yml deleted file mode 100644 index 64237eb8..00000000 --- a/.github/workflows/sdk-publish.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Upload App SDK to PiPy - -on: - workflow_dispatch: # Allows the workflow to be run manually from GitHub - inputs: - version: - description: 'Version of the package to publish' - required: true - release: - types: [published] - push: - tags: - - 'v*' # Triggers when a version tag is pushed (e.g., v1.0.0) - - -permissions: - contents: read - -jobs: - deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - - name: Install dependencies - run: | - cd ./backend/app_sdk - python -m pip install --upgrade pip - pip install build - - - name: Build package - run: | - cd ./backend/app_sdk - python -m build - - - name: Move build artifacts - run: | - ls -alh - ls -alh ./backend/app_sdk - mv ./backend/app_sdk/dist ./dist - - - name: Publish package - uses: pypa/gh-action-pypi-publish@v1.10.2 - with: - verify-metadata: false - repository-url: https://upload.pypi.org/legacy/ - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - env: - ACTIONS_STEP_DEBUG: true # Enables debug mode for this step - diff --git a/frontend/src/components/AppGrid.jsx b/frontend/src/components/AppGrid.jsx index dcc7310a..b0577937 100644 --- a/frontend/src/components/AppGrid.jsx +++ b/frontend/src/components/AppGrid.jsx @@ -464,8 +464,17 @@ const AppGrid = (props) => { }} > {data.name} { + // Replace the image with the default image + const foundImage = document.getElementById(`image_${index}`) + if (foundImage !== undefined && foundImage !== null) { + foundImage.src = theme.palette.defaultImage + data.image_url = theme.palette.defaultImage + } + }} style={{ width: 80, height: 80, @@ -995,7 +1004,7 @@ const AppGrid = (props) => { }} autoComplete="off" color="primary" - placeholder="Search your Activated or Self-built apps" + placeholder="Search your Activated or self-built apps" id="shuffle_search_field" onChange={(event) => { setSearchQuery(event.currentTarget.value); diff --git a/frontend/src/components/AuthenticationItem.jsx b/frontend/src/components/AuthenticationItem.jsx index 175f3510..604418b2 100644 --- a/frontend/src/components/AuthenticationItem.jsx +++ b/frontend/src/components/AuthenticationItem.jsx @@ -45,21 +45,21 @@ const AuthenticationItem = (props) => { data.fields = [ { key: "url", - value: "Secret. Replaced during app execution!", + value: "URL Secret. Replaced during runtime", }, { key: "client_id", - value: "Secret. Replaced during app execution!", + value: "ClientID Secret. Replaced during runtime.", }, { key: "client_secret", - value: "Secret. Replaced during app execution!", + value: "Client Secret. Replaced during runtime.", }, { key: "scope", - value: "Secret. Replaced during app execution!", + value: "Scope Secret. Replaced during runtime.", }, - ]; + ] } const deleteAuthentication = (data) => { diff --git a/frontend/src/components/AuthenticationWindow.jsx b/frontend/src/components/AuthenticationWindow.jsx index 05733ea7..49b6118c 100755 --- a/frontend/src/components/AuthenticationWindow.jsx +++ b/frontend/src/components/AuthenticationWindow.jsx @@ -330,8 +330,8 @@ const AuthenticationData = (props) => { + + + ) : null diff --git a/frontend/src/defaultCytoscapeStyle.jsx b/frontend/src/defaultCytoscapeStyle.jsx index a070c788..cfeeff62 100644 --- a/frontend/src/defaultCytoscapeStyle.jsx +++ b/frontend/src/defaultCytoscapeStyle.jsx @@ -13,6 +13,30 @@ const data = [ return elementname }, "text-valign": "center", + "text-margin-x": function(element) { + // Attempt at bottom-positioning + // Required text-valign: bottom + // FIXME: Disabled for now. + return "15px" + + + + const name = element.data("label") + console.log("Name: ", name) + if (name === null || name === undefined || name == "" || document=== undefined || document === null) { + return "0px" + } + + const canvas = document.createElement('canvas'); + const context = canvas.getContext('2d') + + context.font = '18px Segoe UI, Tahoma, Geneva, Verdana, sans-serif, sans-serif' + + const textWidth = context.measureText(name).width + return textWidth + "px" + //return -1*(textWidth) + "px" + }, + "font-family": "Segoe UI, Tahoma, Geneva, Verdana, sans-serif, sans-serif", "font-weight": "lighter", "font-size": "18px", @@ -23,7 +47,6 @@ const data = [ padding: "10px", margin: "5px", "border-width": "1px", - "text-margin-x": "10px", "z-index": 5001, }, }, diff --git a/frontend/src/views/Admin.jsx b/frontend/src/views/Admin.jsx index 15ef65bc..a13519a0 100755 --- a/frontend/src/views/Admin.jsx +++ b/frontend/src/views/Admin.jsx @@ -6223,9 +6223,9 @@ If you're interested, please let me know a time that works for you, or set up a --name="shuffle-orborus" \\ --pull=always \\ --volume "/var/run/docker.sock:/var/run/docker.sock" \\ - -e AUTH="d85b017c-7f47-4d3a-bb20-9b00731bc397" \\ - -e ENVIRONMENT_NAME="swarm testing" \\ - -e ORG="9c4e7cd9-cfa4-457b-9ee5-3a9faa6e8c3c" \\ + -e AUTH="${environment.auth}" \\ + -e ENVIRONMENT_NAME="${environment.Name}" \\ + -e ORG="${environment.org_id}" \\ -e SHUFFLE_WORKER_IMAGE="ghcr.io/shuffle/shuffle-worker:nightly" \\ -e SHUFFLE_SWARM_CONFIG=run \\ -e SHUFFLE_LOGS_DISABLED=true \\ @@ -6284,7 +6284,7 @@ curTab === 6 ? (

Locations

- Decides where to run your workflows and actions. Uses Shuffle's Orborus runner to handle queued jobs. Previously "Environments". + Decides where to run your workflows and actions. Uses Shuffle's Orborus runner to handle queued jobs onprem. Previously "Environments". If you have scale problems, talk to our team: support@shuffler.io.  { const releaseToConnectLabel = "Release to Connect" const integrationApps = [{ "id": "integration", - "name": "Integration Framework", + "name": "Singul", "type": "ACTION", "app_version": "1.0.0", "loop_versions": ["1.0.0"], @@ -737,8 +737,64 @@ const releaseToConnectLabel = "Release to Connect" } } + if (cy !== undefined && cy !== null) { + + // Check if any apps in the workflow has + cy.nodes().forEach((node) => { + const data = node.data() + if (data.app_id === foundapp.id) { + + if (data.name === "tmp" && data.parameters !== undefined && data.parameters !== null && data.parameters.length === 1 && data.parameters[0].name === "tmp" && foundapp.actions !== undefined && foundapp.actions !== null && foundapp.actions.length > 0) { + const startIndex = foundapp.actions.findIndex((action) => action.category_label !== undefined && action.category_label !== null && action.category_label.length > 0) + const actionIndex = startIndex < 0 ? 0 : startIndex + + node.data("name", foundapp.actions[actionIndex].name) + node.data("large_image", foundapp.large_image) + node.data("parameters", foundapp.actions[actionIndex].parameters) + node.data("finished", true) + node.data("category", foundapp.categories !== null && foundapp.categories !== undefined && foundapp.categories.length > 0 ? foundapp.categories[0] : "") + + /* + name: app.actions[actionIndex].name, + label: actionLabel, + app_name: app.name, + app_version: app.app_version, + app_id: app.id, + sharing: app.sharing, + private_id: app.private_id, + description: description, + environment: parsedEnvironments, + errors: [], + finished: false, + id_: newNodeId, + _id_: newNodeId, + id: newNodeId, + is_valid: true, + type: actionType, + parameters: parameters, + isStartNode: false, + large_image: app.large_image, + run_magic_output: false, + authentication: [], + execution_variable: undefined, + example: example, + required_body_fields: app.actions[actionIndex].required_body_fields, + authentication_id: authId, + finished: false, + template: app.template === true ? true : false, + */ + + toast("REPLACING ACTIONS") + } + } + }) + //if (action.app_id === same && app.actions.length === 1 && app.actions[0].parameters.length === 1 && app.actions[0].parameters[0].name === "tmp") { + } + + // FIXME: Add it to the existing list AND update the selected app } + }) .catch((error) => { console.log(`Failed side-loading app ${appId}: ${error}`) @@ -974,7 +1030,6 @@ const releaseToConnectLabel = "Release to Connect" if (responseJson.reason !== undefined && responseJson.reason !== undefined && responseJson.reason.length > 0) { if (!responseJson.reason.includes("404: Not Found") && responseJson.reason.length > 25) { - // Translate into markdown ![]() const imgRegex = / { if (authenticationModalOpen === true && selectedAction.app_name !== undefined) { - console.log(`Should get app docs for: ${selectedAction.app_name}`) //console.log(selectedAction) //console.log("APP: ", selectedApp) @@ -2607,7 +2661,7 @@ const releaseToConnectLabel = "Release to Connect" return } - console.log("Apps loaded. JSON decoding next") + //console.log("Apps loaded. JSON decoding next") return response.json() }) @@ -3816,7 +3870,6 @@ const releaseToConnectLabel = "Release to Connect" left: 0, selected: "", }); - //console.timeEnd("UNSELECT"); }) sendStreamRequest({ @@ -4020,6 +4073,7 @@ const releaseToConnectLabel = "Release to Connect" nodedata.app_name !== "Testing" && nodedata.app_name !== "Shuffle Workflow" && nodedata.app_name !== "Integration Framework" && + nodedata.app_name !== "Singul" && nodedata.app_name !== "User Input") || nodedata.isStartNode) ) { @@ -4280,13 +4334,30 @@ const releaseToConnectLabel = "Release to Connect" } } } + + /* + // FIXME: This is the start of a highlighter for the node + // to better match it up with other elements + // 1. Get current node's position in X/Y on the screen + // 2. Draw a red line on the X and Y axis for positioning + + // Draw a red div line in the HTML + const position = event.target.position() + const redline = document.getElementById("redline") + if (redline !== null && redline !== undefined) { + redline.style.display = "block" + redline.style.position = "absolute" + redline.style.left = position.x + "px" + redline.style.top = position.y + "px" + redline.style.height = "10000px" + redline.style.width = 1 + console.log("REDLINE!") + } + */ + } - if ( - originalLocation.x === 0 && - originalLocation.y === 0 && - nodedata.position !== undefined - ) { + if (originalLocation.x === 0 && originalLocation.y === 0 && nodedata.position !== undefined) { originalLocation.x = nodedata.position.x; originalLocation.y = nodedata.position.y; } @@ -5340,37 +5411,61 @@ const releaseToConnectLabel = "Release to Connect" } } } else { - console.log("Should check APP if it has the same params as ACTION") - for (let actionKey in curapp.actions) { - const tmpaction = curapp.actions[actionKey] - if (tmpaction.name === curaction.name) { - console.log("Found action - needs change?", tmpaction) - if (tmpaction.parameters !== undefined && tmpaction.parameters !== null && tmpaction.parameters.length > 0) { - curaction.parameters = JSON.parse(JSON.stringify(tmpaction.parameters)) - } - break - } + console.log("Should check APP if it has the same params as ACTION") + for (let actionKey in curapp.actions) { + const tmpaction = curapp.actions[actionKey] + if (tmpaction.name === curaction.name) { + console.log("Found action - needs change?", tmpaction) + if (tmpaction.parameters !== undefined && tmpaction.parameters !== null && tmpaction.parameters.length > 0) { + curaction.parameters = JSON.parse(JSON.stringify(tmpaction.parameters)) + } + break + } + } + } + + // Fix authentication fields that may be missing in the UI + if (curapp.authentication.required && !curapp?.authentication?.type?.includes("oauth")) { + if (curapp.authentication.parameters !== undefined && curapp.authentication.parameters !== null) { + var actionChanged = false + for (let paramKey in curapp.authentication.parameters) { + var param = curapp.authentication.parameters[paramKey] + + if (curaction.parameters === undefined || curaction.parameters === null) { + curaction.parameters = [] + } + + var found = false + for (let actionParamKey in curaction.parameters) { + if (curaction.parameters[actionParamKey].name === param.name) { + found = true + break } } - //curaction["authentication"] = [] - //curaction["authentication_id"] = "" - // Fix parameters that are... Not ideal - //var paramnames = [] - //var newparams = [] - //for (let paramKey in curaction.parameters) { - // console.log("Name: ", curaction.parameters[paramKey].name) - // if (paramnames.includes(curaction.parameters[paramKey].name)) { - // continue - // } + if (!found) { + param.configuration = true + curaction.parameters.push(param) + + actionChanged = true + } + } - // paramnames.push(curaction.parameters[paramKey].name) - // newparams.push(curaction.parameters[paramKey]) - //} + if (actionChanged && workflow.actions !== undefined && workflow.actions !== null) { + // Find it in the workflow and set it + for (let wfActionKey in workflow.actions) { + if (workflow.actions[wfActionKey].id === curaction.id) { + workflow.actions[wfActionKey] = curaction + } + } - //curaction.parameters = newparams + setWorkflow(workflow) + + } + } + } - setSelectedApp(curapp); + setSelectedApp(curapp) setSelectedAction(curaction); cy.removeListener("drag"); @@ -5537,7 +5632,7 @@ const releaseToConnectLabel = "Release to Connect" setSelectedTriggerIndex(trigger_index) setSelectedTrigger(data) - setSelectedActionEnvironment(data.env) + //setSelectedActionEnvironment(data.env) }, 25) } else if (data.type === "COMMENT") { setSelectedComment(data); @@ -5889,7 +5984,7 @@ const releaseToConnectLabel = "Release to Connect" const edge = event.target.data(); if (edge.source === undefined && edge.target === undefined) { - console.log("Edge added without source or target") + //console.log("Edge added without source or target") return } @@ -6020,7 +6115,7 @@ const releaseToConnectLabel = "Release to Connect" found = true break } else { - console.log("Old branch didn't exist afterall. Remove.") + //console.log("Old branch didn't exist afterall. Remove.") } } @@ -6115,28 +6210,13 @@ const releaseToConnectLabel = "Release to Connect" const node = event.target; const nodedata = event.target.data(); - //if (Object.keys(nodedata).length === 1) { - // console.log("Check if another node actually exists before adding") - //} - if (nodedata.finished === false || (nodedata.id !== undefined && nodedata.is_valid === undefined) ) { - //if (nodedata.app_id === undefined) { - //console.log("Returning because node is not valid: ", nodedata) return; } - // Check for recommendations when a new action is added - // if (isLoaded === true && firstrequest === false) { - // fetchRecommendations(workflow) - // } - - // DONT MOVE THIS LINE RIGHT HERE v setLastSaved(false) - // Dont move the line above. May break stuff. - - if (node.isNode() && cy.nodes().size() === 1) { workflow.start = node.data("id"); nodedata.isStartNode = true; @@ -6169,15 +6249,8 @@ const releaseToConnectLabel = "Release to Connect" } if (nodedata.type === "ACTION") { - // Should get recommendations to load in for all nodesma + // Should get recommendations to load in for all nodesma - /* - var curaction = workflow.actions.find((a) => a.id === nodedata.id); - if (curaction === null || curaction === undefined) { - toast("Node not found. Please remake it.") - event.target.remove(); - } - */ if (workflow.actions.length === 1 && workflow.actions[0].id === workflow.start) { const newEdgeUuid = uuidv4(); const newcybranch = { @@ -6216,11 +6289,7 @@ const releaseToConnectLabel = "Release to Connect" } - if ( - nodedata.parameters !== undefined && - nodedata.parameters !== null && - !nodedata.label.endsWith("_copy") - ) { + if (nodedata.parameters !== undefined && nodedata.parameters !== null && !nodedata.label.endsWith("_copy")) { var newparameters = []; for (let [subkey,subkeyval] in Object.entries(nodedata.parameters)) { @@ -6679,42 +6748,58 @@ const releaseToConnectLabel = "Release to Connect" return response.json(); }) .then((responseJson) => { - var found = false; - var showEnvCnt = 0; + var found = false + var showEnvCnt = 0 for (let jsonkey in responseJson) { if (responseJson[jsonkey].default && !found) { - setDefaultEnvironmentIndex(jsonkey); - found = true; + setDefaultEnvironmentIndex(jsonkey) + found = true } if (responseJson[jsonkey].archived === false) { - showEnvCnt += 1; + showEnvCnt += 1 } } if (showEnvCnt > 1) { - setShowEnvironment(true); + setShowEnvironment(true) } if (!found) { for (let jsonkey in responseJson) { if (!responseJson[jsonkey].archived) { - setDefaultEnvironmentIndex(jsonkey); + setDefaultEnvironmentIndex(jsonkey) break; } } } - // FIXME: Don't allow multiple in cloud yet. Cloud -> Onprem isn't stable. if (isCloud) { if (responseJson !== undefined && responseJson !== null && responseJson.length > 0) { - setEnvironments(responseJson); + setEnvironments(responseJson) } else { - setEnvironments([{ Name: "Cloud", Type: "cloud" }]); + setEnvironments([{ Name: "Cloud", Type: "cloud" }]) } } else { - setEnvironments(responseJson); + setEnvironments(responseJson) } + + /* + setTimeout(() => { + console.log("ACTIONS: ", workflow.actions) + if (workflow.actions !== undefined && workflow.actions !== null && workflow.actions.length > 0) { + for (var actionkey in workflow.actions) { + if (workflow.actions[actionkey].environment !== undefined && workflow.actions[actionkey].environment !== null && workflow.actions[actionkey].environment.length > 0) { + + const env = environments.findIndex((data) => data.Name === workflow.actions[actionkey].environment) + if (env !== -1) { + setSelectedActionEnvironment(environments[env]) + } + } + } + } + }, 2500) + */ }) .catch((error) => { //toast(error.toString()); @@ -7446,7 +7531,6 @@ const releaseToConnectLabel = "Release to Connect" console.log("NODE UNFINISHED (hover in): ", nodedata) // Should just be 1, so this should be fast enough :3 - /* const incomingEdges = event.target.incomers("edge").jsons() if (incomingEdges !== undefined && incomingEdges !== null) { for (var i = 0; i < incomingEdges.length; i++) { @@ -7465,7 +7549,6 @@ const releaseToConnectLabel = "Release to Connect" } return - */ } @@ -7603,28 +7686,6 @@ const releaseToConnectLabel = "Release to Connect" if (nodedata.type !== "COMMENT") { parsedStyle.color = "white"; - - //if (!event.target.data("isButton") && !event.target.data("buttonId")) { - // const px = event.target.position("x") - 0; - // const py = event.target.position("y") - 50; - // const circleId = (newNodeId = uuidv4()); - - // console.log("Got px, py: ", px, py) - // - // cy.add({ - // group: "nodes", - // data: { - // weight: 30, - // id: circleId, - // isButton: true, - // attachedTo: event.target.data("id"), - // buttonType: "edgehandler", - // is_valid: true, - // }, - // position: { x: px, y: py }, - // locked: true, - // }) - //} } if (event.target !== undefined && event.target !== null) { @@ -7884,7 +7945,7 @@ const releaseToConnectLabel = "Release to Connect" } else { action.iconBackground = iconInfo.iconBackgroundColor; } - } else if (action.app_name === "Integration Framework") { + } else if (action.app_name === "Integration Framework" || action.app_name === "Singul") { const iconInfo = GetIconInfo(action) if (iconInfo !== undefined && iconInfo !== null) { action.fillGradient = iconInfo.fillGradient @@ -7921,13 +7982,17 @@ const releaseToConnectLabel = "Release to Connect" }) // What are these again? Where are they used? + const decoratorNodes = [] + + /* + // Removed for now as it wasn't really that helpful const decoratorNodes = inputworkflow.actions.map((action) => { if (!action.isStartNode) { if (action.app_name === "Testing") { return null } else if (action.app_name === "Shuffle Tools") { return null - } else if (action.app_name === "Integration Framework") { + } else if (action.app_name === "Integration Framework" || action.app_name === "Singul") { return null } } @@ -7964,6 +8029,7 @@ const releaseToConnectLabel = "Release to Connect" } return decoratorNode }) + */ const foundtriggers = inputworkflow.triggers.map((trigger) => { @@ -9509,8 +9575,22 @@ const releaseToConnectLabel = "Release to Connect" const handleAppDrag = (e, app) => { const cycontainer = cy.container(); - console.log("APPDRAG!") + // Handling drag of public apps + if (app.objectID !== undefined && app.objectID !== null && app.objectID.length > 0) { + // FIXME: This is still buggy for now. Not allowed + return + loadAppConfig(app.objectID, undefined) + // Some arbitrary check + + app.id = app.objectID + app.actions = [{ + "name": "tmp", + "parameters": [{ + "name": "tmp", + }] + }] + } if (app.type === "TRIGGER") { handleTriggerDrag(e, app) @@ -9520,13 +9600,8 @@ const releaseToConnectLabel = "Release to Connect" //console.log("e: ", e) //console.log("Offset: ", cycontainer) - // Chrome lol - if ( - e.pageX > cycontainer.offsetLeft && - e.pageX < cycontainer.offsetLeft + cycontainer.offsetWidth && - e.pageY > cycontainer.offsetTop && - e.pageY < cycontainer.offsetTop + cycontainer.offsetHeight - ) { + // HTML -> Canvas overlap check + if (e.pageX > cycontainer.offsetLeft && e.pageX < cycontainer.offsetLeft + cycontainer.offsetWidth && e.pageY > cycontainer.offsetTop && e.pageY < cycontainer.offsetTop + cycontainer.offsetHeight) { if (newNodeId.length > 0) { var currentnode = cy.getElementById(newNodeId); if ( @@ -9902,8 +9977,19 @@ const releaseToConnectLabel = "Release to Connect" > {newAppname} { + if (props.index !== undefined && props.index !== null) { + // Replace the image with the default image + + const foundImage = document.getElementById(`image_${props.index}`) + if (foundImage !== undefined && foundImage !== null) { + foundImage.src = theme.palette.defaultImage + app.large_image = theme.palette.defaultImage + } + } + }} style={{ pointerEvents: "none", userDrag: "none", @@ -10063,7 +10149,7 @@ const releaseToConnectLabel = "Release to Connect" const clickedApp = (hit) => { - toast.success(`Activating App. Please wait a moment.`) + toast.success(`Activating App. Please wait a moment, and it will show up highlighted in your apps.`) const queryID = hit.__queryID @@ -10174,6 +10260,7 @@ const releaseToConnectLabel = "Release to Connect" e.preventDefault() e.stopPropagation() + handleAppDrag(e, hit) if (!appdragged) { clickedApp(hit) } @@ -10184,8 +10271,8 @@ const releaseToConnectLabel = "Release to Connect" }} dragging={false} position={{ - x: 0, - y: 0, + x: 0, + y: 0, }} >
{ @@ -10297,14 +10384,14 @@ const releaseToConnectLabel = "Release to Connect" {/**/}
- +
{/*
*/}
:
{extraMessage} - +
) })} @@ -12728,7 +12815,7 @@ const releaseToConnectLabel = "Release to Connect" type: "action", id: item.id, name: item.label, - autocomplete: `${item.label.split(" ").join("_")}`, + autocomplete: `${item?.label?.split(" ")?.join("_")}`, example: exampledata, } actionlist.push(actionvalue); @@ -14843,7 +14930,7 @@ const releaseToConnectLabel = "Release to Connect"
Information - The information you want to show the user. Supports variables. + The information you want to show the user. Supports variables. Supports Markdown & HTML.
@@ -15058,7 +15145,7 @@ const releaseToConnectLabel = "Release to Connect" style={{ backgroundColor: theme.palette.inputColor, borderRadius: theme.palette?.borderRadius, - marginTop: 10, + marginTop: 10, }} InputProps={{ style: { @@ -15092,7 +15179,7 @@ const releaseToConnectLabel = "Release to Connect" style={{ backgroundColor: theme.palette.inputColor, borderRadius: theme.palette?.borderRadius, - marginTop: 10, + marginTop: 10, }} InputProps={{ style: { @@ -15114,9 +15201,8 @@ const releaseToConnectLabel = "Release to Connect" /> ) : null} -
-
+
Required Input-Questions {workflow.input_questions !== undefined && workflow.input_questions !== null && workflow.input_questions.length > 0 ?
@@ -15174,6 +15260,7 @@ const releaseToConnectLabel = "Release to Connect" No Input-Questions found. Click to add them!
} +
const defaultEnvironment = environments.find( @@ -15876,71 +15963,77 @@ const releaseToConnectLabel = "Release to Connect" getFiles(e.target.value) listOrgCache(e.target.value) - if (e.target.value === originalWorkflow.org_id) { - console.log("Original org selected. No change.") - - updateCurrentWorkflow(originalWorkflow) - return - } else { - // Load environments, auth, auth groups - //toast("Loading correct info for suborg") - } - + // FIXME: There is a timing problem here. + // For events to have the data they need, they + // need to be registered with setupGraph() + // AFTER all the APIs are done // Should look through childorg workflow - console.log("Original: ", originalWorkflow) - if (originalWorkflow.childorg_workflow_ids === undefined || originalWorkflow.childorg_workflow_ids === null || originalWorkflow.childorg_workflow_ids.length === 0) { - console.log("In childorg doesn't exist. Suborgworkflows: ", suborgWorkflows) + setTimeout(() => { + if (e.target.value === originalWorkflow.org_id) { + console.log("Original org selected. No change.") - if (suborgWorkflows !== undefined && suborgWorkflows !== null && suborgWorkflows.length > 0) { - var found = false - for (var suborgkey in suborgWorkflows) { - const suborgWorkflow = suborgWorkflows[suborgkey] - if (suborgWorkflow.org_id === e.target.value) { - found = true - updateCurrentWorkflow(suborgWorkflow) - break + updateCurrentWorkflow(originalWorkflow) + return + } else { + // Load environments, auth, auth groups + //toast("Loading correct info for suborg") + } + + console.log("Original: ", originalWorkflow) + if (originalWorkflow.childorg_workflow_ids === undefined || originalWorkflow.childorg_workflow_ids === null || originalWorkflow.childorg_workflow_ids.length === 0) { + console.log("In childorg doesn't exist. Suborgworkflows: ", suborgWorkflows) + + if (suborgWorkflows !== undefined && suborgWorkflows !== null && suborgWorkflows.length > 0) { + var found = false + for (var suborgkey in suborgWorkflows) { + const suborgWorkflow = suborgWorkflows[suborgkey] + if (suborgWorkflow.org_id === e.target.value) { + found = true + updateCurrentWorkflow(suborgWorkflow) + break + } } - } - if (!found) { - toast("(3) Creating new workflow for this org. Please wait a second while we duplicate.") - //console.log("No workflow found out of suborg workflows.") - - //saveWorkflow(originalWorkflow, undefined, undefined, e.target.value) + if (!found) { + toast("(3) Creating new workflow for this org. Please wait a second while we duplicate.") + //console.log("No workflow found out of suborg workflows.") + + //saveWorkflow(originalWorkflow, undefined, undefined, e.target.value) + } + } else { + console.log("Suborgworkflows: ", suborgWorkflows) + toast("(1) Loading NEW workflow for this org (?). Please wait a second.") + saveWorkflow(originalWorkflow, undefined, undefined, e.target.value) } } else { - console.log("Suborgworkflows: ", suborgWorkflows) - toast("(1) Loading NEW workflow for this org (?). Please wait a second.") - saveWorkflow(originalWorkflow, undefined, undefined, e.target.value) - } - } else { - console.log("In childorg EXIST!") + console.log("In childorg EXIST!") - var workflowFound = false - for (var childorgidkey in originalWorkflow.childorg_workflow_ids) { - const childworkflowid = originalWorkflow.childorg_workflow_ids[childorgidkey] - for (var suborgWorkflowKey in suborgWorkflows) { - const suborgWorkflow = suborgWorkflows[suborgWorkflowKey] - if (suborgWorkflow.org_id === e.target.value) { - workflowFound = true + var workflowFound = false + for (var childorgidkey in originalWorkflow.childorg_workflow_ids) { + const childworkflowid = originalWorkflow.childorg_workflow_ids[childorgidkey] + for (var suborgWorkflowKey in suborgWorkflows) { + const suborgWorkflow = suborgWorkflows[suborgWorkflowKey] + if (suborgWorkflow.org_id === e.target.value) { + workflowFound = true - updateCurrentWorkflow(suborgWorkflow) + updateCurrentWorkflow(suborgWorkflow) + break + } + } + + if (workflowFound) { break } } - if (workflowFound) { - break + if (!workflowFound) { + console.log("No workflow found.") + toast("(2) Creating new workflow for this org. Please wait a few seconds while we prepare it for you.") + //saveWorkflow(originalWorkflow, undefined, undefined, e.target.value) } } - - if (!workflowFound) { - console.log("No workflow found.") - toast("(2) Creating new workflow for this org. Please wait a few seconds while we prepare it for you.") - //saveWorkflow(originalWorkflow, undefined, undefined, e.target.value) - } - } + }, 500) }) }} label="Suborg Distribution" @@ -16048,7 +16141,7 @@ const releaseToConnectLabel = "Release to Connect" })} - {showEnvironment === true && environments.length > 1 ? + {showEnvironment === true && environments.length > 1 && selectedActionEnvironment !== undefined && selectedActionEnvironment !== null && selectedActionEnvironment.Name !== undefined && selectedActionEnvironment.Name !== null ? { + setLastSaved(false) const env = environments.find((a) => a.Name === e.target.value); - setSelectedActionEnvironment(env); - selectedAction.environment = env.Name; - setSelectedAction(selectedAction); + setSelectedActionEnvironment(env) + selectedAction.environment = env.Name + setSelectedAction(selectedAction) for (let actionkey in workflow.actions) { workflow.actions[actionkey].environment = env.Name @@ -16110,7 +16204,7 @@ const releaseToConnectLabel = "Release to Connect" {data.Name === "cloud" || data.Name === "Cloud" ? null : !isRunning ?
- + @@ -19866,7 +19959,7 @@ const releaseToConnectLabel = "Release to Connect"
-
+
{curapp === null ? null : ( {selectedResult.action.app_name} - - {data.name} +
+ + + {data?.name?.endsWith("_basic") ? data?.name?.replace("_basic", "") : data?.name} + +
{data.schema !== undefined && data.schema !== null && @@ -20815,7 +20913,7 @@ const releaseToConnectLabel = "Release to Connect" } color="primary" defaultValue={ - data.value !== undefined && data.value !== null + data.value !== undefined && data.value !== null && !data.value.includes("Secret. Replace") ? data.value : "" } @@ -20824,6 +20922,7 @@ const releaseToConnectLabel = "Release to Connect" authenticationOption.fields[data.name] = event.target.value; }} + id={`${data.name}_auth`} /> )}
@@ -20832,19 +20931,11 @@ const releaseToConnectLabel = "Release to Connect" -  or  -
@@ -1393,15 +1471,18 @@ const RunWorkflow = (defaultprops) => {
} - - Forms are in Beta. Form submission data includes your Organization's unique ID while logged in, or a unique identifier for your browser otherwise. Your input will be automatically sanitized. - + + {workflowQuestion !== "" ? null : + + Forms are in late Beta. Form submission data includes your Organization's unique ID while logged in, or a unique identifier for your browser otherwise. Your input will be automatically sanitized. + + } // const isCorrectOrg = userdata.active_org.id === undefined || userdata.active_org.id === null || workflow.org_id === null || workflow.org_id === undefined || workflow.org_id.length === 0 || userdata.active_org.id === workflow.org_id const loadedCheck = isLoaded ? -
+
{editWorkflowModalOpen === true ? { > Organization only - + @@ -1485,7 +1566,7 @@ const RunWorkflow = (defaultprops) => { - {isLoggedIn && userdata?.active_org?.id === workflow?.org_id ? + {isLoggedIn && userdata?.active_org?.id === workflow?.org_id || userdata?.support === true ?