From 2dc61ec6693e2bb59483e6af869bd327956aff72 Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 1 May 2023 12:51:58 -0400 Subject: [PATCH] fixed tests w/ burnettk --- .../migrations/versions/68adb1d504e1_.py | 2 +- .../services/process_instance_report_service.py | 12 ++++-------- .../unit/test_process_instance_report_service.py | 5 ++++- .../src/routes/CompletedInstances.tsx | 2 +- .../src/routes/InProgressInstances.tsx | 2 +- 5 files changed, 11 insertions(+), 12 deletions(-) diff --git a/spiffworkflow-backend/migrations/versions/68adb1d504e1_.py b/spiffworkflow-backend/migrations/versions/68adb1d504e1_.py index dbeca2ba..7cf74222 100644 --- a/spiffworkflow-backend/migrations/versions/68adb1d504e1_.py +++ b/spiffworkflow-backend/migrations/versions/68adb1d504e1_.py @@ -11,7 +11,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '68adb1d504e1' -down_revision = '0c7428378d6e' +down_revision = '664bb2f00694' branch_labels = None depends_on = None 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 fd254601..7f67051e 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 @@ -76,7 +76,7 @@ class ProcessInstanceReportService: ], "order_by": ["-start_in_seconds", "-id"], } - system_report_completed_instances_with_tasks_completed_by_my_groups: ReportMetadata = { + system_report_completed_instances: ReportMetadata = { "columns": cls.builtin_column_options(), "filter_by": [ {"field_name": "process_status", "field_value": terminal_status_values}, @@ -128,7 +128,7 @@ class ProcessInstanceReportService: ], "order_by": ["-start_in_seconds", "-id"], } - system_report_in_progress_instances_with_tasks_for_my_group: ReportMetadata = { + system_report_in_progress_instances_with_tasks: ReportMetadata = { "columns": [ {"Header": "id", "accessor": "id"}, { @@ -156,16 +156,12 @@ class ProcessInstanceReportService: "system_report_completed_instances_with_tasks_completed_by_me": ( system_report_completed_instances_with_tasks_completed_by_me ), - "system_report_completed_instances_with_tasks_completed_by_my_groups": ( - system_report_completed_instances_with_tasks_completed_by_my_groups - ), + "system_report_completed_instances": system_report_completed_instances, "system_report_in_progress_instances_initiated_by_me": system_report_in_progress_instances_initiated_by_me, "system_report_in_progress_instances_with_tasks_for_me": ( system_report_in_progress_instances_with_tasks_for_me ), - "system_report_in_progress_instances_with_tasks_for_my_group": ( - system_report_in_progress_instances_with_tasks_for_my_group - ), + "system_report_in_progress_instances_with_tasks": system_report_in_progress_instances_with_tasks, } if metadata_key not in temp_system_metadata_map: return None diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_report_service.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_report_service.py index e7e2ad61..95eab41e 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_report_service.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_process_instance_report_service.py @@ -197,7 +197,10 @@ class TestProcessInstanceReportService(BaseTest): process_instance_report = ProcessInstanceReportService.report_with_identifier( user=user_one, - report_identifier="system_report_completed_instances_with_tasks_completed_by_my_groups", + report_identifier="system_report_completed_instances", + ) + process_instance_report.report_metadata["filter_by"].append( + {"field_name": "user_group_identifier", "field_value": user_one.groups[0].identifier} ) response_json = ProcessInstanceReportService.run_process_instance_report( report_metadata=process_instance_report.report_metadata, diff --git a/spiffworkflow-frontend/src/routes/CompletedInstances.tsx b/spiffworkflow-frontend/src/routes/CompletedInstances.tsx index 581dbe04..6b8e0883 100644 --- a/spiffworkflow-frontend/src/routes/CompletedInstances.tsx +++ b/spiffworkflow-frontend/src/routes/CompletedInstances.tsx @@ -29,7 +29,7 @@ export default function CompletedInstances() { paginationQueryParamPrefix="group_completed_instances" paginationClassName="with-large-bottom-margin" perPageOptions={[2, 5, 25]} - reportIdentifier="system_report_completed_instances_with_tasks_completed_by_my_groups" + reportIdentifier="system_report_completed_instances" showReports={false} textToShowIfEmpty="This group has no completed instances at this time." additionalReportFilters={[ diff --git a/spiffworkflow-frontend/src/routes/InProgressInstances.tsx b/spiffworkflow-frontend/src/routes/InProgressInstances.tsx index cc66a51b..eb68a05b 100644 --- a/spiffworkflow-frontend/src/routes/InProgressInstances.tsx +++ b/spiffworkflow-frontend/src/routes/InProgressInstances.tsx @@ -35,7 +35,7 @@ export default function InProgressInstances() { ).replace('-', '_')}`} paginationClassName="with-large-bottom-margin" perPageOptions={[2, 5, 25]} - reportIdentifier="system_report_in_progress_instances_with_tasks_for_my_group" + reportIdentifier="system_report_in_progress_instances_with_tasks" showReports={false} textToShowIfEmpty="This group has no instances waiting on it at this time." additionalReportFilters={[