ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rz...@apache.org
Subject ambari git commit: AMBARI-19871 - Config version switch/compare/revert doesn't work <fix2> (rzang)
Date Tue, 14 Feb 2017 19:52:18 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 98dda7fa8 -> 387f2e55f


AMBARI-19871 - Config version switch/compare/revert doesn't work <fix2> (rzang)


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

Branch: refs/heads/branch-2.5
Commit: 387f2e55f92daeaa9beda35cce09859b4ff23f8b
Parents: 98dda7f
Author: Richard Zang <rzang@apache.org>
Authored: Tue Feb 14 11:37:44 2017 -0800
Committer: Richard Zang <rzang@apache.org>
Committed: Tue Feb 14 11:52:06 2017 -0800

----------------------------------------------------------------------
 .../templates/common/configs/config_history_flow.hbs |  6 +++---
 .../app/views/common/configs/config_history_flow.js  | 15 +++++++++------
 2 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/387f2e55/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index 315f2e6..73ffbae 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -64,12 +64,12 @@
           <div class="notes">{{view.parentView.hoveredServiceVersion.fullNotes}}</div>
         </div>
         <div class="version-operations-buttons">
-          <button {{bindAttr disabled="view.parentView.hoveredServiceVersion.disabledActionAttr.view"
class=":btn view.parentView.hoveredServiceVersion.isDisplayed:not-allowed-cursor" title="view.parentView.hoveredServiceVersion.disabledActionMessages.view"}}
{{action doAction view.parentView.hoveredServiceVersion view.parentView.actionTypes.SWITCH
target="view.parentView"}}><i class="icon-search"></i>&nbsp;{{t common.view}}</button>
+          <button {{bindAttr disabled="view.parentView.hoveredServiceVersion.disabledActionAttr.view"
class=":btn view.parentView.hoveredServiceVersion.isDisplayed:not-allowed-cursor" title="view.parentView.hoveredServiceVersion.disabledActionMessages.view"}}
{{action doAction undefined view.parentView.actionTypes.SWITCH target="view.parentView"}}><i
class="icon-search"></i>&nbsp;{{t common.view}}</button>
           {{#isAuthorized "SERVICE.COMPARE_CONFIGS"}}
-            <button {{bindAttr disabled="view.parentView.hoveredServiceVersion.disabledActionAttr.compare"
class=":btn view.parentView.hoveredServiceVersion.isDisplayed:not-allowed-cursor" title="view.parentView.hoveredServiceVersion.disabledActionMessages.compare"}}
{{action doAction view.parentView.hoveredServiceVersion view.parentView.actionTypes.COMPARE
target="view.parentView"}}><i class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
+            <button {{bindAttr disabled="view.parentView.hoveredServiceVersion.disabledActionAttr.compare"
class=":btn view.parentView.hoveredServiceVersion.isDisplayed:not-allowed-cursor" title="view.parentView.hoveredServiceVersion.disabledActionMessages.compare"}}
{{action doAction undefined view.parentView.actionTypes.COMPARE target="view.parentView"}}><i
class="icon-copy"></i>&nbsp;{{t common.compare}}</button>
           {{/isAuthorized}}
           {{#isAuthorized "SERVICE.MODIFY_CONFIGS"}}
-            <button {{bindAttr disabled="view.parentView.hoveredServiceVersion.disabledActionAttr.revert"
class=":btn view.parentView.hoveredServiceVersion.isCurrent:not-allowed-cursor view.parentView.hoveredServiceVersion.isCompatible::hidden"
title="view.parentView.hoveredServiceVersion.disabledActionMessages.revert"}} {{action doAction
view.parentView.hoveredServiceVersion view.parentView.actionTypes.REVERT target="view.parentView"}}>{{t
dashboard.configHistory.info-bar.revert.button}}</button>
+            <button {{bindAttr disabled="view.parentView.hoveredServiceVersion.disabledActionAttr.revert"
class=":btn view.parentView.hoveredServiceVersion.isCurrent:not-allowed-cursor view.parentView.hoveredServiceVersion.isCompatible::hidden"
title="view.parentView.hoveredServiceVersion.disabledActionMessages.revert"}} {{action doAction
undefined view.parentView.actionTypes.REVERT target="view.parentView"}}>{{t dashboard.configHistory.info-bar.revert.button}}</button>
           {{/isAuthorized}}
         </div>
       {{/if}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/387f2e55/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 bdb9842..d0991da 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -274,11 +274,13 @@ App.ConfigHistoryFlowView = Em.View.extend({
     var type = event.contexts[1],
         controller = this.get('controller'),
         self = this;
-
+    // action from right popup of pull down version list will have context[0] == undefined,
and use 'hoveredServiceVersion'.
+    // refer to AMBARI-19871 for more info
+    var configVersion = event.contexts[0] || this.get('hoveredServiceVersion');
     if (type === 'switchVersion') {
-      if (event.context.get("isDisplayed"))  return;
+      if (configVersion && configVersion.get("isDisplayed"))  return;
     } else {
-      var isDisabled = event.context ? event.context.get('isDisabled') : false;
+      var isDisabled = configVersion ? configVersion.get('isDisabled') : false;
       if (isDisabled) return;
     }
 
@@ -302,7 +304,8 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * switch configs view version to chosen
    */
   switchVersion: function (event) {
-    var version = event.context.get('version');
+    var configVersion = event.contexts[0] || this.get('hoveredServiceVersion');
+    var version = configVersion.get('version');
     var versionIndex = 0;
     this.set('compareServiceVersion', null);
     this.get('serviceVersions').forEach(function (serviceVersion, index) {
@@ -322,7 +325,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * add a second version-info-bar for the chosen version
    */
   compare: function (event) {
-    var serviceConfigVersion = event.context;
+    var serviceConfigVersion = event.contexts[0] || this.get('hoveredServiceVersion');
     this.set('controller.compareServiceVersion', serviceConfigVersion);
     this.set('compareServiceVersion', serviceConfigVersion);
 
@@ -359,7 +362,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    */
   revert: function (event) {
     var self = this;
-    var serviceConfigVersion = event.context || Em.Object.create({
+    var serviceConfigVersion = event.contexts[0] || this.get('hoveredServiceVersion') ||
Em.Object.create({
       version: this.get('displayedServiceVersion.version'),
       serviceName: this.get('displayedServiceVersion.serviceName'),
       notes:''


Mime
View raw message