ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject [7/8] ambari git commit: AMBARI-18519 - Enable Add/Remove JournalNode on NNHA Wizard Step 2 (rzang)
Date Wed, 05 Oct 2016 00:00:08 GMT
AMBARI-18519 - Enable Add/Remove JournalNode on NNHA Wizard Step 2 (rzang)


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

Branch: refs/heads/branch-feature-AMBARI-18456
Commit: a442efbde22ac635b60b5650df397fd06c147ae1
Parents: 98efb57
Author: Richard Zang <rzang@apache.org>
Authored: Tue Oct 4 14:19:55 2016 -0700
Committer: Richard Zang <rzang@apache.org>
Committed: Tue Oct 4 14:19:55 2016 -0700

----------------------------------------------------------------------
 .../nameNode/step2_controller.js                | 32 +++++++++++++++++++-
 .../admin/highAvailability/nameNode/step3.hbs   | 10 +++---
 2 files changed, 35 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a442efbd/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js
b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js
index b8d7978..435fe0f 100644
--- a/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js
+++ b/ambari-web/app/controllers/main/admin/highAvailability/nameNode/step2_controller.js
@@ -34,7 +34,37 @@ App.HighAvailabilityWizardStep2Controller = Em.Controller.extend(App.BlueprintMi
 
   showAdditionalPrefix: ['NAMENODE'],
 
-  showInstalledMastersFirst: true
+  showInstalledMastersFirst: true,
+
+  JOURNALNODES_COUNT_MINIMUM: 3, // TODO get this from stack
+  
+  renderComponents: function(masterComponents) {
+    this._super(masterComponents);
+    this.showHideJournalNodesAddRemoveControl();
+  },
+
+  addComponent: function(componentName) {
+    this._super(componentName);
+    this.showHideJournalNodesAddRemoveControl();
+  },
+
+  removeComponent: function(componentName, serviceComponentId) {
+    this._super(componentName, serviceComponentId);
+    this.showHideJournalNodesAddRemoveControl()
+  },
+
+  showHideJournalNodesAddRemoveControl: function() {
+    var masterComponents = this.get('selectedServicesMasters');
+    var jns = masterComponents.filterProperty('component_name', 'JOURNALNODE');
+    var maxNumMasters = this.getMaxNumberOfMasters('JOURNALNODE')
+    var showRemoveControl = jns.get('length') > this.get('JOURNALNODES_COUNT_MINIMUM');
+    var showAddControl = jns.get('length') < maxNumMasters;
+    jns.forEach(function(item) {
+      item.set('showAddControl', false);
+      item.set('showRemoveControl', showRemoveControl);
+    });
+    jns.set('lastObject.showAddControl', showAddControl);
+  }
 
 });
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a442efbd/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs b/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs
index 27653d3..ef2621d 100644
--- a/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs
+++ b/ambari-web/app/templates/main/admin/highAvailability/nameNode/step3.hbs
@@ -52,12 +52,10 @@
         </td>
         <td>
           <ul>
-            <li><span class="to-be-installed-green"><i
-                    class="icon-plus"></i>&nbsp;{{t admin.highAvailability.wizard.step3.toBeInstalled}}</span></li>
-            <li><span class="to-be-installed-green"><i
-                    class="icon-plus"></i>&nbsp;{{t admin.highAvailability.wizard.step3.toBeInstalled}}</span></li>
-            <li><span class="to-be-installed-green"><i
-                    class="icon-plus"></i>&nbsp;{{t admin.highAvailability.wizard.step3.toBeInstalled}}</span></li>
+              {{#each item in view.journalNodes}}
+                  <li><span class="to-be-installed-green"><i
+                          class="icon-plus"></i>&nbsp;{{t admin.highAvailability.wizard.step3.toBeInstalled}}</span></li>
+              {{/each}}
           </ul>
         </td>
       </tr>


Mime
View raw message