diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx index d23daed05..6c8f5fb90 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListSaveAsReport.tsx @@ -41,6 +41,12 @@ export default function ProcessInstanceListSaveAsReport({ return identifier?.length > 0; }; + const responseHandler = (result: any) => { + if (result.ok === true) { + onSuccess(identifier); + } + }; + const addProcessInstanceReport = (event: any) => { event.preventDefault(); @@ -92,7 +98,7 @@ export default function ProcessInstanceListSaveAsReport({ HttpService.makeCallToBackend({ path: `/process-instances/reports`, - successCallback: onSuccess, + successCallback: responseHandler, httpMethod: 'POST', postBody: { identifier, diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx index 32674a05b..9b239502b 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceListTable.tsx @@ -367,6 +367,7 @@ export default function ProcessInstanceListTable({ } }; + // TODO: after factoring this out page hangs when invalid date ranges and applying the filter const calculateStartAndEndSeconds = () => { const startFromSeconds = convertDateAndTimeStringsToSeconds( startFromDate, @@ -793,7 +794,11 @@ export default function ProcessInstanceListTable({ const saveAsReportComponent = () => { // TODO onSuccess reload/select the new report in the report search - const callback = (_: any) => {}; + const callback = (identifier: string) => { + processInstanceReportDidChange({ + selectedItem: { id: identifier, display_name: identifier }, + }); + }; const { valid, startFromSeconds,