From 3a5412850c137aafa02cf21bdf5b2c6a5ceeae1d Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Fri, 17 May 2024 10:03:39 -0400 Subject: [PATCH] refactor(editor): Convert `workflowActivate` mixin into a composable (no-changelog) (#9423) --- .../src/components/NodeDetailsView.vue | 7 +- .../src/components/WorkflowActivator.vue | 8 +- .../src/composables/useWorkflowActivate.ts | 135 ++++++++++++++++++ .../editor-ui/src/mixins/workflowActivate.ts | 134 ----------------- 4 files changed, 141 insertions(+), 143 deletions(-) create mode 100644 packages/editor-ui/src/composables/useWorkflowActivate.ts delete mode 100644 packages/editor-ui/src/mixins/workflowActivate.ts diff --git a/packages/editor-ui/src/components/NodeDetailsView.vue b/packages/editor-ui/src/components/NodeDetailsView.vue index d89000a0fb6f8..21ac42f7ff080 100644 --- a/packages/editor-ui/src/components/NodeDetailsView.vue +++ b/packages/editor-ui/src/components/NodeDetailsView.vue @@ -165,7 +165,7 @@ import { START_NODE_TYPE, STICKY_NODE_TYPE, } from '@/constants'; -import { workflowActivate } from '@/mixins/workflowActivate'; +import { useWorkflowActivate } from '@/composables/useWorkflowActivate'; import { dataPinningEventBus } from '@/event-bus'; import { useWorkflowsStore } from '@/stores/workflows.store'; import { useNDVStore } from '@/stores/ndv.store'; @@ -189,7 +189,6 @@ export default defineComponent({ NDVDraggablePanels, TriggerPanel, }, - mixins: [workflowActivate], props: { readOnly: { type: Boolean, @@ -210,16 +209,16 @@ export default defineComponent({ const pinnedData = usePinnedData(activeNode); const router = useRouter(); const workflowHelpers = useWorkflowHelpers({ router }); + const workflowActivate = useWorkflowActivate(); return { externalHooks, nodeHelpers, pinnedData, workflowHelpers, + workflowActivate, ...useDeviceSupport(), ...useMessage(), - // eslint-disable-next-line @typescript-eslint/no-misused-promises - ...workflowActivate.setup?.(props, ctx), }; }, data() { diff --git a/packages/editor-ui/src/components/WorkflowActivator.vue b/packages/editor-ui/src/components/WorkflowActivator.vue index 0e0c31f3c242e..10599a97c36b6 100644 --- a/packages/editor-ui/src/components/WorkflowActivator.vue +++ b/packages/editor-ui/src/components/WorkflowActivator.vue @@ -52,7 +52,7 @@