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

View File

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

View File

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