aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-02-06 10:23:06 +0100
committerStas Vilchik <stas-vilchik@users.noreply.github.com>2017-02-07 13:10:37 +0100
commit929dcab3e90bc534193441f97cf6006d9495e448 (patch)
tree6f3a41a92c99b4409e1a4bd9f1b526e5b53e89c0 /server/sonar-web/src/main/js
parent665500942b44a9d80b18a6d0483b65f4a94fabc0 (diff)
downloadsonarqube-929dcab3e90bc534193441f97cf6006d9495e448.tar.gz
sonarqube-929dcab3e90bc534193441f97cf6006d9495e448.zip
SONAR-8668 Hide groups on the "Users" page when in the "Cloud" mode
Diffstat (limited to 'server/sonar-web/src/main/js')
-rw-r--r--server/sonar-web/src/main/js/apps/users/list-item-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/users/list-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/users/templates/users-list-item.hbs28
-rw-r--r--server/sonar-web/src/main/js/apps/users/templates/users-list.hbs20
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 @@
</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}}
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 @@
<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>