This commit is contained in:
jasquat 2022-12-12 12:29:36 -05:00
parent 77aa32646a
commit 978849d379
3 changed files with 25 additions and 15 deletions

View File

@ -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: def task_list_for_me(page: int = 1, per_page: int = 100) -> flask.wrappers.Response:
"""Task_list_for_me."""
return get_tasks( return get_tasks(
processes_started_by_user=False, processes_started_by_user=False,
has_lane_assignment_id=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( def task_list_for_my_groups(
group_identifier: str = None, group_identifier: Optional[str] = None, page: int = 1, per_page: int = 100
page: int = 1, per_page: int = 100
) -> flask.wrappers.Response: ) -> 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( def task_list_user_groups() -> flask.wrappers.Response:
) -> flask.wrappers.Response: """Task_list_user_groups."""
groups = g.user.groups groups = g.user.groups
# TODO: filter out the default group and have a way to know what is the default group # 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) return make_response(jsonify(sorted(group_identifiers)), 200)
@ -1329,7 +1335,7 @@ def get_tasks(
has_lane_assignment_id: bool = True, has_lane_assignment_id: bool = True,
page: int = 1, page: int = 1,
per_page: int = 100, per_page: int = 100,
group_identifier: str = None, group_identifier: Optional[str] = None,
) -> flask.wrappers.Response: ) -> flask.wrappers.Response:
"""Get_tasks.""" """Get_tasks."""
user_id = g.user.id user_id = g.user.id

View File

@ -7,6 +7,7 @@ from spiffworkflow_backend.services.git_service import GitService
class TestGitService(BaseTest): class TestGitService(BaseTest):
"""TestGitService."""
def test_strips_output_of_stdout_from_command( def test_strips_output_of_stdout_from_command(
self, self,
@ -14,5 +15,8 @@ class TestGitService(BaseTest):
client: FlaskClient, client: FlaskClient,
with_db_and_bpmn_file_cleanup: None, with_db_and_bpmn_file_cleanup: None,
) -> None: ) -> None:
output = GitService.run_shell_command_to_get_stdout(["echo", ' This output should not end in space or newline \n']) """Test_strips_output_of_stdout_from_command."""
assert output == 'This output should not end in space or newline' 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"

View File

@ -203,10 +203,10 @@ export const refreshAtInterval = (
timeout: number, timeout: number,
func: Function func: Function
) => { ) => {
// const intervalRef = setInterval(() => func(), interval * 1000); const intervalRef = setInterval(() => func(), interval * 1000);
// const timeoutRef = setTimeout( const timeoutRef = setTimeout(
// () => clearInterval(intervalRef), () => clearInterval(intervalRef),
// timeout * 1000 timeout * 1000
// ); );
// return [intervalRef, timeoutRef]; return [intervalRef, timeoutRef];
}; };