diff --git a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx index 0a604972b..9728e7d50 100644 --- a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx +++ b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx @@ -185,8 +185,8 @@ export default function ReactDiagramEditor({ ) { if (onLaunchScriptEditor) { setPerformingXmlUpdates(true); - // const modeling = diagramModeler.get('modeling'); - onLaunchScriptEditor(element, script, scriptType, eventBus); + const modeling = diagramModeler.get('modeling'); + onLaunchScriptEditor(element, script, scriptType, eventBus, modeling); } } diff --git a/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx b/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx index 53f335a29..aa1643d84 100644 --- a/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx @@ -280,15 +280,20 @@ export default function ProcessModelEditDiagram() { const onLaunchScriptEditor = ( element: any, script: string, - scriptType: string, - eventBus: any + scriptTypeString: string, + eventBus: any, + modeling: any ) => { + // TODO: modeling is only needed for script unit tests. + // we should update this to act like updating scripts + // where we pass an event to bpmn-js + setScriptModeling(modeling); + setScriptText(script || ''); - setScriptType(scriptType); + setScriptType(scriptTypeString); setScriptEventBus(eventBus); - // setScriptModeling(modeling); setScriptElement(element); - // setScriptUnitTestElementWithIndex(0, element); + setScriptUnitTestElementWithIndex(0, element); handleShowScriptEditor(); }; @@ -305,10 +310,6 @@ export default function ProcessModelEditDiagram() { const handleEditorScriptChange = (value: any) => { setScriptText(value); - // (scriptModeling as any).updateProperties(scriptElement, { - // scriptFormat: 'python', - // script: value, - // }); }; const handleEditorScriptTestUnitInputChange = (value: any) => {