From: Stas Vilchik Date: Mon, 6 Feb 2017 09:23:06 +0000 (+0100) Subject: SONAR-8668 Hide groups on the "Users" page when in the "Cloud" mode X-Git-Tag: 6.3-RC1~185 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=929dcab3e90bc534193441f97cf6006d9495e448;p=sonarqube.git SONAR-8668 Hide groups on the "Users" page when in the "Cloud" mode --- 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