From bfc8e68b37f77bd1a8259ca8162269451aca4f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milorad=20FIlipovi=C4=87?= Date: Mon, 19 Dec 2022 14:36:25 +0100 Subject: [PATCH] fix(editor): Fix for wrong execution data displayed in executions preview (#4966) --- packages/editor-ui/src/components/ExecutionsList.vue | 6 ++++++ packages/editor-ui/src/stores/workflows.ts | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/packages/editor-ui/src/components/ExecutionsList.vue b/packages/editor-ui/src/components/ExecutionsList.vue index 1176a0e5db..d967911693 100644 --- a/packages/editor-ui/src/components/ExecutionsList.vue +++ b/packages/editor-ui/src/components/ExecutionsList.vue @@ -611,6 +611,7 @@ export default mixins(externalHooks, genericHelpers, restApi, showMessage).exten } this.workflowsStore.activeExecutions = activeExecutions; + this.workflowsStore.addToCurrentExecutions(activeExecutions); }, async loadAutoRefresh(): Promise { const filter = this.workflowFilterPast; @@ -697,6 +698,7 @@ export default mixins(externalHooks, genericHelpers, restApi, showMessage).exten ); this.finishedExecutionsCount = results[0].count; this.finishedExecutionsCountEstimated = results[0].estimated; + this.workflowsStore.addToCurrentExecutions(this.finishedExecutions); }, async loadFinishedExecutions(): Promise { if (this.filter.status === 'running') { @@ -712,6 +714,8 @@ export default mixins(externalHooks, genericHelpers, restApi, showMessage).exten this.finishedExecutions = data.results; this.finishedExecutionsCount = data.count; this.finishedExecutionsCountEstimated = data.estimated; + + this.workflowsStore.addToCurrentExecutions(data.results); }, async loadMore() { if (this.filter.status === 'running') { @@ -747,6 +751,8 @@ export default mixins(externalHooks, genericHelpers, restApi, showMessage).exten this.finishedExecutionsCountEstimated = data.estimated; this.isDataLoading = false; + + this.workflowsStore.addToCurrentExecutions(data.results); }, async loadWorkflows() { try { diff --git a/packages/editor-ui/src/stores/workflows.ts b/packages/editor-ui/src/stores/workflows.ts index c4ade1f8c8..b45fb99e5c 100644 --- a/packages/editor-ui/src/stores/workflows.ts +++ b/packages/editor-ui/src/stores/workflows.ts @@ -944,5 +944,13 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, { deleteExecution(execution: IExecutionsSummary): void { this.currentWorkflowExecutions.splice(this.currentWorkflowExecutions.indexOf(execution), 1); }, + addToCurrentExecutions(executions: IExecutionsSummary[]): void { + executions.forEach(execution => { + const exists = this.currentWorkflowExecutions.find(ex => ex.id === execution.id); + if (!exists) { + this.currentWorkflowExecutions.push(execution); + } + }); + }, }, });