瀏覽代碼

AMBARI-2536. Security wizard: Back button remains enabled after a stage fails. (jaimin)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1499046 13f79535-47bb-0310-9956-ffa450edef68
Jaimin Jetly 12 年之前
父節點
當前提交
63fdd28e13

+ 10 - 7
ambari-web/app/controllers/main/admin/security/add/step3.js

@@ -30,7 +30,9 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
   globalProperties: [],
   globalProperties: [],
 
 
   isSubmitDisabled: true,
   isSubmitDisabled: true,
-  isBackBtnDisabled: true,
+  isBackBtnDisabled: function () {
+    return !this.get('stages').someProperty('isError', true);
+  }.property('stages.@each.isCompleted'),
 
 
   isOozieSelected: function () {
   isOozieSelected: function () {
     return this.get('content.services').someProperty('serviceName', 'OOZIE');
     return this.get('content.services').someProperty('serviceName', 'OOZIE');
@@ -109,14 +111,15 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
   },
   },
 
 
   enableSubmit: function () {
   enableSubmit: function () {
+    var addSecurityController = App.router.get('addSecurityController');
     if (this.get('stages').someProperty('isError', true) || this.get('stages').everyProperty('isSuccess', true)) {
     if (this.get('stages').someProperty('isError', true) || this.get('stages').everyProperty('isSuccess', true)) {
       this.set('isSubmitDisabled', false);
       this.set('isSubmitDisabled', false);
       if (this.get('stages').someProperty('isError', true)) {
       if (this.get('stages').someProperty('isError', true)) {
-        this.set('isBackBtnDisabled', false);
-        App.router.get('addSecurityController').setStepsEnable();
+        addSecurityController.setStepsEnable();
       }
       }
     } else {
     } else {
       this.set('isSubmitDisabled', true);
       this.set('isSubmitDisabled', true);
+      addSecurityController.setLowerStepsDisable(3);
     }
     }
   }.observes('stages.@each.isCompleted'),
   }.observes('stages.@each.isCompleted'),
 
 
@@ -230,7 +233,7 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
     }, this);
     }, this);
     var dependentConfig = this.get('secureMapping').filterProperty('foreignKey');
     var dependentConfig = this.get('secureMapping').filterProperty('foreignKey');
     dependentConfig.forEach(function (_config) {
     dependentConfig.forEach(function (_config) {
-      if (App.Service.find().mapProperty('serviceName').contains( _config.serviceName)) {
+      if (App.Service.find().mapProperty('serviceName').contains(_config.serviceName)) {
         this.setConfigValue(uiConfig, _config);
         this.setConfigValue(uiConfig, _config);
         uiConfig.pushObject({
         uiConfig.pushObject({
           "id": "site property",
           "id": "site property",
@@ -356,9 +359,9 @@ App.MainAdminSecurityAddStep3Controller = Em.Controller.extend({
         value: hiveHostName
         value: hiveHostName
       });
       });
     }
     }
-    var webHcatComponent =  App.Service.find('WEBHCAT').get('hostComponents').findProperty('componentName', 'WEBHCAT_SERVER');
-    if(this.isWebHcatSelected() && webHcatComponent) {
-     var webHcatHostName =  webHcatComponent.get('host.hostName');
+    var webHcatComponent = App.Service.find('WEBHCAT').get('hostComponents').findProperty('componentName', 'WEBHCAT_SERVER');
+    if (this.isWebHcatSelected() && webHcatComponent) {
+      var webHcatHostName = webHcatComponent.get('host.hostName');
       this.get('globalProperties').pushObject({
       this.get('globalProperties').pushObject({
         id: 'puppet var',
         id: 'puppet var',
         name: 'webhcat_server',
         name: 'webhcat_server',

+ 1 - 1
ambari-web/app/templates/common/configs/service_config.hbs

@@ -76,7 +76,7 @@
                               {{displayName}}
                               {{displayName}}
                               {{#if App.supports.secureCluster}}
                               {{#if App.supports.secureCluster}}
                                 {{#if isSecureConfig}}
                                 {{#if isSecureConfig}}
-                                  <a href="#"><i class="icon-lock" rel="tooltip" data-toggle="tooltip" title="security knob"></i></a>
+                                  <a href="javascript:void(null);"><i class="icon-lock" rel="tooltip" data-toggle="tooltip" title="security knob"></i></a>
                                 {{/if}}
                                 {{/if}}
                               {{/if}}
                               {{/if}}
                             </label>
                             </label>