Skip to content

Commit

Permalink
add create new workflow activity
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Dec 6, 2024
1 parent c554490 commit f37dddd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client/src/components/Workflow/Editor/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,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(
Expand Down Expand Up @@ -775,6 +779,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);
Expand Down
11 changes: 11 additions & 0 deletions client/src/components/Workflow/Editor/modules/activities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
faMagic,
faPencilAlt,
faPlay,
faPlus,
faRecycle,
faSave,
faSignOutAlt,
Expand Down Expand Up @@ -116,6 +117,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,
Expand Down

0 comments on commit f37dddd

Please sign in to comment.