From ff0d12b23018c1317e9d52d6f64f384fdf6524ed Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Fri, 6 Dec 2024 22:41:17 +0100 Subject: [PATCH 1/8] add create new workflow activity --- client/src/components/Workflow/Editor/Index.vue | 8 ++++++++ .../components/Workflow/Editor/modules/activities.ts | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/client/src/components/Workflow/Editor/Index.vue b/client/src/components/Workflow/Editor/Index.vue index 357482638c78..b974a4e824fa 100644 --- a/client/src/components/Workflow/Editor/Index.vue +++ b/client/src/components/Workflow/Editor/Index.vue @@ -738,6 +738,10 @@ export default { onSaveAs() { this.showSaveAsModal = true; }, + async createNewWorkflow() { + await this.saveOrCreate(); + this.$router.push("/workflows/edit"); + }, async saveOrCreate() { if (this.hasInvalidConnections) { const confirmed = await this.confirm( @@ -788,6 +792,10 @@ export default { if (activityId === "save-workflow-as") { this.onSaveAs(); } + + if (activityId === "workflow-create") { + this.createNewWorkflow(); + } }, onAnnotation(nodeId, newAnnotation) { this.stepActions.setAnnotation(this.steps[nodeId], newAnnotation); diff --git a/client/src/components/Workflow/Editor/modules/activities.ts b/client/src/components/Workflow/Editor/modules/activities.ts index 5a5534a4af0e..365bbba411d3 100644 --- a/client/src/components/Workflow/Editor/modules/activities.ts +++ b/client/src/components/Workflow/Editor/modules/activities.ts @@ -6,6 +6,7 @@ import { faMagic, faPencilAlt, faPlay, + faPlus, faRecycle, faSave, faSignOutAlt, @@ -126,6 +127,16 @@ export const workflowEditorActivities = [ click: true, optional: true, }, + { + description: "Save this workflow and create a new workflow.", + icon: faPlus, + title: "Create new", + id: "workflow-create", + tooltip: "Save this workflow and create a new one", + visible: true, + click: true, + optional: true, + }, { description: "Exit the workflow editor and return to the start screen.", icon: faSignOutAlt, From f58ba5cc9ddb0e0415c558ef69d9ed0fc773c55e Mon Sep 17 00:00:00 2001 From: Laila Los <44241786+ElectronicBlueberry@users.noreply.github.com> Date: Fri, 6 Dec 2024 22:53:58 +0100 Subject: [PATCH 2/8] add create button to activity panel --- .../src/components/Panels/ActivityPanel.vue | 6 +++-- .../src/components/Panels/WorkflowPanel.vue | 24 +++++++++++++++++++ .../src/components/Workflow/Editor/Index.vue | 3 ++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/client/src/components/Panels/ActivityPanel.vue b/client/src/components/Panels/ActivityPanel.vue index d97512c24cc5..e0d3dd646ab8 100644 --- a/client/src/components/Panels/ActivityPanel.vue +++ b/client/src/components/Panels/ActivityPanel.vue @@ -1,5 +1,5 @@