ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akovale...@apache.org
Subject ambari git commit: AMBARI-16684. Ranger Tagsync component (added in HDP-2.5) is shown under Summary Tab when installed HDP-2.2 (akovalenko)
Date Mon, 16 May 2016 18:51:54 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b33bebb5d -> 93a045df4


AMBARI-16684. Ranger Tagsync component (added in HDP-2.5) is shown under Summary Tab when
installed HDP-2.2 (akovalenko)


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

Branch: refs/heads/trunk
Commit: 93a045df49b48de52cbd39821e89cfd65e49d923
Parents: b33bebb
Author: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Authored: Mon May 16 19:38:14 2016 +0300
Committer: Aleksandr Kovalenko <akovalenko@hortonworks.com>
Committed: Mon May 16 19:53:06 2016 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step8_controller.js  |  2 +-
 .../templates/main/service/services/ranger.hbs  | 34 +++++++++++---------
 .../app/views/main/service/services/ranger.js   |  8 +++++
 .../views/main/service/services/ranger_test.js  | 22 +++++++++++++
 4 files changed, 49 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/93a045df/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index c0356a0..e2ba016 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -983,7 +983,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs,
App.wiz
   },
 
   createClusterSuccess: function (data, xhr, params) {
-    App.set('clusterName', params.cluster)
+    App.set('clusterName', params.cluster);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/ambari/blob/93a045df/ambari-web/app/templates/main/service/services/ranger.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/service/services/ranger.hbs b/ambari-web/app/templates/main/service/services/ranger.hbs
index 5c2c1f2..fb99453 100644
--- a/ambari-web/app/templates/main/service/services/ranger.hbs
+++ b/ambari-web/app/templates/main/service/services/ranger.hbs
@@ -19,22 +19,24 @@
 {{view view.dashboardMasterComponentView}}
 
 <!-- Ranger Tagsyncs -->
-<tr {{bindAttr class=":component view.rangerTagsyncComponent.componentName"}}>
-  <td class="summary-label">
-    <a href="#" {{action filterHosts view.rangerTagsyncComponent}}>{{t dashboard.services.ranger.rangerTagsyncs}}</a>
-  </td>
-  <td class="summary-value">
-    {{#if App.router.clusterController.isServiceContentFullyLoaded}}
-      <span>
-        {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.rangerTagsyncsStarted"
totalComponentsBinding="view.service.rangerTagsyncsTotal"}}
-          {{view.liveComponents}}/{{view.totalComponents}}
-        {{/view}}
-      </span>{{t common.started}}
-    {{else}}
-      {{t common.loading.eclipses}}
-    {{/if}}
-  </td>
-</tr>
+{{#if view.isRangerTagsyncInStack}}
+  <tr {{bindAttr class=":component view.rangerTagsyncComponent.componentName"}}>
+    <td class="summary-label">
+      <a href="#" {{action filterHosts view.rangerTagsyncComponent}}>{{t dashboard.services.ranger.rangerTagsyncs}}</a>
+    </td>
+    <td class="summary-value">
+      {{#if App.router.clusterController.isServiceContentFullyLoaded}}
+        <span>
+          {{#view App.ComponentLiveTextView liveComponentsBinding="view.service.rangerTagsyncsStarted"
totalComponentsBinding="view.service.rangerTagsyncsTotal"}}
+            {{view.liveComponents}}/{{view.totalComponents}}
+          {{/view}}
+        </span>{{t common.started}}
+      {{else}}
+        {{t common.loading.eclipses}}
+      {{/if}}
+    </td>
+  </tr>
+{{/if}}
 
 {{#each item in controller.rangerPlugins}}
   {{#if item.isDisplayed}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/93a045df/ambari-web/app/views/main/service/services/ranger.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/services/ranger.js b/ambari-web/app/views/main/service/services/ranger.js
index b33758b..3843277 100644
--- a/ambari-web/app/views/main/service/services/ranger.js
+++ b/ambari-web/app/views/main/service/services/ranger.js
@@ -27,6 +27,14 @@ App.MainDashboardServiceRangerView = App.MainDashboardServiceView.extend({
     componentName: 'RANGER_TAGSYNC'
   }),
 
+  /**
+   * Define if RANGER_TAGSYNC is present in the installed stack
+   * @type {Boolean}
+   */
+  isRangerTagsyncInStack: function () {
+    return App.StackServiceComponent.find().someProperty('componentName', 'RANGER_TAGSYNC');
+  }.property(),
+
   didInsertElement: function () {
     this.set('controller.isRangerUpdateWorking', true);
     App.updater.run(this.get('controller'), 'updateRangerPluginsStatus', 'isRangerUpdateWorking',
App.bgOperationsUpdateInterval);

http://git-wip-us.apache.org/repos/asf/ambari/blob/93a045df/ambari-web/test/views/main/service/services/ranger_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/service/services/ranger_test.js b/ambari-web/test/views/main/service/services/ranger_test.js
index a7c683f..daea5e0 100644
--- a/ambari-web/test/views/main/service/services/ranger_test.js
+++ b/ambari-web/test/views/main/service/services/ranger_test.js
@@ -45,4 +45,26 @@ describe('App.MainDashboardServiceRangerView', function () {
     });
   });
 
+  describe("#isRangerTagsyncInStack", function() {
+
+    beforeEach(function() {
+      this.mock = sinon.stub(App.StackServiceComponent, 'find');
+    });
+    afterEach(function() {
+      this.mock.restore();
+    });
+
+    it("no RANGER_TAGSYNC component", function() {
+      this.mock.returns([]);
+      view.propertyDidChange('isRangerTagsyncInStack');
+      expect(view.get('isRangerTagsyncInStack')).to.be.false;
+    });
+
+    it("NFS_GATEWAY component present", function() {
+      this.mock.returns([{componentName: 'RANGER_TAGSYNC'}]);
+      view.propertyDidChange('isRangerTagsyncInStack');
+      expect(view.get('isRangerTagsyncInStack')).to.be.true;
+    });
+  });
+
 });
\ No newline at end of file


Mime
View raw message