From 05c520015bed0d80e5af2405d9d0e888d9bd9d18 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 8 Jul 2020 15:04:19 +0300 Subject: [PATCH] [SSE] Disable switch button for empty range. Fix error messages --- .../main/app/view/ChartDataDialog.js | 15 +++++++++------ .../main/app/view/ChartDataRangeDialog.js | 9 ++++++++- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js b/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js index 67353743b..e2576eacd 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ChartDataDialog.js @@ -244,7 +244,7 @@ define([ } var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.Chart, value, false); - return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; + return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? (me.textError + ' ' + me.textInvalidRange) : true; }; this.updateSeriesList(props.getSeries(), 0); @@ -289,8 +289,9 @@ define([ Common.UI.warning({msg: this.errorMaxRows}); } else if (isvalid == Asc.c_oAscError.ID.MaxDataPointsError) Common.UI.warning({msg: this.errorMaxPoints}); - else - this.txtDataRange.cmpEl.find('input').focus(); + else { + Common.UI.warning({msg: this.textInvalidRange}); + } return false; }, @@ -354,6 +355,7 @@ define([ updateButtons: function() { this.btnEdit.setDisabled(this.seriesList.store.length<1); this.btnDelete.setDisabled(this.seriesList.store.length<1); + this.btnSwitch.setDisabled(this.seriesList.store.length<1 || !this.chartSettings.getRange()); this.updateMoveButtons(); }, @@ -509,11 +511,12 @@ define([ textTitle: 'Chart Data', txtEmpty: 'This field is required', - textInvalidRange: 'ERROR! Invalid cells range', + textInvalidRange: 'Invalid cells range', + textError: 'ERROR!', textSelectData: 'Select data', - errorMaxRows: 'ERROR! The maximum number of data series per chart is 255.', + errorMaxRows: 'The maximum number of data series per chart is 255.', errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:
opening price, max price, min price, closing price.', - errorMaxPoints: 'ERROR! The maximum number of points in series per chart is 4096.', + errorMaxPoints: 'The maximum number of points in series per chart is 4096.', textSeries: 'Legend Entries (Series)', textAdd: 'Add', textEdit: 'Edit', diff --git a/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js b/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js index 2df1ce630..be783d2f3 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ChartDataRangeDialog.js @@ -267,6 +267,8 @@ define([ Common.UI.warning({msg: this.errorMaxRows}); } else if (isvalid == Asc.c_oAscError.ID.MaxDataPointsError) Common.UI.warning({msg: this.errorMaxPoints}); + else + Common.UI.warning({msg: this.textInvalidRange}); return false; }, @@ -332,6 +334,11 @@ define([ txtChoose: 'Choose range', textSelectData: 'Select data', txtEmpty : 'This field is required', - txtInvalidRange: 'ERROR! Invalid cells range' + textInvalidRange: 'Invalid cells range', + textError: 'ERROR!', + errorMaxRows: 'The maximum number of data series per chart is 255.', + errorStockChart: 'Incorrect row order. To build a stock chart place the data on the sheet in the following order:
opening price, max price, min price, closing price.', + errorMaxPoints: 'The maximum number of points in series per chart is 4096.' + }, SSE.Views.ChartDataRangeDialog || {})) });