From 978849d3793456715410bee9e116073a32de816a Mon Sep 17 00:00:00 2001 From: jasquat Date: Mon, 12 Dec 2022 12:29:36 -0500 Subject: [PATCH] pyl --- .../routes/process_api_blueprint.py | 20 ++++++++++++------- .../unit/test_git_service.py | 8 ++++++-- spiffworkflow-frontend/src/helpers.tsx | 12 +++++------ 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py index 2f194af63..06c23cf59 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -1301,6 +1301,7 @@ def task_list_for_my_open_processes( def task_list_for_me(page: int = 1, per_page: int = 100) -> flask.wrappers.Response: + """Task_list_for_me.""" return get_tasks( processes_started_by_user=False, has_lane_assignment_id=False, @@ -1310,17 +1311,22 @@ def task_list_for_me(page: int = 1, per_page: int = 100) -> flask.wrappers.Respo def task_list_for_my_groups( - group_identifier: str = None, - page: int = 1, per_page: int = 100 + group_identifier: Optional[str] = None, page: int = 1, per_page: int = 100 ) -> flask.wrappers.Response: - return get_tasks(group_identifier=group_identifier, processes_started_by_user=False, page=page, per_page=per_page) + """Task_list_for_my_groups.""" + return get_tasks( + group_identifier=group_identifier, + processes_started_by_user=False, + page=page, + per_page=per_page, + ) -def task_list_user_groups( -) -> flask.wrappers.Response: +def task_list_user_groups() -> flask.wrappers.Response: + """Task_list_user_groups.""" groups = g.user.groups # TODO: filter out the default group and have a way to know what is the default group - group_identifiers = [i.identifier for i in groups if i.identifier != 'everybody'] + group_identifiers = [i.identifier for i in groups if i.identifier != "everybody"] return make_response(jsonify(sorted(group_identifiers)), 200) @@ -1329,7 +1335,7 @@ def get_tasks( has_lane_assignment_id: bool = True, page: int = 1, per_page: int = 100, - group_identifier: str = None, + group_identifier: Optional[str] = None, ) -> flask.wrappers.Response: """Get_tasks.""" user_id = g.user.id diff --git a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_git_service.py b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_git_service.py index ad3c814f4..ed1e24e1e 100644 --- a/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_git_service.py +++ b/spiffworkflow-backend/tests/spiffworkflow_backend/unit/test_git_service.py @@ -7,6 +7,7 @@ from spiffworkflow_backend.services.git_service import GitService class TestGitService(BaseTest): + """TestGitService.""" def test_strips_output_of_stdout_from_command( self, @@ -14,5 +15,8 @@ class TestGitService(BaseTest): client: FlaskClient, with_db_and_bpmn_file_cleanup: None, ) -> None: - output = GitService.run_shell_command_to_get_stdout(["echo", ' This output should not end in space or newline \n']) - assert output == 'This output should not end in space or newline' + """Test_strips_output_of_stdout_from_command.""" + output = GitService.run_shell_command_to_get_stdout( + ["echo", " This output should not end in space or newline \n"] + ) + assert output == "This output should not end in space or newline" diff --git a/spiffworkflow-frontend/src/helpers.tsx b/spiffworkflow-frontend/src/helpers.tsx index fcc3371b7..6781ada97 100644 --- a/spiffworkflow-frontend/src/helpers.tsx +++ b/spiffworkflow-frontend/src/helpers.tsx @@ -203,10 +203,10 @@ export const refreshAtInterval = ( timeout: number, func: Function ) => { - // const intervalRef = setInterval(() => func(), interval * 1000); - // const timeoutRef = setTimeout( - // () => clearInterval(intervalRef), - // timeout * 1000 - // ); - // return [intervalRef, timeoutRef]; + const intervalRef = setInterval(() => func(), interval * 1000); + const timeoutRef = setTimeout( + () => clearInterval(intervalRef), + timeout * 1000 + ); + return [intervalRef, timeoutRef]; };