From 8845b15233f968f732e4479be04311ac4036a689 Mon Sep 17 00:00:00 2001 From: Robert Duda Date: Fri, 13 Dec 2024 17:39:01 +0100 Subject: [PATCH] AAE-29384 Fix for process variable filtering --- .../services/process-list-cloud.service.ts | 13 +++++++++++++ .../task-list/services/task-list-cloud.service.ts | 12 ++++++++++++ 2 files changed, 25 insertions(+) diff --git a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts index ff32133f52..1ae89957cb 100644 --- a/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/process/process-list/services/process-list-cloud.service.ts @@ -133,6 +133,18 @@ export class ProcessListCloudService extends BaseCloudService { } } + /* + * Remove process variable filter keys with empty values from the query data. + */ + if (queryData['processVariableFilters']) { + queryData['processVariableFilters'] = queryData['processVariableFilters'].filter( + (filter) => filter.value !== '' && filter.value !== null && filter.value !== undefined + ); + } + + /* + * Remove keys with empty values from the query data. + */ Object.keys(queryData).forEach((key) => { const value = queryData[key]; const isValueEmpty = !value; @@ -141,6 +153,7 @@ export class ProcessListCloudService extends BaseCloudService { delete queryData[key]; } }); + return queryData; } diff --git a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts index 881b6df202..d68195e9bc 100644 --- a/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/task/task-list/services/task-list-cloud.service.ts @@ -131,6 +131,18 @@ export class TaskListCloudService extends BaseCloudService implements TaskListCl } } + /* + * Remove process variable filter keys with empty values from the query data. + */ + if (queryData['processVariableFilters']) { + queryData['processVariableFilters'] = queryData['processVariableFilters'].filter( + (filter) => filter.value !== '' && filter.value !== null && filter.value !== undefined + ); + } + + /* + * Remove keys with empty values from the query data. + */ Object.keys(queryData).forEach((key) => { const value = queryData[key]; const isValueEmpty = !value;