Repository: ambari
Updated Branches:
  refs/heads/trunk 23e080aba -> 878dc6ac7


AMBARI-21985. Option to skip Host Check during the host add wizard. (Ishan via 
Jaimin)


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

Branch: refs/heads/trunk
Commit: 878dc6ac72b9d5d87a5f6c21991290886459eede
Parents: 23e080a
Author: Jaimin Jetly <[email protected]>
Authored: Tue Sep 19 18:54:00 2017 -0700
Committer: Jaimin Jetly <[email protected]>
Committed: Tue Sep 19 18:54:00 2017 -0700

----------------------------------------------------------------------
 ambari-web/app/config.js                        |  1 -
 .../app/controllers/wizard/step2_controller.js  |  4 +++-
 ambari-web/app/messages.js                      |  3 +++
 .../main/host/details/actions/check_host.js     |  4 ++--
 ambari-web/app/templates/wizard/step2.hbs       |  5 +++++
 ambari-web/app/views/wizard/step2_view.js       | 21 ++++++++++++++++++++
 6 files changed, 34 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/878dc6ac/ambari-web/app/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/config.js b/ambari-web/app/config.js
index b87b36f..0963f70 100644
--- a/ambari-web/app/config.js
+++ b/ambari-web/app/config.js
@@ -67,7 +67,6 @@ App.enableDigitalClock = false;
 App.enableExperimental = false;
 
 App.supports = {
-  disableHostCheckOnAddHostWizard: false,
   preUpgradeCheck: true,
   displayOlderVersions: false,
   autoRollbackHA: false,

http://git-wip-us.apache.org/repos/asf/ambari/blob/878dc6ac/ambari-web/app/controllers/wizard/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step2_controller.js 
b/ambari-web/app/controllers/wizard/step2_controller.js
index 7bbb2dd..05813e2 100644
--- a/ambari-web/app/controllers/wizard/step2_controller.js
+++ b/ambari-web/app/controllers/wizard/step2_controller.js
@@ -557,6 +557,8 @@ App.WizardStep2Controller = Em.Controller.extend({
 
     this.set('content.hosts', $.extend(hosts, this.getHostInfo()));
     this.setAmbariJavaHome();
-  }
+  },
+
+  isAddHostWizard: Em.computed.equal('content.controllerName', 
'addHostController')
 
 });

http://git-wip-us.apache.org/repos/asf/ambari/blob/878dc6ac/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 3d4924e..113fb8f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -733,6 +733,9 @@ Em.I18n.translations = {
   'installer.step2.bootStrap.error':'Errors were encountered while setting up 
Ambari Agents on the hosts.',
   'installer.step2.bootStrap.inProgress':'Please wait while Ambari Agents are 
being set up on the hosts. This can take several minutes depending on the 
number of hosts.',
   'installer.step2.bootStrap.header':'Setting Up Ambari Agents',
+  'installer.step2.skipHostChecks.label': 'Skip host checks',
+  'installer.step2.skipHostChecks.popup.header': 'Warning',
+  'installer.step2.skipHostChecks.popup.body': 'By skipping host checks, 
Ambari will not check and warn if any issues with the host are identified and 
the host will be added to the cluster as is.',
 
   'installer.step3.header':'Confirm Hosts',
   'installer.step3.body':'Registering your hosts.<br>' +

http://git-wip-us.apache.org/repos/asf/ambari/blob/878dc6ac/ambari-web/app/mixins/main/host/details/actions/check_host.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/main/host/details/actions/check_host.js 
b/ambari-web/app/mixins/main/host/details/actions/check_host.js
index 80f4f03..2e2e021 100644
--- a/ambari-web/app/mixins/main/host/details/actions/check_host.js
+++ b/ambari-web/app/mixins/main/host/details/actions/check_host.js
@@ -115,8 +115,8 @@ App.CheckHostMixin = Em.Mixin.create({
    * disables host check on Add host wizard as per the experimental flag
    */
   disableHostCheck: function () {
-    return App.get('supports.disableHostCheckOnAddHostWizard') && 
this.get('isAddHostWizard');
-  }.property('App.supports.disableHostCheckOnAddHostWizard', 
'isAddHostWizard'),
+    return this.get('content.installOptions.skipHostChecks') && 
this.get('isAddHostWizard');
+  }.property('content.installOptions.skipHostChecks', 'isAddHostWizard'),
 
   /**
    * send request to create tasks for performing hosts checks

http://git-wip-us.apache.org/repos/asf/ambari/blob/878dc6ac/ambari-web/app/templates/wizard/step2.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step2.hbs 
b/ambari-web/app/templates/wizard/step2.hbs
index 836029f..167246a 100644
--- a/ambari-web/app/templates/wizard/step2.hbs
+++ b/ambari-web/app/templates/wizard/step2.hbs
@@ -184,6 +184,11 @@
           </div>
         {{/if}}
       </div>
+      {{#if isAddHostWizard}}
+        <br>
+        {{view view.skipHostsCheckBox 
checkedBinding="content.installOptions.skipHostChecks"}}
+        {{t installer.step2.skipHostChecks.label}}
+      {{/if}}
     </div>
   </div>
 </div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/878dc6ac/ambari-web/app/views/wizard/step2_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step2_view.js 
b/ambari-web/app/views/wizard/step2_view.js
index 03c474f..6bbda30 100644
--- a/ambari-web/app/views/wizard/step2_view.js
+++ b/ambari-web/app/views/wizard/step2_view.js
@@ -108,6 +108,27 @@ App.WizardStep2View = Em.View.extend({
   }),
 
   /**
+   * Checkbox to skip Host Checks
+   * @type {App.CheckboxView}
+   */
+  skipHostsCheckBox: App.CheckboxView.extend({
+    classNames: ['display-inline-block'],
+    classNameBindings: ['containerClassName'],
+    containerClassName: 'checkbox',
+
+    showConfirmPopup: function() {
+      if(this.get('controller.content.installOptions.skipHostChecks')) {
+        App.ModalPopup.show({
+          header: Em.I18n.t('installer.step2.skipHostChecks.popup.header'),
+          body: Em.I18n.t('installer.step2.skipHostChecks.popup.body'),
+          primary: Em.I18n.t('ok'),
+          secondary: false
+        });
+      }
+    }.observes('controller.content.installOptions.skipHostChecks')
+  }),
+
+  /**
    * Textarea with ssh-key
    * @type {Ember.TextField}
    */

Reply via email to