You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by zh...@apache.org on 2016/03/31 20:37:23 UTC

ambari git commit: AMBARI-15610 Add Service Wizard: invalid host name doesn't prevent proceeding to next page (zhewang)

Repository: ambari
Updated Branches:
  refs/heads/trunk 1fbc106b8 -> 354b0a975


AMBARI-15610 Add Service Wizard: invalid host name doesn't prevent proceeding to next page (zhewang)


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

Branch: refs/heads/trunk
Commit: 354b0a9756f24d2dcbbaa7c4867e95cfd4c03471
Parents: 1fbc106
Author: Zhe (Joe) Wang <zh...@apache.org>
Authored: Thu Mar 31 11:36:15 2016 -0700
Committer: Zhe (Joe) Wang <zh...@apache.org>
Committed: Thu Mar 31 11:36:15 2016 -0700

----------------------------------------------------------------------
 ambari-web/app/messages.js                                |  1 +
 ambari-web/app/mixins/wizard/assign_master_components.js  | 10 ++++++++--
 .../app/views/common/assign_master_components_view.js     |  3 +++
 3 files changed, 12 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/354b0a97/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 15dbb7e..1b2a02f 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -796,6 +796,7 @@ Em.I18n.translations = {
   'installer.step5.hiveGroup':'HiveServer2, WebHCat Server, MySQL Server',
   'installer.step5.validationIssuesAttention.header': 'Validation Issues',
   'installer.step5.validationIssuesAttention': 'Master component assignments have issues that need attention.',
+  'installer.step5.error.host.invalid': 'The host you choose could (1) have an invalid host name; (2) be conflicting with another selection; or (3) be in maintenance mode',
 
   'installer.step6.header':'Assign Slaves and Clients',
   'installer.step6.body':'Assign slave and client components to hosts you want to run them on.<br/>Hosts that are assigned master components are shown with <i class=icon-asterisks>&#10037;</i>.',

http://git-wip-us.apache.org/repos/asf/ambari/blob/354b0a97/ambari-web/app/mixins/wizard/assign_master_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js b/ambari-web/app/mixins/wizard/assign_master_components.js
index 93ecac3..b78daf9 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -997,9 +997,12 @@ App.AssignMasterComponents = Em.Mixin.create({
     if (componentName) {
       if (serviceComponentId) {
         component = this.get('selectedServicesMasters').filterProperty('component_name', componentName).findProperty("serviceComponentId", serviceComponentId);
-        if (component) component.set("isHostNameValid", flag);
       } else {
-        this.get('selectedServicesMasters').findProperty("component_name", componentName).set("isHostNameValid", flag);
+        component = this.get('selectedServicesMasters').findProperty("component_name", componentName);
+      }
+      if (component) {
+        component.set("isHostNameValid", flag);
+        component.set("errorMessage", flag ? '' : Em.I18n.t('installer.step5.error.host.invalid'));
       }
     }
   },
@@ -1143,6 +1146,9 @@ App.AssignMasterComponents = Em.Mixin.create({
    */
   submit: function () {
     var self = this;
+    if (this.get('submitDisabled')) {
+      return;
+    }
     if (!this.get('submitButtonClicked') && !App.router.get('nextBtnClickInProgress')) {
       this.set('submitButtonClicked', true);
       App.router.set('nextBtnClickInProgress', true);

http://git-wip-us.apache.org/repos/asf/ambari/blob/354b0a97/ambari-web/app/views/common/assign_master_components_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/assign_master_components_view.js b/ambari-web/app/views/common/assign_master_components_view.js
index bfc674d..95ba766 100644
--- a/ambari-web/app/views/common/assign_master_components_view.js
+++ b/ambari-web/app/views/common/assign_master_components_view.js
@@ -69,10 +69,12 @@ App.InputHostView = Em.TextField.extend(App.SelectHost, {
     var host = this.get('controller.hosts').findProperty('host_name', this.get('value'));
     if (Em.isNone(host)) {
       this.get('controller').updateIsHostNameValidFlag(this.get("component.component_name"), this.get("component.serviceComponentId"), false);
+      this.get('controller').updateIsSubmitDisabled();
       return;
     }
     this.get('controller').assignHostToMaster(this.get("component.component_name"), host.get('host_name'), this.get("component.serviceComponentId"));
     this.tryTriggerRebalanceForMultipleComponents();
+    this.get('controller').updateIsSubmitDisabled();
   }.observes('controller.hostNameCheckTrigger'),
 
   didInsertElement: function () {
@@ -92,6 +94,7 @@ App.InputHostView = Em.TextField.extend(App.SelectHost, {
       self.change();
     });
     this.set('typeahead', typeahead);
+    App.popover($("[rel=popover]"), {'placement': 'right', 'trigger': 'hover'});
   },
 
   /**