From 9cf7d0e5dc76781e917e7ae0d61f8264cc0df933 Mon Sep 17 00:00:00 2001 From: lana-k Date: Thu, 9 Oct 2025 22:49:54 +0200 Subject: [PATCH] #128 fix save and close --- src/views/MainView/MainMenu.vue | 10 ---------- tests/views/MainView/MainMenu.spec.js | 13 ------------- 2 files changed, 23 deletions(-) diff --git a/src/views/MainView/MainMenu.vue b/src/views/MainView/MainMenu.vue index 54bbd3b..1c9b6c4 100644 --- a/src/views/MainView/MainMenu.vue +++ b/src/views/MainView/MainMenu.vue @@ -217,16 +217,6 @@ export default { } }) - // Restore data: - // e.g. if we save predefined inquiry the tab will be created again - // (because of new id) and - // it will be without sql result and has default view - table. - // That's why we need to restore data and view - this.$nextTick(() => { - this.currentInquiryTab.result = dataSet - this.currentInquiryTab.view = tabView - }) - // Hide dialogs this.$modal.hide('save') this.$modal.hide('inquiry-conflict') diff --git a/tests/views/MainView/MainMenu.spec.js b/tests/views/MainView/MainMenu.spec.js index f403ec7..c8637c3 100644 --- a/tests/views/MainView/MainMenu.spec.js +++ b/tests/views/MainView/MainMenu.spec.js @@ -1206,19 +1206,6 @@ describe('MainMenu.vue', () => { // check that 'inquirySaved' event was triggered on eventBus expect(eventBus.$emit.calledOnceWith('inquirySaved')).to.equal(true) - - // We saved predefined inquiry, so the tab will be created again - // (because of new id) and it will be without sql result and has default view - table. - // That's why we need to restore data and view. - // Check that result and view are preserved in the currentTab: - expect(state.currentTab.viewType).to.equal('chart') - expect(state.currentTab.result).to.eql({ - columns: ['id', 'name'], - values: [ - [1, 'Harry Potter'], - [2, 'Drako Malfoy'] - ] - }) }) it('Cancel saving', async () => {