From c5654919367bd752adb4273aaa1bf4b26fcf3a7c Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 16 Mar 2023 11:07:56 -0400 Subject: [PATCH 1/2] don't overwrite the current user variable (passed as an argument to the function) with the initiator these values should be kept separate. --- .../services/process_instance_report_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py index 62f7c993..3de0319e 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/process_instance_report_service.py @@ -404,10 +404,10 @@ class ProcessInstanceReportService: ) if report_filter.process_initiator_username is not None: - user = UserModel.query.filter_by(username=report_filter.process_initiator_username).first() + initiator = UserModel.query.filter_by(username=report_filter.process_initiator_username).first() process_initiator_id = -1 - if user: - process_initiator_id = user.id + if initiator: + process_initiator_id = initiator.id process_instance_query = process_instance_query.filter_by(process_initiator_id=process_initiator_id) if ( From f5f0c86bf49dae7db0d6156601aa675f1397970f Mon Sep 17 00:00:00 2001 From: Dan Date: Thu, 16 Mar 2023 11:54:09 -0400 Subject: [PATCH 2/2] avoid the flicker when switching between detailed view and normal view by just clearing out the data before making a new request. The vast majority of the delay is not in the api call, but in rendering the data - and at just a split second, it isn't long enough for a spinner to be very effective. --- spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx index 413a7d35..5c1803f7 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx @@ -29,6 +29,11 @@ export default function ProcessInstanceLogList({ variant }: OwnProps) { } useEffect(() => { + // Clear out any previous results to avoid a "flicker" effect where columns + // are updated above the incorrect data. + setProcessInstanceLogs([]); + setPagination(null); + const setProcessInstanceLogListFromResult = (result: any) => { setProcessInstanceLogs(result.results); setPagination(result.pagination);