Browse Source

AMBARI-5238. UI showing Hive configs on HBase service page. (onechiporenko)

Oleg Nechiporenko 11 years ago
parent
commit
56b177608b
1 changed files with 5 additions and 9 deletions
  1. 5 9
      ambari-web/app/views/wizard/controls_view.js

+ 5 - 9
ambari-web/app/views/wizard/controls_view.js

@@ -346,26 +346,22 @@ App.ServiceConfigRadioButton = Ember.Checkbox.extend({
     // Wrapping the call with Ember.run.next prevents a problem where setting isVisible on component
     // causes JS error due to re-rendering.  For example, this occurs when switching the Config Group
     // in Service Config page
-    Ember.run.next(this, function() {
+    Em.run.next(this, function() {
       console.debug('App.ServiceConfigRadioButton.onChecked');
       this.set('parentView.serviceConfig.value', this.get('value'));
       var components = this.get('parentView.serviceConfig.options');
-      components
-        .forEach(function (_component) {
+      if (components) {
+        components.forEach(function (_component) {
           if (_component.foreignKeys) {
             _component.foreignKeys.forEach(function (_componentName) {
               if (this.get('parentView.categoryConfigsAll').someProperty('name', _componentName)) {
                 var component = this.get('parentView.categoryConfigsAll').findProperty('name', _componentName);
-                if (_component.displayName === this.get('value')) {
-                  console.debug('setting isVisible on ' + component.get('name'));
-                  component.set('isVisible', true);
-                } else {
-                  component.set('isVisible', false);
-                }
+                component.set('isVisible', _component.displayName === this.get('value'));
               }
             }, this);
           }
         }, this);
+      }
     });
   }.observes('checked'),