ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jai...@apache.org
Subject git commit: AMBARI-6783. Add service wizard -> Assign Slave and Client page: Change selection/display criteria for headers. (jaimin)
Date Fri, 08 Aug 2014 00:09:44 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b13bb71dc -> f1273f29d


AMBARI-6783. Add service wizard -> Assign Slave and Client page: Change selection/display
criteria for headers. (jaimin)


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

Branch: refs/heads/trunk
Commit: f1273f29d4eace2e3a33a2288cce5283e666d11f
Parents: b13bb71
Author: Jaimin Jetly <jaimin@hortonworks.com>
Authored: Thu Aug 7 17:09:26 2014 -0700
Committer: Jaimin Jetly <jaimin@hortonworks.com>
Committed: Thu Aug 7 17:09:26 2014 -0700

----------------------------------------------------------------------
 .../app/controllers/wizard/step6_controller.js  | 34 +++++++++++++-------
 ambari-web/app/messages.js                      |  3 +-
 ambari-web/app/styles/application.less          |  6 ++++
 ambari-web/app/templates/wizard/step6.hbs       |  2 +-
 ambari-web/app/views/wizard/step6_view.js       |  6 ++--
 5 files changed, 34 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f1273f29/ambari-web/app/controllers/wizard/step6_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js
index 10fb6ba..960dc68 100644
--- a/ambari-web/app/controllers/wizard/step6_controller.js
+++ b/ambari-web/app/controllers/wizard/step6_controller.js
@@ -231,19 +231,21 @@ App.WizardStep6Controller = Em.Controller.extend({
             label: serviceComponent.get('displayName'),
             allChecked: false,
             isRequired: serviceComponent.get('isRequired'),
-            noChecked: true
+            noChecked: true,
+            isDisabled: installedServices.someProperty('serviceName',stackService.get('serviceName'))
           }));
         }
       }, this);
     }, this);
-
-    headers.pushObject(Em.Object.create({
-      name: 'CLIENT',
-      label: App.format.role('CLIENT'),
-      allChecked: false,
-      noChecked: true
-    }));
-
+    if (this.get('content.clients') && !!this.get('content.clients').length) {
+      headers.pushObject(Em.Object.create({
+        name: 'CLIENT',
+        label: App.format.role('CLIENT'),
+        allChecked: false,
+        noChecked: true,
+        isDisabled: false
+      }));
+    }
     this.get('headers').pushObjects(headers);
 
     this.render();
@@ -299,7 +301,8 @@ App.WizardStep6Controller = Em.Controller.extend({
           component: header.name,
           title: header.label,
           checked: false,
-          isInstalled: false
+          isInstalled: false,
+          isDisabled: header.get('isDisabled')
         }));
       });
 
@@ -327,6 +330,7 @@ App.WizardStep6Controller = Em.Controller.extend({
    */
   renderSlaves: function (hostsObj) {
     var headers = this.get('headers');
+    var clientHeaders = headers.findProperty('name', 'CLIENT');
     var slaveComponents = this.get('content.slaveComponentHosts');
     if (!slaveComponents) { // we are at this page for the first time
       if (!App.supports.serverRecommendValidate) {
@@ -334,7 +338,9 @@ App.WizardStep6Controller = Em.Controller.extend({
           var checkboxes = host.get('checkboxes');
           checkboxes.setEach('checked', !host.hasMaster);
           checkboxes.setEach('isInstalled', false);
-          checkboxes.findProperty('title', headers.findProperty('name', 'CLIENT').get('label')).set('checked',
false);
+          if (clientHeaders) {
+            checkboxes.findProperty('title', clientHeaders.get('label')).set('checked', false);
+          }
         });
         this.selectClientHost(hostsObj);
 
@@ -399,6 +405,10 @@ App.WizardStep6Controller = Em.Controller.extend({
    */
   selectClientHost: function (hostsObj) {
     var headers = this.get('headers');
+    var clientHeaders = headers.findProperty('name', 'CLIENT');
+    if (!clientHeaders) {
+      return;
+    }
     var client_is_set = false;
     hostsObj.forEach(function (host) {
       if (!client_is_set) {
@@ -407,7 +417,7 @@ App.WizardStep6Controller = Em.Controller.extend({
         var checkboxServiceComponent = checkboxes.findProperty('title', headers.findProperty('name',
dfsService.get('serviceComponents').
           findProperty('isShownOnInstallerSlaveClientPage').get('componentName')).get('label'));
         if (checkboxServiceComponent && checkboxServiceComponent.get('checked'))
{
-          checkboxes.findProperty('title', headers.findProperty('name', 'CLIENT').get('label')).set('checked',
true);
+          checkboxes.findProperty('title', clientHeaders.get('label')).set('checked', true);
           client_is_set = true;
         }
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1273f29/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 7f134f6..417ddc7 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -609,7 +609,8 @@ Em.I18n.translations = {
   'installer.step5.hiveGroup':'HiveServer2, WebHCat Server, MySQL Server',
 
   '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>.
<br/>&quot;Client&quot; will install ',
+  '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>.',
+  'installer.step6.body.clientText': ' <br/>&quot;Client&quot; will install
',
   'installer.step6.error.mustSelectOne':'You must assign at least one host to each component.',
   'installer.step6.error.mustSelectOneForHost':'You must assign at least one slave/client
component to each.',
   'installer.step6.error.mustSelectComponents': 'You must assign at least: {0}',

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1273f29/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 4a4a5ae..6446985 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -798,6 +798,12 @@ h1 {
     }
   }
   #step6 {
+    a.remove-link {
+      text-decoration:none;
+      pointer-events: none;
+      color:black;
+      cursor: default;
+    }
     .pre-scrollable {
       max-height: 440px;
       position: relative;

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1273f29/ambari-web/app/templates/wizard/step6.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step6.hbs b/ambari-web/app/templates/wizard/step6.hbs
index b27f721..c9d600c 100644
--- a/ambari-web/app/templates/wizard/step6.hbs
+++ b/ambari-web/app/templates/wizard/step6.hbs
@@ -54,7 +54,7 @@
             {{#each checkbox in host.checkboxes}}
               <td>
                 <label class="checkbox">
-                  <input {{bindAttr checked = "checkbox.checked" disabled="checkbox.isInstalled"}}
{{action "checkboxClick" checkbox target="view" }}
+                  <input {{bindAttr checked = "checkbox.checked" disabled="checkbox.isDisabled"}}
{{action "checkboxClick" checkbox target="view" }}
                           type="checkbox"/>{{checkbox.title}}
                 </label>
               </td>

http://git-wip-us.apache.org/repos/asf/ambari/blob/f1273f29/ambari-web/app/views/wizard/step6_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/wizard/step6_view.js b/ambari-web/app/views/wizard/step6_view.js
index c700565..1a32bc6 100644
--- a/ambari-web/app/views/wizard/step6_view.js
+++ b/ambari-web/app/views/wizard/step6_view.js
@@ -65,13 +65,13 @@ App.WizardStep6View = App.TableView.extend({
    * @method setLabel
    */
   setLabel: function () {
-    var label = Em.I18n.t('installer.step6.body');
     var clients = this.get('controller.content.clients');
+    var label = !!clients.length ? Em.I18n.t('installer.step6.body') +  Em.I18n.t('installer.step6.body.clientText')
: Em.I18n.t('installer.step6.body');
+
     clients.forEach(function (_client) {
       if (clients.length === 1) {
         label = label + ' ' + _client.display_name;
-      }
-      else {
+      } else {
         if (_client !== clients[clients.length - 1]) {           // [clients.length - 1]
           label = label + ' ' + _client.display_name;
           if (_client !== clients[clients.length - 2]) {


Mime
View raw message