({});
@@ -117,6 +121,7 @@ export default function TaskShow() {
// eslint-disable-next-line sonarjs/no-duplicate-string
const supportedHumanTaskTypes = ['User Task', 'Manual Task'];
+
useEffect(() => {
const processResult = (result: ProcessInstanceTask) => {
setTask(result);
@@ -157,7 +162,15 @@ export default function TaskShow() {
if (result.ok) {
navigate(`/tasks`);
} else if (result.process_instance_id) {
- navigate(`/tasks/${result.process_instance_id}/${result.id}`);
+ if (result.type in supportedHumanTaskTypes) {
+ navigate(`/tasks/${result.process_instance_id}/${result.id}`);
+ } else {
+ navigate(
+ `/process/${modifyProcessIdentifierForPathParam(
+ result.process_model_identifier
+ )}/${result.process_instance_id}/interstitial`
+ );
+ }
} else {
addError(result);
}
@@ -344,8 +357,10 @@ export default function TaskShow() {
);
} else {
- throw new UnexpectedHumanTaskType(
- `Invalid task type given: ${task.type}. Only supported types: ${supportedHumanTaskTypes}`
+ return (
+
+ Page will refresh in {refreshSeconds} seconds.
+
);
}
reactFragmentToHideSubmitButton = (
diff --git a/spiffworkflow-frontend/src/services/HttpService.ts b/spiffworkflow-frontend/src/services/HttpService.ts
index ed2e5149..83d71af8 100644
--- a/spiffworkflow-frontend/src/services/HttpService.ts
+++ b/spiffworkflow-frontend/src/services/HttpService.ts
@@ -8,7 +8,7 @@ const HttpMethods = {
DELETE: 'DELETE',
};
-const getBasicHeaders = (): object => {
+export const getBasicHeaders = (): Record => {
if (UserService.isLoggedIn()) {
return {
Authorization: `Bearer ${UserService.getAccessToken()}`,