{visibleApps.map((app, index) => {
if (app.invalid) {
- return null
+ return null
}
- if (app.trigger_type === "PIPELINE" && userdata.support !== true) {
- return null
- }
+ if (app.trigger_type === "PIPELINE" && userdata.support !== true) {
+ return null
+ }
- if (app.id === "integration" && userdata.support !== true) {
- return null
- }
+ if (app.id === "integration" && userdata.support !== true) {
+ return null
+ }
- if (viewedApps.includes(app.id)) {
- return null
- }
+ if (viewedApps.includes(app.id)) {
+ return null
+ }
- if (app.trigger_type !== undefined && app.trigger_type !== null && app.trigger_type.length > 0) {
- app.is_valid = true
- app.actions = [{"name": "empty"}]
- }
+ if (app.trigger_type !== undefined && app.trigger_type !== null && app.trigger_type.length > 0) {
+ app.is_valid = true
+ app.actions = [{ "name": "empty" }]
+ }
- viewedApps.push(app.id)
+ viewedApps.push(app.id)
var extraMessage = ""
if (index == 2) {
- extraMessage =
+ extraMessage =
}
delay += 75
return (
runDelay ?
-
- {/**/}
+
+ {/**/}
- {/**/}
-
+ {/**/}
+
:
{extraMessage}
@@ -10993,31 +11042,31 @@ const releaseToConnectLabel = "Release to Connect"
)
})}
- {visibleApps.length <= 2 ?
-
{
- }}
- >
-
- Click one of the relevant public apps below to Activate it for your organization.
-
- {
- console.log("CLICKED")
- }}>
-
-
-
-
-
-
- :
-
-
- Apps need to be activated before they can be used. Search from our 2500+ apps to activate them for your organisation.
-
-
- }
+ {visibleApps.length <= 2 ?
+
{
+ }}
+ >
+
+ Click one of the relevant public apps below to Activate it for your organization.
+
+ {
+ console.log("CLICKED")
+ }}>
+
+
+
+
+
+
+ :
+
+
+ Apps need to be activated before they can be used. Search from our 2500+ apps to activate them for your organisation.
+
+
+ }
) : apps.length > 0 ? (
);
-}
+ }
@@ -11065,18 +11114,18 @@ const releaseToConnectLabel = "Release to Connect"
var highest = "";
const allitems = workflow.actions.concat(workflow.triggers);
- if (allitems !== undefined && allitems !== null) {
- for (let itemkey in allitems) {
- const item = allitems[itemkey];
+ if (allitems !== undefined && allitems !== null) {
+ for (let itemkey in allitems) {
+ const item = allitems[itemkey];
- if (item.app_name === appName && item.label !== undefined && item.label !== null) {
- var number = item.label.split("_");
- if (isNaN(number[-1]) && parseInt(number[number.length - 1]) > highest) {
- highest = number[number.length - 1];
- }
- }
- }
- }
+ if (item.app_name === appName && item.label !== undefined && item.label !== null) {
+ var number = item.label.split("_");
+ if (isNaN(number[-1]) && parseInt(number[number.length - 1]) > highest) {
+ highest = number[number.length - 1];
+ }
+ }
+ }
+ }
appName = appName.replaceAll(" ", "_")
if (highest) {
@@ -11091,18 +11140,18 @@ const releaseToConnectLabel = "Release to Connect"
return
}
- if (selectedApp.actions.length === 1) {
- // Find if there's a new app
- const newApp = apps.find((app) => (app.name === selectedApp.name && app.app_version !== selectedApp.app_version) || app.id == selectedApp.id)
- if (newApp !== undefined && newApp !== null) {
+ if (selectedApp.actions.length === 1) {
+ // Find if there's a new app
+ const newApp = apps.find((app) => (app.name === selectedApp.name && app.app_version !== selectedApp.app_version) || app.id == selectedApp.id)
+ if (newApp !== undefined && newApp !== null) {
- if (selectedApp.actions !== undefined && selectedApp.actions !== null && selectedApp.actions.length > 1) {
- setSelectedApp(newApp)
- }
+ if (selectedApp.actions !== undefined && selectedApp.actions !== null && selectedApp.actions.length > 1) {
+ setSelectedApp(newApp)
+ }
- selectedApp.actions = newApp.actions
- }
- }
+ selectedApp.actions = newApp.actions
+ }
+ }
const newaction = selectedApp.actions.find((a) => a.name === e.target.value)
if (newaction === undefined || newaction === null) {
@@ -11127,104 +11176,104 @@ const releaseToConnectLabel = "Release to Connect"
newSelectedAction.errors = [];
newSelectedAction.isValid = true;
newSelectedAction.is_valid = true;
- newSelectedAction.required_body_fields = newaction.required_body_fields
+ newSelectedAction.required_body_fields = newaction.required_body_fields
- // Simple action swap autocompleter
- if (oldaction.parameters !== undefined && oldaction.parameters !== null && newSelectedAction.parameters !== undefined && oldaction.id === newSelectedAction.id) {
- var fileid_found = false
+ // Simple action swap autocompleter
+ if (oldaction.parameters !== undefined && oldaction.parameters !== null && newSelectedAction.parameters !== undefined && oldaction.id === newSelectedAction.id) {
+ var fileid_found = false
- for (let [paramkey,paramkeyval] in Object.entries(oldaction.parameters)) {
- const param = oldaction.parameters[paramkey];
-
- if (param.name === "file_id") {
- fileid_found = true
- }
+ for (let [paramkey, paramkeyval] in Object.entries(oldaction.parameters)) {
+ const param = oldaction.parameters[paramkey];
- if (param.value === null || param.value === undefined || param.value.length === 0) {
- continue
- }
+ if (param.name === "file_id") {
+ fileid_found = true
+ }
- if (param.name === "body") {
- //console.log("Param: ", param)
- continue
- }
+ if (param.value === null || param.value === undefined || param.value.length === 0) {
+ continue
+ }
- if (param.name === "headers") {
- if (fileid_found) {
- newSelectedAction.parameters[paramkey].value = ""
- newSelectedAction.parameters[paramkey].autocompleted = true
+ if (param.name === "body") {
+ //console.log("Param: ", param)
+ continue
+ }
- continue
- }
- }
+ if (param.name === "headers") {
+ if (fileid_found) {
+ newSelectedAction.parameters[paramkey].value = ""
+ newSelectedAction.parameters[paramkey].autocompleted = true
- if (newSelectedAction.parameters === undefined || newSelectedAction.parameters === null) {
- continue
- }
+ continue
+ }
+ }
- // Not doing options fields
- const newParamIndex = newSelectedAction.parameters.findIndex(paramdata => paramdata.name === param.name)
- if (newParamIndex < 0) {
- continue
- }
+ if (newSelectedAction.parameters === undefined || newSelectedAction.parameters === null) {
+ continue
+ }
- if (newSelectedAction.parameters[newParamIndex].name === "headers") {
- if (param.value !== undefined && param.value !== null && param.value.includes("=undefined")) {
- if (newSelectedAction.parameters[newParamIndex].example !== undefined && newSelectedAction.parameters[newParamIndex].example !== null) {
- newSelectedAction.parameters[newParamIndex].value = newSelectedAction.parameters[newParamIndex].example
- } else {
- newSelectedAction.parameters[newParamIndex].value = ""
- }
+ // Not doing options fields
+ const newParamIndex = newSelectedAction.parameters.findIndex(paramdata => paramdata.name === param.name)
+ if (newParamIndex < 0) {
+ continue
+ }
- continue
- }
- }
+ if (newSelectedAction.parameters[newParamIndex].name === "headers") {
+ if (param.value !== undefined && param.value !== null && param.value.includes("=undefined")) {
+ if (newSelectedAction.parameters[newParamIndex].example !== undefined && newSelectedAction.parameters[newParamIndex].example !== null) {
+ newSelectedAction.parameters[newParamIndex].value = newSelectedAction.parameters[newParamIndex].example
+ } else {
+ newSelectedAction.parameters[newParamIndex].value = ""
+ }
- newSelectedAction.parameters[newParamIndex].value = param.value
- newSelectedAction.parameters[newParamIndex].autocompleted = true
- if (param.options !== undefined && param.options !== null && param.options.length > 0) {
- newSelectedAction.parameters[newParamIndex].autocompleted = false
- }
- }
- }
+ continue
+ }
+ }
- if (newSelectedAction.app_name === "Shuffle Tools") {
- const iconInfo = GetIconInfo(newSelectedAction);
- const svg_pin = `
`;
- const svgpin_Url = encodeURI("data:image/svg+xml;utf-8," + svg_pin);
- newSelectedAction.large_image = svgpin_Url;
- newSelectedAction.fillGradient = iconInfo.fillGradient;
- newSelectedAction.fillstyle = "solid";
- if (newSelectedAction.fillGradient !== undefined && newSelectedAction.fillGradient !== null && newSelectedAction.fillGradient.length > 0) {
- newSelectedAction.fillstyle = "linear-gradient";
- } else {
- newSelectedAction.iconBackground = iconInfo.iconBackgroundColor;
- }
+ newSelectedAction.parameters[newParamIndex].value = param.value
+ newSelectedAction.parameters[newParamIndex].autocompleted = true
+ if (param.options !== undefined && param.options !== null && param.options.length > 0) {
+ newSelectedAction.parameters[newParamIndex].autocompleted = false
+ }
+ }
+ }
- const foundnode = cy.getElementById(newSelectedAction.id);
- if (foundnode !== null && foundnode !== undefined) {
- foundnode.data(newSelectedAction);
- }
- }
+ if (newSelectedAction.app_name === "Shuffle Tools") {
+ const iconInfo = GetIconInfo(newSelectedAction);
+ const svg_pin = `
`;
+ const svgpin_Url = encodeURI("data:image/svg+xml;utf-8," + svg_pin);
+ newSelectedAction.large_image = svgpin_Url;
+ newSelectedAction.fillGradient = iconInfo.fillGradient;
+ newSelectedAction.fillstyle = "solid";
+ if (newSelectedAction.fillGradient !== undefined && newSelectedAction.fillGradient !== null && newSelectedAction.fillGradient.length > 0) {
+ newSelectedAction.fillstyle = "linear-gradient";
+ } else {
+ newSelectedAction.iconBackground = iconInfo.iconBackgroundColor;
+ }
- for (var preparamindex in newSelectedAction.parameters) {
- const param = newSelectedAction.parameters[preparamindex]
- if (param.configuration === true) {
- continue
- }
+ const foundnode = cy.getElementById(newSelectedAction.id);
+ if (foundnode !== null && foundnode !== undefined) {
+ foundnode.data(newSelectedAction);
+ }
+ }
- if (param?.value?.toLowerCase().includes("secret. replace")) {
- newSelectedAction.parameters[preparamindex].value = ""
- }
- }
+ for (var preparamindex in newSelectedAction.parameters) {
+ const param = newSelectedAction.parameters[preparamindex]
+ if (param.configuration === true) {
+ continue
+ }
+
+ if (param?.value?.toLowerCase().includes("secret. replace")) {
+ newSelectedAction.parameters[preparamindex].value = ""
+ }
+ }
// Takes an action as input, then runs through and updates the relevant parameters based on previous actions' results (parent nodes)
// Further checks if those fields are already set in a previously used action
newSelectedAction = RunAutocompleter(newSelectedAction);
if (
- newaction.return !== undefined &&
- newaction.return !== null &&
+ newaction.return !== undefined &&
+ newaction.return !== null &&
newaction.returns.example !== undefined &&
newaction.returns.example !== null &&
newaction.returns.example.length > 0
@@ -11257,63 +11306,63 @@ const releaseToConnectLabel = "Release to Connect"
}
}
- // Last fix for params
- if (newSelectedAction.parameters !== undefined && newSelectedAction.parameters !== null && newSelectedAction.parameters.length > 0) {
- for (let paramkey in newSelectedAction.parameters) {
- const param = newSelectedAction.parameters[paramkey]
- if (param.name !== "body") {
- continue
- }
+ // Last fix for params
+ if (newSelectedAction.parameters !== undefined && newSelectedAction.parameters !== null && newSelectedAction.parameters.length > 0) {
+ for (let paramkey in newSelectedAction.parameters) {
+ const param = newSelectedAction.parameters[paramkey]
+ if (param.name !== "body") {
+ continue
+ }
- if (param.example !== undefined && param.example !== null && param.example.length > 0) {
- if (param.value === undefined || param.value === null || param.value.length === 0) {
- param.value = param.example
- }
- }
+ if (param.example !== undefined && param.example !== null && param.example.length > 0) {
+ if (param.value === undefined || param.value === null || param.value.length === 0) {
+ param.value = param.example
+ }
+ }
- newSelectedAction.parameters[paramkey] = param
- }
- }
+ newSelectedAction.parameters[paramkey] = param
+ }
+ }
setSelectedAction(newSelectedAction)
setUpdate(Math.random())
const allNodes = cy.nodes().jsons()
- if (allNodes !== undefined && allNodes !== null) {
- for (let nodekey in allNodes) {
- const currentNode = allNodes[nodekey];
- if (
- currentNode.data.attachedTo === oldaction.id &&
- currentNode.data.isDescriptor
- ) {
- const foundnode = cy.getElementById(currentNode.data.id);
- if (foundnode !== null && foundnode !== undefined) {
- const iconInfo = GetIconInfo(newaction);
- const svg_pin = `
`;
- const svgpin_Url = encodeURI("data:image/svg+xml;utf-8," + svg_pin);
- foundnode.data("image", svgpin_Url);
- foundnode.data("imageColor", iconInfo.iconBackgroundColor);
- }
+ if (allNodes !== undefined && allNodes !== null) {
+ for (let nodekey in allNodes) {
+ const currentNode = allNodes[nodekey];
+ if (
+ currentNode.data.attachedTo === oldaction.id &&
+ currentNode.data.isDescriptor
+ ) {
+ const foundnode = cy.getElementById(currentNode.data.id);
+ if (foundnode !== null && foundnode !== undefined) {
+ const iconInfo = GetIconInfo(newaction);
+ const svg_pin = `
`;
+ const svgpin_Url = encodeURI("data:image/svg+xml;utf-8," + svg_pin);
+ foundnode.data("image", svgpin_Url);
+ foundnode.data("imageColor", iconInfo.iconBackgroundColor);
+ }
- break;
- }
- }
- }
+ break;
+ }
+ }
+ }
- // Send it in here, after all fields are filled
- // Disabled for now :(
- // const aiMsg = "Fill based on previous values"
- // aiSubmit(aiMsg, undefined, undefined, newSelectedAction)
- };
+ // Send it in here, after all fields are filled
+ // Disabled for now :(
+ // const aiMsg = "Fill based on previous values"
+ // aiSubmit(aiMsg, undefined, undefined, newSelectedAction)
+ };
// APPSELECT at top
// appname & version
// description
// ACTION select
const selectedNameChange = (appActionName) => {
- if (appActionName === undefined || appActionName === null) {
- return
- }
+ if (appActionName === undefined || appActionName === null) {
+ return
+ }
appActionName = appActionName.replaceAll("(", "");
appActionName = appActionName.replaceAll(")", "");
@@ -11377,9 +11426,9 @@ const releaseToConnectLabel = "Release to Connect"
var handled = [];
var results = [];
- if (cy === undefined || cy === null) {
- return []
- }
+ if (cy === undefined || cy === null) {
+ return []
+ }
// maxiter = max amount of parent nodes to loop
// also handles breaks if there are issues
@@ -11460,17 +11509,17 @@ const releaseToConnectLabel = "Release to Connect"
zIndex: 1000,
resize: "vertical",
overflow: "auto",
- paddingBottom: 100,
+ paddingBottom: 100,
- overflowAnchor: "none",
+ overflowAnchor: "none",
};
- const minSize = 370
+ const minSize = 370
var rightsidebarStyle = {
position: "fixed",
top: workflow?.public && !isLoggedIn ? 100 : showWorkflowRevisions ? 100 : appBarSize - 35,
right: 25,
- height: "90vh",
+ height: "90vh",
maxWidth: 600,
maxHeight: "100vh",
border: "1px solid rgb(91, 96, 100)",
@@ -11479,10 +11528,10 @@ const releaseToConnectLabel = "Release to Connect"
resize: "both",
overflow: "auto",
- overflowAnchor: "none",
+ overflowAnchor: "none",
minWidth: minSize,
width: isMobile ? "100%" : minSize,
- zoom: 0.9,
+ zoom: 0.9,
};
const setTriggerFolderWrapperMulti = (event) => {
@@ -11545,18 +11594,18 @@ const releaseToConnectLabel = "Release to Connect"
const setTriggerOptionsWrapper = (value) => {
if (selectedTrigger.parameters === null || selectedTrigger.parameters === undefined) {
selectedTrigger.parameters = [
- { name: "", value: "" },
- { name: "", value: "" },
- { name: "", value: "" },
- ]
+ { name: "", value: "" },
+ { name: "", value: "" },
+ { name: "", value: "" },
+ ]
}
- if (selectedTrigger.parameters.length < 3 ) {
- selectedTrigger.parameters.push({ name: "", value: "" })
- }
+ if (selectedTrigger.parameters.length < 3) {
+ selectedTrigger.parameters.push({ name: "", value: "" })
+ }
const splitItems = workflow.triggers[selectedTriggerIndex].parameters[2].value.split(",");
-
+
console.log(splitItems);
if (splitItems.includes(value)) {
for (let i = 0; i < splitItems.length; i++) {
@@ -11578,7 +11627,7 @@ const releaseToConnectLabel = "Release to Connect"
setWorkflow(workflow);
setLocalFirstrequest(!localFirstrequest);
- setUpdate(Math.random());
+ setUpdate(Math.random());
};
const setTriggerTextInformationWrapper = (value) => {
@@ -11927,51 +11976,51 @@ const releaseToConnectLabel = "Release to Connect"
// Makes a list of items the user can choose from based on previous runs
var availableArguments = []
if (executionArgumentModalOpen && workflowExecutions.length > 0) {
- for (let executionKey in workflowExecutions) {
- if (availableArguments.length > 2) {
- break
- }
+ for (let executionKey in workflowExecutions) {
+ if (availableArguments.length > 2) {
+ break
+ }
- const execution = workflowExecutions[executionKey]
- if (execution.execution_argument === undefined || execution.execution_argument === null || execution.execution_argument.length < 2) {
- continue
- }
+ const execution = workflowExecutions[executionKey]
+ if (execution.execution_argument === undefined || execution.execution_argument === null || execution.execution_argument.length < 2) {
+ continue
+ }
- if (execution.execution_argument.includes("too large ")) {
- continue
- }
+ if (execution.execution_argument.includes("too large ")) {
+ continue
+ }
- if (availableArguments.includes(execution.execution_argument)) {
- continue
- }
+ if (availableArguments.includes(execution.execution_argument)) {
+ continue
+ }
- availableArguments.push(execution.execution_argument)
- }
+ availableArguments.push(execution.execution_argument)
+ }
}
const handleAppAuthGroupCheckbox = (data) => {
console.log("CHECKED: ", data)
- if (workflow.auth_groups === undefined || workflow.auth_groups === null) {
- workflow.auth_groups = []
- }
+ if (workflow.auth_groups === undefined || workflow.auth_groups === null) {
+ workflow.auth_groups = []
+ }
- const foundIndex = workflow.auth_groups.findIndex(auth => auth === data.id)
- if (foundIndex >= 0) {
- workflow.auth_groups.splice(foundIndex, 1)
- } else {
- workflow.auth_groups.push(data.id)
- }
+ const foundIndex = workflow.auth_groups.findIndex(auth => auth === data.id)
+ if (foundIndex >= 0) {
+ workflow.auth_groups.splice(foundIndex, 1)
+ } else {
+ workflow.auth_groups.push(data.id)
+ }
- setWorkflow(workflow)
- console.log("WF: ", workflow)
- setUpdate(Math.random())
+ setWorkflow(workflow)
+ console.log("WF: ", workflow)
+ setUpdate(Math.random())
}
- const authgroupModal =
-
- const executionArgumentModal =
-
const submitQueryModal = () => {
- const changeActionTextfield = document.getElementById("change-action-textfield")
- if (changeActionTextfield === undefined || changeActionTextfield === null) {
- setAiQueryModalOpen(false)
- toast.error("Failed to find textfield")
- return
- }
+ const changeActionTextfield = document.getElementById("change-action-textfield")
+ if (changeActionTextfield === undefined || changeActionTextfield === null) {
+ setAiQueryModalOpen(false)
+ toast.error("Failed to find textfield")
+ return
+ }
- if (changeActionTextfield.value === undefined || changeActionTextfield.value === null || changeActionTextfield.value === "") {
- toast("Please provide how you want formatting to happen")
- return
- }
+ if (changeActionTextfield.value === undefined || changeActionTextfield.value === null || changeActionTextfield.value === "") {
+ toast("Please provide how you want formatting to happen")
+ return
+ }
- setAutocompleting(true)
- if (codeEditorModalOpen === true) {
- autoFormatCodemodal(changeActionTextfield.value)
- } else {
- aiSubmit(changeActionTextfield.value, undefined, undefined, selectedAction)
- }
+ setAutocompleting(true)
+ if (codeEditorModalOpen === true) {
+ autoFormatCodemodal(changeActionTextfield.value)
+ } else {
+ aiSubmit(changeActionTextfield.value, undefined, undefined, selectedAction)
+ }
}
- const autoFormatCodemodal = (input) => {
- if (codeEditorModalOpen !== true) {
- toast.error("Code editor is not open")
- return
- }
+ const autoFormatCodemodal = (input) => {
+ if (codeEditorModalOpen !== true) {
+ toast.error("Code editor is not open")
+ return
+ }
- if (editorData.name === undefined || editorData.name === null || editorData.name === "") {
- toast.error("Failed to find editor field name")
- return
- }
+ if (editorData.name === undefined || editorData.name === null || editorData.name === "") {
+ toast.error("Failed to find editor field name")
+ return
+ }
- const codeeditor = document.getElementById("shuffle-codeeditor")
- if (codeeditor === undefined || codeeditor === null) {
- toast.error("Failed to find code editor html")
- return
- }
+ const codeeditor = document.getElementById("shuffle-codeeditor")
+ if (codeeditor === undefined || codeeditor === null) {
+ toast.error("Failed to find code editor html")
+ return
+ }
- const editorInstance = window?.ace?.edit("shuffle-codeeditor")
- if (editorInstance === undefined || editorInstance === null) {
- toast.error("Failed to find code editor instance")
- return
- }
+ const editorInstance = window?.ace?.edit("shuffle-codeeditor")
+ if (editorInstance === undefined || editorInstance === null) {
+ toast.error("Failed to find code editor instance")
+ return
+ }
- //console.log("ACE data: ", editorInstance.getValue())
- //editorInstance.setValue("HELO")
+ //console.log("ACE data: ", editorInstance.getValue())
+ //editorInstance.setValue("HELO")
- // Should try to automatically fix this input
- console.log("Running AI input fixer: ", selectedResult)
- if (aiSubmit === undefined || selectedAction === undefined) {
- toast.error("Failed to find AI submit function")
- return
- }
-
- // Should remove params from selectedAction that aren't parameterName
- var tmpAction = JSON.parse(JSON.stringify(selectedAction))
- var tmpParams = tmpAction.parameters.filter((param) => param.name === editorData.name)
- if (tmpParams.length !== 1) {
- toast.error("Failed to find correct parameter in action")
- return
- }
+ // Should try to automatically fix this input
+ console.log("Running AI input fixer: ", selectedResult)
+ if (aiSubmit === undefined || selectedAction === undefined) {
+ toast.error("Failed to find AI submit function")
+ return
+ }
- tmpParams[0].value = editorInstance.getValue()
- tmpAction.parameters = tmpParams
- aiSubmit(input, undefined, undefined, tmpAction)
- }
+ // Should remove params from selectedAction that aren't parameterName
+ var tmpAction = JSON.parse(JSON.stringify(selectedAction))
+ var tmpParams = tmpAction.parameters.filter((param) => param.name === editorData.name)
+ if (tmpParams.length !== 1) {
+ toast.error("Failed to find correct parameter in action")
+ return
+ }
- const aiQueryModal =
+ tmpParams[0].value = editorInstance.getValue()
+ tmpAction.parameters = tmpParams
+ aiSubmit(input, undefined, undefined, tmpAction)
+ }
+
+ const aiQueryModal =
@@ -12431,8 +12480,8 @@ const releaseToConnectLabel = "Release to Connect"
minWidth: isMobile ? "90%" : 800,
border: theme.palette.defaultBorder,
- borderRadius: theme.palette.borderRadius,
- backgroundColor: "black",
+ borderRadius: theme.palette.borderRadius,
+ backgroundColor: "black",
},
}}
onClose={() => {
@@ -12444,7 +12493,7 @@ const releaseToConnectLabel = "Release to Connect"
bottom: 10,
left: 10,
color: "rgba(255,255,255,0.6)",
- zIndex: 10000,
+ zIndex: 10000,
}}
>
Conditions can't be used for loops [ .# ]{" "}
@@ -12452,10 +12501,10 @@ const releaseToConnectLabel = "Release to Connect"
rel="noopener noreferrer"
target="_blank"
href="/docs/workflows#conditions"
- style={{
- textDecoration: "none",
- color: "#FF8544",
- }}
+ style={{
+ textDecoration: "none",
+ color: "#FF8544",
+ }}
>
Learn more
@@ -12923,25 +12972,25 @@ const releaseToConnectLabel = "Release to Connect"
});
}
- // Startnode = dest node
- const conditionsDisabled = false
+ // Startnode = dest node
+ const conditionsDisabled = false
const conditionId = uuidv4();
return (
-
+
- {/* Check if dest is the same as start */}
- {conditionsDisabled ?
-
- Conditions are unavailable between triggers and the startnode.
-
- : null}
+ {/* Check if dest is the same as start */}
+ {conditionsDisabled ?
+
+ Conditions are unavailable between triggers and the startnode.
+
+ : null}
-
-
-
);
};
- const handleWorkflowSelectionUpdate = (e, isUserinput) => {
+ const handleWorkflowSelectionUpdate = (e, isUserinput) => {
- if (e.target.value === undefined || e.target.value === null || e.target.value.id === undefined) {
- console.log("Returning as there's no id. Value: ", e.target.value);
- return null
- }
+ if (e.target.value === undefined || e.target.value === null || e.target.value.id === undefined) {
+ console.log("Returning as there's no id. Value: ", e.target.value);
+ return null
+ }
- const paramIndex = isUserinput === true ? 5 : 0
+ const paramIndex = isUserinput === true ? 5 : 0
- console.log("USERINPUT: ", paramIndex, workflow.triggers[selectedTriggerIndex])
- if (workflow.triggers[selectedTriggerIndex].parameters[paramIndex] === undefined || workflow.triggers[selectedTriggerIndex].parameters[paramIndex] === null) {
- workflow.triggers[selectedTriggerIndex].parameters[paramIndex] = {
- "name": "subflow",
- "value": "",
- }
- }
+ console.log("USERINPUT: ", paramIndex, workflow.triggers[selectedTriggerIndex])
+ if (workflow.triggers[selectedTriggerIndex].parameters[paramIndex] === undefined || workflow.triggers[selectedTriggerIndex].parameters[paramIndex] === null) {
+ workflow.triggers[selectedTriggerIndex].parameters[paramIndex] = {
+ "name": "subflow",
+ "value": "",
+ }
+ }
- setUpdate(Math.random());
- workflow.triggers[selectedTriggerIndex].parameters[paramIndex].value = e.target.value.id;
- setSubworkflow(e.target.value);
+ setUpdate(Math.random());
+ workflow.triggers[selectedTriggerIndex].parameters[paramIndex].value = e.target.value.id;
+ setSubworkflow(e.target.value);
- // Sets the startnode
- if (e.target.value.id !== workflow.id && e.target.value.id.length > 0 ) {
+ // Sets the startnode
+ if (e.target.value.id !== workflow.id && e.target.value.id.length > 0) {
- const startnode = e?.target?.value?.actions?.find((action) => action.id === e.target.value.start);
-
+ const startnode = e?.target?.value?.actions?.find((action) => action.id === e.target.value.start);
- if (startnode !== undefined && startnode !== null) {
- setSubworkflowStartnode(startnode);
- if (paramIndex === 0) {
- try {
- workflow.triggers[selectedTriggerIndex].parameters[3].value = startnode.id;
- } catch {
- workflow.triggers[selectedTriggerIndex].parameters[3] = {
- name: "startnode",
- value: startnode.id,
- };
- }
- }
+ if (startnode !== undefined && startnode !== null) {
+ setSubworkflowStartnode(startnode);
- //setWorkflow(workflow);
- }
- } else {
- console.log("WORKFLOW: ", workflow);
- }
+ if (paramIndex === 0) {
+ try {
+ workflow.triggers[selectedTriggerIndex].parameters[3].value = startnode.id;
+ } catch {
+ workflow.triggers[selectedTriggerIndex].parameters[3] = {
+ name: "startnode",
+ value: startnode.id,
+ };
+ }
+ }
- setWorkflow(workflow);
- }
+ //setWorkflow(workflow);
+ }
+ } else {
+ console.log("WORKFLOW: ", workflow);
+ }
+
+ setWorkflow(workflow);
+ }
// Function to transform the data
const transformAuthData = (authData) => {
const transformedData = {};
@@ -13170,7 +13219,7 @@ const releaseToConnectLabel = "Release to Connect"
})
appIdsInWorkflow = [...new Set(appIdsInWorkflow)];
-
+
// loop through the authData and create transformedData which looks like:
// appId: [auth1, auth2, ...]
authData.forEach((auth) => {
@@ -13189,7 +13238,7 @@ const releaseToConnectLabel = "Release to Connect"
});
return transformedData;
-
+
};
const AppAuthSelector = ({ appAuthData }) => {
@@ -13214,7 +13263,7 @@ const releaseToConnectLabel = "Release to Connect"
if (mappingWithName[appName] !== undefined) {
return mappingWithName[appName];
}
-
+
return "no-overrides";
}
@@ -13223,10 +13272,10 @@ const releaseToConnectLabel = "Release to Connect"
if (authId === "no-override") {
// remove the override parameter
- let oldValue = workflow.triggers[selectedTriggerIndex].parameters[5].value;
+ let oldValue = workflow.triggers[selectedTriggerIndex].parameters[5].value;
// replace from appName= to the next ;
let newValue = oldValue.replace(new RegExp(appName + "=[^;]*;"), "");
-
+
workflow.triggers[selectedTriggerIndex].parameters[5].value = newValue
setSelectedAuth("");
return
@@ -13249,19 +13298,19 @@ const releaseToConnectLabel = "Release to Connect"
// return;
// }
// }
-
- if (workflow.triggers[selectedTriggerIndex].parameters[5] === undefined || workflow.triggers[selectedTriggerIndex].parameters[5] === null) {
- workflow.triggers[selectedTriggerIndex].parameters[5] = {
- name: "auth_override",
- value: "",
- };
- }
-
- let authGroupValue = workflow.triggers[selectedTriggerIndex].parameters[5].value;
- if (authGroupValue === undefined || authGroupValue === null || authGroupValue === "") {
+ if (workflow.triggers[selectedTriggerIndex].parameters[5] === undefined || workflow.triggers[selectedTriggerIndex].parameters[5] === null) {
+ workflow.triggers[selectedTriggerIndex].parameters[5] = {
+ name: "auth_override",
+ value: "",
+ };
+ }
+
+ let authGroupValue = workflow.triggers[selectedTriggerIndex].parameters[5].value;
+
+ if (authGroupValue === undefined || authGroupValue === null || authGroupValue === "") {
workflow.triggers[selectedTriggerIndex].parameters[5].value = appName + "=" + auth.id + ";";
- } else {
+ } else {
// check if the app is already in the list
if (authGroupValue.includes(appName)) {
let oldValue = workflow.triggers[selectedTriggerIndex].parameters[5].value;
@@ -13270,7 +13319,7 @@ const releaseToConnectLabel = "Release to Connect"
} else {
workflow.triggers[selectedTriggerIndex].parameters[5].value += appName + "=" + auth.id + ";";
}
- }
+ }
// workflow.triggers[selectedTriggerIndex].parameters.push({
// name: auth.label + "_" + auth.app.id + "_override",
@@ -13280,892 +13329,878 @@ const releaseToConnectLabel = "Release to Connect"
}
return (
-
- {Object.entries(transformedAuthData).map(([appId, authList]) => {
- if (authList === undefined || authList === null || authList.length < 2) {
- return null;
- }
+
+ {Object.entries(transformedAuthData).map(([appId, authList]) => {
+ if (authList === undefined || authList === null || authList.length < 2) {
+ return null;
+ }
- return (
-
-
-
-
- )})}
-
+
+ {authList.flatMap((auth) =>
+
+ )}
+
+
+ )
+ })}
+
);
};
- const iconStyle = {
- marginRight: 15,
- };
+ const iconStyle = {
+ marginRight: 15,
+ };
-
- if (Object.getOwnPropertyNames(selectedTrigger)?.length > 0) {
- if (workflow.triggers[selectedTriggerIndex] === undefined) {
- return null;
- }
- if (
- workflow.triggers[selectedTriggerIndex].parameters === undefined ||
- workflow.triggers[selectedTriggerIndex].parameters === null ||
- workflow.triggers[selectedTriggerIndex].parameters.length === 0
- ) {
- workflow.triggers[selectedTriggerIndex].parameters = [];
- workflow.triggers[selectedTriggerIndex].parameters[0] = {
- name: "workflow",
- value: "",
- };
- workflow.triggers[selectedTriggerIndex].parameters[1] = {
- name: "argument",
- value: "",
- };
- workflow.triggers[selectedTriggerIndex].parameters[2] = {
- name: "user_apikey",
- value: "",
- };
- workflow.triggers[selectedTriggerIndex].parameters[3] = {
- name: "startnode",
- value: "",
- };
- workflow.triggers[selectedTriggerIndex].parameters[4] = {
- name: "check_result",
- value: "false",
- };
- workflow.triggers[selectedTriggerIndex].parameters[5] = {
- name: "auth_override",
- value: "",
- };
-
- /*
- // API-key has been replaced by auth key for the execution.
- // Parents can now automatically execute children without auth from a user, as long as the subflow in question is owned by the same org and the subflow is actually referencing it during checkin.
- console.log("SETTINGS: ", userSettings);
- if (
- userSettings !== undefined &&
- userSettings !== null &&
- userSettings.apikey !== null &&
- userSettings.apikey !== undefined &&
- userSettings.apikey.length > 0
- ) {
- workflow.triggers[selectedTriggerIndex].parameters[2] = {
- name: "user_apikey",
- value: userSettings.apikey,
- };
- }
- */
- }
-
- var handleSubflowStartnodeSelection = (e) => {
- setSubworkflowStartnode(e.target.value);
-
- if (e.target.value === null || e.target.value === undefined) {
- return
- }
-
- const branchId = uuidv4();
- const newbranch = {
- source_id: workflow.triggers[selectedTriggerIndex].id,
- destination_id: e.target.value.id,
- source: workflow.triggers[selectedTriggerIndex].id,
- target: e.target.value.id,
- has_errors: false,
- id: branchId,
- _id: branchId,
- label: "Subflow",
- decorator: true,
- };
-
- if (workflow.visual_branches !== undefined) {
- if (workflow.visual_branches === null) {
- workflow.visual_branches = [newbranch];
- } else if (workflow.visual_branches.length === 0) {
- workflow.visual_branches.push(newbranch);
- } else {
- const foundIndex = workflow.visual_branches.findIndex(
- (branch) => branch.source_id === newbranch.source_id
- );
- if (foundIndex !== -1) {
- const currentEdge = cy.getElementById(
- workflow.visual_branches[foundIndex].id
- );
- if (
- currentEdge !== undefined &&
- currentEdge !== null
- ) {
- currentEdge.remove();
- }
- }
-
- workflow.visual_branches.splice(foundIndex, 1);
- workflow.visual_branches.push(newbranch);
- }
- }
-
- if (workflow.id === subworkflow.id) {
- const cybranch = {
- group: "edges",
- source: newbranch.source_id,
- target: newbranch.destination_id,
- id: branchId,
- data: newbranch,
- };
-
- cy.add(cybranch);
- }
-
- console.log("Value to be set: ", e.target.value);
- try {
- workflow.triggers[
- selectedTriggerIndex
- ].parameters[3].value = e.target.value.id;
- } catch {
- workflow.triggers[selectedTriggerIndex].parameters[3] =
- {
- name: "startnode",
- value: e.target.value.id,
- };
- }
-
- setWorkflow(workflow);
- }
+ if (Object.getOwnPropertyNames(selectedTrigger)?.length > 0) {
+ if (workflow.triggers[selectedTriggerIndex] === undefined) {
+ return null;
}
- const handleMenuClose = () => {
- setUpdate(Math.random());
- setMenuPosition(null);
- };
+ if (
+ workflow.triggers[selectedTriggerIndex].parameters === undefined ||
+ workflow.triggers[selectedTriggerIndex].parameters === null ||
+ workflow.triggers[selectedTriggerIndex].parameters.length === 0
+ ) {
+ workflow.triggers[selectedTriggerIndex].parameters = [];
+ workflow.triggers[selectedTriggerIndex].parameters[0] = {
+ name: "workflow",
+ value: "",
+ };
+ workflow.triggers[selectedTriggerIndex].parameters[1] = {
+ name: "argument",
+ value: "",
+ };
+ workflow.triggers[selectedTriggerIndex].parameters[2] = {
+ name: "user_apikey",
+ value: "",
+ };
+ workflow.triggers[selectedTriggerIndex].parameters[3] = {
+ name: "startnode",
+ value: "",
+ };
+ workflow.triggers[selectedTriggerIndex].parameters[4] = {
+ name: "check_result",
+ value: "false",
+ };
+ workflow.triggers[selectedTriggerIndex].parameters[5] = {
+ name: "auth_override",
+ value: "",
+ };
- const handleItemClick = (values) => {
- console.log("VALUES: ", values)
- if (values === undefined || values === null || values.length === 0) {
- return;
- }
+ }
+ var handleSubflowStartnodeSelection = (e) => {
+ setSubworkflowStartnode(e.target.value);
- /*
- workflow.triggers[selectedTriggerIndex].parameters[1].value
- .trim()
- .endsWith("$")
- ? values[0].autocomplete
- : "$" + values[0].autocomplete;
-
- for (var key in values) {
- if (key === 0 || values[key].autocomplete.length === 0) {
- continue;
- }
-
- toComplete += values[key].autocomplete
- }
- */
-
- if (selectedTrigger.name === "Shuffle Workflow") {
- const toComplete = workflow?.triggers?.[selectedTriggerIndex]?.parameters?.[1]?.value + "$" + values[0]?.autocomplete
- // selectedTrigger.parameters[1].value = toComplete
- workflow.triggers[selectedTriggerIndex].parameters[1].value = toComplete
- const foundfield = document.getElementById("subflow_exec_field")
- if (foundfield !== undefined && foundfield !== null) {
- foundfield.value = toComplete
- }
- setWorkflow(workflow)
- }
-
- setUpdate(Math.random());
- setShowDropdown(false);
- setMenuPosition(null);
- };
-
- const subflowtypes = [
- {
- name: "Any",
- },
- {
- name: "Enrich",
- }
- ]
-
- const handleSubflowParamChange = (value) => {
-
- if (!workflow?.triggers || !workflow.triggers[selectedTriggerIndex]?.parameters) {
- console.log("Required workflow properties are undefined")
+ if (e.target.value === null || e.target.value === undefined) {
return
}
- if (!workflow.triggers[selectedTriggerIndex].parameters[1]) {
- workflow.triggers[selectedTriggerIndex].parameters[1] = {
- name: "execution_argument",
- value: ""
+ const branchId = uuidv4();
+ const newbranch = {
+ source_id: workflow.triggers[selectedTriggerIndex].id,
+ destination_id: e.target.value.id,
+ source: workflow.triggers[selectedTriggerIndex].id,
+ target: e.target.value.id,
+ has_errors: false,
+ id: branchId,
+ _id: branchId,
+ label: "Subflow",
+ decorator: true,
+ };
+
+ if (workflow.visual_branches !== undefined) {
+ if (workflow.visual_branches === null) {
+ workflow.visual_branches = [newbranch];
+ } else if (workflow.visual_branches.length === 0) {
+ workflow.visual_branches.push(newbranch);
+ } else {
+ const foundIndex = workflow.visual_branches.findIndex(
+ (branch) => branch.source_id === newbranch.source_id
+ );
+
+ if (foundIndex !== -1) {
+ const currentEdge = cy.getElementById(
+ workflow.visual_branches[foundIndex].id
+ );
+ if (
+ currentEdge !== undefined &&
+ currentEdge !== null
+ ) {
+ currentEdge.remove();
+ }
+ }
+
+ workflow.visual_branches.splice(foundIndex, 1);
+ workflow.visual_branches.push(newbranch);
}
}
- workflow.triggers[selectedTriggerIndex].parameters[1].value = value
- setWorkflow(workflow)
- setLastSaved(false)
+ if (workflow.id === subworkflow.id) {
+ const cybranch = {
+ group: "edges",
+ source: newbranch.source_id,
+ target: newbranch.destination_id,
+ id: branchId,
+ data: newbranch,
+ };
+
+ cy.add(cybranch);
+ }
+
+ console.log("Value to be set: ", e.target.value);
+ try {
+ workflow.triggers[
+ selectedTriggerIndex
+ ].parameters[3].value = e.target.value.id;
+ } catch {
+ workflow.triggers[selectedTriggerIndex].parameters[3] =
+ {
+ name: "startnode",
+ value: e.target.value.id,
+ };
+ }
+
+ setWorkflow(workflow);
+ }
+ }
+
+ const handleMenuClose = () => {
+ setUpdate(Math.random());
+ setMenuPosition(null);
+ };
+
+ const handleItemClick = (values) => {
+ console.log("VALUES: ", values)
+ if (values === undefined || values === null || values.length === 0) {
+ return;
}
- const SubflowSidebar = Object.getOwnPropertyNames(selectedTrigger).length === 0 || workflow.triggers[selectedTriggerIndex] === undefined || selectedTrigger.trigger_type !== "SUBFLOW" ? null :
-