From: Stas Vilchik Date: Mon, 6 Feb 2017 09:17:47 +0000 (+0100) Subject: SONAR-8667 Hide groups on the "Profile" page when in "Cloud" mode X-Git-Tag: 6.3-RC1~186 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=665500942b44a9d80b18a6d0483b65f4a94fabc0;p=sonarqube.git SONAR-8667 Hide groups on the "Profile" page when in "Cloud" mode --- diff --git a/server/sonar-web/src/main/js/apps/account/profile/Profile.js b/server/sonar-web/src/main/js/apps/account/profile/Profile.js index 3d3213b7ea2..7c4bcd520a1 100644 --- a/server/sonar-web/src/main/js/apps/account/profile/Profile.js +++ b/server/sonar-web/src/main/js/apps/account/profile/Profile.js @@ -17,16 +17,29 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +// @flow import React from 'react'; import { connect } from 'react-redux'; import UserExternalIdentity from './UserExternalIdentity'; import UserGroups from './UserGroups'; import UserScmAccounts from './UserScmAccounts'; -import { getCurrentUser } from '../../../store/rootReducer'; +import { getCurrentUser, areThereCustomOrganizations } from '../../../store/rootReducer'; class Profile extends React.Component { + props: { + customOrganizations: boolean, + user: { + email?: string, + externalProvider?: string, + groups: Array<*>, + local: boolean, + login: string, + scmAccounts: Array<*> + } + }; + render () { - const { user } = this.props; + const { customOrganizations, user } = this.props; return (
@@ -46,9 +59,12 @@ class Profile extends React.Component {
)} -
- - + {!customOrganizations && ( +
+ )} + {!customOrganizations && ( + + )}
@@ -58,6 +74,9 @@ class Profile extends React.Component { } } -export default connect( - state => ({ user: getCurrentUser(state) }) -)(Profile); +const mapStateToProps = state => ({ + customOrganizations: areThereCustomOrganizations(state), + user: getCurrentUser(state) +}); + +export default connect(mapStateToProps)(Profile);