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 f7f7b60eb6
commit c94912c739
3 changed files with 8 additions and 1 deletions

View File

@ -36,6 +36,7 @@ type OwnProps = {
showDateStarted?: boolean; showDateStarted?: boolean;
showLastUpdated?: boolean; showLastUpdated?: boolean;
hideIfNoTasks?: boolean; hideIfNoTasks?: boolean;
canCompleteAllTasks?: boolean;
}; };
export default function TaskListTable({ export default function TaskListTable({
@ -56,6 +57,7 @@ export default function TaskListTable({
showDateStarted = true, showDateStarted = true,
showLastUpdated = true, showLastUpdated = true,
hideIfNoTasks = false, hideIfNoTasks = false,
canCompleteAllTasks = false,
}: OwnProps) { }: OwnProps) {
const [searchParams] = useSearchParams(); const [searchParams] = useSearchParams();
const [tasks, setTasks] = useState<ProcessInstanceTask[] | null>(null); const [tasks, setTasks] = useState<ProcessInstanceTask[] | null>(null);
@ -128,7 +130,10 @@ export default function TaskListTable({
const regex = new RegExp(`\\b(${preferredUsername}|${userEmail})\\b`); const regex = new RegExp(`\\b(${preferredUsername}|${userEmail})\\b`);
let hasAccessToCompleteTask = false; let hasAccessToCompleteTask = false;
if ((processInstanceTask.potential_owner_usernames || '').match(regex)) { if (
canCompleteAllTasks ||
(processInstanceTask.potential_owner_usernames || '').match(regex)
) {
hasAccessToCompleteTask = true; hasAccessToCompleteTask = true;
} }
const rowElements = []; const rowElements = [];

View File

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

View File

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