From 164bd2ee1736d41939c90334d6efedd96e8001f1 Mon Sep 17 00:00:00 2001 From: Jon Herron Date: Wed, 16 Nov 2022 11:45:34 -0500 Subject: [PATCH] Set status from filters --- .../components/ProcessInstanceListTable.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx index ec2397c0a..d5a28bfdb 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx @@ -235,12 +235,18 @@ export default function ProcessInstanceListTable({ processModelFullIdentifier ) { // queryParamString += `&process_model_identifier=${processModelFullIdentifier}`; - } else if (filters[paramName]) { - // @ts-expect-error TS(7053) FIXME: - const functionToCall = parametersToGetFromSearchParams[paramName]; - if (functionToCall !== null) { - functionToCall(searchParams.get(paramName) || ''); - } + } else if ( + paramName === 'process_status' && + typeof filters.process_status === 'string' + ) { + const processStatusSelectedArray: string[] = []; + 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); } }