mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 16:44:07 -08:00
fix(editor): Adding projectId execution filters
This commit is contained in:
parent
5af35abae8
commit
91a61abd47
|
@ -1351,6 +1351,7 @@ export type ExecutionFilterType = {
|
||||||
|
|
||||||
export type ExecutionsQueryFilter = {
|
export type ExecutionsQueryFilter = {
|
||||||
status?: ExecutionStatus[];
|
status?: ExecutionStatus[];
|
||||||
|
projectId?: string;
|
||||||
workflowId?: string;
|
workflowId?: string;
|
||||||
finished?: boolean;
|
finished?: boolean;
|
||||||
waitTill?: boolean;
|
waitTill?: boolean;
|
||||||
|
|
|
@ -14,9 +14,11 @@ import type {
|
||||||
import { useRootStore } from '@/stores/root.store';
|
import { useRootStore } from '@/stores/root.store';
|
||||||
import { makeRestApiRequest, unflattenExecutionData } from '@/utils/apiUtils';
|
import { makeRestApiRequest, unflattenExecutionData } from '@/utils/apiUtils';
|
||||||
import { executionFilterToQueryFilter, getDefaultExecutionFilters } from '@/utils/executionUtils';
|
import { executionFilterToQueryFilter, getDefaultExecutionFilters } from '@/utils/executionUtils';
|
||||||
|
import { useProjectsStore } from '@/stores/projects.store';
|
||||||
|
|
||||||
export const useExecutionsStore = defineStore('executions', () => {
|
export const useExecutionsStore = defineStore('executions', () => {
|
||||||
const rootStore = useRootStore();
|
const rootStore = useRootStore();
|
||||||
|
const projectsStore = useProjectsStore();
|
||||||
|
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const itemsPerPage = ref(10);
|
const itemsPerPage = ref(10);
|
||||||
|
@ -24,9 +26,15 @@ export const useExecutionsStore = defineStore('executions', () => {
|
||||||
const activeExecution = ref<ExecutionSummary | null>(null);
|
const activeExecution = ref<ExecutionSummary | null>(null);
|
||||||
|
|
||||||
const filters = ref<ExecutionFilterType>(getDefaultExecutionFilters());
|
const filters = ref<ExecutionFilterType>(getDefaultExecutionFilters());
|
||||||
const executionsFilters = computed<ExecutionsQueryFilter>(() =>
|
const executionsFilters = computed<ExecutionsQueryFilter>(() => {
|
||||||
executionFilterToQueryFilter(filters.value),
|
const filter = executionFilterToQueryFilter(filters.value);
|
||||||
);
|
|
||||||
|
if (projectsStore.currentProjectId) {
|
||||||
|
filter.projectId = projectsStore.currentProjectId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return filter;
|
||||||
|
});
|
||||||
const currentExecutionsFilters = computed<Partial<ExecutionFilterType>>(() => ({
|
const currentExecutionsFilters = computed<Partial<ExecutionFilterType>>(() => ({
|
||||||
...(filters.value.workflowId !== 'all' ? { workflowId: filters.value.workflowId } : {}),
|
...(filters.value.workflowId !== 'all' ? { workflowId: filters.value.workflowId } : {}),
|
||||||
}));
|
}));
|
||||||
|
|
Loading…
Reference in a new issue