users can always complete tasks on process instance show page and on task group table on home page w/ burnettk

This commit is contained in:
jasquat 2023-02-14 11:53:37 -05:00
parent 4d81907966
commit 4d4e0c9a57
3 changed files with 8 additions and 1 deletions

View File

@ -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<ProcessInstanceTask[] | null>(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 = [];

View File

@ -29,6 +29,7 @@ export default function TasksWaitingForMyGroups() {
textToShowIfEmpty="This group has no task assignments at this time."
autoReload
showWaitingOn={false}
canCompleteAllTasks
/>
);
});

View File

@ -1111,6 +1111,7 @@ export default function ProcessInstanceShow({ variant }: OwnProps) {
showDateStarted={false}
showLastUpdated={false}
hideIfNoTasks
canCompleteAllTasks
/>
</Column>
</Grid>