diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml index 3d78cb43..be9796aa 100755 --- a/spiffworkflow-backend/src/spiffworkflow_backend/api.yml +++ b/spiffworkflow-backend/src/spiffworkflow_backend/api.yml @@ -1166,7 +1166,7 @@ paths: get: tags: - Process Instances - operationId: spiffworkflow_backend.routes.process_api_blueprint.user_groups_for_current_user + operationId: spiffworkflow_backend.routes.process_api_blueprint.user_group_list_for_current_user summary: Group identifiers for current logged in user responses: "200": 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 7907ef97..294a6524 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -989,7 +989,7 @@ def process_instance_list( process_instance_query = process_instance_query.filter( SpiffLoggingModel.spiff_step == SpiffStepDetailsModel.spiff_step ) - if (group_identifier): + if group_identifier: process_instance_query = process_instance_query.join( GroupModel, GroupModel.identifier == group_identifier, @@ -1380,8 +1380,8 @@ def task_list_for_my_groups( ) -def user_groups_for_current_user() -> flask.wrappers.Response: - """User_groups_for_current_user.""" +def user_group_list_for_current_user() -> flask.wrappers.Response: + """User_group_list_for_current_user.""" 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"] diff --git a/spiffworkflow-frontend/src/components/TasksTable.tsx b/spiffworkflow-frontend/src/components/TaskListTable.tsx similarity index 96% rename from spiffworkflow-frontend/src/components/TasksTable.tsx rename to spiffworkflow-frontend/src/components/TaskListTable.tsx index 0c657016..d6688f22 100644 --- a/spiffworkflow-frontend/src/components/TasksTable.tsx +++ b/spiffworkflow-frontend/src/components/TaskListTable.tsx @@ -27,15 +27,17 @@ type OwnProps = { autoReload?: boolean; showStartedBy?: boolean; showWaitingOn?: boolean; + textToShowIfEmpty?: string; }; -export default function TasksTable({ +export default function TaskListTable({ apiPath, tableTitle, tableDescription, additionalParams, paginationQueryParamPrefix, paginationClassName, + textToShowIfEmpty, autoReload = false, showStartedBy = true, showWaitingOn = true, @@ -67,8 +69,9 @@ export default function TasksTable({ }; getTasks(); if (autoReload) { - refreshAtInterval(REFRESH_INTERVAL, REFRESH_TIMEOUT, getTasks); + return refreshAtInterval(REFRESH_INTERVAL, REFRESH_TIMEOUT, getTasks); } + return undefined; }, [ searchParams, additionalParams, @@ -164,7 +167,7 @@ export default function TasksTable({ if (pagination && pagination.total < 1) { return (

- Your groups have no task assignments at this time. + {textToShowIfEmpty}

); } diff --git a/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx b/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx index 7ee7edec..6634e8e8 100644 --- a/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx +++ b/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx @@ -1,15 +1,16 @@ -import TasksTable from './TasksTable'; +import TaskListTable from './TaskListTable'; const paginationQueryParamPrefix = 'tasks_for_my_open_processes'; export default function MyOpenProcesses() { return ( - diff --git a/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx b/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx index e253afd6..1939e4ba 100644 --- a/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx +++ b/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx @@ -1,13 +1,14 @@ -import TasksTable from './TasksTable'; +import TaskListTable from './TaskListTable'; export default function TasksWaitingForMe() { return ( - diff --git a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx index 948aee6c..b7515c91 100644 --- a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx +++ b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx @@ -1,6 +1,6 @@ import { useEffect, useState } from 'react'; import HttpService from '../services/HttpService'; -import TasksTable from './TasksTable'; +import TaskListTable from './TaskListTable'; export default function TasksWaitingForMyGroups() { const [userGroups, setUserGroups] = useState(null); @@ -19,13 +19,14 @@ export default function TasksWaitingForMyGroups() { return userGroups.map((userGroup: string) => { return ( -