[SSE] Add Asc.c_oAscError.ID.DataValidate error

This commit is contained in:
Julia Radzhabova 2019-07-31 11:21:02 +03:00
parent bd1d3af79f
commit 61de22e1d7
2 changed files with 19 additions and 4 deletions

View file

@ -1367,6 +1367,17 @@ define([
config.msg = this.errorFrmlMaxTextLength;
break;
case Asc.c_oAscError.ID.DataValidate:
var icon = errData ? errData.asc_getErrorStyle() : null;
if (icon) {
config.iconCls = (icon==Asc.c_oAscEDataValidationErrorStyle.Stop) ? 'error' : ((icon==Asc.c_oAscEDataValidationErrorStyle.Information) ? 'info' : 'warn');
}
errData && errData.asc_getErrorTitle() && (config.title = errData.asc_getErrorTitle());
config.buttons = ['ok', 'cancel'];
config.msg = errData && errData.asc_getError() ? errData.asc_getError() : this.errorDataValidate;
config.maxwidth = 600;
break;
default:
config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id);
break;
@ -1395,9 +1406,9 @@ define([
} else {
Common.Gateway.reportWarning(id, config.msg);
config.title = this.notcriticalErrorTitle;
config.iconCls = 'warn';
config.buttons = ['ok'];
config.title = config.title || this.notcriticalErrorTitle;
config.iconCls = config.iconCls || 'warn';
config.buttons = config.buttons || ['ok'];
config.callback = _.bind(function(btn){
if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) {
Common.UI.Menu.Manager.hideAll();
@ -1405,6 +1416,8 @@ define([
} else if (id == Asc.c_oAscError.ID.EditingError) {
this.disableEditing(true);
Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print
} else if (id == Asc.c_oAscError.ID.DataValidate && btn !== 'ok') {
this.api.asc_closeCellEditor();
}
this._state.lostEditingRights = false;
this.onEditComplete();
@ -2376,7 +2389,8 @@ define([
errorNoDataToParse: 'No data was selected to parse.',
errorCannotUngroup: 'Cannot ungroup. To start an outline, select the detail rows or columns and group them.',
errorFrmlMaxTextLength: 'Text values in formulas are limited to 255 characters.<br>Use the CONCATENATE function or concatenation operator (&)',
waitText: 'Please, wait...'
waitText: 'Please, wait...',
errorDataValidate: 'The value you entered is not valid.<br>A user has restricted values that can be entered into this cell.'
}
})(), SSE.Controllers.Main || {}))
});

View file

@ -471,6 +471,7 @@
"SSE.Controllers.Main.errorWrongBracketsCount": "An error in the entered formula.<br>Wrong number of brackets is used.",
"SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br>Please correct the error.",
"SSE.Controllers.Main.errorFrmlMaxTextLength": "Text values in formulas are limited to 255 characters.<br>Use the CONCATENATE function or concatenation operator (&).",
"SSE.Controllers.Main.errorDataValidate": "The value you entered is not valid.<br>A user has restricted values that can be entered into this cell.",
"SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.",
"SSE.Controllers.Main.loadFontsTextText": "Loading data...",
"SSE.Controllers.Main.loadFontsTitleText": "Loading Data",