From 99ab8d315870a0801fabc9a916c43fa5eaebfcd3 Mon Sep 17 00:00:00 2001 From: Dan Date: Fri, 21 Apr 2023 11:21:52 -0400 Subject: [PATCH] minor fixes to the frontend so that he Start button works in all cases and the interstial page's console is not so noisy, and images show up correctly. --- .../src/components/ProcessInstanceRun.tsx | 10 +++++----- .../src/routes/ProcessInterstitial.tsx | 6 ++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/spiffworkflow-frontend/src/components/ProcessInstanceRun.tsx b/spiffworkflow-frontend/src/components/ProcessInstanceRun.tsx index b4ad4eeff..22cd3ac3f 100644 --- a/spiffworkflow-frontend/src/components/ProcessInstanceRun.tsx +++ b/spiffworkflow-frontend/src/components/ProcessInstanceRun.tsx @@ -94,12 +94,12 @@ export default function ProcessInstanceRun({ const { ability } = usePermissionFetcher(permissionRequestData); const onProcessInstanceRun = (processInstance: any) => { - // FIXME: ensure that the task is actually for the current user as well const processInstanceId = (processInstance as any).id; - const nextTask = (processInstance as any).next_task; - if (nextTask && nextTask.state === 'READY') { - navigate(`/tasks/${processInstanceId}/${nextTask.id}`); - } + navigate( + `/process/${modifyProcessIdentifierForPathParam( + processModel.id + )}/${processInstanceId}/interstitial` + ); onSuccessCallback(processInstance); }; diff --git a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx index b465cf117..bdd566992 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx @@ -27,7 +27,6 @@ export default function ProcessInterstitial() { { headers: getBasicHeaders(), onmessage(ev) { - console.log(data, ev.data); const task = JSON.parse(ev.data); setData((prevData) => [...prevData, task]); setLastTask(task); @@ -68,7 +67,6 @@ export default function ProcessInterstitial() { if (state === 'CLOSED') { return lastTask.state; } - console.log('The State is: ', state); return state; }; @@ -80,6 +78,7 @@ export default function ProcessInterstitial() { ); case 'LOCKED': return Locked; + case 'READY': case 'REDIRECTING': return Redirecting ....; case 'WAITING': @@ -87,12 +86,11 @@ export default function ProcessInterstitial() { case 'COMPLETED': return Completed; default: - return
; + return getStatus(); } }; function capitalize(str: string): string { - console.log('Capitalizing: ', str); if (str && str.length > 0) { return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase(); }