From ccd7b07e12a641b2b3b5e30bd89784af95d9b8df Mon Sep 17 00:00:00 2001
From: jbirddog <100367399+jbirddog@users.noreply.github.com>
Date: Wed, 28 Dec 2022 11:29:47 -0500
Subject: [PATCH] Revive report deletion (#85)
---
flask-bpmn/src/flask_bpmn/api/api_error.py | 3 +-
.../bin/spiffworkflow-realm.json | 2 +-
.../ProcessInstanceListDeleteReport.tsx | 29 +++++++++++++++++++
.../components/ProcessInstanceListTable.tsx | 15 ++++++++++
.../src/routes/ProcessInstanceReportList.tsx | 4 +--
5 files changed, 48 insertions(+), 5 deletions(-)
create mode 100644 spiffworkflow-frontend/src/components/ProcessInstanceListDeleteReport.tsx
diff --git a/flask-bpmn/src/flask_bpmn/api/api_error.py b/flask-bpmn/src/flask_bpmn/api/api_error.py
index 8586f476a..ed792e7e8 100644
--- a/flask-bpmn/src/flask_bpmn/api/api_error.py
+++ b/flask-bpmn/src/flask_bpmn/api/api_error.py
@@ -176,7 +176,8 @@ def handle_exception(exception: Exception) -> flask.wrappers.Response:
id = capture_exception(exception)
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")
project_slug = current_app.config.get("SENTRY_PROJECT_SLUG")
diff --git a/spiffworkflow-backend/bin/spiffworkflow-realm.json b/spiffworkflow-backend/bin/spiffworkflow-realm.json
index 0df83605d..e31942cf1 100644
--- a/spiffworkflow-backend/bin/spiffworkflow-realm.json
+++ b/spiffworkflow-backend/bin/spiffworkflow-realm.json
@@ -2876,4 +2876,4 @@
"clientPolicies" : {
"policies" : [ ]
}
-}
\ No newline at end of file
+}
diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceListDeleteReport.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceListDeleteReport.tsx
new file mode 100644
index 000000000..ca04d516c
--- /dev/null
+++ b/spiffworkflow-frontend/src/components/ProcessInstanceListDeleteReport.tsx
@@ -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 (
+