From 929dcab3e90bc534193441f97cf6006d9495e448 Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 6 Feb 2017 10:23:06 +0100 Subject: [PATCH] SONAR-8668 Hide groups on the "Users" page when in the "Cloud" mode --- .../src/main/js/apps/users/list-item-view.js | 4 ++- .../src/main/js/apps/users/list-view.js | 8 ++++++ .../apps/users/templates/users-list-item.hbs | 28 ++++++++++--------- .../js/apps/users/templates/users-list.hbs | 20 +++++++------ 4 files changed, 38 insertions(+), 22 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/users/list-item-view.js b/server/sonar-web/src/main/js/apps/users/list-item-view.js index 94e96d682f0..4637fbadeb9 100644 --- a/server/sonar-web/src/main/js/apps/users/list-item-view.js +++ b/server/sonar-web/src/main/js/apps/users/list-item-view.js @@ -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() }; } }); diff --git a/server/sonar-web/src/main/js/apps/users/list-view.js b/server/sonar-web/src/main/js/apps/users/list-view.js index 6caa6cd8736..2371289cf76 100644 --- a/server/sonar-web/src/main/js/apps/users/list-view.js +++ b/server/sonar-web/src/main/js/apps/users/list-view.js @@ -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() + }; } }); diff --git a/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs b/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs index f9c238d69c9..45e51c4983c 100644 --- a/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs +++ b/server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs @@ -43,19 +43,21 @@ - - - +{{#unless customOrganizations}} + + + +{{/unless}} {{tokensCount}} diff --git a/server/sonar-web/src/main/js/apps/users/templates/users-list.hbs b/server/sonar-web/src/main/js/apps/users/templates/users-list.hbs index 1987624e130..15b3fe3ce14 100644 --- a/server/sonar-web/src/main/js/apps/users/templates/users-list.hbs +++ b/server/sonar-web/src/main/js/apps/users/templates/users-list.hbs @@ -1,13 +1,17 @@ - - {{#ifShowAvatars}}{{/ifShowAvatars}} - - - - - - + + {{#ifShowAvatars}} + + {{/ifShowAvatars}} + + + {{#unless customOrganizations}} + + {{/unless}} + + +
  SCM AccountsGroupsTokens 
  SCM AccountsGroupsTokens 
-- 2.39.5