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( setProcessModelSelection(null);
(paramName: string) => { processModelAvailableItems.forEach((item: any) => {
if (paramName === 'process_model_identifier') { if (item.id === filters.process_model_identifier) {
setProcessModelSelection(null); setProcessModelSelection(item);
processModelAvailableItems.forEach((item: any) => {
if (item.id === filters.process_model_identifier) {
setProcessModelSelection(item);
}
});
} 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)) {
processStatusSelectedArray.push(processStatusOption);
}
});
setProcessStatusSelection(processStatusSelectedArray);
setShowFilterOptions(true);
}
} }
); });
const processStatusSelectedArray: string[] = [];
if (filters.process_status) {
PROCESS_STATUSES.forEach((processStatusOption: any) => {
const regex = new RegExp(`\\b${processStatusOption}\\b`);
if (filters.process_status.match(regex)) {
processStatusSelectedArray.push(processStatusOption);
}
});
setShowFilterOptions(true);
}
setProcessStatusSelection(processStatusSelectedArray);
}, [ }, [
processInstanceFilters, processInstanceFilters,
parametersToAlwaysFilterBy, parametersToAlwaysFilterBy,