Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 222384428 -> 314cbf989


AMBARI-13636. No Properties for Flume configs in Add Service Wizard. 
(akovalenko)


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

Branch: refs/heads/branch-2.1
Commit: 314cbf9898c32152301312b330d7b4cbbbb03e0a
Parents: 2223844
Author: Aleksandr Kovalenko <[email protected]>
Authored: Thu Oct 29 18:53:29 2015 +0200
Committer: Aleksandr Kovalenko <[email protected]>
Committed: Fri Oct 30 12:22:17 2015 +0200

----------------------------------------------------------------------
 .../resourceManager/step4_controller.js         |  2 +-
 .../main/service/reassign/step4_controller.js   |  7 ++---
 .../main/service/reassign/step5_controller.js   |  2 +-
 .../main/service/reassign/step6_controller.js   |  2 ++
 .../main/service/reassign_controller.js         |  7 +++--
 .../app/mixins/wizard/wizardEnableDone.js       |  7 ++---
 .../wizard/wizardProgressPageController.js      |  2 ++
 .../main/service/reassign_controller_test.js    | 31 ++++++++++++++++++--
 .../test/mixins/wizard/wizardEnableDone_test.js | 17 +++++++++--
 9 files changed, 61 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
index 94060ba..697ed1a 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js
@@ -20,7 +20,7 @@ var App = require('app');
 
 require('controllers/main/admin/serviceAccounts_controller');
 
-App.RMHighAvailabilityWizardStep4Controller = 
App.HighAvailabilityProgressPageController.extend({
+App.RMHighAvailabilityWizardStep4Controller = 
App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
 
   name: "rMHighAvailabilityWizardStep4Controller",
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/app/controllers/main/service/reassign/step4_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step4_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
index e62a6f2..dffdf9e 100644
--- a/ambari-web/app/controllers/main/service/reassign/step4_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step4_controller.js
@@ -18,7 +18,9 @@
 
 var App = require('app');
 
-App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageController.extend({
+App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
+
+  name: "reassignMasterWizardStep4Controller",
 
   commands: [
     'stopRequiredServices',
@@ -1000,7 +1002,6 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
 
   testDBConnection: function() {
     this.prepareDBCheckAction();
-    // this.onTaskCompleted();
   },
 
   isComponentWithDB: function() {
@@ -1084,8 +1085,6 @@ App.ReassignMasterWizardStep4Controller = 
App.HighAvailabilityProgressPageContro
   }.property('dbProperty'),
 
   prepareDBCheckAction: function() {
-    var ambariProperties = null;
-    var properties = this.get('content.serviceProperties');
     var params = this.get('preparedDBProperties');
 
     ambariProperties = App.router.get('clusterController.ambariProperties');

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/app/controllers/main/service/reassign/step5_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step5_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step5_controller.js
index 5e65e61..33d8064 100644
--- a/ambari-web/app/controllers/main/service/reassign/step5_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step5_controller.js
@@ -19,5 +19,5 @@
 var App = require('app');
 
 App.ReassignMasterWizardStep5Controller = Em.Controller.extend({
-
+  name: "reassignMasterWizardStep5Controller"
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/app/controllers/main/service/reassign/step6_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/service/reassign/step6_controller.js 
b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
index b16e2aa..67fa99e 100644
--- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
@@ -20,6 +20,8 @@ var App = require('app');
 
 App.ReassignMasterWizardStep6Controller = 
App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
 
+  name: "reassignMasterWizardStep2Controller",
+
   commands: ['stopMysqlService', 'putHostComponentsInMaintenanceMode', 
'deleteHostComponents', 'startAllServices'],
 
   clusterDeployState: 'REASSIGN_MASTER_INSTALLING',

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/app/controllers/main/service/reassign_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/reassign_controller.js 
b/ambari-web/app/controllers/main/service/reassign_controller.js
index 762aad8..d3d81e9 100644
--- a/ambari-web/app/controllers/main/service/reassign_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign_controller.js
@@ -23,7 +23,7 @@ App.ReassignMasterController = App.WizardController.extend({
 
   name: 'reassignMasterController',
 
-  totalSteps: 7,
+  totalSteps: 6,
 
   /**
    * Used for hiding back button in wizard
@@ -80,7 +80,9 @@ App.ReassignMasterController = App.WizardController.extend({
   ],
 
   addManualSteps: function () {
-    this.set('content.hasManualSteps', 
this.get('content.componentsWithManualCommands').contains(this.get('content.reassign.component_name')));
+    var hasManualSteps = 
this.get('content.componentsWithManualCommands').contains(this.get('content.reassign.component_name'));
+    this.set('content.hasManualSteps', hasManualSteps);
+    this.set('totalSteps', hasManualSteps ? 6 : 4);
   }.observes('content.reassign.component_name'),
 
   addCheckDBStep: function () {
@@ -234,6 +236,7 @@ App.ReassignMasterController = App.WizardController.extend({
         var manual = 
App.router.reassignMasterController.get('content.componentsWithManualCommands').without('OOZIE_SERVER');
         App.router.reassignMasterController.set('content.hasManualSteps', 
false);
         
App.router.reassignMasterController.set('content.componentsWithManualCommands', 
manual);
+        this.set('totalSteps', 4);
       }
     }
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/app/mixins/wizard/wizardEnableDone.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardEnableDone.js 
b/ambari-web/app/mixins/wizard/wizardEnableDone.js
index 1e4e175..b4f60ee 100644
--- a/ambari-web/app/mixins/wizard/wizardEnableDone.js
+++ b/ambari-web/app/mixins/wizard/wizardEnableDone.js
@@ -25,11 +25,10 @@ var App = require('app');
  */
 App.WizardEnableDone = Em.Mixin.create({
   statusChangeCallback: function (data) {
+    var wizardController = App.router.get(this.get('content.controllerName'));
     this._super(data);
-    if (this.get('tasks.lastObject.id') === this.get('currentTaskId')) {
-      if (this.get('tasks.lastObject.status') === 'FAILED') {
-        this.set('isSubmitDisabled', false);
-      }
+    if (wizardController.get('totalSteps') == 
wizardController.get('currentStep') && this.get('tasks.lastObject.status') === 
'FAILED') {
+      this.set('isSubmitDisabled', false);
     }
   }
 });
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/app/mixins/wizard/wizardProgressPageController.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js 
b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
index e0440c4..f2af630 100644
--- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js
+++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js
@@ -290,6 +290,8 @@ App.wizardProgressPageControllerMixin = 
Em.Mixin.create(App.InstallComponent, {
     var task = this.get('tasks').findProperty('status', 'FAILED');
     task.set('showRetry', false);
     task.set('showRollback', false);
+    this.set('isSubmitDisabled', true);
+    this.set('isBackButtonDisabled', true);
     task.set('status', 'PENDING');
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/test/controllers/main/service/reassign_controller_test.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/test/controllers/main/service/reassign_controller_test.js 
b/ambari-web/test/controllers/main/service/reassign_controller_test.js
index 12e5f9c..1745723 100644
--- a/ambari-web/test/controllers/main/service/reassign_controller_test.js
+++ b/ambari-web/test/controllers/main/service/reassign_controller_test.js
@@ -26,8 +26,35 @@ describe('App.ReassignMasterController', function () {
   var reassignMasterController = App.ReassignMasterController.create({});
 
   describe('#totalSteps', function () {
-    it('check', function () {
-      expect(reassignMasterController.get('totalSteps')).to.equal(7);
+
+    var cases = [
+      {
+        componentName: 'ZOOKEEPER_SERVER',
+        result: 4
+      },
+      {
+        componentName: 'RESOURCE_MANAGER',
+        result: 4
+      },
+      {
+        componentName: 'OOZIE_SERVER',
+        result: 6
+      },
+      {
+        componentName: 'APP_TIMELINE_SERVER',
+        result: 6
+      },
+      {
+        componentName: 'NAMENODE',
+        result: 6
+      }
+    ];
+
+    cases.forEach(function (c) {
+      it('check ' + c.componentName, function () {
+        reassignMasterController.set('content.reassign', {'component_name': 
c.componentName});
+        expect(reassignMasterController.get('totalSteps')).to.equal(c.result);
+      });
     });
   });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/314cbf98/ambari-web/test/mixins/wizard/wizardEnableDone_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/wizard/wizardEnableDone_test.js 
b/ambari-web/test/mixins/wizard/wizardEnableDone_test.js
index 801a516..a3f09fc 100644
--- a/ambari-web/test/mixins/wizard/wizardEnableDone_test.js
+++ b/ambari-web/test/mixins/wizard/wizardEnableDone_test.js
@@ -27,9 +27,22 @@ describe('App.WizardEnableDone', function () {
       mixedObject = baseObject.extend(App.WizardEnableDone);
   beforeEach(function () {
     mixedObjectInstance = mixedObject.create({
-      tasks: [{id: 77, status: 'FAILED'}],
-      currentTaskId: 77
+      tasks: [{status: 'COMPLETED'}, {status: 'FAILED'}],
+      content: Em.Object.create({
+        controllerName: 'wizardControllerName'
+      })
     });
+    sinon.stub(App.router, 'get', function () {
+          return Em.Object.create({
+            totalSteps: 6,
+            currentStep: 6
+          });
+        }
+    );
+  });
+
+  afterEach(function () {
+    App.router.get.restore();
   });
 
   it('#statusChangeCallback should enable done/complete button', function () {

Reply via email to