diff --git a/CHANGELOG.md b/CHANGELOG.md index a306bd37b..a0c4b7036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ All notable changes to the [Camunda Modeler](https://github.com/camunda/camunda- ___Note:__ Yet to be released changes appear here._ +### General + +* `FIX`: correct default extension used when saving Camunda 8 BPMN diagrams ([#4661](https://github.com/camunda/camunda-modeler/issues/4661)) + ## 5.29.0 ### General diff --git a/client/src/app/App.js b/client/src/app/App.js index 8110f1fc7..42e8ce1c9 100644 --- a/client/src/app/App.js +++ b/client/src/app/App.js @@ -1438,6 +1438,7 @@ export class App extends PureComponent { } = options; const provider = tabsProvider.getProvider(fileType); + const saveType = provider.extensions[0]; let savePath; @@ -1464,7 +1465,7 @@ export class App extends PureComponent { encoding, originalFile: file, savePath, - saveType: fileType + saveType }; } diff --git a/client/src/app/__tests__/AppSpec.js b/client/src/app/__tests__/AppSpec.js index eec3923e7..8ba0c365d 100644 --- a/client/src/app/__tests__/AppSpec.js +++ b/client/src/app/__tests__/AppSpec.js @@ -1035,6 +1035,35 @@ describe('', function() { }); + it('should save tab with correct extension', async function() { + + // given + const file = createFile('diagram_1.bpmn', { type: 'cloud-bpmn' }); + + await app.openFiles([ file ]); + + dialog.setShowSaveFileDialogResponse('diagram_2'); + + // when + await app.triggerAction('save-as'); + + // then + expect(showSaveFileDialogSpy).to.have.been.called; + + expect(writeFileSpy).to.have.been.calledWith( + 'diagram_2', + { + ...file, + contents: 'CONTENTS' + }, + { + encoding: 'utf8', + fileType: 'bpmn' + } + ); + }); + + it('should save as existing tab', async function() { // given