diff --git a/spiffworkflow-frontend/src/components/ProcessModelForm.tsx b/spiffworkflow-frontend/src/components/ProcessModelForm.tsx
index 1599aff5d..7cfd4d616 100644
--- a/spiffworkflow-frontend/src/components/ProcessModelForm.tsx
+++ b/spiffworkflow-frontend/src/components/ProcessModelForm.tsx
@@ -194,7 +194,6 @@ export default function ProcessModelForm({
onChange={(event: any) => {
onDisplayNameChanged(event.target.value);
}}
- onBlur={(event: any) => console.log('event', event)}
/>,
];
diff --git a/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx b/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx
index 4787fe94e..1412635c5 100644
--- a/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx
+++ b/spiffworkflow-frontend/src/components/ProcessModelListTiles.tsx
@@ -54,9 +54,9 @@ export default function ProcessModelListTiles({
Process Instance {processInstance.id} kicked off (
view
diff --git a/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx b/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx
index a81779c7a..deb2030ea 100644
--- a/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx
+++ b/spiffworkflow-frontend/src/components/TasksForMyOpenProcesses.tsx
@@ -55,7 +55,7 @@ export default function MyOpenProcesses() {
{rowToUse.process_instance_id}
diff --git a/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx b/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx
index 924202248..7d06b7a30 100644
--- a/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx
+++ b/spiffworkflow-frontend/src/components/TasksWaitingForMe.tsx
@@ -47,7 +47,7 @@ export default function TasksWaitingForMe() {
|
{rowToUse.process_instance_id}
diff --git a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx
index 51c38e946..565cd4a55 100644
--- a/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx
+++ b/spiffworkflow-frontend/src/components/TasksWaitingForMyGroups.tsx
@@ -55,7 +55,7 @@ export default function TasksWaitingForMyGroups() {
|
{rowToUse.process_instance_id}
diff --git a/spiffworkflow-frontend/src/hooks/UriListForPermissions.tsx b/spiffworkflow-frontend/src/hooks/UriListForPermissions.tsx
index 80c78987a..eff30a828 100644
--- a/spiffworkflow-frontend/src/hooks/UriListForPermissions.tsx
+++ b/spiffworkflow-frontend/src/hooks/UriListForPermissions.tsx
@@ -9,10 +9,12 @@ export const useUriListForPermissions = () => {
messageInstanceListPath: '/v1.0/messages',
processGroupListPath: '/v1.0/process-groups',
processGroupShowPath: `/v1.0/process-groups/${params.process_group_id}`,
- processInstanceActionPath: `/v1.0/process-models/${params.process_model_id}/process-instances`,
+ processInstanceCreatePath: `/v1.0/process-instances/${params.process_model_id}`,
+ processInstanceActionPath: `/v1.0/process-instances/${params.process_model_id}/${params.process_instance_id}`,
processInstanceListPath: '/v1.0/process-instances',
- processInstanceTaskListPath: `/v1.0/process-instances/${params.process_model_id}/${params.process_instance_id}/tasks`,
+ processInstanceLogListPath: `/v1.0/logs/${params.process_model_id}/${params.process_instance_id}`,
processInstanceReportListPath: '/v1.0/process-instances/reports',
+ processInstanceTaskListPath: `/v1.0/task-data/${params.process_model_id}/${params.process_instance_id}`,
processModelCreatePath: `/v1.0/process-models/${params.process_group_id}`,
processModelFileCreatePath: `/v1.0/process-models/${params.process_model_id}/files`,
processModelFileShowPath: `/v1.0/process-models/${params.process_model_id}/files/${params.file_name}`,
diff --git a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx
index 91ae7ab08..da6cae356 100644
--- a/spiffworkflow-frontend/src/routes/AdminRoutes.tsx
+++ b/spiffworkflow-frontend/src/routes/AdminRoutes.tsx
@@ -71,11 +71,11 @@ export default function AdminRoutes() {
element={}
/>
}
/>
}
/>
}
/>
}
/>
} />
diff --git a/spiffworkflow-frontend/src/routes/MessageInstanceList.tsx b/spiffworkflow-frontend/src/routes/MessageInstanceList.tsx
index b77b744cb..a9ec6b69f 100644
--- a/spiffworkflow-frontend/src/routes/MessageInstanceList.tsx
+++ b/spiffworkflow-frontend/src/routes/MessageInstanceList.tsx
@@ -102,9 +102,9 @@ export default function MessageInstanceList() {
|
{row.process_instance_id}
@@ -163,9 +163,9 @@ export default function MessageInstanceList() {
},
[
`Process Instance: ${searchParams.get('process_instance_id')}`,
- `/admin/process-models/${searchParams.get(
+ `/admin/process-instances/${searchParams.get(
'process_model_id'
- )}/process-instances/${searchParams.get('process_instance_id')}`,
+ )}/${searchParams.get('process_instance_id')}`,
],
['Messages'],
]}
diff --git a/spiffworkflow-frontend/src/routes/MyTasks.tsx b/spiffworkflow-frontend/src/routes/MyTasks.tsx
index 51f5f3e99..4c1cbc9bf 100644
--- a/spiffworkflow-frontend/src/routes/MyTasks.tsx
+++ b/spiffworkflow-frontend/src/routes/MyTasks.tsx
@@ -55,9 +55,9 @@ export default function MyTasks() {
Process Instance {processInstance.id} kicked off (
view
@@ -95,7 +95,7 @@ export default function MyTasks() {
|
{rowToUse.process_instance_id}
diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx
index f41caf944..37ef5519c 100644
--- a/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx
+++ b/spiffworkflow-frontend/src/routes/ProcessInstanceLogList.tsx
@@ -1,6 +1,6 @@
import { useEffect, useState } from 'react';
// @ts-ignore
-import { Table } from '@carbon/react';
+import { Table, Tabs, TabList, Tab } from '@carbon/react';
import { useParams, useSearchParams, Link } from 'react-router-dom';
import PaginationForTable from '../components/PaginationForTable';
import ProcessBreadcrumb from '../components/ProcessBreadcrumb';
@@ -10,15 +10,18 @@ import {
convertSecondsToFormattedDateTime,
} from '../helpers';
import HttpService from '../services/HttpService';
+import { useUriListForPermissions } from '../hooks/UriListForPermissions';
export default function ProcessInstanceLogList() {
const params = useParams();
- const [searchParams] = useSearchParams();
+ const [searchParams, setSearchParams] = useSearchParams();
const [processInstanceLogs, setProcessInstanceLogs] = useState([]);
const [pagination, setPagination] = useState(null);
const modifiedProcessModelId = modifyProcessIdentifierForPathParam(
`${params.process_model_id}`
);
+ const { targetUris } = useUriListForPermissions();
+ const isDetailedView = searchParams.get('detailed') === 'true';
useEffect(() => {
const setProcessInstanceLogListFromResult = (result: any) => {
@@ -27,26 +30,36 @@ export default function ProcessInstanceLogList() {
};
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
HttpService.makeCallToBackend({
- path: `/process-instances/${params.process_instance_id}/logs?per_page=${perPage}&page=${page}`,
+ path: `${targetUris.processInstanceLogListPath}?per_page=${perPage}&page=${page}&detailed=${isDetailedView}`,
successCallback: setProcessInstanceLogListFromResult,
});
- }, [searchParams, params]);
+ }, [
+ searchParams,
+ params,
+ targetUris.processInstanceLogListPath,
+ isDetailedView,
+ ]);
const buildTable = () => {
const rows = processInstanceLogs.map((row) => {
const rowToUse = row as any;
return (
|
- {rowToUse.bpmn_process_identifier} |
+ {rowToUse.id} |
{rowToUse.message} |
- {rowToUse.bpmn_task_identifier} |
{rowToUse.bpmn_task_name} |
- {rowToUse.bpmn_task_type} |
+ {isDetailedView && (
+ <>
+ {rowToUse.bpmn_task_identifier} |
+ {rowToUse.bpmn_task_type} |
+ {rowToUse.bpmn_process_identifier} |
+ >
+ )}
{rowToUse.username} |
{convertSecondsToFormattedDateTime(rowToUse.timestamp)}
@@ -58,11 +71,16 @@ export default function ProcessInstanceLogList() {
- Bpmn Process Identifier |
+ Id |
Message |
- Task Identifier |
Task Name |
- Task Type |
+ {isDetailedView && (
+ <>
+ Task Identifier |
+ Task Type |
+ Bpmn Process Identifier |
+ >
+ )}
User |
Timestamp |
@@ -71,11 +89,12 @@ export default function ProcessInstanceLogList() {
);
};
+ const selectedTabIndex = isDetailedView ? 1 : 0;
if (pagination) {
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
return (
-
+ <>
+
+
+ {
+ searchParams.set('detailed', 'false');
+ setSearchParams(searchParams);
+ }}
+ >
+ Simple
+
+ {
+ searchParams.set('detailed', 'true');
+ setSearchParams(searchParams);
+ }}
+ >
+ Detailed
+
+
+
+
-
+ >
);
}
return null;
diff --git a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx
index c407c7713..9a0495d1d 100644
--- a/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx
+++ b/spiffworkflow-frontend/src/routes/ProcessInstanceShow.tsx
@@ -59,6 +59,11 @@ export default function ProcessInstanceShow() {
const permissionRequestData: PermissionsToCheck = {
[targetUris.messageInstanceListPath]: ['GET'],
[targetUris.processInstanceTaskListPath]: ['GET'],
+ [targetUris.processInstanceActionPath]: ['DELETE'],
+ [targetUris.processInstanceLogListPath]: ['GET'],
+ [`${targetUris.processInstanceActionPath}/suspend`]: ['PUT'],
+ [`${targetUris.processInstanceActionPath}/terminate`]: ['PUT'],
+ [`${targetUris.processInstanceActionPath}/resume`]: ['PUT'],
};
const { ability, permissionsLoaded } = usePermissionFetcher(
permissionRequestData
@@ -76,7 +81,7 @@ export default function ProcessInstanceShow() {
setTasksCallHadError(true);
};
HttpService.makeCallToBackend({
- path: `/process-models/${modifiedProcessModelId}/process-instances/${params.process_instance_id}`,
+ path: `/process-instances/${modifiedProcessModelId}/${params.process_instance_id}`,
successCallback: setProcessInstance,
});
let taskParams = '?all_tasks=true';
@@ -85,7 +90,7 @@ export default function ProcessInstanceShow() {
}
if (ability.can('GET', targetUris.processInstanceTaskListPath)) {
HttpService.makeCallToBackend({
- path: `/process-instances/${modifiedProcessModelId}/${params.process_instance_id}/tasks${taskParams}`,
+ path: `${targetUris.processInstanceTaskListPath}${taskParams}`,
successCallback: setTasks,
failureCallback: processTaskFailure,
});
@@ -97,7 +102,7 @@ export default function ProcessInstanceShow() {
const deleteProcessInstance = () => {
HttpService.makeCallToBackend({
- path: `/process-instances/${params.process_instance_id}`,
+ path: targetUris.processInstanceActionPath,
successCallback: navigateToProcessInstances,
httpMethod: 'DELETE',
});
@@ -110,7 +115,7 @@ export default function ProcessInstanceShow() {
const terminateProcessInstance = () => {
HttpService.makeCallToBackend({
- path: `/process-instances/${params.process_instance_id}/terminate`,
+ path: `${targetUris.processInstanceActionPath}/terminate`,
successCallback: refreshPage,
httpMethod: 'POST',
});
@@ -118,7 +123,7 @@ export default function ProcessInstanceShow() {
const suspendProcessInstance = () => {
HttpService.makeCallToBackend({
- path: `/process-instances/${params.process_instance_id}/suspend`,
+ path: `${targetUris.processInstanceActionPath}/suspend`,
successCallback: refreshPage,
httpMethod: 'POST',
});
@@ -126,7 +131,7 @@ export default function ProcessInstanceShow() {
const resumeProcessInstance = () => {
HttpService.makeCallToBackend({
- path: `/process-instances/${params.process_instance_id}/resume`,
+ path: `${targetUris.processInstanceActionPath}/resume`,
successCallback: refreshPage,
httpMethod: 'POST',
});
@@ -174,7 +179,7 @@ export default function ProcessInstanceShow() {
-
+
Completed:{' '}
@@ -235,7 +240,7 @@ export default function ProcessInstanceShow() {
return (
<>
-
+
Started:{' '}
@@ -246,7 +251,7 @@ export default function ProcessInstanceShow() {
{currentEndDateTag}
-
+
Status:{' '}
@@ -259,14 +264,20 @@ export default function ProcessInstanceShow() {
-
+
+
{
const elements = [];
- elements.push(terminateButton(processInstanceToUse));
- elements.push(suspendButton(processInstanceToUse));
- elements.push(resumeButton(processInstanceToUse));
- elements.push(
-
- );
+ if (
+ ability.can('POST', `${targetUris.processInstanceActionPath}/terminate`)
+ ) {
+ elements.push(terminateButton(processInstanceToUse));
+ }
+ if (
+ ability.can('POST', `${targetUris.processInstanceActionPath}/suspend`)
+ ) {
+ elements.push(suspendButton(processInstanceToUse));
+ }
+ if (ability.can('POST', `${targetUris.processInstanceActionPath}/resume`)) {
+ elements.push(resumeButton(processInstanceToUse));
+ }
+ if (ability.can('DELETE', targetUris.processInstanceActionPath)) {
+ elements.push(
+
+ );
+ }
return elements;
};
diff --git a/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx b/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx
index d117f798f..1a5c751f7 100644
--- a/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx
+++ b/spiffworkflow-frontend/src/routes/ProcessModelEditDiagram.tsx
@@ -283,7 +283,7 @@ export default function ProcessModelEditDiagram() {
const onServiceTasksRequested = (event: any) => {
HttpService.makeCallToBackend({
- path: `/service_tasks`,
+ path: `/service-tasks`,
successCallback: makeApiHandler(event),
});
};
diff --git a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx
index 2882e1832..96a656567 100644
--- a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx
+++ b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx
@@ -66,7 +66,7 @@ export default function ProcessModelShow() {
const permissionRequestData: PermissionsToCheck = {
[targetUris.processModelShowPath]: ['PUT', 'DELETE'],
[targetUris.processInstanceListPath]: ['GET'],
- [targetUris.processInstanceActionPath]: ['POST'],
+ [targetUris.processInstanceCreatePath]: ['POST'],
[targetUris.processModelFileCreatePath]: ['POST', 'PUT', 'GET', 'DELETE'],
};
const { ability, permissionsLoaded } = usePermissionFetcher(
@@ -95,7 +95,7 @@ export default function ProcessModelShow() {
Process Instance {processInstance.id} kicked off (
view
@@ -556,7 +556,7 @@ export default function ProcessModelShow() {
<>
diff --git a/spiffworkflow-frontend/src/routes/TaskShow.tsx b/spiffworkflow-frontend/src/routes/TaskShow.tsx
index 768043cd8..9e0f65c53 100644
--- a/spiffworkflow-frontend/src/routes/TaskShow.tsx
+++ b/spiffworkflow-frontend/src/routes/TaskShow.tsx
@@ -26,6 +26,9 @@ import Form from '../themes/carbon';
import HttpService from '../services/HttpService';
import ErrorContext from '../contexts/ErrorContext';
import { modifyProcessIdentifierForPathParam } from '../helpers';
+import { useUriListForPermissions } from '../hooks/UriListForPermissions';
+import { PermissionsToCheck } from '../interfaces';
+import { usePermissionFetcher } from '../hooks/PermissionService';
export default function TaskShow() {
const [task, setTask] = useState(null);
@@ -35,24 +38,36 @@ export default function TaskShow() {
const setErrorMessage = (useContext as any)(ErrorContext)[1];
- useEffect(() => {
- const processResult = (result: any) => {
- setTask(result);
- HttpService.makeCallToBackend({
- path: `/process-instances/${modifyProcessIdentifierForPathParam(
- result.process_model_identifier
- )}/${params.process_instance_id}/tasks`,
- successCallback: setUserTasks,
- });
- };
+ const { targetUris } = useUriListForPermissions();
+ const permissionRequestData: PermissionsToCheck = {
+ [targetUris.processInstanceTaskListPath]: ['GET'],
+ };
+ const { ability, permissionsLoaded } = usePermissionFetcher(
+ permissionRequestData
+ );
- HttpService.makeCallToBackend({
- path: `/tasks/${params.process_instance_id}/${params.task_id}`,
- successCallback: processResult,
- // This causes the page to continuously reload
- // failureCallback: setErrorMessage,
- });
- }, [params]);
+ useEffect(() => {
+ if (permissionsLoaded) {
+ const processResult = (result: any) => {
+ setTask(result);
+ if (ability.can('GET', targetUris.processInstanceTaskListPath)) {
+ HttpService.makeCallToBackend({
+ path: `/task-data/${modifyProcessIdentifierForPathParam(
+ result.process_model_identifier
+ )}/${params.process_instance_id}`,
+ successCallback: setUserTasks,
+ });
+ }
+ };
+
+ HttpService.makeCallToBackend({
+ path: `/tasks/${params.process_instance_id}/${params.task_id}`,
+ successCallback: processResult,
+ // This causes the page to continuously reload
+ // failureCallback: setErrorMessage,
+ });
+ }
+ }, [params, permissionsLoaded, ability, targetUris]);
const processSubmitResult = (result: any) => {
setErrorMessage(null);
@@ -116,17 +131,18 @@ export default function TaskShow() {
}
return null;
});
+ return (
+
+
+ {userTasksElement}
+
+
+ );
}
- return (
-
-
- {userTasksElement}
-
-
- );
+ return null;
};
const formElement = (taskToUse: any) => {
@@ -207,7 +223,7 @@ export default function TaskShow() {
);
};
- if (task && userTasks) {
+ if (task) {
const taskToUse = task as any;
let statusString = '';
if (taskToUse.state !== 'READY') {
|