Choose new report

This commit is contained in:
Jon Herron 2022-11-28 17:26:26 -05:00
parent 49e4db6ae2
commit 589361b7fc
2 changed files with 13 additions and 2 deletions

View File

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

View File

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