ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-17927. Configs: Additional input appeared for overrides with same config name from different file names (akovalenko)
Date Wed, 27 Jul 2016 18:33:45 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 cab9ef7dc -> d6ec169e1


AMBARI-17927. Configs: Additional input appeared for overrides with same config name from
different file names (akovalenko)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d6ec169e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d6ec169e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d6ec169e

Branch: refs/heads/branch-2.4
Commit: d6ec169e1a6100b0921be74021ca2695fa9784e2
Parents: cab9ef7
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Wed Jul 27 21:26:29 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Wed Jul 27 21:33:37 2016 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step7_controller.js  |  4 +-
 .../test/controllers/wizard/step7_test.js       | 42 ++++++++++----------
 2 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d6ec169e/ambari-web/app/controllers/wizard/step7_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js
index fcb5c0b..2b7bbcc 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -1199,9 +1199,9 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin,
App.E
     if (config.get('group')) return config;
     var selectedGroup = this.get('selectedConfigGroup'),
       overrideToAdd = this.get('overrideToAdd'),
-      configOverrides = overrides.filterProperty('name', config.get('name'));
+      configOverrides = overrides.filterProperty('id', config.get('id'));
     if (!selectedGroup) return config;
-    if (overrideToAdd && overrideToAdd.get('name') === config.get('name')) {
+    if (overrideToAdd && overrideToAdd.get('id') === config.get('id')) {
       var valueForOverride = (config.get('widget') || config.get('displayType') === 'checkbox')
? config.get('value') : '';
       var group = this.get('selectedService.configGroups').findProperty('name', selectedGroup.get('name'));
       var newSCP = App.config.createOverride(config, {value: valueForOverride, recommendedValue:
valueForOverride}, group);

http://git-wip-us.apache.org/repos/asf/ambari/blob/d6ec169e/ambari-web/test/controllers/wizard/step7_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js
index 7aa559a..0104405 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -654,12 +654,12 @@ describe('App.InstallerStep7Controller', function () {
       var isDefault;
       beforeEach(function () {
         isDefault = true;
-        var name = 'n1',
-          config = Em.Object.create({overrides: null, name: name, flag: 'flag'}),
+        var id = 'n1',
+          config = Em.Object.create({overrides: null, id: id, flag: 'flag'}),
           overrides = Em.A([
-            Em.Object.create({name: name, value: 'v1'}),
-            Em.Object.create({name: name, value: 'v2'}),
-            Em.Object.create({name: 'n2', value: 'v3'})
+            Em.Object.create({id: id, value: 'v1'}),
+            Em.Object.create({id: id, value: 'v2'}),
+            Em.Object.create({id: 'n2', value: 'v3'})
           ]);
         installerStep7Controller.reopen({
           overrideToAdd: null,
@@ -684,19 +684,19 @@ describe('App.InstallerStep7Controller', function () {
     describe('overrideToAdd exists', function () {
       var isDefault = true;
       beforeEach(function () {
-        var name = 'n1',
-          config = Em.Object.create({overrides: null, name: name, flag: 'flag'}),
-          overrides = Em.A([
-            Em.Object.create({name: name, value: 'v1'}),
-            Em.Object.create({name: name, value: 'v2'}),
-            Em.Object.create({name: 'n2', value: 'v3'})
-          ]);
+        var id = 'n1',
+            config = Em.Object.create({overrides: null, id: id, flag: 'flag'}),
+            overrides = Em.A([
+              Em.Object.create({id: id, value: 'v1'}),
+              Em.Object.create({id: id, value: 'v2'}),
+              Em.Object.create({id: 'n2', value: 'v3'})
+            ]);
         installerStep7Controller.reopen({
-          overrideToAdd: Em.Object.create({name: name}),
-          selectedService: {configGroups: [Em.Object.create({name: 'n', properties: []})]},
+          overrideToAdd: Em.Object.create({id: id}),
+          selectedService: {configGroups: [Em.Object.create({id: 'n', properties: []})]},
           selectedConfigGroup: Em.Object.create({
             isDefault: isDefault,
-            name: 'n'
+            id: 'n'
           })
         });
         this.updatedConfig = installerStep7Controller._setOverrides(config, overrides);
@@ -734,8 +734,8 @@ describe('App.InstallerStep7Controller', function () {
       var configGroups = [
         Em.Object.create({
           properties: [
-            {name: 'g1', value: 'v1'},
-            {name: 'g2', value: 'v2'}
+            {id: 'g1', value: 'v1'},
+            {id: 'g2', value: 'v2'}
           ]
         })
       ];
@@ -751,8 +751,8 @@ describe('App.InstallerStep7Controller', function () {
         installerStep7Controller.reopen({
           selectedConfigGroup: Em.Object.create({isDefault: true, name: 'g1'}),
           content: {services: []},
-          selectedService: {configs: Em.A([Em.Object.create({name: 'g1', overrides: [], properties:
[]}), Em.Object.create({name: 'g2', overrides: []})])},
-          serviceConfigs: {configs: [Em.Object.create({name: 'g1'})]}
+          selectedService: {configs: Em.A([Em.Object.create({id: 'g1', overrides: [], properties:
[]}), Em.Object.create({id: 'g2', overrides: []})])},
+          serviceConfigs: {configs: [Em.Object.create({id: 'g1'})]}
         });
         installerStep7Controller.switchConfigGroupConfigs();
         this.configs = installerStep7Controller.get('selectedService.configs');
@@ -764,11 +764,11 @@ describe('App.InstallerStep7Controller', function () {
       });
 
       it('g1 has 1 override', function () {
-        expect(this.configs.findProperty('name', 'g1').get('overrides').length).to.equal(1);
+        expect(this.configs.findProperty('id', 'g1').get('overrides').length).to.equal(1);
       });
 
       it('g2 has 1 override', function () {
-        expect(this.configs.findProperty('name', 'g2').get('overrides').length).to.equal(1);
+        expect(this.configs.findProperty('id', 'g2').get('overrides').length).to.equal(1);
       });
 
       it('all configs are editable', function () {


Mime
View raw message