Minor fixes for the launch buttons.

This commit is contained in:
Dan 2022-11-10 12:31:26 -05:00
parent dfff56e460
commit ac1a972c73
1 changed files with 28 additions and 28 deletions

View File

@ -640,21 +640,13 @@ export default function ProcessModelEditDiagram() {
const markdownEditor = () => { const markdownEditor = () => {
return ( return (
<Modal <Modal
size="xl" open={showMarkdownEditor}
show={showMarkdownEditor} modalHeading={`Edit Markdown`}
onHide={handleMarkdownEditorClose} primaryButtonText="Close"
onRequestSubmit={handleMarkdownEditorClose}
size="lg"
> >
<Modal.Header closeButton> <MDEditor height={500} highlightEnable={false} value={markdownText} onChange={setMarkdownText} />
<Modal.Title>Edit Markdown Content</Modal.Title>
</Modal.Header>
<Modal.Body>
<MDEditor value={markdownText} onChange={setMarkdownText} />
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={handleMarkdownEditorClose}>
Close
</Button>
</Modal.Footer>
</Modal> </Modal>
); );
}; };
@ -684,33 +676,41 @@ export default function ProcessModelEditDiagram() {
* @param processId * @param processId
*/ */
const fileNameTemplatePath =
'/admin/process-models/:process_model_id/files/:file_name';
const onLaunchBpmnEditor = (processId: string) => { const onLaunchBpmnEditor = (processId: string) => {
const file = findFileNameForReferenceId(processId, 'bpmn'); const file = findFileNameForReferenceId(processId, 'bpmn');
if (file) { if (file) {
const path = generatePath(fileNameTemplatePath, { const path = generatePath(
'/admin/process-models/:process_model_id/files/:file_name',
{
process_model_id: params.process_model_id, process_model_id: params.process_model_id,
file_name: file.name, file_name: file.name,
}); }
);
window.open(path); window.open(path);
} }
}; };
const onLaunchJsonEditor = (fileName: string) => { const onLaunchJsonEditor = (fileName: string) => {
const path = generatePath(fileNameTemplatePath, { const path = generatePath(
'/admin/process-models/:process_model_id/form/:file_name',
{
process_model_id: params.process_model_id, process_model_id: params.process_model_id,
file_name: fileName, file_name: fileName,
}); }
);
window.open(path); window.open(path);
}; };
const onLaunchDmnEditor = (processId: string) => { const onLaunchDmnEditor = (processId: string) => {
const file = findFileNameForReferenceId(processId, 'dmn'); const file = findFileNameForReferenceId(processId, 'dmn');
if (file) { if (file) {
const path = generatePath(fileNameTemplatePath, { const path = generatePath(
'/admin/process-models/:process_model_id/files/:file_name',
{
process_model_id: params.process_model_id, process_model_id: params.process_model_id,
file_name: file.name, file_name: file.name,
}); }
);
window.open(path); window.open(path);
} }
}; };