Revive report deletion (#85)
This commit is contained in:
parent
b97395d5d8
commit
ccd7b07e12
|
@ -176,7 +176,8 @@ def handle_exception(exception: Exception) -> flask.wrappers.Response:
|
||||||
id = capture_exception(exception)
|
id = capture_exception(exception)
|
||||||
|
|
||||||
if isinstance(exception, ApiError):
|
if isinstance(exception, ApiError):
|
||||||
current_app.logger.info(f"Sending ApiError exception to sentry: {exception} with error code {exception.error_code}")
|
current_app.logger.info(
|
||||||
|
f"Sending ApiError exception to sentry: {exception} with error code {exception.error_code}")
|
||||||
|
|
||||||
organization_slug = current_app.config.get("SENTRY_ORGANIZATION_SLUG")
|
organization_slug = current_app.config.get("SENTRY_ORGANIZATION_SLUG")
|
||||||
project_slug = current_app.config.get("SENTRY_PROJECT_SLUG")
|
project_slug = current_app.config.get("SENTRY_PROJECT_SLUG")
|
||||||
|
|
|
@ -2876,4 +2876,4 @@
|
||||||
"clientPolicies" : {
|
"clientPolicies" : {
|
||||||
"policies" : [ ]
|
"policies" : [ ]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
import { ProcessInstanceReport } from '../interfaces';
|
||||||
|
import HttpService from '../services/HttpService';
|
||||||
|
import ButtonWithConfirmation from './ButtonWithConfirmation';
|
||||||
|
|
||||||
|
type OwnProps = {
|
||||||
|
onSuccess: (..._args: any[]) => any;
|
||||||
|
processInstanceReportSelection: ProcessInstanceReport;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function ProcessInstanceListDeleteReport({
|
||||||
|
onSuccess,
|
||||||
|
processInstanceReportSelection,
|
||||||
|
}: OwnProps) {
|
||||||
|
const deleteProcessInstanceReport = () => {
|
||||||
|
HttpService.makeCallToBackend({
|
||||||
|
path: `/process-instances/reports/${processInstanceReportSelection.id}`,
|
||||||
|
successCallback: onSuccess,
|
||||||
|
httpMethod: 'DELETE',
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<ButtonWithConfirmation
|
||||||
|
description={`Delete Perspective ${processInstanceReportSelection.identifier}?`}
|
||||||
|
onConfirmation={deleteProcessInstanceReport}
|
||||||
|
buttonLabel="Delete"
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
|
@ -62,6 +62,7 @@ import {
|
||||||
} from '../interfaces';
|
} from '../interfaces';
|
||||||
import ProcessModelSearch from './ProcessModelSearch';
|
import ProcessModelSearch from './ProcessModelSearch';
|
||||||
import ProcessInstanceReportSearch from './ProcessInstanceReportSearch';
|
import ProcessInstanceReportSearch from './ProcessInstanceReportSearch';
|
||||||
|
import ProcessInstanceListDeleteReport from './ProcessInstanceListDeleteReport';
|
||||||
import ProcessInstanceListSaveAsReport from './ProcessInstanceListSaveAsReport';
|
import ProcessInstanceListSaveAsReport from './ProcessInstanceListSaveAsReport';
|
||||||
import { FormatProcessModelDisplayName } from './MiniComponents';
|
import { FormatProcessModelDisplayName } from './MiniComponents';
|
||||||
import { Notification } from './Notification';
|
import { Notification } from './Notification';
|
||||||
|
@ -681,6 +682,19 @@ export default function ProcessInstanceListTable({
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const onDeleteReportSuccess = () => {
|
||||||
|
processInstanceReportDidChange({ selectedItem: null });
|
||||||
|
};
|
||||||
|
|
||||||
|
const deleteReportComponent = () => {
|
||||||
|
return processInstanceReportSelection ? (
|
||||||
|
<ProcessInstanceListDeleteReport
|
||||||
|
onSuccess={onDeleteReportSuccess}
|
||||||
|
processInstanceReportSelection={processInstanceReportSelection}
|
||||||
|
/>
|
||||||
|
) : null;
|
||||||
|
};
|
||||||
|
|
||||||
const removeColumn = (reportColumn: ReportColumn) => {
|
const removeColumn = (reportColumn: ReportColumn) => {
|
||||||
if (reportMetadata) {
|
if (reportMetadata) {
|
||||||
const reportMetadataCopy = { ...reportMetadata };
|
const reportMetadataCopy = { ...reportMetadata };
|
||||||
|
@ -1062,6 +1076,7 @@ export default function ProcessInstanceListTable({
|
||||||
</Column>
|
</Column>
|
||||||
<Column sm={4} md={4} lg={8}>
|
<Column sm={4} md={4} lg={8}>
|
||||||
{saveAsReportComponent()}
|
{saveAsReportComponent()}
|
||||||
|
{deleteReportComponent()}
|
||||||
</Column>
|
</Column>
|
||||||
</Grid>
|
</Grid>
|
||||||
</>
|
</>
|
||||||
|
|
|
@ -31,9 +31,7 @@ export default function ProcessInstanceReportList() {
|
||||||
return (
|
return (
|
||||||
<tr key={(row as any).id}>
|
<tr key={(row as any).id}>
|
||||||
<td>
|
<td>
|
||||||
<Link
|
<Link to={`/admin/process-instances?report_id=${rowToUse.id}`}>
|
||||||
to={`/admin/process-instances/reports/${rowToUse.identifier}`}
|
|
||||||
>
|
|
||||||
{rowToUse.identifier}
|
{rowToUse.identifier}
|
||||||
</Link>
|
</Link>
|
||||||
</td>
|
</td>
|
||||||
|
|
Loading…
Reference in New Issue