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