ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject ambari git commit: AMBARI-18648. There were no labels on fields on step "Configure Kerberos" after clicking back (alexantonenko)
Date Fri, 21 Oct 2016 21:50:24 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk dbe77dda8 -> 96ef52f4b


AMBARI-18648. There were no labels on fields on step "Configure Kerberos" after clicking back
 (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 96ef52f4b688d26e0236fc80213f19bd714aab6a
Parents: dbe77dd
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Fri Oct 21 21:56:13 2016 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Sat Oct 22 00:50:19 2016 +0300

----------------------------------------------------------------------
 .../controllers/main/admin/kerberos/step2_controller.js |  2 +-
 ambari-web/app/utils/config.js                          | 12 +++++++-----
 .../main/admin/kerberos/step2_controller_test.js        |  2 ++
 3 files changed, 10 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/96ef52f4/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
index dbea0b2..992fd34 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/step2_controller.js
@@ -97,7 +97,7 @@ App.KerberosWizardStep2Controller = App.WizardStep7Controller.extend(App.KDCCred
     App.config.setPreDefinedServiceConfigs(this.get('addMiscTabToPage'));
     var stored = this.get('content.serviceConfigProperties');
 
-    this.set('configs', stored || this.getKerberosConfigs());
+    this.set('configs', stored ? App.config.mergeStoredValue(this.getKerberosConfigs(), stored)
: this.getKerberosConfigs());
 
     this.filterConfigs(this.get('configs'));
     if (!this.get('wizardController.skipClientInstall')) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/96ef52f4/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 78aacac..fb6a15e 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -1210,16 +1210,18 @@ App.config = Em.Object.create({
    * Merge values in "stored" to "base" if name matches, it's a value only merge.
    * @param base {Array} Em.Object
    * @param stored {Array} Object
+   * @returns {Object[]|Em.Object[]} base
    */
   mergeStoredValue: function(base, stored) {
     if (stored) {
       base.forEach(function (p) {
-        var sp = stored.filterProperty("filename", p.filename).findProperty("name", p.name);
+        var sp = stored.filterProperty('filename', p.filename).findProperty('name', p.name);
         if (sp) {
-          p.set("value", sp.value);
+          Em.set(p, 'value', Em.get(sp, 'value'));
         }
       });
     }
+    return base;
   },
 
 
@@ -1244,10 +1246,10 @@ App.config = Em.Object.create({
     }
     return false;
   },
-  
+
   /**
-   * creates config object with non static properties like 
-   * 'value', 'isFinal', 'errorMessage' and 
+   * creates config object with non static properties like
+   * 'value', 'isFinal', 'errorMessage' and
    * 'id', 'name', 'filename',
    * @param configProperty
    * @returns {Object}

http://git-wip-us.apache.org/repos/asf/ambari/blob/96ef52f4/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js b/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
index dd8263e..2e603da 100644
--- a/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/kerberos/step2_controller_test.js
@@ -212,6 +212,7 @@ describe('App.KerberosWizardStep2Controller', function() {
       }]);
       sinon.stub(controller, 'clearStep');
       sinon.stub(App.config, 'setPreDefinedServiceConfigs');
+      sinon.stub(App.config, 'mergeStoredValue');
       sinon.stub(controller, 'filterConfigs');
       sinon.stub(controller, 'getKerberosConfigs');
       sinon.stub(controller, 'initializeKDCStoreProperties');
@@ -233,6 +234,7 @@ describe('App.KerberosWizardStep2Controller', function() {
       this.mockStackService.restore();
       controller.clearStep.restore();
       App.config.setPreDefinedServiceConfigs.restore();
+      App.config.mergeStoredValue.restore();
       controller.filterConfigs.restore();
       controller.getKerberosConfigs.restore();
       controller.initializeKDCStoreProperties.restore();


Mime
View raw message