From 61de22e1d70b43be40f429b985a2ff919ab6702f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 31 Jul 2019 11:21:02 +0300 Subject: [PATCH] [SSE] Add Asc.c_oAscError.ID.DataValidate error --- .../main/app/controller/Main.js | 22 +++++++++++++++---- apps/spreadsheeteditor/main/locale/en.json | 1 + 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 94d25fb03..8686c02eb 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -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.
Use the CONCATENATE function or concatenation operator (&)', - waitText: 'Please, wait...' + waitText: 'Please, wait...', + errorDataValidate: 'The value you entered is not valid.
A user has restricted values that can be entered into this cell.' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index bea565081..9c87eab7c 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -471,6 +471,7 @@ "SSE.Controllers.Main.errorWrongBracketsCount": "An error in the entered formula.
Wrong number of brackets is used.", "SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.
Please correct the error.", "SSE.Controllers.Main.errorFrmlMaxTextLength": "Text values in formulas are limited to 255 characters.
Use the CONCATENATE function or concatenation operator (&).", + "SSE.Controllers.Main.errorDataValidate": "The value you entered is not valid.
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",