put the proper extension on downloaded bpmn and dmn files w/ burnettk cullerton

This commit is contained in:
jasquat 2022-08-24 10:09:30 -04:00
parent 30c8c7c122
commit 74d5b4acd4
1 changed files with 7 additions and 3 deletions

View File

@ -341,14 +341,18 @@ export default function ReactDiagramEditor({
const file = new Blob([xmlObject.xml], {
type: 'application/xml',
});
let downloadFileName = fileName;
if (!downloadFileName) {
downloadFileName = `${processModelId}.${diagramType}`;
}
element.href = URL.createObjectURL(file);
element.download = `${processModelId}.bpmn`;
element.download = downloadFileName;
document.body.appendChild(element);
element.click();
});
};
const saveButton = () => {
const userActionOptions = () => {
if (diagramType !== 'readonly') {
return (
<>
@ -362,5 +366,5 @@ export default function ReactDiagramEditor({
return null;
};
return <div>{saveButton()}</div>;
return <div>{userActionOptions()}</div>;
}