From e2b582b7fc442635712286246f9fc332b9618a4f Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 26 Apr 2023 18:10:02 -0400 Subject: [PATCH] various css tweaks --- .../services/workflow_execution_service.py | 1 - .../unit/test_process_instance_processor.py | 15 ++++++++++---- spiffworkflow-frontend/src/index.css | 20 +++++++++++++++++++ .../src/routes/ProcessInterstitial.tsx | 14 +++++++------ 4 files changed, 39 insertions(+), 11 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py b/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py index a4760b247..c159def3b 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/services/workflow_execution_service.py @@ -312,7 +312,6 @@ class RunUntilUserTaskOrMessageExecutionStrategy(ExecutionStrategy): self.delegate.will_complete_task(engine_steps[0]) engine_steps[0].run() self.delegate.did_complete_task(engine_steps[0]) - bpmn_process_instance.refresh_waiting_tasks() should_continue = True bpmn_process_instance.refresh_waiting_tasks() diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py index a6ff70e38..6dec5b28c 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_processor.py @@ -348,8 +348,15 @@ class TestProcessInstanceProcessor(BaseTest): assert len(process_instance.human_tasks) == 1 spiff_manual_task = processor.bpmn_process_instance.get_task_from_id(UUID(human_task_one.task_id)) + assert ( + len(process_instance.active_human_tasks) == 1 + ), "expected 1 active human task" + ProcessInstanceService.complete_form_task(processor, spiff_manual_task, {}, initiator_user, human_task_one) assert len(process_instance.human_tasks) == 2, "expected 2 human tasks after first one is completed" + assert ( + len(process_instance.active_human_tasks) == 1 + ), "expected 1 active human tasks after 1st one is completed" # unnecessary lookup just in case on windows process_instance = ProcessInstanceModel.query.filter_by(id=process_instance.id).first() @@ -358,8 +365,8 @@ class TestProcessInstanceProcessor(BaseTest): spiff_manual_task = processor.bpmn_process_instance.get_task_from_id(UUID(human_task_one.task_id)) ProcessInstanceService.complete_form_task(processor, spiff_manual_task, {}, initiator_user, human_task_one) assert ( - len(process_instance.active_human_tasks) == 0 - ), "expected 0 active human tasks after 2nd one is completed" + len(process_instance.active_human_tasks) == 1 + ), "expected 1 active human tasks after 2nd one is completed, as we have looped back around." processor.suspend() @@ -372,7 +379,7 @@ class TestProcessInstanceProcessor(BaseTest): assert len(all_task_models_matching_top_level_subprocess_script) == 1 task_model_to_reset_to = all_task_models_matching_top_level_subprocess_script[0] assert task_model_to_reset_to is not None - assert len(process_instance.human_tasks) == 2, "expected 2 human tasks before reset" + assert len(process_instance.human_tasks) == 3, "expected 3 human tasks before reset" ProcessInstanceProcessor.reset_process(process_instance, task_model_to_reset_to.guid) assert len(process_instance.human_tasks) == 2, "still expected 2 human tasks after reset" @@ -380,7 +387,7 @@ class TestProcessInstanceProcessor(BaseTest): db.session.expire_all() assert ( len(process_instance.human_tasks) == 2 - ), "still expected 2 human tasks after reset and session expire_all" + ), "still expected 3 human tasks after reset and session expire_all" process_instance = ProcessInstanceModel.query.filter_by(id=process_instance.id).first() processor = ProcessInstanceProcessor(process_instance) diff --git a/spiffworkflow-frontend/src/index.css b/spiffworkflow-frontend/src/index.css index 66aa3da69..2cb95276d 100644 --- a/spiffworkflow-frontend/src/index.css +++ b/spiffworkflow-frontend/src/index.css @@ -429,3 +429,23 @@ svg.notification-icon { font-weight: bold; } + +.user_instructions_0 { + filter: opacity(1); +} + +.user_instructions_1 { + filter: opacity(90%); +} + +.user_instructions_2 { + filter: opacity(70%); +} + +.user_instructions_3 { + filter: opacity(50%); +} + +.user_instructions_4 { + filter: opacity(30%); +} diff --git a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx index 8996b10c3..cb7dacce8 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInterstitial.tsx @@ -35,7 +35,7 @@ export default function ProcessInterstitial() { if ('error_code' in retValue) { addError(retValue); } else { - setData((prevData) => [...prevData, retValue]); + setData((prevData) => [retValue, ...prevData]); setLastTask(retValue); } }, @@ -100,8 +100,10 @@ export default function ProcessInterstitial() { } }; - const getReturnHomeButton = () => { - if (['WAITING', 'ERROR', 'LOCKED', 'COMPLETED'].includes(getStatus())) + const getReturnHomeButton = (index: number) => { + if ( + index === 0 && + ['WAITING', 'ERROR', 'LOCKED', 'COMPLETED'].includes(getStatus())) return ( <>
@@ -184,14 +186,14 @@ export default function ProcessInterstitial() {

- {data.map((d) => ( + {data.map((d, index) => ( - {userMessage(d)} +
{userMessage(d)}
+ {getReturnHomeButton(index)}
))} - {getReturnHomeButton()} ); }