ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-8228 Incorrect behavior of config groups on Configs tab. (ababiichuk)
Date Sun, 09 Nov 2014 07:50:19 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b4b9a9700 -> d11292226


AMBARI-8228 Incorrect behavior of config groups on Configs tab. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: d11292226e758e574c17755b63dda733d39cb404
Parents: b4b9a97
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Sat Nov 8 17:55:53 2014 +0200
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Sun Nov 9 09:50:07 2014 +0200

----------------------------------------------------------------------
 .../app/views/common/configs/config_history_flow.js      | 11 +++++------
 .../app/views/common/configs/overriddenProperty_view.js  | 10 +++++++---
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/d1129222/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 00c7a13..12b0c51 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -231,7 +231,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
           // find current in default group
           if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName')
== Em.I18n.t('dashboard.configHistory.table.configGroup.default')){
             serviceVersion.set('isDisplayed', true);
-            currentIndex = index;
+            currentIndex = index + 1;
           }
         });
       }else {
@@ -240,7 +240,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
           // find current in selected group
           if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName')
== selectedGroupName){
             serviceVersion.set('isDisplayed', true);
-            currentIndex = index;
+            currentIndex = index + 1;
           }
         });
         // no current version for selected group, show default group current version
@@ -248,15 +248,14 @@ App.ConfigHistoryFlowView = Em.View.extend({
           serviceVersions.forEach(function (serviceVersion, index) {
             // find current in default group
             if (serviceVersion.get('isCurrent') && serviceVersion.get('groupName')
== Em.I18n.t('dashboard.configHistory.table.configGroup.default')){
-              serviceVersion.set('isDisplayed', true);
-              currentIndex = index;
+              currentIndex = index + 1;
             }
           });
         }
       }
       // show current version as the last one
-      if (currentIndex + 1 > this.VERSIONS_IN_FLOW) {
-        startIndex = currentIndex + 1 - this.VERSIONS_IN_FLOW;
+      if (currentIndex > this.VERSIONS_IN_FLOW) {
+        startIndex = currentIndex - this.VERSIONS_IN_FLOW;
       }
       this.set('startIndex', startIndex);
       this.adjustFlowView();

http://git-wip-us.apache.org/repos/asf/ambari/blob/d1129222/ambari-web/app/views/common/configs/overriddenProperty_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/overriddenProperty_view.js b/ambari-web/app/views/common/configs/overriddenProperty_view.js
index 8397c88..cf4f4d8 100644
--- a/ambari-web/app/views/common/configs/overriddenProperty_view.js
+++ b/ambari-web/app/views/common/configs/overriddenProperty_view.js
@@ -26,7 +26,9 @@ App.ServiceConfigView.SCPOverriddenRowsView = Ember.View.extend({
 
   init: function () {
     this._super();
-    this.addObserver('isDefaultGroupSelected', this, 'setSwitchText');
+    if (this.get('controller.name') != 'mainServiceInfoConfigsController') {
+      this.addObserver('isDefaultGroupSelected', this, 'setSwitchText');
+    }
   },
 
   didInsertElement: function () {
@@ -34,7 +36,9 @@ App.ServiceConfigView.SCPOverriddenRowsView = Ember.View.extend({
   },
 
   willDestroyElement: function () {
-    this.removeObserver('isDefaultGroupSelected', this, 'setSwitchText');
+    if (this.get('controller.name') != 'mainServiceInfoConfigsController') {
+      this.removeObserver('isDefaultGroupSelected', this, 'setSwitchText');
+    }
   },
 
   setSwitchText: function () {
@@ -46,7 +50,7 @@ App.ServiceConfigView.SCPOverriddenRowsView = Ember.View.extend({
           Em.I18n.t('services.service.config_groups.switchGroupTextShort').format(overriddenSCP.get('group.displayName')));
         overriddenSCP.get('group').set('switchGroupTextFull',
           Em.I18n.t('services.service.config_groups.switchGroupTextFull').format(overriddenSCP.get('group.displayName')));
-      })
+      });
       this.set('serviceConfigProperty.overrides', overrides);
     }
     App.tooltip(this.$('[data-toggle=tooltip]'),{


Mime
View raw message