Navigate to my task (#35)

This commit is contained in:
jbirddog 2022-11-15 10:52:39 -05:00 committed by GitHub
parent bad6d17f3a
commit b66e42d2b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 11 deletions

View File

@ -132,20 +132,11 @@ export default function ProcessModelShow() {
const processInstanceResultTag = () => {
if (processModel && processInstanceResult) {
let takeMeToMyTaskBlurb = null;
// FIXME: ensure that the task is actually for the current user as well
const processInstanceId = (processInstanceResult as any).id;
const nextTask = (processInstanceResult as any).next_task;
if (nextTask && nextTask.state === 'READY') {
takeMeToMyTaskBlurb = (
<span>
You have a task to complete. Go to{' '}
<Link to={`/tasks/${processInstanceId}/${nextTask.id}`}>
my task
</Link>
.
</span>
);
navigate(`/tasks/${processInstanceId}/${nextTask.id}`);
}
return (
<div className="alert alert-success" role="alert">
@ -157,7 +148,7 @@ export default function ProcessModelShow() {
>
view
</Link>
). {takeMeToMyTaskBlurb}
).
</p>
</div>
);