For Bug 25910

This commit is contained in:
Julia.Radzhabova
2025-08-29 22:37:29 +03:00
parent 4f145f37fd
commit bbeadf8233
4 changed files with 43 additions and 6 deletions

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

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

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",

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