From 5a99e9cc9ebf1c643d53053d7c7e2ecfbab3e874 Mon Sep 17 00:00:00 2001 From: Jon Herron Date: Mon, 28 Nov 2022 16:46:19 -0500 Subject: [PATCH] Save first status --- .../src/components/ProcessInstanceListSaveAsReport.tsx | 9 +++++++++ .../src/components/ProcessInstanceListTable.tsx | 1 + 2 files changed, 10 insertions(+) diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx index 35cb9223..77e2ac37 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx @@ -15,6 +15,7 @@ type OwnProps = { columnArray: { Header: string; accessor: string }; orderBy: string; processModelSelection: ProcessModel | null; + processStatusSelection: string[]; buttonText?: string; }; @@ -23,6 +24,7 @@ export default function ProcessInstanceListSaveAsReport({ columnArray, orderBy, processModelSelection, + processStatusSelection, buttonText = 'Save as Perspective', }: OwnProps) { const [identifier, setIdentifier] = useState(''); @@ -45,6 +47,13 @@ export default function ProcessInstanceListSaveAsReport({ }); } + if (processStatusSelection.length > 0) { + filterByArray.push({ + field_name: 'process_status', + field_value: processStatusSelection[0], // TODO: support more than one status + }); + } + HttpService.makeCallToBackend({ path: `/process-instances/reports`, successCallback: onSuccess, diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx index 46bdae47..9ad23ac3 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx @@ -778,6 +778,7 @@ export default function ProcessInstanceListTable({ columnArray={reportColumns()} orderBy="" processModelSelection={processModelSelection} + processStatusSelection={processStatusSelection} /> ); };