mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
fix(editor): Remove 'crashed' status from filter (#5524)
* fix(editor): remove 'crashed' status from filter * fix(editor): remove 'crashed' and 'new' status from filter * fix(editor): add 'status' to response * fix(editor): create request filter for workflow level execution filtering * fix(editor): update filters * fix(editor): simplify condition * fix(editor): update filters * fix(editor): optimizing data loading flow * fix(editor): always load past executions
This commit is contained in:
@@ -938,33 +938,24 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
|
||||
Vue.set(this, 'activeExecutions', newActiveExecutions);
|
||||
},
|
||||
|
||||
async loadCurrentWorkflowExecutions(filter: {
|
||||
finished: boolean;
|
||||
status: string;
|
||||
}): Promise<IExecutionsSummary[]> {
|
||||
async loadCurrentWorkflowExecutions(requestFilter: IDataObject): Promise<IExecutionsSummary[]> {
|
||||
let activeExecutions = [];
|
||||
let finishedExecutions = [];
|
||||
const requestFilter: IDataObject = { workflowId: this.workflowId };
|
||||
|
||||
if (!this.workflowId) {
|
||||
if (!requestFilter.workflowId) {
|
||||
return [];
|
||||
}
|
||||
try {
|
||||
const rootStore = useRootStore();
|
||||
if (filter.status === '' || !filter.finished) {
|
||||
activeExecutions = await getCurrentExecutions(rootStore.getRestApiContext, requestFilter);
|
||||
}
|
||||
if (filter.status === '' || filter.finished) {
|
||||
if (filter.status === 'waiting') {
|
||||
requestFilter.waitTill = true;
|
||||
} else if (filter.status !== '') {
|
||||
requestFilter.finished = filter.status === 'success';
|
||||
}
|
||||
finishedExecutions = await getFinishedExecutions(
|
||||
rootStore.getRestApiContext,
|
||||
requestFilter,
|
||||
);
|
||||
if (!requestFilter.status || !requestFilter.finished) {
|
||||
activeExecutions = await getCurrentExecutions(rootStore.getRestApiContext, {
|
||||
workflowId: requestFilter.workflowId,
|
||||
});
|
||||
}
|
||||
finishedExecutions = await getFinishedExecutions(
|
||||
rootStore.getRestApiContext,
|
||||
requestFilter,
|
||||
);
|
||||
this.finishedExecutionsCount = finishedExecutions.count;
|
||||
return [...activeExecutions, ...(finishedExecutions.results || [])];
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user