Clear/remove filter works

This commit is contained in:
Jon Herron 2022-11-16 16:25:19 -05:00
parent c1813d4ef7
commit 5f6bb4a0f8
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)) {