Skip to content

Commit

Permalink
updated frontend to display info for other instances of a task w/ bur…
Browse files Browse the repository at this point in the history
…nettk
  • Loading branch information
jasquat committed Dec 15, 2023
1 parent 8f14d30 commit 984e6f4
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from spiffworkflow_backend.exceptions.error import HumanTaskAlreadyCompletedError
from spiffworkflow_backend.exceptions.error import HumanTaskNotFoundError
from spiffworkflow_backend.exceptions.error import UserDoesNotHaveAccessToTaskError
from spiffworkflow_backend.models import task_definition
from spiffworkflow_backend.models.db import SpiffworkflowBaseDBModel
from spiffworkflow_backend.models.db import db
from spiffworkflow_backend.models.group import GroupModel
Expand Down Expand Up @@ -319,9 +318,9 @@ def task_instance_list(
task_guid: str,
) -> Response:
task_model = _get_task_model_from_guid_or_raise(task_guid, process_instance_id)
# task_model_instances = TaskModel.query.filter_by(task_definition_id=task_model.task_definition.id, bpmn_process_id=task_model.bpmn_process_id).all()
task_model_instances = (
TaskModel.query.filter_by(task_definition_id=task_model.task_definition.id, bpmn_process_id=task_model.bpmn_process_id).order_by(TaskModel.id.desc()) # type: ignore
TaskModel.query.filter_by(task_definition_id=task_model.task_definition.id, bpmn_process_id=task_model.bpmn_process_id)
.order_by(TaskModel.id.desc()) # type: ignore
.join(TaskDefinitionModel, TaskDefinitionModel.id == TaskModel.task_definition_id)
.add_columns(
TaskDefinitionModel.bpmn_identifier,
Expand All @@ -339,7 +338,6 @@ def task_instance_list(
return make_response(jsonify(task_model_instances), 200)



def manual_complete_task(
modified_process_model_identifier: str,
process_instance_id: int,
Expand Down
3 changes: 2 additions & 1 deletion spiffworkflow-frontend/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
'jsx-a11y/label-has-associated-control': 'off',
'no-console': 'off',
'react/jsx-filename-extension': [
1,
'warn',
{ extensions: ['.js', '.jsx', '.tsx', '.ts'] },
],
'react/react-in-jsx-scope': 'off',
Expand Down Expand Up @@ -71,5 +71,6 @@ module.exports = {
tsx: 'never',
},
],
curly: ['error', 'all'],
},
};
8 changes: 6 additions & 2 deletions spiffworkflow-frontend/src/components/ReactDiagramEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ export default function ReactDiagramEditor({
// @ts-ignore
diagramModelerToUse.on('import.parse.complete', event => { // eslint-disable-line
// @ts-ignore
if (!event.references) return;
if (!event.references) {
return;
}
const refs = event.references.filter(
(r: any) =>
r.property === 'bpmn:loopDataInputRef' ||
Expand Down Expand Up @@ -676,7 +678,9 @@ export default function ReactDiagramEditor({
const getReferencesButton = () => {
if (callers && callers.length > 0) {
let buttonText = `View ${callers.length} Reference`;
if (callers.length > 1) buttonText += 's';
if (callers.length > 1) {
buttonText += 's';
}
return (
<Button onClick={() => setShowingReferences(true)}>{buttonText}</Button>
);
Expand Down
8 changes: 3 additions & 5 deletions spiffworkflow-frontend/src/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ export const HUMAN_TASK_TYPES = [

export const MULTI_INSTANCE_TASK_TYPES = [
'ParallelMultiInstanceTask',
'SequentialMultiInstanceTask'
]
'SequentialMultiInstanceTask',
];

export const LOOP_TASK_TYPES = [
'StandardLoopTask'
]
export const LOOP_TASK_TYPES = ['StandardLoopTask'];

export const underscorizeString = (inputString: string) => {
return slugifyString(inputString).replace(/-/g, '_');
Expand Down
8 changes: 6 additions & 2 deletions spiffworkflow-frontend/src/hooks/UsePrompt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ export function useBlocker(blocker: any, when: any = true) {
const { navigator } = useContext(NavigationContext);

useEffect(() => {
if (!when) return null;
if (!when) {
return null;
}

const unblock = (navigator as any).block((tx: any) => {
const autoUnblockingTx = {
Expand Down Expand Up @@ -49,7 +51,9 @@ export function usePrompt(message: any, when: any = true) {
const blocker = useCallback(
(tx: any) => {
// eslint-disable-next-line no-alert
if (window.confirm(message)) tx.retry();
if (window.confirm(message)) {
tx.retry();
}
},
[message]
);
Expand Down
4 changes: 3 additions & 1 deletion spiffworkflow-frontend/src/hooks/useKeyboardShortcut.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import { KeyboardShortcuts } from '../interfaces';

export const overrideSystemHandling = (e: KeyboardEvent) => {
if (e) {
if (e.preventDefault) e.preventDefault();
if (e.preventDefault) {
e.preventDefault();
}
if (e.stopPropagation) {
e.stopPropagation();
} else if (window.event) {
Expand Down
8 changes: 8 additions & 0 deletions spiffworkflow-frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -922,3 +922,11 @@ div.onboarding {
float: right; /* Floats the keys to the right */
text-align: right; /* Aligns text to the right within the container */
}

.task-info-modal-accordion .cds--accordion__content {
padding-right: 1rem;
}
.task-instance-modal-row-item {
height: 48px;
line-height: 48px;
}
Loading

0 comments on commit 984e6f4

Please sign in to comment.