diff --git a/apps/spreadsheeteditor/main/app/controller/DataTab.js b/apps/spreadsheeteditor/main/app/controller/DataTab.js index 22e795049..298b90fdd 100644 --- a/apps/spreadsheeteditor/main/app/controller/DataTab.js +++ b/apps/spreadsheeteditor/main/app/controller/DataTab.js @@ -612,7 +612,7 @@ define([ txtImportWizard: 'Text Import Wizard', txtUrlTitle: 'Paste a data URL', txtErrorExternalLink: 'Error: updating is failed', - strSheet : 'Sheet' + strSheet: 'Sheet' }, SSE.Controllers.DataTab || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/main/app/view/ImportFromXmlDialog.js b/apps/spreadsheeteditor/main/app/view/ImportFromXmlDialog.js index 0e851a4c4..5e4a09809 100644 --- a/apps/spreadsheeteditor/main/app/view/ImportFromXmlDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ImportFromXmlDialog.js @@ -34,14 +34,14 @@ /** * CreatePivotDialog.js * - * Created by Julia Radzhabova on 04.10.2019 + * Created by Julia Radzhabova on 08.12.2022 * Copyright (c) 2019 Ascensio System SIA. All rights reserved. * */ define([ 'common/main/lib/util/utils', 'common/main/lib/component/InputField', - 'common/main/lib/component/ComboBox', + 'common/main/lib/component/RadioBox', 'common/main/lib/view/AdvancedSettingsWindow' ], function () { 'use strict'; @@ -88,7 +88,7 @@ define([ ].join('') }, options); - this.api = options.api; + this.api = options.api; this.options.handler = function(result, value) { if ( result != 'ok' || this.isRangeValid() ) { @@ -115,16 +115,14 @@ define([ btnHint : this.textSelectData, allowBlank : true, validateOnChange: true, - validateOnBlur: false, - disabled: true + validateOnBlur: false }); this.txtDestRange.on('button:click', _.bind(this.onSelectData, this, 'dest')); this.radioNew = new Common.UI.RadioBox({ el: $('#import-xml-radio-new'), labelText: this.textNew, - name: 'asc-radio-xml-dest', - checked: true + name: 'asc-radio-xml-dest' }).on('change', function(field, newValue) { me.txtDestRange.setDisabled(newValue); me.txtDestRange.showError(); @@ -133,7 +131,8 @@ define([ this.radioExist = new Common.UI.RadioBox({ el: $('#import-xml-radio-exist'), labelText: this.textExist, - name: 'asc-radio-xml-dest' + name: 'asc-radio-xml-dest', + checked: true }).on('change', function(field, newValue) { me.txtDestRange.setDisabled(!newValue); me.txtDestRange.cmpEl.find('input').focus(); @@ -149,21 +148,22 @@ define([ getDefaultFocusableComponent: function () { if (this._alreadyRendered) return; // focus only at first show this._alreadyRendered = true; - return this.txtSourceRange; + return this.txtDestRange; }, afterRender: function() { - this._setDefaults(this.props); + this._setDefaults(); }, - _setDefaults: function (props) { - if (props) { - var me = this; - this.txtDestRange.validation = function(value) { - var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableReport, value, false); - return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; - }; - } + _setDefaults: function () { + var me = this; + this.txtDestRange.validation = function(value) { + var isvalid = me.api.asc_checkDataRange(Asc.c_oAscSelectionDialogType.PivotTableReport, value, false); + return (isvalid==Asc.c_oAscError.ID.DataRangeError) ? me.textInvalidRange : true; + }; + var range = this.api.asc_getActiveRangeStr(Asc.referenceType.A); + this.txtDestRange.setValue(range); + this.dataDestValid = range; }, getSettings: function () { diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 348419e4d..a360f8958 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -668,6 +668,7 @@ "SSE.Controllers.DataTab.txtRemoveDataValidation": "The selection contains more than one type of validation.
Erase current settings and continue?", "SSE.Controllers.DataTab.txtRemSelected": "Remove in selected", "SSE.Controllers.DataTab.txtUrlTitle": "Paste a data URL", + "SSE.Controllers.DataTab.strSheet": "Sheet", "SSE.Controllers.DocumentHolder.alignmentText": "Alignment", "SSE.Controllers.DocumentHolder.centerText": "Center", "SSE.Controllers.DocumentHolder.deleteColumnText": "Delete Column", @@ -2767,6 +2768,13 @@ "SSE.Views.ImageSettingsAdvanced.textTitle": "Image - Advanced settings", "SSE.Views.ImageSettingsAdvanced.textTwoCell": "Move and size with cells", "SSE.Views.ImageSettingsAdvanced.textVertically": "Vertically", + "SSE.Views.ImportFromXmlDialog.textTitle": "Import Data", + "SSE.Views.ImportFromXmlDialog.textSelectData": "Select data", + "SSE.Views.ImportFromXmlDialog.textDestination": "Choose, where to place the data", + "SSE.Views.ImportFromXmlDialog.textNew": "New worksheet", + "SSE.Views.ImportFromXmlDialog.textExist": "Existing worksheet", + "SSE.Views.ImportFromXmlDialog.txtEmpty": "This field is required", + "SSE.Views.ImportFromXmlDialog.textInvalidRange": "Invalid cells range", "SSE.Views.LeftMenu.tipAbout": "About", "SSE.Views.LeftMenu.tipChat": "Chat", "SSE.Views.LeftMenu.tipComments": "Comments",