More frontend changes

This commit is contained in:
mike cullerton 2022-11-08 12:33:21 -05:00
parent 1f3f5dbc2e
commit 06673dc762
3 changed files with 18 additions and 13 deletions

View File

@ -65,7 +65,7 @@ export default function AdminRoutes() {
element={<ProcessModelEditDiagram />}
/>
<Route
path="process-models/:process_group_id/:process_model_id/process-instances"
path="process-models/:process_model_id/process-instances"
element={<ProcessInstanceList />}
/>
<Route
@ -77,7 +77,7 @@ export default function AdminRoutes() {
element={<ProcessInstanceShow />}
/>
<Route
path="process-models/:process_group_id/:process_model_id/process-instances/:process_instance_id/:spiff_step"
path="process-models/:process_model_id/process-instances/:process_instance_id/:spiff_step"
element={<ProcessInstanceShow />}
/>
<Route
@ -105,7 +105,7 @@ export default function AdminRoutes() {
element={<ReactFormEditor />}
/>
<Route
path="process-models/:process_group_id/:process_model_id/process-instances/:process_instance_id/logs"
path="process-models/:process_model_id/process-instances/:process_instance_id/logs"
element={<ProcessInstanceLogList />}
/>
<Route path="process-instances" element={<ProcessInstanceList />} />

View File

@ -27,7 +27,7 @@ export default function ProcessInstanceLogList() {
};
const { page, perPage } = getPageInfoFromSearchParams(searchParams);
HttpService.makeCallToBackend({
path: `/process-models/${modifiedProcessModelId}/process-instances/${params.process_instance_id}/logs?per_page=${perPage}&page=${page}`,
path: `/process-instances/${params.process_instance_id}/logs?per_page=${perPage}&page=${page}`,
successCallback: setProcessInstanceLogListFromResult,
});
}, [searchParams, params]);
@ -36,6 +36,7 @@ export default function ProcessInstanceLogList() {
// return null;
const rows = processInstanceLogs.map((row) => {
const rowToUse = row as any;
console.log(`rowToUse: ${rowToUse}`);
return (
<tr key={rowToUse.id}>
<td>{rowToUse.bpmn_process_identifier}</td>
@ -87,7 +88,7 @@ export default function ProcessInstanceLogList() {
perPage={perPage}
pagination={pagination}
tableToDisplay={buildTable()}
path={`/admin/process-models/${modifiedProcessModelId}/process-instances/${params.process_instance_id}/logs`}
path={`/admin/process-instances/${params.process_instance_id}/logs`}
/>
</main>
);

View File

@ -26,13 +26,17 @@ export default function ProcessInstanceShow() {
const setErrorMessage = (useContext as any)(ErrorContext)[1];
const modifiedProcessModelId = modifyProcessModelPath(
const unModifiedProcessModelId = unModifyProcessModelPath(
`${params.process_model_id}`
);
const modifiedProcessModelId = params.process_model_id
console.log(`params.process_model_id: ${params.process_model_id}`);
console.log(`modifiedProcessModelId: ${modifiedProcessModelId}`);
const navigateToProcessInstances = (_result: any) => {
navigate(
`/admin/process-instances?process_group_identifier=${params.process_group_id}&process_model_identifier=${params.process_model_id}`
`/admin/process-instances?process_model_identifier=${unModifiedProcessModelId}`
);
};
@ -55,7 +59,7 @@ export default function ProcessInstanceShow() {
const deleteProcessInstance = () => {
HttpService.makeCallToBackend({
path: `/process-models/${modifiedProcessModelId}/process-instances/${params.process_instance_id}`,
path: `/process-instances/${params.process_instance_id}`,
successCallback: navigateToProcessInstances,
httpMethod: 'DELETE',
});
@ -68,7 +72,7 @@ export default function ProcessInstanceShow() {
const terminateProcessInstance = () => {
HttpService.makeCallToBackend({
path: `/process-models/${modifiedProcessModelId}/process-instances/${params.process_instance_id}/terminate`,
path: `/process-instances/${params.process_instance_id}/terminate`,
successCallback: refreshPage,
httpMethod: 'POST',
});
@ -76,7 +80,7 @@ export default function ProcessInstanceShow() {
const suspendProcessInstance = () => {
HttpService.makeCallToBackend({
path: `/process-models/${modifiedProcessModelId}/process-instances/${params.process_instance_id}/suspend`,
path: `/process-instances/${params.process_instance_id}/suspend`,
successCallback: refreshPage,
httpMethod: 'POST',
});
@ -84,7 +88,7 @@ export default function ProcessInstanceShow() {
const resumeProcessInstance = () => {
HttpService.makeCallToBackend({
path: `/process-models/${modifiedProcessModelId}/process-instances/${params.process_instance_id}/resume`,
path: `/process-instances/${params.process_instance_id}/resume`,
successCallback: refreshPage,
httpMethod: 'POST',
});
@ -133,7 +137,7 @@ export default function ProcessInstanceShow() {
<Link
reloadDocument
data-qa="process-instance-step-link"
to={`/admin/process-models/${params.process_group_id}/${
to={`/admin/process-models/${
params.process_model_id
}/process-instances/${params.process_instance_id}/${
currentSpiffStep(processInstanceToUse) + distance
@ -195,7 +199,7 @@ export default function ProcessInstanceShow() {
<li>
<Link
data-qa="process-instance-message-instance-list-link"
to={`/admin/messages?process_group_id=${params.process_group_id}&process_model_id=${params.process_model_id}&process_instance_id=${params.process_instance_id}`}
to={`/admin/messages?process_model_id=${params.process_model_id}&process_instance_id=${params.process_instance_id}`}
>
Messages
</Link>