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