You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/09/01 17:05:42 UTC

ambari git commit: AMBARI-12960. UX: after click Override for property was opened another tab (Settings instead Advanced) (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 864a50f06 -> 544824970


AMBARI-12960. UX: after click Override for property was opened another tab (Settings instead Advanced) (alexantonenko)


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

Branch: refs/heads/branch-2.1
Commit: 54482497068e136cb6eeda64453f5efca623f0fb
Parents: 864a50f
Author: Alex Antonenko <hi...@gmail.com>
Authored: Tue Sep 1 17:11:34 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Tue Sep 1 18:05:37 2015 +0300

----------------------------------------------------------------------
 .../controllers/main/service/info/configs.js    |  5 ++++
 .../app/controllers/wizard/step7_controller.js  |  3 ++
 .../common/configs/service_config_tab_view.js   |  1 +
 .../views/common/configs/service_config_view.js |  2 +-
 .../test/controllers/wizard/step7_test.js       | 31 ++++++++++++++++++++
 5 files changed, 41 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/54482497/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index 087ef53..da2be95 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -39,6 +39,8 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A
 
   selectedConfigGroup: null,
 
+  selectedServiceNameTrigger: null,
+
   requestsInProgress: [],
 
   groupsStore: App.ServiceConfigGroup.find(),
@@ -554,6 +556,9 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ConfigsLoader, A
     }, this);
 
     var selectedService = this.get('stepConfigs').findProperty('serviceName', this.get('content.serviceName'));
+    if (this.get('selectedService.serviceName') != selectedService.get('serviceName')) {
+      this.propertyDidChange('selectedServiceNameTrigger');
+    }
     this.set('selectedService', selectedService);
     this.checkOverrideProperty(selectedService);
     //this.checkDatabaseProperties(selectedService);

http://git-wip-us.apache.org/repos/asf/ambari/blob/54482497/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 2607b89..b4c2197 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -45,6 +45,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
 
   addMiscTabToPage: true,
 
+  selectedServiceNameTrigger: null,
+
   /**
    * Is Submit-click processing now
    * @type {bool}
@@ -1422,6 +1424,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
       {
         var service = errorServices[0];
         this.set('selectedService', service);
+        this.propertyDidChange('selectedServiceNameTrigger');
         $('a[href="#' + service.serviceName + '"]').tab('show');
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/54482497/ambari-web/app/views/common/configs/service_config_tab_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_config_tab_view.js b/ambari-web/app/views/common/configs/service_config_tab_view.js
index 2cfa626..0998ba6 100644
--- a/ambari-web/app/views/common/configs/service_config_tab_view.js
+++ b/ambari-web/app/views/common/configs/service_config_tab_view.js
@@ -24,6 +24,7 @@ App.ServiceConfigTab = Em.View.extend({
 
   selectService: function (event) {
     this.set('controller.selectedService', event.context);
+    this.get('controller').propertyDidChange('selectedServiceNameTrigger');
   },
 
   didInsertElement: function () {

http://git-wip-us.apache.org/repos/asf/ambari/blob/54482497/ambari-web/app/views/common/configs/service_config_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_config_view.js b/ambari-web/app/views/common/configs/service_config_view.js
index 86fb2c8..2393b47 100644
--- a/ambari-web/app/views/common/configs/service_config_view.js
+++ b/ambari-web/app/views/common/configs/service_config_view.js
@@ -184,7 +184,7 @@ App.ServiceConfigView = Em.View.extend({
     this.processTabs(tabs);
     this.pickActiveTab(tabs);
     return tabs;
-  }.property('controller.selectedService.serviceName'),
+  }.property('controller.selectedServiceNameTrigger'),
 
   /**
    * Pick the first non hidden tab and make it active when there is no active tab

http://git-wip-us.apache.org/repos/asf/ambari/blob/54482497/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 c0e820f..cea7e7f 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -1892,6 +1892,12 @@ describe('App.InstallerStep7Controller', function () {
   });
 
   describe('#toggleIssuesFilter', function () {
+    beforeEach(function () {
+      sinon.stub(installerStep7Controller, 'propertyDidChange', Em.K);
+    });
+    afterEach(function () {
+      installerStep7Controller.propertyDidChange.restore();
+    });
     it('should toggle issues filter', function () {
       var issuesFilter = installerStep7Controller.get('filterColumns').findProperty('attributeName', 'hasIssues');
       issuesFilter.set('selected', false);
@@ -1900,6 +1906,31 @@ describe('App.InstallerStep7Controller', function () {
       installerStep7Controller.toggleIssuesFilter();
       expect(issuesFilter.get('selected')).to.be.false;
     });
+    it('selected service should be changed', function () {
+      installerStep7Controller.setProperties({
+        selectedService: {
+          errorCount: 0,
+          configGroups: []
+        },
+        stepConfigs: [
+          {
+            errorCount: 1,
+            configGroups: []
+          },
+          {
+            errorCount: 2,
+            configGroups: []
+          }
+        ]
+      });
+      installerStep7Controller.toggleIssuesFilter();
+      expect(installerStep7Controller.get('selectedService')).to.eql({
+        errorCount: 1,
+        configGroups: []
+      });
+      expect(installerStep7Controller.propertyDidChange.calledOnce).to.be.true;
+      expect(installerStep7Controller.propertyDidChange.calledWith('selectedServiceNameTrigger')).to.be.true;
+    });
   });
 
   describe('#addKerberosDescriptorConfigs', function() {