use the correct interface for process callers since backend returns references and print errors to the console in boundary fallback

This commit is contained in:
jasquat 2023-09-22 17:02:58 -04:00
parent 0c4761ac20
commit 08e7afee97
No known key found for this signature in database
3 changed files with 10 additions and 8 deletions

View File

@ -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 (
<Notification
title="Something Went Wrong. "
title="Something Went Wrong."
onClose={() => resetBoundary()}
type="error"
>

View File

@ -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
>
<UnorderedList>
{callers.map((ref: ProcessModelCaller) => (
{callers.map((ref: ProcessReference) => (
<li>
<Link
size="lg"
href={`/process-models/${modifyProcessIdentifierForPathParam(
ref.process_model_id
ref.relative_location
)}`}
>
{`${ref.display_name}`}
</Link>{' '}
({ref.process_model_id})
({ref.relative_location})
</li>
))}
</UnorderedList>

View File

@ -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<ProcessModelCaller[]>([]);
const [callers, setCallers] = useState<ProcessReference[]>([]);
usePrompt('Changes you made may not be saved.', diagramHasChanges);