diff --git a/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlModal.js b/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlModal.js index ff546593..d27becef 100644 --- a/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlModal.js +++ b/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlModal.js @@ -30,7 +30,7 @@ const Footer = Modal.Footer; export default function YamlModal(props) { const [uploadFile, setUploadFile] = useState(null); - const { onClose, element, wineryEndpoint } = props; + const { onClose, element, commandStack } = props; const onSubmit = async () => { // Process the uploaded file or text input here @@ -39,6 +39,13 @@ export default function YamlModal(props) { reader.onload = function () { var fileContent = reader.result; element.businessObject.yaml = fileContent; + commandStack.execute('element.updateModdleProperties', { + element, + moddleElement: element.businessObject, + properties: { + 'yaml': fileContent + } + }); }; reader.readAsText(uploadFile); diff --git a/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlUpload.js b/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlUpload.js index c1278364..42ea94ea 100644 --- a/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlUpload.js +++ b/components/bpmn-q/modeler-component/extensions/quantme/modeling/properties-provider/service-task/YamlUpload.js @@ -12,6 +12,7 @@ import './yaml-modal.css'; export function YamlUpload(props) { const { element } = props; const translate = useService('translate'); + const commandStack = useService('commandStack'); const onClick = () => { const yamlUploadDiv = document.querySelector("#yamlUploadDiv"); @@ -23,7 +24,7 @@ export function YamlUpload(props) { div.id = "yamlUploadDiv"; document.getElementById('main-div').appendChild(div); const root = createRoot(document.getElementById("yamlUploadDiv")); - root.render(); + root.render(); }; return HeaderButton({ @@ -39,16 +40,16 @@ export function YamlUpload(props) { function YAMLModal(props) { const [showModal, setShowModal] = useState(true); - const {element, wineryEndpoint} = props; + const {element, commandStack} = props; - function handleWizardClosed() { + function handleModalClosed() { setShowModal(false); } return (
{showModal && ( - + )}
);