aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web/src/main/js/app/components/Landing.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/sonar-web/src/main/js/app/components/Landing.js')
-rw-r--r--server/sonar-web/src/main/js/app/components/Landing.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/js/app/components/Landing.js b/server/sonar-web/src/main/js/app/components/Landing.js
index 2d69e4686ca..f5851ac0a66 100644
--- a/server/sonar-web/src/main/js/app/components/Landing.js
+++ b/server/sonar-web/src/main/js/app/components/Landing.js
@@ -22,7 +22,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { withRouter } from 'react-router';
import { connect } from 'react-redux';
-import { getCurrentUser } from '../../store/rootReducer';
+import { getCurrentUser, getGlobalSettingValue } from '../../store/rootReducer';
class Landing extends React.PureComponent {
static propTypes = {
@@ -30,9 +30,11 @@ class Landing extends React.PureComponent {
};
componentDidMount() {
- const { currentUser, router } = this.props;
+ const { currentUser, router, onSonarCloud } = this.props;
if (currentUser.isLoggedIn) {
router.replace('/projects');
+ } else if (onSonarCloud && onSonarCloud.value === 'true') {
+ window.location = 'https://about.sonarcloud.io';
} else {
router.replace('/about');
}
@@ -44,7 +46,8 @@ class Landing extends React.PureComponent {
}
const mapStateToProps = state => ({
- currentUser: getCurrentUser(state)
+ currentUser: getCurrentUser(state),
+ onSonarCloud: getGlobalSettingValue(state, 'sonar.sonarcloud.enabled')
});
export default connect(mapStateToProps)(withRouter(Landing));