Merge pull request 'fix/bug-25910' (#657) from fix/bug-25910 into release/v9.1.0

This commit is contained in:
Julia Radzhabova
2025-08-29 19:57:15 +00:00
7 changed files with 64 additions and 55 deletions

View File

@ -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();

View File

@ -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);

View File

@ -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);
},

View File

@ -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.<br>Are you sure you want to continue?",
"SSE.Controllers.LeftMenu.warnDownloadCsvSheets": "The CSV format does not support saving a multi-sheet file.<br>To keep the selected format and save only the current sheet, press Save.<br>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.<br>To save only the selected sheet to CSV, press OK.<br>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.<br>Do you want to continue?",
"SSE.Controllers.Main.confirmAddCellWatchesMax": "This action will add only {0} cell watches by memory save reason.<br>Do you want to continue?",
"SSE.Controllers.Main.confirmMaxChangesSize": "The size of actions exceeds the limitation set for your server.<br>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).",
@ -1578,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.<br>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.<br>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.",
@ -1610,6 +1612,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",

View File

@ -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",
@ -884,7 +886,8 @@
"txtUk": "Ukrainian",
"txtVi": "Vietnamese",
"txtZh": "Chinese",
"warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?"
"warnDownloadAs": "If you continue saving in this format all features except the text will be lost.<br>Are you sure you want to continue?",
"warnDownloadCsv": "The CSV format does not support saving a multi-sheet file and all elements, except text.<br>To save only the selected sheet to CSV, press OK.<br>To save the whole spreadsheet and all features, click Cancel and select another format."
}
}
}

View File

@ -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) => {

View File

@ -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