Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-22008 bd5320232 -> 72f2a100b


AMBARI-22507. Ambari UI changes to support Isilon OneFS (amagyar)


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

Branch: refs/heads/branch-feature-AMBARI-22008
Commit: 72f2a100bedc1523ff1d7ecb4a60cf5bad7858a5
Parents: bd53202
Author: Attila Magyar <amag...@hortonworks.com>
Authored: Tue Nov 28 22:05:49 2017 +0100
Committer: Attila Magyar <amag...@hortonworks.com>
Committed: Tue Nov 28 22:05:49 2017 +0100

----------------------------------------------------------------------
 .../app/controllers/wizard/step4_controller.js  | 13 ++++-
 ambari-web/app/mappers/stack_service_mapper.js  |  3 +
 ambari-web/app/messages.js                      |  2 +
 ambari-web/app/models/stack_service.js          | 17 ++++++
 ambari-web/app/templates/wizard/step4.hbs       | 58 ++++++++++++++++----
 .../test/controllers/wizard/step4_test.js       | 29 +++++++++-
 6 files changed, 107 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/72f2a100/ambari-web/app/controllers/wizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step4_controller.js 
b/ambari-web/app/controllers/wizard/step4_controller.js
index 8a62f3b..9defa12 100644
--- a/ambari-web/app/controllers/wizard/step4_controller.js
+++ b/ambari-web/app/controllers/wizard/step4_controller.js
@@ -34,11 +34,12 @@ App.WizardStep4Controller = Em.ArrayController.extend({
    */
   isAllChecked: function(key, value) {
     if (arguments.length > 1) {
-      this.filterProperty('isDisabled', false).setEach('isSelected', value);
+      this.filterProperty('isDisabled', false).filterProperty('isDFS', 
false).setEach('isSelected', value);
       return value;
     }
     return this.filterProperty('isInstalled', false).
       filterProperty('isHiddenOnSelectServicePage', false).
+      filterProperty('isDFS', false).
       everyProperty('isSelected', true);
   }.property('@each.isSelected'),
 
@@ -59,6 +60,16 @@ App.WizardStep4Controller = Em.ArrayController.extend({
   errorStack: [],
 
   /**
+   * Services which are HDFS compatible
+   */
+  fileSystems: function() {
+    var fileSystems = this.filterProperty('isDFS', true);;
+    return fileSystems.map(function(fs) {
+      return App.FileSystem.create({content: fs, services: fileSystems});
+    });
+  }.property('@each.isDFS'),
+
+  /**
    * Drop errorStack content on selected state changes.
    */
   clearErrors: function() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/72f2a100/ambari-web/app/mappers/stack_service_mapper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mappers/stack_service_mapper.js 
b/ambari-web/app/mappers/stack_service_mapper.js
index f49b4d0..368a182 100644
--- a/ambari-web/app/mappers/stack_service_mapper.js
+++ b/ambari-web/app/mappers/stack_service_mapper.js
@@ -119,6 +119,9 @@ App.stackServiceMapper = App.QuickDataMapper.create({
         stackService.is_installable = false;
         stackService.is_selected = false;
       }
+      if (stackService.service_type === 'HCFS' && stackService.service_name 
!== 'HDFS') {
+        stackService.is_selected = false;
+      }
       if(stackService.selection === "MANDATORY") {
         stackService.is_mandatory = true;
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/72f2a100/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index 9ca51de..a69258a 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -874,6 +874,8 @@ Em.I18n.translations = {
 
   'installer.step4.header':'Choose Services',
   'installer.step4.body':'Choose which services you want to install on your 
cluster.',
+  'installer.step4.headerFS':'Choose File System',
+  'installer.step4.bodyFS':'Choose which file system you want to install on 
your cluster.',
   'installer.step4.fsCheck.popup.header':'File System Required',
   'installer.step4.fsCheck.popup.body':'You did not select a File System but 
one is required. We will automatically add {0}. Is this OK?',
   'installer.step4.multipleDFS.popup.header':'Multiple File Systems Selected',

http://git-wip-us.apache.org/repos/asf/ambari/blob/72f2a100/ambari-web/app/models/stack_service.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/stack_service.js 
b/ambari-web/app/models/stack_service.js
index a84816e..1b583c1 100644
--- a/ambari-web/app/models/stack_service.js
+++ b/ambari-web/app/models/stack_service.js
@@ -71,6 +71,23 @@ var MissingDependency = Ember.Object.extend({
   })
 });
 
+App.FileSystem = Ember.ObjectProxy.extend({
+  content: null,
+  services: [],
+
+  isSelected: function(key, aBoolean) {
+    if (arguments.length > 1) {
+      this.clearAllSelection();
+      this.get('content').set('isSelected', aBoolean);
+    }
+    return this.get('content.isSelected');
+  }.property('content.isSelected', 'services.@each.isSelected'),
+
+  clearAllSelection: function() {
+    this.get('services').setEach('isSelected', false);
+  }
+});
+
 /**
  * This model loads all services supported by the stack
  * The model maps to the  
http://hostname:8080/api/v1/stacks/HDP/versions/${versionNumber}/services?fields=StackServices/*,serviceComponents/*

http://git-wip-us.apache.org/repos/asf/ambari/blob/72f2a100/ambari-web/app/templates/wizard/step4.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/wizard/step4.hbs 
b/ambari-web/app/templates/wizard/step4.hbs
index 5a08250..b738f69 100644
--- a/ambari-web/app/templates/wizard/step4.hbs
+++ b/ambari-web/app/templates/wizard/step4.hbs
@@ -17,9 +17,8 @@
 }}
 
 <div id="step4" class="wizard-content col-md-9">
-  <h4 class="step-title">{{t installer.step4.header}}</h4>
-  <p class="step-description">{{t installer.step4.body}}</p>
-
+  <h4 class="step-title">{{t installer.step4.headerFS}}</h4>
+  <p class="step-description">{{t installer.step4.bodyFS}}</p>
   <div class="panel panel-default">
     <div class="panel-body">
       <table class="table table-hover">
@@ -28,23 +27,20 @@
           <th {{QAAttr "service-name-header"}} class="col-md-3">{{t 
common.service}}</th>
           <th {{QAAttr "service-version-header"}} id="service-version">{{t 
common.version}}</th>
           <th {{QAAttr "service-description-header"}} 
id="service-description">{{t common.description}}</th>
-          <th>
-            {{view App.CheckboxView data-qa="toggle-all" 
disabledBinding="isInstalled" checkedBinding="isAllChecked"}}
-          </th>
         </tr>
         </thead>
         <tbody>
-        {{#each service in controller}}
-          {{#unless isHiddenOnSelectServicePage}}
-            <tr {{QAAttr "service-row"}} {{bindAttr 
class="service.isSelected:active service.isSelected:service-selected"}} 
{{action toggleCheckBox service target="view"}}>
+        {{#each service in controller.fileSystems}}
+          {{#unless service.isHiddenOnSelectServicePage}}
+            <tr {{QAAttr "service-row"}} {{bindAttr 
class="service.isSelected:active service.isSelected:service-selected"}} 
{{action toggleCheckBox service target="view"}} >
               <td {{QAAttr 
"service-name"}}>{{service.displayNameOnSelectServicePage}}</td>
               <td {{QAAttr 
"service-version"}}>{{service.serviceVersionDisplay}}</td>
               <td {{QAAttr "service-description"}}>{{{service.comments}}}</td>
               <td>
                 <div class="checkbox">
                   {{view App.CheckboxView 
checkboxClassNamesBinding="service.serviceName" data-qa="toggle-service"
-                  disabledBinding="service.isDisabled"
-                  checkedBinding="service.isSelected"
+                         disabledBinding="service.isDisabled"
+                         checkedBinding="service.isSelected"
                   }}
                 </div>
               </td>
@@ -55,6 +51,46 @@
       </table>
     </div>
   </div>
+
+  <h4 class="step-title">{{t installer.step4.header}}</h4>
+  <p class="step-description">{{t installer.step4.body}}</p>
+
+  <div class="panel panel-default">
+    <div class="panel-body">
+      <table class="table table-hover">
+        <thead>
+        <tr>
+          <th {{QAAttr "service-name-header"}} class="col-md-3">{{t 
common.service}}</th>
+          <th {{QAAttr "service-version-header"}} id="service-version">{{t 
common.version}}</th>
+          <th {{QAAttr "service-description-header"}} 
id="service-description">{{t common.description}}</th>
+          <th>
+            {{view App.CheckboxView data-qa="toggle-all" 
disabledBinding="isInstalled" checkedBinding="isAllChecked"}}
+          </th>
+        </tr>
+        </thead>
+        <tbody>
+        {{#each service in controller}}
+          {{#unless service.isHiddenOnSelectServicePage}}
+            {{#unless service.isDFS}}
+              <tr {{QAAttr "service-row"}} {{bindAttr 
class="service.isSelected:active service.isSelected:service-selected"}} 
{{action toggleCheckBox service target="view"}}>
+                <td {{QAAttr 
"service-name"}}>{{service.displayNameOnSelectServicePage}}</td>
+                <td {{QAAttr 
"service-version"}}>{{service.serviceVersionDisplay}}</td>
+                <td {{QAAttr 
"service-description"}}>{{{service.comments}}}</td>
+                <td>
+                  <div class="checkbox">
+                    {{view App.CheckboxView 
checkboxClassNamesBinding="service.serviceName" data-qa="toggle-service"
+                        disabledBinding="service.isDisabled"
+                        checkedBinding="service.isSelected" }}
+                  </div>
+                </td>
+              </tr>
+            {{/unless}}
+          {{/unless}}
+        {{/each}}
+        </tbody>
+      </table>
+    </div>
+  </div>
 </div>
 
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/72f2a100/ambari-web/test/controllers/wizard/step4_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard/step4_test.js 
b/ambari-web/test/controllers/wizard/step4_test.js
index 1cd4863..e9942e0 100644
--- a/ambari-web/test/controllers/wizard/step4_test.js
+++ b/ambari-web/test/controllers/wizard/step4_test.js
@@ -78,18 +78,41 @@ describe('App.WizardStep4Controller', function () {
   });
 
   describe('#isAllChecked', function () {
-    it('should return true if all services are selected', function () {
+    it('should return true if all non DFS services are selected', function () {
       controller.setEach('isInstalled', false);
-      controller.findProperty('serviceName', 'HDFS').set('isSelected', true);
+      controller.findProperty('serviceName', 'YARN').set('isSelected', true);
+      controller.findProperty('serviceName', 'HDFS').set('isSelected', false);
       expect(controller.get('isAllChecked')).to.equal(true);
     });
 
     it('should return false if at least one service is not selected', function 
() {
-      controller.findProperty('serviceName', 'HDFS').set('isSelected', false);
+      controller.findProperty('serviceName', 'YARN').set('isSelected', false);
       expect(controller.get('isAllChecked')).to.equal(false);
     });
   });
 
+  describe('#fileSystems', function () {
+    beforeEach(function () {
+      controller.clear();
+      controller.set('content', generateSelectedServicesContent(['HDFS', 
'GLUSTERFS', 'YARN']));
+    });
+
+    it('returns only DFS services', function () {
+      expect(controller.get('fileSystems')).to.have.length(2);
+      
expect(controller.get('fileSystems').mapProperty('serviceName')).to.contain('GLUSTERFS');
+      
expect(controller.get('fileSystems').mapProperty('serviceName')).to.contain('HDFS');
+    });
+
+    it('allows selecting only one DFS at a time', function () {
+      var fileSystems = controller.get('fileSystems');
+      fileSystems[0].set('isSelected', true);
+      expect(fileSystems[0].get('isSelected')).to.equal(true);
+      expect(fileSystems[1].get('isSelected')).to.equal(false);
+      fileSystems[1].set('isSelected', true);
+      expect(fileSystems[0].get('isSelected')).to.equal(false);
+      expect(fileSystems[1].get('isSelected')).to.equal(true);
+    });
+  });
   describe('#multipleDFSs()', function () {
     it('should return true if HDFS is selected and GLUSTERFS is selected', 
function () {
       controller.set('content', generateSelectedServicesContent(['HDFS', 
'GLUSTERFS']));

Reply via email to