From 91a61abd47d08597d65ca605757ecc640ed6f4c2 Mon Sep 17 00:00:00 2001 From: Csaba Tuncsik Date: Tue, 5 Nov 2024 16:17:02 +0100 Subject: [PATCH] fix(editor): Adding projectId execution filters --- packages/editor-ui/src/Interface.ts | 1 + packages/editor-ui/src/stores/executions.store.ts | 14 +++++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/editor-ui/src/Interface.ts b/packages/editor-ui/src/Interface.ts index b6691ac76b..0d79b85053 100644 --- a/packages/editor-ui/src/Interface.ts +++ b/packages/editor-ui/src/Interface.ts @@ -1351,6 +1351,7 @@ export type ExecutionFilterType = { export type ExecutionsQueryFilter = { status?: ExecutionStatus[]; + projectId?: string; workflowId?: string; finished?: boolean; waitTill?: boolean; diff --git a/packages/editor-ui/src/stores/executions.store.ts b/packages/editor-ui/src/stores/executions.store.ts index f80f0f5e4d..b7f160a950 100644 --- a/packages/editor-ui/src/stores/executions.store.ts +++ b/packages/editor-ui/src/stores/executions.store.ts @@ -14,9 +14,11 @@ import type { import { useRootStore } from '@/stores/root.store'; import { makeRestApiRequest, unflattenExecutionData } from '@/utils/apiUtils'; import { executionFilterToQueryFilter, getDefaultExecutionFilters } from '@/utils/executionUtils'; +import { useProjectsStore } from '@/stores/projects.store'; export const useExecutionsStore = defineStore('executions', () => { const rootStore = useRootStore(); + const projectsStore = useProjectsStore(); const loading = ref(false); const itemsPerPage = ref(10); @@ -24,9 +26,15 @@ export const useExecutionsStore = defineStore('executions', () => { const activeExecution = ref(null); const filters = ref(getDefaultExecutionFilters()); - const executionsFilters = computed(() => - executionFilterToQueryFilter(filters.value), - ); + const executionsFilters = computed(() => { + const filter = executionFilterToQueryFilter(filters.value); + + if (projectsStore.currentProjectId) { + filter.projectId = projectsStore.currentProjectId; + } + + return filter; + }); const currentExecutionsFilters = computed>(() => ({ ...(filters.value.workflowId !== 'all' ? { workflowId: filters.value.workflowId } : {}), }));