From 4f145f37fd0124307b53c1afafbce9fbcd16b7fa Mon Sep 17 00:00:00 2001 From: "Julia.Radzhabova" Date: Fri, 29 Aug 2025 19:38:26 +0300 Subject: [PATCH 1/3] For Bug 25910 --- .../main/app/controller/LeftMenu.js | 60 ++++--------------- apps/spreadsheeteditor/main/locale/en.json | 1 + apps/spreadsheeteditor/mobile/locale/en.json | 3 +- .../src/controller/settings/Download.jsx | 2 +- 4 files changed, 17 insertions(+), 49 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index b38f53c9e2..d7260d8273 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -344,7 +344,7 @@ define([ showLostDataWarning: function(callback) { Common.UI.warning({ title: this.textWarning, - msg: this.warnDownloadAs, + msg: this.warnDownloadCsv, buttons: ['ok', 'cancel'], callback: _.bind(function (btn) { if (btn == 'ok') { @@ -357,25 +357,10 @@ define([ clickSaveAsFormat: function(menu, format) { if (format == Asc.c_oAscFileType.CSV) { var me = this; - if (this.api.asc_getWorksheetsCount()>1) { - Common.UI.warning({ - title: this.textWarning, - msg: this.warnDownloadCsvSheets, - buttons: [{value: 'ok', caption: this.textSave}, 'cancel'], - callback: _.bind(function (btn) { - if (btn == 'ok') { - me.showLostDataWarning(function () { - Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); - menu.hide(); - }); - } - }, this) - }); - } else - this.showLostDataWarning(function () { - Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); - menu.hide(); - }); + this.showLostDataWarning(function () { + Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, new Asc.asc_CDownloadOptions(format)); + menu.hide(); + }); } else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA) { menu.hide(); Common.NotificationCenter.trigger('download:settings', this.leftMenu, format); @@ -388,33 +373,14 @@ define([ clickSaveCopyAsFormat: function(menu, format, ext, wopiPath) { if (format == Asc.c_oAscFileType.CSV) { var me = this; - if (this.api.asc_getWorksheetsCount()>1) { - Common.UI.warning({ - title: this.textWarning, - msg: this.warnDownloadCsvSheets, - buttons: [{value: 'ok', caption: this.textSave}, 'cancel'], - callback: _.bind(function (btn) { - if (btn == 'ok') { - me.showLostDataWarning(function () { - me.isFromFileDownloadAs = ext; - var options = new Asc.asc_CDownloadOptions(format, true); - options.asc_setIsSaveAs(true); - wopiPath && options.asc_setWopiSaveAsPath(wopiPath); - Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, options); - menu.hide(); - }); - } - }, this) - }); - } else - me.showLostDataWarning(function () { - me.isFromFileDownloadAs = ext; - var options = new Asc.asc_CDownloadOptions(format, true); - options.asc_setIsSaveAs(true); - wopiPath && options.asc_setWopiSaveAsPath(wopiPath); - Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, options); - menu.hide(); - }); + me.showLostDataWarning(function () { + me.isFromFileDownloadAs = ext; + var options = new Asc.asc_CDownloadOptions(format, true); + options.asc_setIsSaveAs(true); + wopiPath && options.asc_setWopiSaveAsPath(wopiPath); + Common.NotificationCenter.trigger('download:advanced', Asc.c_oAscAdvancedOptionsID.CSV, me.api.asc_getAdvancedOptions(), 2, options); + menu.hide(); + }); } else if (format == Asc.c_oAscFileType.PDF || format == Asc.c_oAscFileType.PDFA) { this.isFromFileDownloadAs = ext; menu.hide(); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 5477cce2c9..afd19ab7b5 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1077,6 +1077,7 @@ "SSE.Controllers.LeftMenu.txtUntitled": "Untitled", "SSE.Controllers.LeftMenu.warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?", "SSE.Controllers.LeftMenu.warnDownloadCsvSheets": "The CSV format does not support saving a multi-sheet file.
To keep the selected format and save only the current sheet, press Save.
To save the current spreadsheet, click Cancel and save it in a different format.", + "SSE.Controllers.LeftMenu.warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.
To save only the selected sheet to CSV, press OK.
To save the whole spreadsheet and all features, click Cancel and select another format.", "SSE.Controllers.Main.confirmAddCellWatches": "This action will add {0} cell watches.
Do you want to continue?", "SSE.Controllers.Main.confirmAddCellWatchesMax": "This action will add only {0} cell watches by memory save reason.
Do you want to continue?", "SSE.Controllers.Main.confirmMaxChangesSize": "The size of actions exceeds the limitation set for your server.
Press \"Undo\" to cancel your last action or press \"Continue\" to keep action locally (you need to download the file or copy its content to make sure nothing is lost).", diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 21b6ebbf5a..0c22698b2d 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -884,7 +884,8 @@ "txtUk": "Ukrainian", "txtVi": "Vietnamese", "txtZh": "Chinese", - "warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?" + "warnDownloadAs": "If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?", + "warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.
To save only the selected sheet to CSV, press OK.
To save the whole spreadsheet and all features, click Cancel and select another format." } } } \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx index fcc8f56a26..4f6886ff95 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/settings/Download.jsx @@ -29,7 +29,7 @@ class DownloadController extends Component { if (format == Asc.c_oAscFileType.CSV) { f7.dialog.create({ title: _t.notcriticalErrorTitle, - text: _t.warnDownloadAs, + text: _t.warnDownloadCsv, buttons: [ { text: _t.textCancel From bbeadf82336e10873ee767be9ca2ba62a20b496b Mon Sep 17 00:00:00 2001 From: "Julia.Radzhabova" Date: Fri, 29 Aug 2025 22:37:29 +0300 Subject: [PATCH 2/3] For Bug 25910 --- .../main/app/controller/Statusbar.js | 18 +++++++++++-- apps/spreadsheeteditor/main/locale/en.json | 2 ++ apps/spreadsheeteditor/mobile/locale/en.json | 4 ++- .../mobile/src/controller/Statusbar.jsx | 25 ++++++++++++++++--- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js index eb0b141ec4..9b1734897a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js @@ -785,9 +785,23 @@ define([ onAddWorksheetClick: function(o, index, opts) { if (this.api) { this.api.asc_closeCellEditor(); - this.api.asc_addWorksheet(this.createSheetName()); - Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getActiveWorksheetId()], false); // hide popover + if (this.statusbar.mode.spreadsheet.fileType.toLowerCase()==='csv') { + Common.UI.warning({ + msg: this.warnAddSheetCsv, + buttons: [{value: 'ok', caption: this.textContinue}, 'cancel'], + maxwidth: 500, + callback: _.bind(function (btn) { + if (btn == 'ok') { + this.api.asc_addWorksheet(this.createSheetName()); + Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getActiveWorksheetId()], false); // hide popover + } + }, this) + }); + } else { + this.api.asc_addWorksheet(this.createSheetName()); + Common.NotificationCenter.trigger('comments:updatefilter', ['doc', 'sheet' + this.api.asc_getActiveWorksheetId()], false); // hide popover + } } Common.NotificationCenter.trigger('edit:complete', this.statusbar); }, diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index afd19ab7b5..0c8156a970 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1611,6 +1611,8 @@ "SSE.Controllers.Statusbar.textSheetViewTipFilters": "You are in Sheet View mode. Filters are visible only to you and those who are still in this view.", "SSE.Controllers.Statusbar.warnDeleteSheet": "The selected sheets might contain data. Are you sure you want to proceed?", "SSE.Controllers.Statusbar.zoomText": "Zoom {0}%", + "SSE.Controllers.Statusbar.warnAddSheetCsv": "The CSV format does not support saving a multi-sheet file. Only the active sheet will be saved. To keep all sheets, please save the file in a different format.", + "SSE.Controllers.Statusbar.textContinue": "Continue", "SSE.Controllers.TableDesignTab.notcriticalErrorTitle": "Warning", "SSE.Controllers.TableDesignTab.textExistName": "ERROR! A range with such a name already exists", "SSE.Controllers.TableDesignTab.textInvalidName": "ERROR! Invalid table name", diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index 0c22698b2d..3201719987 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -448,7 +448,9 @@ "textSheetName": "Sheet Name", "textTabColor": "Tab Color", "textUnhide": "Unhide", - "textWarnDeleteSheet": "The sheet maybe has data. Proceed operation?" + "textWarnDeleteSheet": "The sheet maybe has data. Proceed operation?", + "textContinue": "Continue", + "warnAddSheetCsv": "The CSV format does not support saving a multi-sheet file. Only the active sheet will be saved. To keep all sheets, please save the file in a different format." }, "Toolbar": { "btnRestartNow": "Restart now", diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx index 031399e012..806e470fcf 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx @@ -109,8 +109,8 @@ const StatusbarController = inject('storeWorksheets', 'storeFocusObjects', 'user return null; })); -const Statusbar = inject('storeWorksheets', 'storeAppOptions', 'users')(observer(props => { - const {storeWorksheets, storeAppOptions, users} = props; +const Statusbar = inject('storeWorksheets', 'storeAppOptions', 'users', 'storeSpreadsheetInfo')(observer(props => { + const {storeWorksheets, storeAppOptions, users, storeSpreadsheetInfo} = props; const {t} = useTranslation(); const _t = t('Statusbar', {returnObjects: true}); const isEdit = storeAppOptions.isEdit; @@ -161,7 +161,26 @@ const Statusbar = inject('storeWorksheets', 'storeAppOptions', 'users')(observer const onAddTabClicked = () => { const api = Common.EditorApi.get(); api.asc_closeCellEditor(); - api.asc_addWorksheet(createSheetName()); + + if ((storeSpreadsheetInfo.dataDoc?.fileType ?? '').toLowerCase() === 'csv') { + f7.dialog.create({ + title: _t.notcriticalErrorTitle, + text: _t.warnAddSheetCsv, + buttons: [ + { + text: _t.textCancel + }, + { + text: _t.textContinue, + onClick: () => { + api.asc_addWorksheet(createSheetName()); + } + } + ] + }).open(); + } else { + api.asc_addWorksheet(createSheetName()); + } }; const onTabClick = (i, target) => { From c30134c2a890d213add090a93e420297901d74ad Mon Sep 17 00:00:00 2001 From: "Julia.Radzhabova" Date: Fri, 29 Aug 2025 22:57:26 +0300 Subject: [PATCH 3/3] Fix Bug 25910 --- apps/spreadsheeteditor/main/app/controller/Main.js | 3 +++ apps/spreadsheeteditor/main/locale/en.json | 1 + 2 files changed, 4 insertions(+) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index f85ef94c31..f046a5259a 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -991,6 +991,9 @@ define([ me.hidePreloader(); me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); + if (me.appOptions.isEdit && me.appOptions.spreadsheet.fileType.toLowerCase()==='csv') + Common.UI.TooltipManager.showTip({ step: 'openCsv', text: me.warnOpenCsv, target: '#toolbar', maxwidth: 350, automove: true, noHighlight: true, showButton: false}); + value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram || this.appOptions.isEditOle) ? 100 : Common.localStorage.getItem("sse-settings-zoom"); Common.Utils.InternalSettings.set("sse-settings-zoom", value); var zf = (value!==null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 0c8156a970..dca224b812 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -1579,6 +1579,7 @@ "SSE.Controllers.Main.warnNoLicense": "You've reached the limit for simultaneous connections to %1 editors. This document will be opened for viewing only.
Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnNoLicenseUsers": "You've reached the user limit for %1 editors. Contact %1 sales team for personal upgrade terms.", "SSE.Controllers.Main.warnProcessRightsChange": "You have been denied the right to edit the file.", + "SSE.Controllers.Main.warnOpenCsv": "The CSV format does not support saving a multi-sheet file or any elements except text.
Only the active sheet will be saved.", "SSE.Controllers.PivotTable.strSheet": "Sheet", "SSE.Controllers.PivotTable.txtCalculatedItemInPageField": "The item cannot be added or modified. PivotTable report has this field in Filters.", "SSE.Controllers.PivotTable.txtCalculatedItemWarningDefault": "No actions with calculated items are allowed for this active cell.",