From c94912c73913893bb6f9f282ed3f0607d8f6657c Mon Sep 17 00:00:00 2001 From: jasquat Date: Tue, 14 Feb 2023 11:53:37 -0500 Subject: [PATCH] users can always complete tasks on process instance show page and on task group table on home page w/ burnettk --- spiffworkflow-frontend/src/components/TaskListTable.tsx | 7 ++++++- .../src/components/TasksWaitingForMyGroups.tsx | 1 + spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/spiffworkflow-frontend/src/components/TaskListTable.tsx b/spiffworkflow-frontend/src/components/TaskListTable.tsx index 287742e9..26577b3b 100644 --- a/spiffworkflow-frontend/src/components/TaskListTable.tsx +++ b/spiffworkflow-frontend/src/components/TaskListTable.tsx @@ -36,6 +36,7 @@ type OwnProps = { showDateStarted?: boolean; showLastUpdated?: boolean; hideIfNoTasks?: boolean; + canCompleteAllTasks?: boolean; }; export default function TaskListTable({ @@ -56,6 +57,7 @@ export default function TaskListTable({ showDateStarted = true, showLastUpdated = true, hideIfNoTasks = false, + canCompleteAllTasks = false, }: OwnProps) { const [searchParams] = useSearchParams(); const [tasks, setTasks] = useState(null); @@ -128,7 +130,10 @@ export default function TaskListTable({ const regex = new RegExp(`\\b(${preferredUsername}|${userEmail})\\b`); let hasAccessToCompleteTask = false; - if ((processInstanceTask.potential_owner_usernames || '').match(regex)) { + if ( + canCompleteAllTasks || + (processInstanceTask.potential_owner_usernames || '').match(regex) + ) { hasAccessToCompleteTask = true; } const rowElements = []; diff --git a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx index dab0372b..1a07be72 100644 --- a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx +++ b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx @@ -29,6 +29,7 @@ export default function TasksWaitingForMyGroups() { textToShowIfEmpty="This group has no task assignments at this time." autoReload showWaitingOn={false} + canCompleteAllTasks /> ); }); diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx index 94775671..b7ffedb1 100644 --- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx @@ -1111,6 +1111,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) { showDateStarted={false} showLastUpdated={false} hideIfNoTasks + canCompleteAllTasks />