whenever the text changes in the model update the script text in memory, updating size

This commit is contained in:
burnettk 2022-06-15 18:41:20 -04:00
parent e4a1261658
commit 0964473b06
1 changed files with 5 additions and 11 deletions

View File

@ -148,33 +148,27 @@ export default function ProcessModelEditDiagram() {
});
const handleEditorChange = ((value, event) => {
setScriptText(value);
});
const handleScriptEditorSave = ((value, event) => {
modeling.updateProperties(scriptElement, {
scriptFormat: "python",
script: scriptText
script: value
});
setShowScriptEditor(false);
});
const scriptEditor = (() => {
return (
<Modal size="lg" show={showScriptEditor} onHide={handleScriptEditorClose}>
<Modal size="xl" show={showScriptEditor} onHide={handleScriptEditorClose}>
<Modal.Header closeButton>
<Modal.Title>Script</Modal.Title>
</Modal.Header>
<Editor
height="70vh"
width="70vw"
height={600}
width="auto"
defaultLanguage="python"
defaultValue={scriptText}
onChange={handleEditorChange}
/>
<Modal.Footer>
<Button variant="secondary" onClick={handleScriptEditorClose}>
Cancel
</Button>
<Button variant="secondary" onClick={handleScriptEditorSave}>
Save
Close
</Button>
</Modal.Footer>
</Modal>