]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-8668 Hide groups on the "Users" page when in the "Cloud" mode
authorStas Vilchik <vilchiks@gmail.com>
Mon, 6 Feb 2017 09:23:06 +0000 (10:23 +0100)
committerStas Vilchik <stas-vilchik@users.noreply.github.com>
Tue, 7 Feb 2017 12:10:37 +0000 (13:10 +0100)
server/sonar-web/src/main/js/apps/users/list-item-view.js
server/sonar-web/src/main/js/apps/users/list-view.js
server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs
server/sonar-web/src/main/js/apps/users/templates/users-list.hbs

index 94e96d682f0b5ab35d26edc80b16519fda856983..4637fbadeb945067f18ee6a3f93cb5aeb81b2b69 100644 (file)
@@ -24,6 +24,7 @@ import DeactivateView from './deactivate-view';
 import GroupsView from './groups-view';
 import TokensView from './tokens-view';
 import Template from './templates/users-list-item.hbs';
+import { areThereCustomOrganizations } from '../../store/organizations/utils';
 
 export default Marionette.ItemView.extend({
   tagName: 'tr',
@@ -142,7 +143,8 @@ export default Marionette.ItemView.extend({
       firstScmAccounts: scmAccounts.slice(0, scmAccountsLimit),
       moreScmAccountsCount: scmAccounts.length - scmAccountsLimit,
       firstGroups: groups.slice(0, groupsLimit),
-      moreGroupsCount: groups.length - groupsLimit
+      moreGroupsCount: groups.length - groupsLimit,
+      customOrganizations: areThereCustomOrganizations()
     };
   }
 });
index 6caa6cd8736f3ef8bb774e9ba8b5eda52f00bb6b..2371289cf76ddaff444886bc05f271522b3d2cf4 100644 (file)
@@ -20,6 +20,7 @@
 import Marionette from 'backbone.marionette';
 import ListItemView from './list-item-view';
 import Template from './templates/users-list.hbs';
+import { areThereCustomOrganizations } from '../../store/organizations/utils';
 
 export default Marionette.CompositeView.extend({
   template: Template,
@@ -44,6 +45,13 @@ export default Marionette.CompositeView.extend({
 
   hideLoading () {
     this.$el.removeClass('new-loading');
+  },
+
+  serializeData () {
+    return {
+      ...Marionette.CompositeView.prototype.serializeData.apply(this, arguments),
+      customOrganizations: areThereCustomOrganizations()
+    };
   }
 });
 
index f9c238d69c96763dbfc19b2ae3e52e39283f11a5..45e51c4983c500a0f700821d89d11ee0e8f47627 100644 (file)
   </ul>
 </td>
 
-<td>
-  <ul>
-    {{#each firstGroups}}
-      <li class="little-spacer-bottom">{{this}}</li>
-    {{/each}}
-    <li class="little-spacer-bottom">
-      {{#gt moreGroupsCount 0}}
-        <a class="js-user-more-groups spacer-right" href="#">{{moreGroupsCount}} more</a>
-      {{/gt}}
-      <a class="js-user-groups icon-bullet-list" title="Update Groups" data-toggle="tooltip" href="#"></a>
-    </li>
-  </ul>
-</td>
+{{#unless customOrganizations}}
+  <td>
+    <ul>
+      {{#each firstGroups}}
+        <li class="little-spacer-bottom">{{this}}</li>
+      {{/each}}
+      <li class="little-spacer-bottom">
+        {{#gt moreGroupsCount 0}}
+          <a class="js-user-more-groups spacer-right" href="#">{{moreGroupsCount}} more</a>
+        {{/gt}}
+        <a class="js-user-groups icon-bullet-list" title="Update Groups" data-toggle="tooltip" href="#"></a>
+      </li>
+    </ul>
+  </td>
+{{/unless}}
 
 <td>
   {{tokensCount}}
index 1987624e130a5cc02aae925703eecf55ede853bb..15b3fe3ce14aa09d0303679cd766ac5b2f125bc9 100644 (file)
@@ -1,13 +1,17 @@
 <table class="data zebra">
   <thead>
-  <tr>
-    {{#ifShowAvatars}}<th>&nbsp;</th>{{/ifShowAvatars}}
-    <th class="nowrap">&nbsp;</th>
-    <th class="nowrap">SCM Accounts</th>
-    <th class="nowrap">Groups</th>
-    <th class="nowrap">Tokens</th>
-    <th class="nowrap">&nbsp;</th>
-  </tr>
+    <tr>
+      {{#ifShowAvatars}}
+        <th>&nbsp;</th>
+      {{/ifShowAvatars}}
+      <th class="nowrap">&nbsp;</th>
+      <th class="nowrap">SCM Accounts</th>
+      {{#unless customOrganizations}}
+        <th class="nowrap">Groups</th>
+      {{/unless}}
+      <th class="nowrap">Tokens</th>
+      <th class="nowrap">&nbsp;</th>
+    </tr>
   </thead>
   <tbody></tbody>
 </table>