Repository: ambari
Updated Branches:
  refs/heads/trunk e1d4d9766 -> 0ae915896


AMBARI-9969. Complete button to be enabled even if Start Services fails in Move 
Master,Disable Security and Enable HA wizard (alexantonenko)


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

Branch: refs/heads/trunk
Commit: 0ae91589651c0ad383c1c36cd143239e1026519a
Parents: e1d4d97
Author: Alex Antonenko <[email protected]>
Authored: Sat Mar 7 13:02:44 2015 +0200
Committer: Alex Antonenko <[email protected]>
Committed: Sat Mar 7 17:05:40 2015 +0200

----------------------------------------------------------------------
 ambari-web/app/assets/test/tests.js             |  1 +
 .../nameNode/step9_controller.js                |  2 +-
 .../main/admin/kerberos/disable_controller.js   |  2 +-
 .../main/service/reassign/step6_controller.js   |  2 +-
 ambari-web/app/mixins.js                        |  1 +
 .../app/mixins/wizard/wizardEnableDone.js       | 35 ++++++++++++++++++
 .../test/mixins/wizard/wizardEnableDone_test.js | 39 ++++++++++++++++++++
 7 files changed, 79 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae91589/ambari-web/app/assets/test/tests.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/test/tests.js 
b/ambari-web/app/assets/test/tests.js
index e6f6264..ffc3856 100644
--- a/ambari-web/app/assets/test/tests.js
+++ b/ambari-web/app/assets/test/tests.js
@@ -139,6 +139,7 @@ var files = ['test/init_model_test',
   'test/mixins/wizard/addSeccurityConfigs_test',
   'test/mixins/wizard/wizard_menu_view_test',
   'test/mixins/wizard/wizardProgressPageController_test',
+  'test/mixins/wizard/wizardEnableDone_test',
   'test/utils/ajax/ajax_test',
   'test/utils/ajax/ajax_queue_test',
   'test/utils/batch_scheduled_requests_test',

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae91589/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
index d4d5328..721e65b 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step9_controller.js
@@ -18,7 +18,7 @@
 
 var App = require('app');
 
-App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageController.extend({
+App.HighAvailabilityWizardStep9Controller = 
App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
 
   name:"highAvailabilityWizardStep9Controller",
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae91589/ambari-web/app/controllers/main/admin/kerberos/disable_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/admin/kerberos/disable_controller.js 
b/ambari-web/app/controllers/main/admin/kerberos/disable_controller.js
index ff2bf86..8df1f4f 100644
--- a/ambari-web/app/controllers/main/admin/kerberos/disable_controller.js
+++ b/ambari-web/app/controllers/main/admin/kerberos/disable_controller.js
@@ -20,7 +20,7 @@ var App = require('app');
 require('controllers/main/admin/kerberos/progress_controller');
 require('controllers/main/admin/security/security_progress_controller');
 
-App.KerberosDisableController = App.KerberosProgressPageController.extend({
+App.KerberosDisableController = 
App.KerberosProgressPageController.extend(App.WizardEnableDone, {
 
   name: 'kerberosDisableController',
   clusterDeployState: 'DEFAULT',

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae91589/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 a038fbe..e3cdab7 100644
--- a/ambari-web/app/controllers/main/service/reassign/step6_controller.js
+++ b/ambari-web/app/controllers/main/service/reassign/step6_controller.js
@@ -18,7 +18,7 @@
 
 var App = require('app');
 
-App.ReassignMasterWizardStep6Controller = 
App.HighAvailabilityProgressPageController.extend({
+App.ReassignMasterWizardStep6Controller = 
App.HighAvailabilityProgressPageController.extend(App.WizardEnableDone, {
 
   isReassign: true,
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae91589/ambari-web/app/mixins.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins.js b/ambari-web/app/mixins.js
index c17e58c..6f12edf 100644
--- a/ambari-web/app/mixins.js
+++ b/ambari-web/app/mixins.js
@@ -31,6 +31,7 @@ require('mixins/wizard/wizardProgressPageController');
 require('mixins/wizard/wizardDeployProgressController');
 require('mixins/wizard/wizardProgressPageView');
 require('mixins/wizard/wizardDeployProgressView');
+require('mixins/wizard/wizardEnableDone');
 require('mixins/wizard/selectHost');
 require('mixins/wizard/addSecurityConfigs');
 require('mixins/wizard/wizard_menu_view');

http://git-wip-us.apache.org/repos/asf/ambari/blob/0ae91589/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
new file mode 100644
index 0000000..1e4e175
--- /dev/null
+++ b/ambari-web/app/mixins/wizard/wizardEnableDone.js
@@ -0,0 +1,35 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+/**
+ * Mixin for wizard controller for enabling done/complete buttons if last task 
fails
+ * This should
+ * @type {Ember.Mixin}
+ */
+App.WizardEnableDone = Em.Mixin.create({
+  statusChangeCallback: function (data) {
+    this._super(data);
+    if (this.get('tasks.lastObject.id') === this.get('currentTaskId')) {
+      if (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/0ae91589/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
new file mode 100644
index 0000000..801a516
--- /dev/null
+++ b/ambari-web/test/mixins/wizard/wizardEnableDone_test.js
@@ -0,0 +1,39 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+var App = require('app');
+
+describe('App.WizardEnableDone', function () {
+  var baseObject = Em.Object.extend({
+        statusChangeCallback: function (data) {
+          isSubmitDisabled: true
+        }
+      }),
+      mixedObject = baseObject.extend(App.WizardEnableDone);
+  beforeEach(function () {
+    mixedObjectInstance = mixedObject.create({
+      tasks: [{id: 77, status: 'FAILED'}],
+      currentTaskId: 77
+    });
+  });
+
+  it('#statusChangeCallback should enable done/complete button', function () {
+    mixedObjectInstance.statusChangeCallback();
+    expect(mixedObjectInstance.isSubmitDisabled).to.be.false;
+  });
+});
\ No newline at end of file

Reply via email to