refactor(core): Bring active executions into executions controller (no-changelog) (#8371)

This commit is contained in:
Iván Ovejero
2024-01-23 09:48:50 +01:00
committed by GitHub
parent 913c8c6b0c
commit 49b52c4f1d
22 changed files with 544 additions and 331 deletions

View File

@@ -553,7 +553,7 @@ export default defineComponent({
},
async loadActiveExecutions(): Promise<void> {
const activeExecutions = isEmpty(this.workflowFilterCurrent.metadata)
? await this.workflowsStore.getCurrentExecutions(this.workflowFilterCurrent)
? await this.workflowsStore.getActiveExecutions(this.workflowFilterCurrent)
: [];
for (const activeExecution of activeExecutions) {
if (activeExecution.workflowId && !activeExecution.workflowName) {
@@ -573,7 +573,7 @@ export default defineComponent({
// ever get ids 500, 501, 502 and 503 when they finish
const promises = [this.workflowsStore.getPastExecutions(filter, this.requestItemsPerRequest)];
if (isEmpty(filter.metadata)) {
promises.push(this.workflowsStore.getCurrentExecutions({}));
promises.push(this.workflowsStore.getActiveExecutions({}));
}
const results = await Promise.all(promises);

View File

@@ -111,7 +111,7 @@ describe('ExecutionsList.vue', () => {
workflowsStore = useWorkflowsStore();
vi.spyOn(workflowsStore, 'fetchAllWorkflows').mockResolvedValue(workflowsData);
vi.spyOn(workflowsStore, 'getCurrentExecutions').mockResolvedValue([]);
vi.spyOn(workflowsStore, 'getActiveExecutions').mockResolvedValue([]);
});
it('should render empty list', async () => {