Skip to content

Commit

Permalink
TEMP
Browse files Browse the repository at this point in the history
  • Loading branch information
manelcecs committed Apr 30, 2024
1 parent 504b7c4 commit 553530d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/domain-services/flows/flow-search-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand All @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 553530d

Please sign in to comment.