This commit is contained in:
Jon Herron 2022-11-16 16:31:58 -05:00
parent 5f6bb4a0f8
commit f07bf182e5
1 changed files with 17 additions and 25 deletions

View File

@ -233,32 +233,24 @@ export default function ProcessInstanceListTable({
} }
}); });
Object.keys(parametersToGetFromSearchParams).forEach(
(paramName: string) => {
if (paramName === 'process_model_identifier') {
setProcessModelSelection(null); setProcessModelSelection(null);
processModelAvailableItems.forEach((item: any) => { processModelAvailableItems.forEach((item: any) => {
if (item.id === filters.process_model_identifier) { if (item.id === filters.process_model_identifier) {
setProcessModelSelection(item); setProcessModelSelection(item);
} }
}); });
} else if (paramName === 'process_status') {
const processStatusSelectedArray: string[] = []; const processStatusSelectedArray: string[] = [];
setProcessStatusSelection(processStatusSelectedArray); if (filters.process_status) {
if (!filters.process_status) {
return;
}
PROCESS_STATUSES.forEach((processStatusOption: any) => { PROCESS_STATUSES.forEach((processStatusOption: any) => {
const regex = new RegExp(`\\b${processStatusOption}\\b`); const regex = new RegExp(`\\b${processStatusOption}\\b`);
if (filters.process_status.match(regex)) { if (filters.process_status.match(regex)) {
processStatusSelectedArray.push(processStatusOption); processStatusSelectedArray.push(processStatusOption);
} }
}); });
setProcessStatusSelection(processStatusSelectedArray);
setShowFilterOptions(true); setShowFilterOptions(true);
} }
} setProcessStatusSelection(processStatusSelectedArray);
);
}, [ }, [
processInstanceFilters, processInstanceFilters,
parametersToAlwaysFilterBy, parametersToAlwaysFilterBy,