From 16671f8bff2f150735e6e49b17726baf84b3bda1 Mon Sep 17 00:00:00 2001 From: jasquat Date: Thu, 23 Feb 2023 10:23:26 -0500 Subject: [PATCH] logs list page should respect the for-me variant --- .../src/routes/AdminRoutes.tsx | 6 +++++- .../src/routes/ProcessInstanceLogList.tsx | 18 ++++++++++++------ .../src/routes/ProcessInstanceShow.tsx | 4 +++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx index 43eba921..d183dc01 100644 --- a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx +++ b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx @@ -110,7 +110,11 @@ export default function AdminRoutes() { /> } + element={} + /> + } /> { const setProcessInstanceLogListFromResult = (result: any) => { setProcessInstanceLogs(result.results); @@ -65,7 +71,7 @@ export default function ProcessInstanceLogList() { {convertSecondsToFormattedDateTime(rowToUse.timestamp)} @@ -111,7 +117,7 @@ export default function ProcessInstanceLogList() { }, [ `Process Instance: ${params.process_instance_id}`, - `/admin/process-instances/${params.process_model_id}/${params.process_instance_id}`, + `${processInstanceShowPageBaseUrl}/${params.process_instance_id}`, ], ['Logs'], ]} diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx index e45fe6a2..297c9251 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx @@ -116,8 +116,10 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { }; let processInstanceShowPageBaseUrl = `/admin/process-instances/for-me/${params.process_model_id}/${params.process_instance_id}`; + let processInstanceLogListPageBaseUrl = `/admin/logs/for-me/${params.process_model_id}/${params.process_instance_id}`; if (variant === 'all') { processInstanceShowPageBaseUrl = `/admin/process-instances/${params.process_model_id}/${params.process_instance_id}`; + processInstanceLogListPageBaseUrl = `/admin/logs/${params.process_model_id}/${params.process_instance_id}`; } useEffect(() => { @@ -459,7 +461,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { size="sm" className="button-white-background" data-qa="process-instance-log-list-link" - href={`/admin/logs/${modifiedProcessModelId}/${params.process_instance_id}`} + href={`${processInstanceLogListPageBaseUrl}`} > Logs