From d8b0db2a1875c330ae334cb8842bf33a64e6624d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 31 Jan 2023 22:03:37 +0300 Subject: [PATCH] [SSE] Refactoring pivot settings --- apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js | 1 - apps/spreadsheeteditor/main/app/view/PivotSettings.js | 2 -- .../main/app/view/ValueFieldSettingsDialog.js | 6 +++--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js index f281e10508..a4b1a1efba 100644 --- a/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js @@ -73,7 +73,6 @@ define([ 'text!spreadsheeteditor/main/app/template/FieldSettingsDialog.templa this.handler = options.handler; this.props = options.props; this.fieldIndex = options.fieldIndex || 0; - this.names = options.names || []; this.type = options.type || 0; // 0 - columns, 1 - rows, 3 - filters Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); diff --git a/apps/spreadsheeteditor/main/app/view/PivotSettings.js b/apps/spreadsheeteditor/main/app/view/PivotSettings.js index c3b2bfdd37..3d93158d56 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PivotSettings.js @@ -787,7 +787,6 @@ define([ { props: me._originalProps, field: field, - names: me._state.names, api: me.api, handler: function(result, value) { if (result == 'ok' && me.api && value) { @@ -805,7 +804,6 @@ define([ { props: me._originalProps, fieldIndex: pivotIndex, - names: me._state.names, api: me.api, type: me._state.field.type, handler: function(result, value) { diff --git a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js index 5a825f2593..51059d1f04 100644 --- a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js @@ -107,7 +107,6 @@ define([ this.handler = options.handler; this.props = options.props; this.field = options.field || 0; - this.names = options.names || []; Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); }, @@ -227,9 +226,10 @@ define([ this.cmbShowAs.setValue(show_as); var data = []; - this.names.forEach(function(item, index){ - data.push({value: index, displayValue: item}); + this.pivot_names.forEach(function (item, index) { + data.push({value: index, displayValue: item.asc_getName() || me.cache_names[index].asc_getName()}); }); + this.cmbBaseField.setData(data); this.cmbBaseField.setValue(field.asc_getBaseField(), ''); this.cmbBaseField.setDisabled(show_as === Asc.c_oAscShowDataAs.Normal || show_as === Asc.c_oAscShowDataAs.PercentOfTotal || show_as === Asc.c_oAscShowDataAs.PercentOfRow ||