diff --git a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx index 7294112b..1642fe0c 100644 --- a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx @@ -13,6 +13,8 @@ import { Accordion, AccordionItem, Button, + Grid, + Column, Stack, ButtonSet, Modal, @@ -233,17 +235,22 @@ export default function ProcessModelShow() { }); }; - const navigateToFileEdit = (processModelFile: ProcessFile) => { + const profileModelFileEditUrl = (processModelFile: ProcessFile) => { if (processModel) { if (processModelFile.name.match(/\.(dmn|bpmn)$/)) { - navigate( - `/admin/process-models/${modifiedProcessModelId}/files/${processModelFile.name}` - ); - } else if (processModelFile.name.match(/\.(json|md)$/)) { - navigate( - `/admin/process-models/${modifiedProcessModelId}/form/${processModelFile.name}` - ); + return `/admin/process-models/${modifiedProcessModelId}/files/${processModelFile.name}`; } + if (processModelFile.name.match(/\.(json|md)$/)) { + return `/admin/process-models/${modifiedProcessModelId}/form/${processModelFile.name}`; + } + } + return null; + }; + + const navigateToFileEdit = (processModelFile: ProcessFile) => { + const url = profileModelFileEditUrl(processModelFile); + if (url) { + navigate(url); } }; @@ -324,10 +331,15 @@ export default function ProcessModelShow() { if (isPrimaryBpmnFile) { primarySuffix = '- Primary File'; } + let fileLink = null; + const fileUrl = profileModelFileEditUrl(processModelFile); + if (fileUrl) { + fileLink = {processModelFile.name}; + } constructedTag = ( - {processModelFile.name} + {fileLink} {primarySuffix} {actionsTableCell} @@ -440,63 +452,67 @@ export default function ProcessModelShow() { return null; } return ( - - - - + + + } + > + + - - - } - > - - - - - - - -
- {processModelFileList()} -
-
+ + + + + +
+ {processModelFileList()} + + + + ); };