[SSE] Fix Bug 56629

This commit is contained in:
Andrey Shimagin 2022-04-22 13:52:29 +03:00
parent 402af3bb95
commit 7d094c88d5

View file

@ -222,6 +222,7 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu
case Asc.c_oAscError.ID.DataValidate:
errData && errData.asc_getErrorTitle() && (config.title = Common.Utils.String.htmlEncode(errData.asc_getErrorTitle()));
config.buttons = ['OK', 'Cancel'];
config.msg = errData && errData.asc_getError() ? Common.Utils.String.htmlEncode(errData.asc_getError()) : _t.errorDataValidate;
break;
@ -350,8 +351,9 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu
Common.Gateway.reportWarning(id, config.msg);
config.title = config.title || _t.notcriticalErrorTitle;
config.callback = (btn) => {
if (id == Asc.c_oAscError.ID.DataValidate) {
config.buttons = config.buttons || ['OK'];
config.callback = (_, btn) => {
if (id == Asc.c_oAscError.ID.DataValidate && btn.target.textContent !== 'OK') {
api.asc_closeCellEditor(true);
}
storeAppOptions.changeEditingRights(false);
@ -362,12 +364,12 @@ const ErrorController = inject('storeAppOptions')(({storeAppOptions, LoadingDocu
cssClass: 'error-dialog',
title : config.title,
text : config.msg,
buttons: [
buttons: config.buttons.map( button => (
{
text: 'OK',
onClick: () => config.callback
text:button,
onClick: (_, btn) => config.callback(_, btn)
}
]
))
}).open();
Common.component.Analytics.trackEvent('Internal Error', id.toString());