From 3a94db8a2eaef02774592ac13f0653bae07bffbe Mon Sep 17 00:00:00 2001 From: jasquat Date: Fri, 22 Sep 2023 17:02:58 -0400 Subject: [PATCH] use the correct interface for process callers since backend returns references and print errors to the console in boundary fallback --- spiffworkflow-frontend/src/ErrorBoundaryFallack.tsx | 5 ++++- .../src/components/ReactDiagramEditor.tsx | 10 +++++----- .../src/routes/ProcessModelEditDiagram.tsx | 3 +-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/spiffworkflow-frontend/src/ErrorBoundaryFallack.tsx b/spiffworkflow-frontend/src/ErrorBoundaryFallack.tsx index f1f698876..e074df578 100644 --- a/spiffworkflow-frontend/src/ErrorBoundaryFallack.tsx +++ b/spiffworkflow-frontend/src/ErrorBoundaryFallack.tsx @@ -12,9 +12,12 @@ export function ErrorBoundaryFallback({ error }: ErrorProps) { // This is displayed if the ErrorBoundary catches an error when rendering the form. const { resetBoundary } = useErrorBoundary(); + // print the error to the console so we can debug issues + console.error(error); + return ( resetBoundary()} type="error" > diff --git a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx index d94ad9223..c8578e8cd 100644 --- a/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx +++ b/spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx @@ -64,7 +64,7 @@ import { modifyProcessIdentifierForPathParam, } from '../helpers'; import { useUriListForPermissions } from '../hooks/UriListForPermissions'; -import { PermissionsToCheck, ProcessModelCaller, Task } from '../interfaces'; +import { PermissionsToCheck, ProcessReference, Task } from '../interfaces'; import { usePermissionFetcher } from '../hooks/PermissionService'; type OwnProps = { @@ -89,7 +89,7 @@ type OwnProps = { onSearchProcessModels?: (..._args: any[]) => any; onElementsChanged?: (..._args: any[]) => any; url?: string; - callers?: ProcessModelCaller[]; + callers?: ProcessReference[]; activeUserElement?: React.ReactElement; }; @@ -628,17 +628,17 @@ export default function ReactDiagramEditor({ passiveModal > - {callers.map((ref: ProcessModelCaller) => ( + {callers.map((ref: ProcessReference) => (
  • {`${ref.display_name}`} {' '} - ({ref.process_model_id}) + ({ref.relative_location})
  • ))}
    diff --git a/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx b/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx index 15d894d53..c9d7e2608 100644 --- a/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx @@ -43,7 +43,6 @@ import { CarbonComboBoxProcessSelection, ProcessFile, ProcessModel, - ProcessModelCaller, ProcessReference, } from '../interfaces'; import ProcessSearch from '../components/ProcessSearch'; @@ -136,7 +135,7 @@ export default function ProcessModelEditDiagram() { const processModelPath = `process-models/${modifiedProcessModelId}`; - const [callers, setCallers] = useState([]); + const [callers, setCallers] = useState([]); usePrompt('Changes you made may not be saved.', diagramHasChanges);