Save first status

This commit is contained in:
Jon Herron 2022-11-28 16:46:19 -05:00
parent c3257e2d44
commit 5a99e9cc9e
2 changed files with 10 additions and 0 deletions

View File

@ -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,

View File

@ -778,6 +778,7 @@ export default function ProcessInstanceListTable({
columnArray={reportColumns()}
orderBy=""
processModelSelection={processModelSelection}
processStatusSelection={processStatusSelection}
/>
);
};