From e24ced5c3474ebba31b3aae35b49073a03a7003d Mon Sep 17 00:00:00 2001 From: mike cullerton Date: Wed, 7 Dec 2022 14:00:46 -0500 Subject: [PATCH] Return message to use on successful publish --- .../src/routes/ProcessModelShow.tsx | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx index 1b55b0075..50f31b8b1 100644 --- a/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx +++ b/spiffworkflow-frontend/src/routes/ProcessModelShow.tsx @@ -21,6 +21,7 @@ import { ButtonSet, Modal, FileUploader, + InlineNotification, Table, TableHead, TableHeader, @@ -60,6 +61,7 @@ export default function ProcessModelShow() { const [filesToUpload, setFilesToUpload] = useState(null); const [showFileUploadModal, setShowFileUploadModal] = useState(false); + const [processModelPublished, setProcessModelPublished] = useState(null); const navigate = useNavigate(); const { targetUris } = useUriListForPermissions(); @@ -203,10 +205,14 @@ export default function ProcessModelShow() { }); }; + const postPublish = (value: any) => { + setProcessModelPublished(value); + }; + const publishProcessModel = () => { HttpService.makeCallToBackend({ path: `/process-models/${modifiedProcessModelId}/publish`, - successCallback: navigateToProcessModels, + successCallback: postPublish, httpMethod: 'PUT', }); }; @@ -518,10 +524,28 @@ export default function ProcessModelShow() { return null; }; + const processModelPublishMessage = () => { + console.log(`processModelPublishMessage: `); + if (processModelPublished) { + return ( + <> + +
+ + ); + } + return null; + }; + if (processModel) { return ( <> {fileUploadModal()} + {processModelPublishMessage()}