@@ -88,7 +155,13 @@ const ModelerPage: FC<{ className?: string }> = ({ className }) => {
}
- onClick={handleOpenClick}
+ onClick={handleOpenFileClick}
+ className={styles.toolsAction}
+ />
+
+
}
+ onClick={handleOpenDefinitionClick}
className={styles.toolsAction}
/>
@@ -101,40 +174,40 @@ const ModelerPage: FC<{ className?: string }> = ({ className }) => {
}
className={styles.toolsAction}
- onClick={() => {
- if (typeof window === "undefined") {
- return;
- }
-
- const name =
- window?.prompt("Enter deployment name", "random name") || "";
-
- if (!name?.trim()) {
- return;
- }
-
- refModeler.current?.saveXML().then(async (xmlResult) => {
- if (!xmlResult.xml) {
- return;
- }
-
- const formData = new FormData();
- formData.append("process.bpmn", new Blob([xmlResult.xml]));
- formData.append("deployment-name", name);
-
- const res = await fetch("api/engine/deployment/create", {
- method: "POST",
- body: formData,
- });
-
- if (!res.ok) {
- console.log(
- `Failed to deploy data: ${res.statusText} [${res.status}]`
- );
- }
- });
- }}
+ onClick={handleDeploy}
/>
+
+