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} /> ); };