From 553530da31469a86c07078b16e025b10807742c9 Mon Sep 17 00:00:00 2001 From: manelcecs Date: Tue, 30 Apr 2024 14:37:40 +0200 Subject: [PATCH] TEMP --- .../flows/flow-search-service.ts | 18 ++++++++++++++++++ ...s-flow-category-conditions-strategy-impl.ts | 1 + 2 files changed, 19 insertions(+) diff --git a/src/domain-services/flows/flow-search-service.ts b/src/domain-services/flows/flow-search-service.ts index 93c58aa5..96ef79eb 100644 --- a/src/domain-services/flows/flow-search-service.ts +++ b/src/domain-services/flows/flow-search-service.ts @@ -344,6 +344,13 @@ export class FlowSearchService { { flag: isStandardFlows, category: 'Standard', id: 133 }, ]; + const inactiveStatusCategories = [ + { id: 9, category: 'Superseded' }, + { id: 12, category: 'Cancelled' }, + { id: 13, category: 'Deleted' }, + { id: 14, category: 'Restricted' }, + { id: 87, category: 'Rejected' }, + ]; const shortcutFilters: ShortcutCategoryFilter[] = filters .filter((filter) => filter.flag !== undefined) .map((filter) => ({ @@ -352,6 +359,17 @@ export class FlowSearchService { id: filter.id, })); + if (shortcutFilters.length > 0 && isPendingFlows === false) { + const mappedInactiveStatusCategories = inactiveStatusCategories.map( + (filter) => + ({ + category: filter.category, + operation: Op.NOT_IN, + id: filter.id, + }) as ShortcutCategoryFilter + ); + shortcutFilters.push(...mappedInactiveStatusCategories); + } return shortcutFilters.length > 0 ? shortcutFilters : null; } diff --git a/src/domain-services/flows/strategy/impl/get-flowIds-flow-category-conditions-strategy-impl.ts b/src/domain-services/flows/strategy/impl/get-flowIds-flow-category-conditions-strategy-impl.ts index 021df0e1..75906e4f 100644 --- a/src/domain-services/flows/strategy/impl/get-flowIds-flow-category-conditions-strategy-impl.ts +++ b/src/domain-services/flows/strategy/impl/get-flowIds-flow-category-conditions-strategy-impl.ts @@ -67,6 +67,7 @@ export class GetFlowIdsFromCategoryConditionsStrategyImpl .queryBuilder() .distinct('flow.id', 'flow.versionID') .from('flow') + .where('flow.deletedAt', null) .join('categoryRef', function () { this.on('flow.id', '=', 'categoryRef.objectID').andOn( 'flow.versionID',