Author: yusaku
Date: Thu Apr 18 23:37:06 2013
New Revision: 1469634

URL: http://svn.apache.org/r1469634
Log:
AMBARI-1985. Incorrect behavior of "Undo" button for password fields. (yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    
incubator/ambari/trunk/ambari-web/app/templates/common/configs/capacity_scheduler.hbs
    
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
    
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js
    incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1469634&r1=1469633&r2=1469634&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Thu Apr 18 23:37:06 2013
@@ -765,6 +765,8 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1985. Incorrect behavior of "Undo" button for password fields. (yusaku)
+
  AMBARI-1702. Ambari/GSInstallers need to set the value of 
  mapred.jobtracker.completeuserjobs.maximum. New recommended value. (swagle)
 

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/capacity_scheduler.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/common/configs/capacity_scheduler.hbs?rev=1469634&r1=1469633&r2=1469634&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/capacity_scheduler.hbs
 (original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/capacity_scheduler.hbs
 Thu Apr 18 23:37:06 2013
@@ -76,6 +76,11 @@
                             <div class="span8">
                                 <div {{bindAttr class="errorMessage:error: 
:control-group"}}>
                                   {{view viewClass serviceConfigBinding="this" 
categoryConfigsBinding="view.categoryConfigs" }}
+                                  {{#if view.canEdit}}
+                                      {{#if isRemovable}}
+                                          <a class="action" {{action 
"removeProperty" this target="view" }} ><i class="icon-minus-sign"></i>{{t 
common.remove}}</a>
+                                      {{/if}}
+                                  {{/if}}
                                     <span 
class="help-inline">{{errorMessage}}</span>
                                 </div>
                             </div>

Modified: 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs?rev=1469634&r1=1469633&r2=1469634&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
 (original)
+++ 
incubator/ambari/trunk/ambari-web/app/templates/common/configs/service_config.hbs
 Thu Apr 18 23:37:06 2013
@@ -86,12 +86,11 @@
                                            <a class="action" {{action 
"createOverrideProperty" this target="view" }} ><i 
class="icon-plus-sign"></i>{{t common.exception}}</a>
                                     {{/if}}
                                        {{/if}}
-                                       {{#if cantBeUndone}}
-                                       {{else}}
+                                       {{#unless cantBeUndone}}
                                          {{#if isNotDefaultValue}}
                                              <a class="action" {{action 
"doRestoreDefaultValue" this target="view" }} ><i class="icon-undo"></i>{{t 
common.undo}}</a>
                                          {{/if}}
-                                       {{/if}}
+                                       {{/unless}}
                                        {{#if isRemovable}}
                                            <a class="action" {{action 
"removeProperty" this target="view" }} ><i class="icon-minus-sign"></i>{{t 
common.remove}}</a>
                                        {{/if}}

Modified: 
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js?rev=1469634&r1=1469633&r2=1469634&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/views/common/configs/services_config.js 
Thu Apr 18 23:37:06 2013
@@ -280,6 +280,9 @@ App.ServiceConfigsByCategoryView = Ember
     var value = serviceConfigProperty.get('value');
     var dValue = serviceConfigProperty.get('defaultValue');
     if (dValue != null) {
+      if(serviceConfigProperty.get('displayType') === 'password'){
+        serviceConfigProperty.set('retypedPassword', dValue);
+      }
       serviceConfigProperty.set('value', dValue);
     }
   },
@@ -796,7 +799,8 @@ App.ServiceConfigCapacityScheduler = App
         data.push({
           label: Em.I18n.t('common.empty'),
           value: (100 - capacitiesSum),
-          color: 'transparent'
+          color: 'transparent',
+          isEmpty: true
         })
       }
       $(d3.select(this.get('selector'))[0]).children().remove();
@@ -809,7 +813,7 @@ App.ServiceConfigCapacityScheduler = App
       this.get('arcs')
         .on("click", function(d,i) {
           var event = {context: d.data.label};
-          self.get('parentView').queuePopup(event);
+          if (d.data.isEmpty !== true) 
self.get('parentView').queuePopup(event);
         }).on('mouseover', function(d, i){
           var position = d3.svg.mouse(this);
           var label = $('#section_label');

Modified: incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js?rev=1469634&r1=1469633&r2=1469634&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js 
(original)
+++ incubator/ambari/trunk/ambari-web/app/views/wizard/controls_view.js Thu Apr 
18 23:37:06 2013
@@ -122,8 +122,15 @@ App.ServiceConfigPasswordField = Ember.T
         return false;
       }
     },
-    valueBinding: 'parentView.serviceConfig.retypedPassword'
-  })
+    valueBinding: 'parentView.serviceConfig.retypedPassword',
+    disabled: function () {
+      return !this.get('parentView.serviceConfig.isEditable');
+    }.property('parentView.serviceConfig.isEditable')
+  }),
+
+  disabled: function () {
+    return !this.get('serviceConfig.isEditable');
+  }.property('serviceConfig.isEditable')
 
 });
 


Reply via email to