aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/apps/account
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2017-02-08 14:44:46 +0100
committerStas Vilchik <vilchiks@gmail.com>2017-02-08 14:44:46 +0100
commit3047c2d49fdddad31937f70469fc73b714b856c5 (patch)
treec8ba0e5261d92e3af0fcdda581a8b56309ddfcba /server/sonar-web/src/main/js/apps/account
parent3ba637dda13a82c5e702dd09d9ca11710a28eac8 (diff)
downloadsonarqube-3047c2d49fdddad31937f70469fc73b714b856c5.tar.gz
sonarqube-3047c2d49fdddad31937f70469fc73b714b856c5.zip
SONAR-8666 fix display of button to create organization
Diffstat (limited to 'server/sonar-web/src/main/js/apps/account')
-rw-r--r--server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.js b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.js
index cd8e2b831c0..2cad1ade5c1 100644
--- a/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.js
+++ b/server/sonar-web/src/main/js/apps/account/organizations/UserOrganizations.js
@@ -33,7 +33,7 @@ class UserOrganizations extends React.Component {
mounted: boolean;
props: {
- anyoneCanCreate: boolean,
+ anyoneCanCreate?: { value: string },
currentUser: Object,
children: Object,
organizations: Array<Organization>,
@@ -61,9 +61,9 @@ class UserOrganizations extends React.Component {
render () {
const title = translate('my_account.organizations') + ' - ' + translate('my_account.page');
- const canCreateOrganizations = !this.state.loading &&
- this.props.anyoneCanCreate ||
- isUserAdmin(this.props.currentUser);
+ const anyoneCanCreate = this.props.anyoneCanCreate != null && this.props.anyoneCanCreate.value === 'true';
+
+ const canCreateOrganizations = !this.state.loading && (anyoneCanCreate || isUserAdmin(this.props.currentUser));
return (
<div className="account-body account-container">
@@ -100,7 +100,7 @@ class UserOrganizations extends React.Component {
}
const mapStateToProps = state => ({
- anyoneCanCreate: getSettingValue(state, 'sonar.organizations.anyoneCanCreate') === 'true',
+ anyoneCanCreate: getSettingValue(state, 'sonar.organizations.anyoneCanCreate'),
currentUser: getCurrentUser(state),
organizations: getMyOrganizations(state)
});