cleaned up some frontend code and put back logic for script unit tests w/ burnettk danfunk

This commit is contained in:
jasquat 2022-10-31 16:58:10 -04:00
parent 6bfaf9c5c2
commit 0f683ed24a
2 changed files with 12 additions and 11 deletions

View File

@ -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);
}
}

View File

@ -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) => {