Minor fixes here and there
This commit is contained in:
@@ -249,6 +249,11 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
}
|
||||
|
||||
const getUsecase = (subcase, index, subindex) => {
|
||||
//console.log("Skipping getUsecase")
|
||||
// FIXME: Skipping for now as this screws over a lot of the prioritization system
|
||||
// due to them having "looked at" the usecase.
|
||||
return
|
||||
|
||||
subcase = parseUsecase(subcase)
|
||||
setPrevSubcase(subcase)
|
||||
|
||||
@@ -490,8 +495,10 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
}
|
||||
|
||||
|
||||
var canEditApp = userdata !== undefined && (userdata?.admin === "true" || userdata?.id === app?.owner || app?.owner === "" || (userdata?.admin === "true" && userdata?.active_org?.id === app?.reference_org)) || !app?.generated
|
||||
|
||||
var canEditApp = userdata?.support ||
|
||||
userdata?.id === app?.owner ||
|
||||
(userdata?.admin === "true" && userdata?.active_org?.id === app?.reference_org) ||
|
||||
app?.contributors?.includes(userdata?.id)
|
||||
return (
|
||||
<Dialog
|
||||
open={open}
|
||||
@@ -533,15 +540,22 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
fontFamily: theme?.typography?.fontFamily
|
||||
}}
|
||||
>
|
||||
{/*
|
||||
<Typography component="div" sx={{ fontWeight: 500, color: "#F1F1F1", fontSize: "20px" }}>
|
||||
About {app?.name.replace(/_/g, ' ').replace(/\b\w/g, char => char.toUpperCase())}
|
||||
</Typography>
|
||||
*/}
|
||||
<IconButton
|
||||
onClick={onClose}
|
||||
sx={{
|
||||
color: 'rgba(255, 255, 255, 0.7)',
|
||||
'&:hover': { bgcolor: 'rgba(255, 255, 255, 0.1)' }
|
||||
}}
|
||||
style={{
|
||||
position: "absolute",
|
||||
top: 10,
|
||||
right: 10,
|
||||
}}
|
||||
>
|
||||
<CloseIcon />
|
||||
</IconButton>
|
||||
@@ -570,9 +584,11 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
flexDirection: "row",
|
||||
alignItems: "center",
|
||||
}}>
|
||||
<a href={isCloud ? "/apps/" + (app?.id || app?.objectID) : `https://shuffler.io/apps/${app?.objectID || app?.id}`} target="_blank" rel="noopener noreferrer" style={{ textDecoration: "none", color: "rgba(255,255,255,0.9)", }}>
|
||||
<Typography variant="h5" component="div" sx={{ fontWeight: 600 }}>
|
||||
{newAppname}
|
||||
</Typography>
|
||||
</a>
|
||||
<Link
|
||||
to={isCloud ? "/apps/" + (app?.id || app?.objectID) : `https://shuffler.io/apps/${app?.objectID || app?.id}`}
|
||||
style={{ textDecoration: "none", color: "#f85a3e", marginTop: "-2px" }}
|
||||
@@ -663,6 +679,7 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
</Tooltip>
|
||||
): null}
|
||||
|
||||
{(canEditApp && app?.generated) && (
|
||||
<Button
|
||||
variant="contained"
|
||||
sx={{
|
||||
@@ -676,10 +693,7 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
color: "#fff",
|
||||
fontFamily: theme?.typography?.fontFamily
|
||||
}}
|
||||
startIcon={canEditApp ? <EditIcon /> :
|
||||
(app?.generated && app?.activated && userdata?.id !== app?.owner && isCloud ?
|
||||
<ForkRightIcon /> : null
|
||||
)}
|
||||
startIcon={canEditApp ? <EditIcon /> : <ForkRightIcon />}
|
||||
onClick={() => {
|
||||
if (canEditApp) {
|
||||
const editUrl = "/apps/edit/" + (app?.id || app?.objectID);
|
||||
@@ -692,6 +706,7 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
>
|
||||
{canEditApp ? "Edit" : "Fork"}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</Box>
|
||||
|
||||
@@ -812,13 +827,13 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
marginBottom: "16px",
|
||||
fontWeight: 600
|
||||
}}>
|
||||
{
|
||||
{/*
|
||||
(foundAppUsecase?.srcapp !== undefined && foundAppUsecase?.dstapp !== undefined) ? (
|
||||
"Connect " + foundAppUsecase?.srcapp?.replaceAll("_", " ") + " to " + foundAppUsecase?.dstapp?.replaceAll("_", " ")
|
||||
) : (
|
||||
"Connect " + app?.name.replaceAll("_", " ") + " to any tool"
|
||||
)
|
||||
}
|
||||
*/}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -830,7 +845,7 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
alignItems: 'center',
|
||||
mb: 3
|
||||
}}>
|
||||
{usecaseLoading ? (
|
||||
{/*usecaseLoading ? (
|
||||
<Stack direction="row" spacing={2} alignItems="center" sx={{ width: '100%' }}>
|
||||
<Stack direction="row" spacing={-1}>
|
||||
<Skeleton variant="circular" width={32} height={32} />
|
||||
@@ -879,7 +894,7 @@ const AppModal = ({ open, onClose, app, globalUrl, getApps }) => {
|
||||
{foundAppUsecase?.name || "Search for a Usecase"}
|
||||
</Typography>
|
||||
</>
|
||||
)}
|
||||
)*/}
|
||||
</Box>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1467,17 +1467,25 @@ const ParsedAction = (props) => {
|
||||
actionname = "comms"
|
||||
}
|
||||
|
||||
if (isIntegration) {
|
||||
|
||||
if (isAgent || isIntegration) {
|
||||
// Check if actionname uppercase is in the parsedDatatypeImages() dictionary
|
||||
if (parsedDatatypeImages()[actionname.toUpperCase()] !== undefined) {
|
||||
var newimage = parsedDatatypeImages()[actionname.toUpperCase()]
|
||||
if (isAgent) {
|
||||
wrapperapp.large_image = theme.palette.singulBlackWhite
|
||||
newimage = wrapperapp.large_image
|
||||
} else if (isIntegration) {
|
||||
wrapperapp.large_image = theme.palette.singulGreen
|
||||
newimage = theme.palette.singulGreen
|
||||
} else {
|
||||
const uppercaseimage = parsedDatatypeImages()[actionname.toUpperCase()]
|
||||
if (uppercaseimage !== undefined) {
|
||||
var newimage = uppercaseimage
|
||||
//newimage = <img src={newimage} style={{width: 35, height: 35, marginRight: 5, borderRadius: 5, cursor: "pointer", border: noAppSelected ? "3px solid #86c142" : "2px solid rgba(255,255,255,0.6)"}} />
|
||||
wrapperapp.large_image = newimage
|
||||
} else {
|
||||
console.log("Couldn't find actionname: ", actionname)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var authWritten = false;
|
||||
var noAppSelected = false
|
||||
@@ -1745,6 +1753,37 @@ const ParsedAction = (props) => {
|
||||
}
|
||||
</Tooltip>
|
||||
</IconButton>
|
||||
|
||||
{selectedAction?.generated === true && selectedAction?.app_version === "1.0.0" ?
|
||||
<Button
|
||||
variant="contained"
|
||||
color="secondary"
|
||||
style={{marginLeft: 30, textTransform: "none", }}
|
||||
onClick={() => {
|
||||
if (apps === null || apps === undefined || apps?.length === 0) {
|
||||
toast.error("No apps found. Please refresh the page.")
|
||||
return
|
||||
}
|
||||
|
||||
const app = apps.find((app) => app.id === selectedAction.app_id)
|
||||
if (app !== undefined && app !== null) {
|
||||
//setSelectedApp(app)
|
||||
if (app.app_version !== undefined && app.app_version !== null && app.app_version !== "1.0.0") {
|
||||
toast.info(`Upgraded to app version ${app.app_version}`)
|
||||
selectedAction.app_version = app.app_version
|
||||
setSelectedAction(selectedAction)
|
||||
setUpdate(Math.random())
|
||||
}
|
||||
} else {
|
||||
toast.error("No upgrade to be performed for this app. Expected version 1.1.0 available. App rebuild may be available.")
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
Upgrade
|
||||
</Button>
|
||||
: null}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column" }}>
|
||||
@@ -2764,6 +2803,7 @@ const ParsedAction = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
const iconInfo = GetIconInfo(selectedAction)
|
||||
if (iconInfo !== undefined && iconInfo !== null) {
|
||||
selectedAction.fillGradient = iconInfo.fillGradient
|
||||
@@ -2771,6 +2811,7 @@ const ParsedAction = (props) => {
|
||||
selectedAction.iconBackground = iconInfo.iconBackgroundColor
|
||||
selectedAction.fillstyle = "linear-gradient"
|
||||
}
|
||||
*/
|
||||
|
||||
if (paramIndex === -1) {
|
||||
console.log("Couldn't find app_name parameter")
|
||||
@@ -2797,13 +2838,14 @@ const ParsedAction = (props) => {
|
||||
minHeight: 30,
|
||||
maxHeight: 30,
|
||||
|
||||
marginRight: 5,
|
||||
marginRight: 25,
|
||||
marginTop: isIntegration ? 3 : 0,
|
||||
borderRadius: 5,
|
||||
cursor: "pointer",
|
||||
border: noAppSelected ? "3px solid #86c142" : "2px solid rgba(255,255,255,0.6)",
|
||||
|
||||
paddingLeft: 5,
|
||||
paddingTop: 5,
|
||||
paddingLeft: isAgent || isIntegration ? 0 : 5,
|
||||
paddingTop: isAgent || isIntegration ? 0 : 5,
|
||||
}} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
@@ -4579,7 +4621,7 @@ const ParsedAction = (props) => {
|
||||
}
|
||||
|
||||
//console.log("Required fields: ", selectedActionParameters[count])
|
||||
navigate(`?action_id=${selectedAction.id}&field=${data.name}&action_name=${selectedAction.name}`)
|
||||
navigate(`?action_id=${selectedAction.id}&field=${data.name}&action_name=${selectedAction.name}&app_name=${selectedAction?.label}`)
|
||||
setEditorData({
|
||||
"name": data.name,
|
||||
"value": fixExample(parsedvalue),
|
||||
|
||||
@@ -53,7 +53,7 @@ import PaperComponent from "../components/PaperComponent.jsx";
|
||||
|
||||
import { padding, textAlign } from '@mui/system';
|
||||
import data from '../frameworkStyle.jsx';
|
||||
import { useNavigate, Link, useParams } from "react-router-dom";
|
||||
import { useNavigate, Link, useParams, useSearchParams } from "react-router-dom";
|
||||
import { tags as t } from '@lezer/highlight';
|
||||
|
||||
|
||||
@@ -100,6 +100,7 @@ const pythonFilters = [
|
||||
const extensions = []
|
||||
const CodeEditor = (props) => {
|
||||
const {
|
||||
workflow,
|
||||
globalUrl,
|
||||
fieldCount,
|
||||
actionlist,
|
||||
@@ -107,13 +108,14 @@ const CodeEditor = (props) => {
|
||||
expansionModalOpen,
|
||||
setExpansionModalOpen,
|
||||
codedata,
|
||||
handleActionParamChange,
|
||||
setcodedata,
|
||||
isFileEditor,
|
||||
runUpdateText,
|
||||
toolsAppId,
|
||||
parameterName,
|
||||
selectedAction,
|
||||
selectedTrigger,
|
||||
// selectedAction,
|
||||
// selectedTrigger,
|
||||
workflowExecutions,
|
||||
getParents,
|
||||
activeDialog,
|
||||
@@ -145,7 +147,8 @@ const CodeEditor = (props) => {
|
||||
|
||||
const [currentCharacter, setCurrentCharacter] = React.useState(-1);
|
||||
const [currentLine, setCurrentLine] = React.useState(-1);
|
||||
|
||||
const [selectedAction, setSelectedAction] = React.useState({});
|
||||
const [selectedTrigger, setSelectedTrigger] = React.useState({});
|
||||
const [variableOccurences, setVariableOccurences] = React.useState([]);
|
||||
const [currentLocation, setCurrentLocation] = React.useState([]);
|
||||
const [currentVariable, setCurrentVariable] = React.useState("");
|
||||
@@ -187,6 +190,33 @@ const CodeEditor = (props) => {
|
||||
}, [localcodedata])
|
||||
|
||||
let navigate = useNavigate();
|
||||
const [searchParams] = useSearchParams();
|
||||
const actionId = searchParams.get('action_id');
|
||||
const appName = searchParams.get('app_name');
|
||||
const fieldName = searchParams.get('field');
|
||||
const triggerId = searchParams.get('trigger_id');
|
||||
const triggerField = searchParams.get('trigger_field');
|
||||
const triggerName = searchParams.get('trigger_name');
|
||||
|
||||
useEffect(() => {
|
||||
if (actionId === undefined || actionId === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const action = workflow?.actions?.find(action => action.id === actionId);
|
||||
setlocalcodedata(editorData?.value);
|
||||
setSelectedAction(action);
|
||||
}, [actionId, fieldName])
|
||||
|
||||
useEffect(() => {
|
||||
if (triggerId === undefined || triggerId === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
const trigger = workflow?.triggers?.find(trigger => trigger.id === triggerId);
|
||||
setlocalcodedata(editorData?.value);
|
||||
setSelectedTrigger(trigger);
|
||||
}, [triggerId])
|
||||
|
||||
useEffect(() => {
|
||||
var allVariables = []
|
||||
@@ -1364,7 +1394,7 @@ const CodeEditor = (props) => {
|
||||
console.log("In closer")
|
||||
|
||||
if (changeActionParameterCodeMirror !== undefined) {
|
||||
changeActionParameterCodeMirror({ target: { value: "" } }, fieldCount, localcodedata)
|
||||
changeActionParameterCodeMirror({ target: { value: "" } }, fieldCount, localcodedata, selectedAction, setSelectedAction)
|
||||
} else {
|
||||
console.log("No action called changeActionParameterCodeMirror in code editor")
|
||||
}
|
||||
@@ -2120,7 +2150,7 @@ const CodeEditor = (props) => {
|
||||
>
|
||||
<div>
|
||||
<span style={{ color: "white" }}>
|
||||
{selectedAction === undefined ? "" : selectedAction.name === "execute_python" || selectedAction.name === "execute_bash" ? "Code to run" : `Output`}
|
||||
{actionId === null ? `Output : ${triggerName?.replaceAll("_", " ").slice(0, 1).toUpperCase() + triggerName?.replaceAll("_", " ").slice(1)}` : selectedAction.name === "execute_python" || selectedAction.name === "execute_bash" ? "Code to run" : `Output : ${appName?.replaceAll("_", " ").slice(0, 1).toUpperCase() + appName?.replaceAll("_", " ").slice(1)}(${fieldName})`}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -2134,12 +2164,28 @@ const CodeEditor = (props) => {
|
||||
disabled={executing}
|
||||
color="primary"
|
||||
style={{
|
||||
border: `1px solid ${theme.palette.primary.main}`,
|
||||
border: `1px solid rgba(255, 255, 255, 0.15)`,
|
||||
position: "absolute",
|
||||
top: 24,
|
||||
top: 20,
|
||||
right: 100,
|
||||
maxHeight: 35,
|
||||
minWidth: 70,
|
||||
zIndex: 1200,
|
||||
fontWeight: 500,
|
||||
fontSize: 14,
|
||||
backgroundColor: "rgba(33, 33, 33, 0.95)",
|
||||
backdropFilter: "blur(8px)",
|
||||
boxShadow: "0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08)",
|
||||
transition: "all 0.2s ease",
|
||||
borderRadius: "4px",
|
||||
"&:hover": {
|
||||
backgroundColor: "rgba(45, 45, 45, 0.95)",
|
||||
transform: "translateY(-1px)",
|
||||
boxShadow: "0 7px 14px rgba(0, 0, 0, 0.12), 0 3px 6px rgba(0, 0, 0, 0.08)",
|
||||
},
|
||||
"&:active": {
|
||||
transform: "translateY(1px)",
|
||||
}
|
||||
}}
|
||||
onClick={() => {
|
||||
executeSingleAction(expOutput)
|
||||
@@ -2148,7 +2194,7 @@ const CodeEditor = (props) => {
|
||||
{executing ?
|
||||
<CircularProgress style={{ height: 18, width: 18, }} />
|
||||
:
|
||||
<span>{selectedAction === undefined ? "" : selectedAction.name === "execute_python" ? "Run Python Code" : selectedAction.name === "execute_bash" ? "Run Bash" : "Try it"}<PlayArrowIcon style={{ height: 18, width: 18, marginBottom: -4, marginLeft: 5, }} /> </span>
|
||||
<span>{selectedAction === undefined ? "Try it" : selectedAction.name === "execute_python" ? "Run Python Code" : selectedAction.name === "execute_bash" ? "Run Bash" : "Try it"}<PlayArrowIcon style={{ height: 18, width: 18, marginBottom: -4, marginLeft: 5, }} /> </span>
|
||||
}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
@@ -2326,22 +2372,32 @@ const CodeEditor = (props) => {
|
||||
setExpansionModalOpen(false)
|
||||
} else if (changeActionParameterCodeMirror !== undefined) {
|
||||
//changeActionParameterCodeMirror(event, fieldCount, fixedcodedata)
|
||||
changeActionParameterCodeMirror(event, fieldCount, fixedcodedata, actionlist, parameterName)
|
||||
changeActionParameterCodeMirror(event, fieldCount, fixedcodedata, actionlist, parameterName, selectedAction, setSelectedAction)
|
||||
setExpansionModalOpen(false)
|
||||
setcodedata(fixedcodedata)
|
||||
}
|
||||
|
||||
// Check if fieldname is set, and try to find and inject the text
|
||||
if (fieldname !== undefined && fieldname !== null && fieldname.length > 0) {
|
||||
const foundfield = document.getElementById(fieldname)
|
||||
if (foundfield !== undefined && foundfield !== null) {
|
||||
foundfield.value = fixedcodedata
|
||||
if(selectedTrigger !== undefined && selectedTrigger !== null && selectedTrigger.name === "Shuffle Workflow") {
|
||||
handleSubflowParamChange(fixedcodedata)
|
||||
// console.log("fieldname", fieldname)
|
||||
// // Check if fieldname is set, and try to find and inject the text
|
||||
// if (fieldname !== undefined && fieldname !== null && fieldname.length > 0) {
|
||||
// const foundfield = document.getElementById(fieldname)
|
||||
// console.log("foundfield", foundfield)
|
||||
// if (foundfield !== undefined && foundfield !== null) {
|
||||
// foundfield.value = fixedcodedata
|
||||
// if(selectedTrigger !== undefined && selectedTrigger !== null && selectedTrigger.name === "Shuffle Workflow") {
|
||||
// handleSubflowParamChange(fixedcodedata)
|
||||
// }
|
||||
// }
|
||||
// } else {
|
||||
// //toast("No fieldname found: " + fieldname)
|
||||
// }
|
||||
|
||||
if(actionId !== undefined && actionId !== null && actionId.length > 0) {
|
||||
handleActionParamChange(actionId, fieldName, fixedcodedata)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//toast("No fieldname found: " + fieldname)
|
||||
|
||||
if(triggerId !== undefined && triggerId !== null && triggerId.length > 0) {
|
||||
handleSubflowParamChange(triggerId, triggerField, fixedcodedata)
|
||||
}
|
||||
|
||||
setExpansionModalOpen(false)
|
||||
|
||||
@@ -131,10 +131,8 @@ const data = [
|
||||
selector: `node[example="noapp"]`,
|
||||
css: {
|
||||
// Make background image padding on the left side 20px
|
||||
"background-width": "75%",
|
||||
"background-height": "75%",
|
||||
"background-position-x": "17px",
|
||||
"background-position-y": "17px",
|
||||
"background-width": "100%",
|
||||
"background-height": "100%",
|
||||
|
||||
"background-color": "data(iconBackground)",
|
||||
"background-fill": "data(fillstyle)",
|
||||
|
||||
@@ -76,6 +76,9 @@ const theme = createTheme(adaptV4Theme({
|
||||
fontSize: 11,
|
||||
},
|
||||
defaultImage: "/images/no_image.png",
|
||||
singulOrange: "/images/singul_orange.png",
|
||||
singulGreen: "/images/singul_green.png",
|
||||
singulBlackWhite: "/images/singul_black_white.png",
|
||||
},
|
||||
typography: {
|
||||
fontFamily: `"Roboto", "Helvetica", "Arial", "inter", sans-serif`,
|
||||
|
||||
@@ -154,8 +154,6 @@ import ExtraApps from "../components/ExtraApps.jsx"
|
||||
import EditWorkflow from "../components/EditWorkflow.jsx"
|
||||
import { act } from "react";
|
||||
import { Context } from "../context/ContextApi.jsx";
|
||||
// import AppStats from "../components/AppStats.jsx";
|
||||
const noImage = "/public/no_image.png";
|
||||
|
||||
cytoscape.use(edgehandles);
|
||||
|
||||
@@ -446,6 +444,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
const [historyIndex, setHistoryIndex] = React.useState(history.length);
|
||||
const [variableInfo, setVariableInfo] = React.useState({})
|
||||
const [selectedVersion, setSelectedVersion] = React.useState(null)
|
||||
const [selectedTriggerValue, setSelectedTriggerValue] = React.useState("")
|
||||
const [appAuthentication, setAppAuthentication] = React.useState(undefined);
|
||||
const [variablesModalOpen, setVariablesModalOpen] = React.useState(false);
|
||||
const [aiQueryModalOpen, setAiQueryModalOpen] = React.useState(false)
|
||||
@@ -572,6 +571,13 @@ const AngularWorkflow = (defaultprops) => {
|
||||
}
|
||||
}, [editWorkflowModalOpen])
|
||||
|
||||
useEffect(() => {
|
||||
if (selectedTrigger !== undefined && selectedTrigger.parameters !== undefined) {
|
||||
// Right now just setting for the subflow
|
||||
setSelectedTriggerValue(selectedTrigger?.parameters[1]?.value)
|
||||
}
|
||||
}, [selectedTrigger])
|
||||
|
||||
const dragRef = React.useRef(false);
|
||||
|
||||
|
||||
@@ -628,11 +634,13 @@ const AngularWorkflow = (defaultprops) => {
|
||||
"multiselect": true,
|
||||
},
|
||||
]
|
||||
}]
|
||||
}],
|
||||
large_image: theme.palette.singulBlackWhite,
|
||||
},
|
||||
{
|
||||
"id": "integration",
|
||||
"name": "Singul",
|
||||
"large_image": theme.palette.singulGreen,
|
||||
"type": "ACTION",
|
||||
"app_version": "1.0.0",
|
||||
"loop_versions": ["1.0.0"],
|
||||
@@ -9336,14 +9344,16 @@ const AngularWorkflow = (defaultprops) => {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
//useEffect(() => {
|
||||
if (firstrequest) {
|
||||
setFirstrequest(false);
|
||||
getWorkflow(props.match.params.key, {});
|
||||
setFirstrequest(false)
|
||||
getWorkflow(props.match.params.key, {})
|
||||
getChildWorkflows(props.match.params.key)
|
||||
getRevisionHistory(props.match.params.key)
|
||||
loadTriggers()
|
||||
getApps()
|
||||
fetchUsecases()
|
||||
|
||||
getWorkflowExecution(props.match.params.key, "", executionFilter)
|
||||
|
||||
setLeftSideBarOpenByClick(false)
|
||||
localStorage.setItem("expandLeftNav", false)
|
||||
|
||||
@@ -14008,23 +14018,25 @@ const AngularWorkflow = (defaultprops) => {
|
||||
}
|
||||
]
|
||||
|
||||
const handleSubflowParamChange = (value) => {
|
||||
const handleSubflowParamChange = (triggerId, triggerField, newData) => {
|
||||
|
||||
if (!workflow?.triggers || !workflow.triggers[selectedTriggerIndex]?.parameters) {
|
||||
console.log("Required workflow properties are undefined")
|
||||
return
|
||||
}
|
||||
if (workflow !== undefined && workflow !== null) {
|
||||
// Find the trigger with matching id
|
||||
const triggerIndex = workflow?.triggers?.findIndex(trigger => trigger.id === triggerId);
|
||||
if (triggerIndex >= 0) {
|
||||
// Find the parameter with matching name
|
||||
const paramIndex = workflow.triggers[triggerIndex].parameters?.findIndex(param => param.name === triggerField);
|
||||
if (paramIndex >= 0) {
|
||||
// Update the parameter value
|
||||
workflow.triggers[triggerIndex].parameters[paramIndex].value = newData;
|
||||
|
||||
if (!workflow.triggers[selectedTriggerIndex].parameters[1]) {
|
||||
workflow.triggers[selectedTriggerIndex].parameters[1] = {
|
||||
name: "execution_argument",
|
||||
value: ""
|
||||
// Update workflow state to trigger re-render
|
||||
setWorkflow({...workflow});
|
||||
setSelectedTriggerValue(newData)
|
||||
setLastSaved(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
workflow.triggers[selectedTriggerIndex].parameters[1].value = value
|
||||
setWorkflow(workflow)
|
||||
setLastSaved(false)
|
||||
}
|
||||
|
||||
const SubflowSidebar = Object.getOwnPropertyNames(selectedTrigger).length === 0 || workflow.triggers[selectedTriggerIndex] === undefined || selectedTrigger.trigger_type !== "SUBFLOW" ? null :
|
||||
@@ -14482,6 +14494,8 @@ const AngularWorkflow = (defaultprops) => {
|
||||
setActiveDialog("codeeditor")
|
||||
var parsedvalue = workflow?.triggers[selectedTriggerIndex]?.parameters[1]?.value
|
||||
|
||||
// Right now Handling subflow only with this
|
||||
navigate(`?trigger_id=${selectedTrigger.id}&trigger_field=${"argument"}&trigger_name=${selectedTrigger.label}`)
|
||||
setEditorData({
|
||||
"name": workflow.triggers[selectedTriggerIndex].parameters[1].name,
|
||||
"value": parsedvalue,
|
||||
@@ -14531,13 +14545,16 @@ const AngularWorkflow = (defaultprops) => {
|
||||
fullWidth
|
||||
color="primary"
|
||||
placeholder="Some execution data"
|
||||
defaultValue={
|
||||
workflow?.triggers[selectedTriggerIndex]?.parameters[1]?.value
|
||||
value={
|
||||
selectedTriggerValue
|
||||
}
|
||||
onChange={(e) => {
|
||||
workflow.triggers[selectedTriggerIndex].parameters[1].value = e.target.value
|
||||
setWorkflow(workflow)
|
||||
setLastSaved(false)
|
||||
setSelectedTriggerValue(e.target.value)
|
||||
}}
|
||||
onBlur={() => {
|
||||
workflow.triggers[selectedTriggerIndex].parameters[1].value = selectedTriggerValue
|
||||
setWorkflow(workflow)
|
||||
}}
|
||||
/>
|
||||
{!showDropdown ? null :
|
||||
@@ -16933,7 +16950,11 @@ const AngularWorkflow = (defaultprops) => {
|
||||
setLastSaved(false)
|
||||
}}
|
||||
>
|
||||
{workflow.name !== undefined && workflow.name !== null && workflow.name.length > 0 ?
|
||||
<EditIcon style={{ position: "absolute", top: 7, height: 20, width: 20, }} />
|
||||
:
|
||||
null
|
||||
}
|
||||
<span style={{ marginLeft: 30, }}>{workflow.name}</span>
|
||||
</Typography>
|
||||
{workflowAsCode && (
|
||||
@@ -17055,7 +17076,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
>
|
||||
Go to parent org workflow
|
||||
</Button>
|
||||
: userdata !== undefined && userdata !== null && userdata.orgs !== undefined && userdata.orgs !== null && userdata.orgs.length > 0 ?
|
||||
: userdata !== undefined && userdata !== null && userdata.orgs !== undefined && userdata.orgs !== null && userdata.orgs.length > 1 && workflow?.id !== undefined && workflow?.id && workflow?.id?.length > 0 ?
|
||||
<Button
|
||||
color="secondary"
|
||||
variant="outlined"
|
||||
@@ -19353,14 +19374,14 @@ const AngularWorkflow = (defaultprops) => {
|
||||
base_node_name = "exec"
|
||||
}
|
||||
|
||||
console.log("COPY: ", base_node_name, copy);
|
||||
//console.log("COPY: ", base_node_name, copy);
|
||||
|
||||
//var newitem = JSON.parse(base);
|
||||
var newitem = validateJson(base).result
|
||||
|
||||
// Check if base_node_name has changed
|
||||
if (cy !== undefined && cy !== null) {
|
||||
console.log("Change name?")
|
||||
//console.log("Change name?")
|
||||
//const allNodes = cy.nodes().jsons();
|
||||
//for (var key in allNodes) {
|
||||
//const currentNode = allNodes[key];
|
||||
@@ -19401,7 +19422,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
const elementName = "copy_element_shuffle";
|
||||
var copyText = document.getElementById(elementName);
|
||||
if (copyText !== null && copyText !== undefined) {
|
||||
console.log("NAVIGATOR: ", navigator);
|
||||
//console.log("NAVIGATOR: ", navigator);
|
||||
const clipboard = navigator.clipboard;
|
||||
if (clipboard === undefined) {
|
||||
toast("Can only copy over HTTPS (port 3443)");
|
||||
@@ -19414,7 +19435,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
|
||||
/* Copy the text inside the text field */
|
||||
document.execCommand("copy");
|
||||
console.log("COPYING!");
|
||||
//console.log("COPYING!");
|
||||
toast("Copied JSON path to clipboard.")
|
||||
} else {
|
||||
console.log("Couldn't find element ", elementName);
|
||||
@@ -21539,6 +21560,14 @@ const AngularWorkflow = (defaultprops) => {
|
||||
textAlign: "center",
|
||||
}}
|
||||
>
|
||||
{isLoaded && workflowDone ?
|
||||
<div style={{marginTop: "30vh", }}>
|
||||
<Typography variant="body1" color="textSecondary">
|
||||
No workflow to load. Workflow runs may still exist. If you think this is wrong, please contact support@shuffler.io
|
||||
</Typography>
|
||||
</div>
|
||||
:
|
||||
<div>
|
||||
<CircularProgress
|
||||
style={{
|
||||
marginTop: "30vh",
|
||||
@@ -21552,6 +21581,8 @@ const AngularWorkflow = (defaultprops) => {
|
||||
Loading Workflow
|
||||
</Typography>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
) : (
|
||||
<span>
|
||||
{/*<Fade in={true} timeout={1000} style={{ transitionDelay: `${150}ms` }}>*/}
|
||||
@@ -23330,7 +23361,7 @@ const AngularWorkflow = (defaultprops) => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
const changeActionParameterCodeMirror = (event, count, data, actionlist, parametername) => {
|
||||
const changeActionParameterCodeMirror = (event, count, data, actionlist, parametername, selectedAction, setSelectedAction) => {
|
||||
|
||||
// FIXME: This exists ONLY to make sure focus + blur actually changes the field value
|
||||
// in fields from ParsedAction.jsx such as rightside_field_2
|
||||
@@ -23510,6 +23541,25 @@ const AngularWorkflow = (defaultprops) => {
|
||||
//setUpdate(Math.random())
|
||||
}
|
||||
|
||||
const handleActionParamChange = (actionId, fieldName, newData) => {
|
||||
if (workflow !== undefined) {
|
||||
// Find the action with matching id
|
||||
const actionIndex = workflow?.actions.findIndex(action => action.id === actionId);
|
||||
if (actionIndex >= 0) {
|
||||
// Find the parameter with matching name
|
||||
console.log("fieldName", fieldName)
|
||||
const paramIndex = workflow.actions[actionIndex].parameters.findIndex(param => param.name === fieldName);
|
||||
if (paramIndex >= 0) {
|
||||
// Update the parameter value
|
||||
workflow.actions[actionIndex].parameters[paramIndex].value = newData;
|
||||
|
||||
// Update workflow state to trigger re-render
|
||||
setWorkflow({...workflow});
|
||||
setLastSaved(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
var foundusecase = {}
|
||||
if (workflow.actions !== undefined && workflow.actions !== null && workflow.actions.length > 0 && userdata !== undefined && userdata !== null && userdata.priorities !== undefined && userdata.priorities !== null && userdata.priorities.length > 0) {
|
||||
@@ -23587,19 +23637,21 @@ const AngularWorkflow = (defaultprops) => {
|
||||
|
||||
{codeEditorModalOpen ?
|
||||
<ShuffleCodeEditor
|
||||
workflow={workflow}
|
||||
expansionModalOpen={codeEditorModalOpen}
|
||||
setExpansionModalOpen={setCodeEditorModalOpen}
|
||||
isCloud={isCloud}
|
||||
globalUrl={globalUrl}
|
||||
workflowExecutions={workflowExecutions}
|
||||
getParents={getParents}
|
||||
selectedAction={selectedAction}
|
||||
selectedTrigger={selectedTrigger}
|
||||
// selectedAction={selectedAction}
|
||||
// selectedTrigger={selectedTrigger}
|
||||
aiSubmit={aiSubmit}
|
||||
toolsAppId={toolsApp.id}
|
||||
handleSubflowParamChange={handleSubflowParamChange}
|
||||
codedata={editorData.value}
|
||||
setcodedata={setcodedata}
|
||||
handleActionParamChange={handleActionParamChange}
|
||||
|
||||
// Not working out of the box
|
||||
parameterName={editorData.name}
|
||||
|
||||
@@ -28,6 +28,7 @@ import {
|
||||
Close as CloseIcon,
|
||||
Cached as CachedIcon,
|
||||
CloudDownload as CloudDownloadIcon,
|
||||
ForkRight as ForkRightIcon,
|
||||
} from "@mui/icons-material";
|
||||
|
||||
import InputAdornment from '@mui/material/InputAdornment';
|
||||
@@ -52,8 +53,13 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
|
||||
const navigate = useNavigate();
|
||||
const isCloud = window.location.host === "localhost:3002" || window.location.host === "shuffler.io" || window.location.host === "localhost:3000";
|
||||
const appUrl = isCloud ? `/apps/${data.id}` : `https://shuffler.io/apps/${data.id}`;
|
||||
var canEditApp = userdata.admin === "true" || userdata.id === data?.owner || data?.owner === "" || (userdata.admin === "true" && userdata.active_org.id === data?.reference_org) || !data?.generated
|
||||
|
||||
var canEditApp = userdata?.support ||
|
||||
userdata?.id === data?.owner ||
|
||||
(userdata?.admin === "true" && userdata?.active_org?.id === data?.reference_org) ||
|
||||
data?.contributors?.includes(userdata?.id)
|
||||
|
||||
console.log("appdata", data)
|
||||
const paperStyle = {
|
||||
backgroundColor: mouseHoverIndex === index ? "rgba(26, 26, 26, 1)" : "#212121",
|
||||
color: "rgba(241, 241, 241, 1)",
|
||||
@@ -183,7 +189,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
|
||||
))}
|
||||
</div>
|
||||
{/* Deactivate button */}
|
||||
{currTab === 0 && !deactivatedIndexes.includes(index) && mouseHoverIndex === index && data.generated === true && (
|
||||
{(currTab === 0 || currTab === 1) && !deactivatedIndexes.includes(index) && mouseHoverIndex === index && data.generated === true && (
|
||||
<div style={{
|
||||
display: "flex",
|
||||
gap: 8,
|
||||
@@ -191,7 +197,7 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
|
||||
paddingRight: 20
|
||||
}}>
|
||||
{
|
||||
canEditApp && (
|
||||
canEditApp ? (
|
||||
<button style={{ backgroundColor: "rgba(73, 73, 73, 1)", border: "none", cursor: "pointer", color: "white", borderRadius: 3, display: "flex", alignItems: "center", justifyContent: "center", height: 35 }}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
@@ -204,6 +210,17 @@ const AppCard = ({ data, index, mouseHoverIndex, setMouseHoverIndex, globalUrl,
|
||||
>
|
||||
<EditIcon />
|
||||
</button>
|
||||
) : (
|
||||
<button style={{ backgroundColor: "rgba(73, 73, 73, 1)", border: "none", cursor: "pointer", color: "white", borderRadius: 3, display: "flex", alignItems: "center", justifyContent: "center", height: 35 }}
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
const editUrl = "/apps/new?id=" + data?.id;
|
||||
navigate(editUrl)
|
||||
}}
|
||||
>
|
||||
<ForkRightIcon />
|
||||
</button>
|
||||
)
|
||||
}
|
||||
<Button
|
||||
@@ -1844,6 +1861,8 @@ const Apps2 = (props) => {
|
||||
color: "#FF8544"
|
||||
}
|
||||
|
||||
console.log("User", userdata)
|
||||
|
||||
return (
|
||||
<div style={{ paddingTop: 70, paddingLeft: leftSideBarOpenByClick ? 200 : 0, transition: "padding-left 0.3s ease", backgroundColor: "#1A1A1A", fontFamily: theme?.typography?.fontFamily, zoom: 0.7, }}>
|
||||
<InstantSearch searchClient={searchClient} indexName="appsearch">
|
||||
|
||||
@@ -712,9 +712,9 @@ const Docs = (defaultprops) => {
|
||||
const newdata = responseJson.reason.replace(imgRegex, '').replace(tocRegex, "");
|
||||
setData(newdata);
|
||||
if (docId === undefined) {
|
||||
document.title = "Shuffle documentation introduction";
|
||||
document.title = "Shuffle automation documentation";
|
||||
} else {
|
||||
document.title = "Shuffle " + docId + " documentation";
|
||||
document.title = "Shuffle " + docId.replace("_", " ") + " documentation";
|
||||
}
|
||||
|
||||
if (responseJson.reason !== undefined && responseJson.reason !== null && responseJson.reason.includes("404: Not Found")) {
|
||||
|
||||
Reference in New Issue
Block a user