Choose new report
This commit is contained in:
parent
49e4db6ae2
commit
589361b7fc
|
@ -41,6 +41,12 @@ export default function ProcessInstanceListSaveAsReport({
|
||||||
return identifier?.length > 0;
|
return identifier?.length > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const responseHandler = (result: any) => {
|
||||||
|
if (result.ok === true) {
|
||||||
|
onSuccess(identifier);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const addProcessInstanceReport = (event: any) => {
|
const addProcessInstanceReport = (event: any) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
|
@ -92,7 +98,7 @@ export default function ProcessInstanceListSaveAsReport({
|
||||||
|
|
||||||
HttpService.makeCallToBackend({
|
HttpService.makeCallToBackend({
|
||||||
path: `/process-instances/reports`,
|
path: `/process-instances/reports`,
|
||||||
successCallback: onSuccess,
|
successCallback: responseHandler,
|
||||||
httpMethod: 'POST',
|
httpMethod: 'POST',
|
||||||
postBody: {
|
postBody: {
|
||||||
identifier,
|
identifier,
|
||||||
|
|
|
@ -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 calculateStartAndEndSeconds = () => {
|
||||||
const startFromSeconds = convertDateAndTimeStringsToSeconds(
|
const startFromSeconds = convertDateAndTimeStringsToSeconds(
|
||||||
startFromDate,
|
startFromDate,
|
||||||
|
@ -793,7 +794,11 @@ export default function ProcessInstanceListTable({
|
||||||
|
|
||||||
const saveAsReportComponent = () => {
|
const saveAsReportComponent = () => {
|
||||||
// TODO onSuccess reload/select the new report in the report search
|
// 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 {
|
const {
|
||||||
valid,
|
valid,
|
||||||
startFromSeconds,
|
startFromSeconds,
|
||||||
|
|
Loading…
Reference in New Issue