a whole bunch of front end and backend changes that got mangled.

This commit is contained in:
Dan 2023-04-26 16:22:50 -04:00
parent d63aac09b6
commit 4cbf4e456b
13 changed files with 2361 additions and 2329 deletions

File diff suppressed because it is too large Load Diff

View File

@ -314,20 +314,23 @@ class RunUntilUserTaskOrMessageExecutionStrategy(ExecutionStrategy):
self.delegate.did_complete_task(engine_steps[0])
bpmn_process_instance.refresh_waiting_tasks()
should_continue = True
bpmn_process_instance.refresh_waiting_tasks()
engine_steps = self.get_ready_engine_steps(bpmn_process_instance)
while engine_steps:
while engine_steps and should_continue:
for task in engine_steps:
if hasattr(task.task_spec, "extensions") and task.task_spec.extensions.get(
"instructionsForEndUser", None
):
if hasattr(task.task_spec, "extensions") and task.task_spec.extensions.get("instructionsForEndUser", None):
should_continue = False
break
self.delegate.will_complete_task(task)
task.run()
self.delegate.did_complete_task(task)
bpmn_process_instance.refresh_waiting_tasks()
engine_steps = self.get_ready_engine_steps(bpmn_process_instance)
self.delegate.after_engine_steps(bpmn_process_instance)
class OneAtATimeExecutionStrategy(ExecutionStrategy):
"""When you want to run only one engine step at a time."""

View File

@ -38,7 +38,7 @@
"bootstrap": "^5.2.0",
"bpmn-js": "^9.3.2",
"bpmn-js-properties-panel": "^1.10.0",
"bpmn-js-spiffworkflow": "sartography/bpmn-js-spiffworkflow#main",
"bpmn-js-spiffworkflow": "github:sartography/bpmn-js-spiffworkflow#main",
"cookie": "^0.5.0",
"craco": "^0.0.3",
"cypress-slow-down": "^1.2.1",
@ -8343,7 +8343,7 @@
},
"node_modules/bpmn-js-spiffworkflow": {
"version": "0.0.8",
"resolved": "git+ssh://git@github.com/sartography/bpmn-js-spiffworkflow.git#5f2cb3d50b021dffce61fd6b2929ef5620dcdb2e",
"resolved": "git+ssh://git@github.com/sartography/bpmn-js-spiffworkflow.git#313969da1067fce0a51b152626a609a122697693",
"license": "MIT",
"dependencies": {
"inherits": "^2.0.4",
@ -38215,7 +38215,7 @@
}
},
"bpmn-js-spiffworkflow": {
"version": "git+ssh://git@github.com/sartography/bpmn-js-spiffworkflow.git#5f2cb3d50b021dffce61fd6b2929ef5620dcdb2e",
"version": "git+ssh://git@github.com/sartography/bpmn-js-spiffworkflow.git#313969da1067fce0a51b152626a609a122697693",
"from": "bpmn-js-spiffworkflow@sartography/bpmn-js-spiffworkflow#main",
"requires": {
"inherits": "^2.0.4",

View File

@ -33,7 +33,7 @@
"bootstrap": "^5.2.0",
"bpmn-js": "^9.3.2",
"bpmn-js-properties-panel": "^1.10.0",
"bpmn-js-spiffworkflow": "sartography/bpmn-js-spiffworkflow#main",
"bpmn-js-spiffworkflow": "github:sartography/bpmn-js-spiffworkflow#main",
"cookie": "^0.5.0",
"craco": "^0.0.3",
"cypress-slow-down": "^1.2.1",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -2,12 +2,19 @@ import React from 'react';
// @ts-ignore
import MDEditor from '@uiw/react-md-editor';
export default function InstructionsForEndUser({ task }: any) {
type OwnProps = {
task: any;
defaultMessage?: string;
};
export default function InstructionsForEndUser({
task,
defaultMessage = '',
}: OwnProps) {
if (!task) {
return null;
}
let instructions =
'There is no additional instructions or information for this task.';
let instructions = defaultMessage;
let { properties } = task;
if (!properties) {
properties = task.extensions;

View File

@ -1449,12 +1449,10 @@ export default function ProcessInstanceListTable({
buttonElement = (
<Button
kind={
hasAccessToCompleteTask && row.task_id ? 'secondary' : 'ghost'
}
kind={hasAccessToCompleteTask && row.task_id ? 'secondary' : 'ghost'}
href={interstitialUrl}
>
{hasAccessToCompleteTask && row.task_id ? 'Go' : 'View'}
{ hasAccessToCompleteTask && row.task_id ? 'Go' : 'View' }
</Button>
);
currentRow.push(<td>{buttonElement}</td>);

View File

@ -29,6 +29,10 @@
border-color: none;
}
.cds--loading__stroke {
stroke: gray;
}
/* make this a little less prominent so the actual human beings completing tasks stand out */
.system-user-log-entry {
color: #B0B0B0;
@ -424,3 +428,4 @@ svg.notification-icon {
margin-bottom: 1em;
font-weight: bold;
}

View File

@ -2,7 +2,7 @@ import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { fetchEventSource } from '@microsoft/fetch-event-source';
// @ts-ignore
import { Loading, Grid, Column } from '@carbon/react';
import { Loading, Grid, Column, Button } from '@carbon/react';
import { BACKEND_BASE_URL } from '../config';
import { getBasicHeaders } from '../services/HttpService';
@ -100,6 +100,20 @@ export default function ProcessInterstitial() {
}
};
const getReturnHomeButton = () => {
if (['WAITING', 'ERROR', 'LOCKED', 'COMPLETED'].includes(getStatus()))
return (
<>
<br />
<br />
<Button kind="secondary" onClick={() => navigate(`/tasks`)}>
Return to Home
</Button>
</>
);
return '';
};
function capitalize(str: string): string {
if (str && str.length > 0) {
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
@ -109,7 +123,15 @@ export default function ProcessInterstitial() {
const userMessage = (myTask: ProcessInstanceTask) => {
if (!myTask.can_complete && userTasks.includes(myTask.type)) {
return <div>This next task must be completed by a different person.</div>;
return (
<>
<h4 className="heading-compact-01">Waiting on Someone Else</h4>
<p>
This next task is assigned to a different person or team. There is
no action for you take at this time.
</p>
</>
);
}
if (shouldRedirect(myTask)) {
return <div>Redirecting you to the next task now ...</div>;
@ -120,7 +142,10 @@ export default function ProcessInterstitial() {
return (
<div>
<InstructionsForEndUser task={myTask} />
<InstructionsForEndUser
task={myTask}
defaultMessage="There are no additional instructions or information for this task."
/>
</div>
);
};
@ -147,7 +172,7 @@ export default function ProcessInterstitial() {
],
]}
/>
<div style={{ display: 'flex', alignItems: 'center' }}>
<div style={{ display: 'flex', alignItems: 'center', gap: '10px' }}>
{getStatusImage()}
<div>
<h1 style={{ marginBottom: '0em' }}>
@ -161,14 +186,12 @@ export default function ProcessInterstitial() {
<br />
{data.map((d) => (
<Grid fullWidth style={{ marginBottom: '1em' }}>
<Column md={2} lg={4} sm={2}>
Task: <em>{d.title}</em>
</Column>
<Column md={6} lg={6} sm={4}>
{userMessage(d)}
</Column>
</Grid>
))}
{getReturnHomeButton()}
</>
);
}