Quellcode durchsuchen

AMBARI-5244. Wizard Step7 JS error on load page (add service wizard). (onechiporenko)

Oleg Nechiporenko vor 11 Jahren
Ursprung
Commit
5bf62189b8

+ 7 - 3
ambari-web/app/controllers/wizard/step7_controller.js

@@ -79,7 +79,7 @@ App.WizardStep7Controller = Em.Controller.extend({
   installedServiceNames: function () {
     var serviceNames = this.get('content.services').filterProperty('isInstalled').mapProperty('serviceName');
     if(this.get('content.controllerName') !== 'installerController') {
-      return serviceNames.without('SQOOP');
+      return serviceNames.without('SQOOP').without('HCATALOG');
     }
     return serviceNames;
   }.property('content.services').cacheable(),
@@ -403,8 +403,12 @@ App.WizardStep7Controller = Em.Controller.extend({
         this.loadInstalledServicesConfigGroups(this.get('installedServiceNames'));
     }
     this.activateSpecialConfigs();
-    this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
-
+    if (this.get('wizardController.name') === 'addServiceController') {
+      this.set('selectedService', this.get('stepConfigs').filterProperty('selected', true).get('firstObject'));
+    }
+    else {
+      this.set('selectedService', this.get('stepConfigs').filterProperty('showConfig', true).objectAt(0));
+    }
     if (this.get('content.skipConfigStep')) {
       App.router.send('next');
     }

+ 1 - 17
ambari-web/app/views/wizard/step7_view.js

@@ -21,22 +21,6 @@ var App = require('app');
 
 App.WizardStep7View = Em.View.extend({
 
-  templateName: require('templates/wizard/step7'),
-
-  didInsertElement: function() {
-    var self = this;
-    Em.run.next(function() {
-      var tabs = self.get('controller.stepConfigs').filterProperty('showConfig', true).mapProperty('serviceName');
-      var selectedServiceNames = self.get('controller.selectedServiceNames');
-      var tabIndex = 0;
-      for (var i = 0; i < tabs.length; i++) {
-        if (selectedServiceNames.contains(tabs[i])) {
-          tabIndex = i;
-          break;
-        }
-      }
-      self.$().find('.nav-tabs li:eq(' + tabIndex + ') a').trigger('click');
-    });
-  }
+  templateName: require('templates/wizard/step7')
 
 });