Clear/remove filter works

This commit is contained in:
Jon Herron 2022-11-16 16:25:19 -05:00
parent 3bace7d59b
commit 32aa60493b
1 changed files with 8 additions and 8 deletions

View File

@ -225,6 +225,7 @@ export default function ProcessInstanceListTable({
// @ts-expect-error TS(7053) FIXME:
const functionToCall = parametersToAlwaysFilterBy[paramName];
const paramValue = filters[paramName];
functionToCall('');
if (paramValue) {
const dateString = convertSecondsToFormattedDate(paramValue as any);
functionToCall(dateString);
@ -234,20 +235,19 @@ export default function ProcessInstanceListTable({
Object.keys(parametersToGetFromSearchParams).forEach(
(paramName: string) => {
if (
paramName === 'process_model_identifier' &&
typeof filters.process_model_identifier === 'string'
) {
if (paramName === 'process_model_identifier') {
setProcessModelSelection(null);
processModelAvailableItems.forEach((item: any) => {
if (item.id === filters.process_model_identifier) {
setProcessModelSelection(item);
}
});
} else if (
paramName === 'process_status' &&
typeof filters.process_status === 'string'
) {
} else if (paramName === 'process_status') {
const processStatusSelectedArray: string[] = [];
setProcessStatusSelection(processStatusSelectedArray);
if (!filters.process_status) {
return;
}
PROCESS_STATUSES.forEach((processStatusOption: any) => {
const regex = new RegExp(`\\b${processStatusOption}\\b`);
if (filters.process_status.match(regex)) {