From d43d103d492b3a3e4a00b9f4b9476310daac33dc Mon Sep 17 00:00:00 2001 From: Teisha McRae Date: Tue, 21 Jul 2026 17:41:46 -0400 Subject: [PATCH 1/2] Add Flow Genie duplication feature --- .../components/shared/ellipsisMenuActions.js | 9 + .../components/shared/flowGenieNavigation.js | 20 +- .../designer/CreateFlowGenieModal.vue | 299 ++++++++++++++++++ .../processes/designer/RecentAssetsList.vue | 24 +- 4 files changed, 347 insertions(+), 5 deletions(-) create mode 100644 resources/js/processes/designer/CreateFlowGenieModal.vue diff --git a/resources/js/components/shared/ellipsisMenuActions.js b/resources/js/components/shared/ellipsisMenuActions.js index 723b9af3ff..33e7139e11 100644 --- a/resources/js/components/shared/ellipsisMenuActions.js +++ b/resources/js/components/shared/ellipsisMenuActions.js @@ -269,6 +269,15 @@ export default { "view-additional-asset-actions", ], }, + { + value: "copy-item", + content: "Copy", + icon: "fas fa-copy", + permission: [ + "create-flow_genies", + "view-additional-asset-actions", + ], + }, { value: "add-to-project", content: "Add to Project", diff --git a/resources/js/components/shared/flowGenieNavigation.js b/resources/js/components/shared/flowGenieNavigation.js index fa2ec3b728..8b827a92f5 100644 --- a/resources/js/components/shared/flowGenieNavigation.js +++ b/resources/js/components/shared/flowGenieNavigation.js @@ -9,20 +9,32 @@ export default { * navigation for flow genies actions */ onFlowGenieNavigate(action, data) { + const name = data.name || data.title; switch (action.value) { case "edit-item": this.editFlowGenie(data); - break; - case 'add-to-project': - this.showAddToProjectModal(data.title, data.id); + break; + case "copy-item": + this.doDuplicateFlowGenie(data); + break; + case "add-to-project": + this.showAddToProjectModal(name, data.id); break; case "remove-item": this.doDeleteFlowGenie(data); break; + default: + break; } }, /** - * go to edit decision table + * Open the shared Create Flow Genie modal in duplicate mode. + */ + doDuplicateFlowGenie(data) { + this.showFlowGenieCopyModal(data); + }, + /** + * go to edit flow genie */ editFlowGenie(row) { window.location.href = `/designer/flow-genies/${row.id}/edit`; diff --git a/resources/js/processes/designer/CreateFlowGenieModal.vue b/resources/js/processes/designer/CreateFlowGenieModal.vue new file mode 100644 index 0000000000..ff9526b82b --- /dev/null +++ b/resources/js/processes/designer/CreateFlowGenieModal.vue @@ -0,0 +1,299 @@ + + + diff --git a/resources/js/processes/designer/RecentAssetsList.vue b/resources/js/processes/designer/RecentAssetsList.vue index 5e0b26bee4..358a4b2ef6 100644 --- a/resources/js/processes/designer/RecentAssetsList.vue +++ b/resources/js/processes/designer/RecentAssetsList.vue @@ -124,6 +124,14 @@ + @@ -147,6 +155,7 @@ import CreatePmBlockModal from "../../components/pm-blocks/CreatePmBlockModal.vu import EllipsisMenu from "../../components/shared/EllipsisMenu.vue"; import AddToBundle from "../../components/shared/AddToBundle.vue"; import CategorySelect from "../categories/components/CategorySelect.vue"; +import CreateFlowGenieModal from "./CreateFlowGenieModal.vue"; const uniqIdsMixin = createUniqIdsMixin(); @@ -158,6 +167,7 @@ export default { EllipsisMenu, AddToBundle, CategorySelect, + CreateFlowGenieModal, }, mixins: [ datatableMixin, @@ -208,6 +218,8 @@ export default { processTemplateName: "", pmBlockName: "", bundleAssetType: "ProcessMaker\\Models\\Process", + flowGenieName: "", + flowGenieData: {}, }; }, methods: { @@ -267,7 +279,7 @@ export default { case "Decision Table": return this.addBundleAction(this.decisionTableActions, 2); case "Flow Genie": - return this.addBundleAction(this.flowGenieActions, 2); + return this.addBundleAction(this.flowGenieActions, 3); default: return []; // Handle unknown asset types as needed } @@ -424,6 +436,16 @@ export default { } }); }, + /** + * Open the copy Flow Genie modal + */ + showFlowGenieCopyModal(data) { + this.flowGenieName = data.name || data.title || ""; + this.flowGenieData = data; + this.$nextTick(() => { + this.$refs["create-flow-genie-modal"].show(); + }); + }, }, }; From 2ba260eb038b5d07802e9331717875ae28bb8c40 Mon Sep 17 00:00:00 2001 From: Teisha McRae Date: Wed, 22 Jul 2026 12:50:06 -0400 Subject: [PATCH 2/2] Refactor CreateFlowGenieModal to CopyFlowGenieModal --- .../components/shared/flowGenieNavigation.js | 2 +- ...wGenieModal.vue => CopyFlowGenieModal.vue} | 126 +++++------------- .../processes/designer/RecentAssetsList.vue | 11 +- 3 files changed, 40 insertions(+), 99 deletions(-) rename resources/js/processes/designer/{CreateFlowGenieModal.vue => CopyFlowGenieModal.vue} (62%) diff --git a/resources/js/components/shared/flowGenieNavigation.js b/resources/js/components/shared/flowGenieNavigation.js index 8b827a92f5..2e5e8af223 100644 --- a/resources/js/components/shared/flowGenieNavigation.js +++ b/resources/js/components/shared/flowGenieNavigation.js @@ -28,7 +28,7 @@ export default { } }, /** - * Open the shared Create Flow Genie modal in duplicate mode. + * Open the copy Flow Genie modal. */ doDuplicateFlowGenie(data) { this.showFlowGenieCopyModal(data); diff --git a/resources/js/processes/designer/CreateFlowGenieModal.vue b/resources/js/processes/designer/CopyFlowGenieModal.vue similarity index 62% rename from resources/js/processes/designer/CreateFlowGenieModal.vue rename to resources/js/processes/designer/CopyFlowGenieModal.vue index ff9526b82b..90e2bd3e2a 100644 --- a/resources/js/processes/designer/CreateFlowGenieModal.vue +++ b/resources/js/processes/designer/CopyFlowGenieModal.vue @@ -1,13 +1,12 @@