diff options
author | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-04 16:38:13 +0200 |
---|---|---|
committer | Stas Vilchik <stas.vilchik@sonarsource.com> | 2017-10-05 12:12:43 +0200 |
commit | af039ace6676a976e367a6b9a2a52463028fc5a3 (patch) | |
tree | 921e8a7a368fd724e063cb9f1399e845e679658f /server/sonar-web/src/main/js/app | |
parent | 1863f1cddfb0f3eb790c0a0f968dcbd1ebc5ea28 (diff) | |
download | sonarqube-af039ace6676a976e367a6b9a2a52463028fc5a3.tar.gz sonarqube-af039ace6676a976e367a6b9a2a52463028fc5a3.zip |
SONAR-9431 Remove hard-coded SonarCloud home page
Diffstat (limited to 'server/sonar-web/src/main/js/app')
5 files changed, 13 insertions, 17 deletions
diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.js b/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.js index d81f101e78b..9c601855952 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.js +++ b/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.js @@ -19,7 +19,6 @@ */ // @flow import React from 'react'; -import { Link } from 'react-router'; import { translate } from '../../helpers/l10n'; export default function GlobalFooterSonarCloud() { @@ -44,7 +43,7 @@ export default function GlobalFooterSonarCloud() { {' - '} <a href="https://about.sonarcloud.io/contact/">{translate('footer.help')}</a> {' - '} - <Link to="/about">{translate('footer.about')}</Link> + <a href="https://about.sonarcloud.io/">{translate('footer.about')}</a> </div> </div> ); 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)); diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.js.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.js.snap index 9abb73d6d77..0a3aa1953b1 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.js.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.js.snap @@ -47,13 +47,11 @@ exports[`should render correctly 1`] = ` footer.help </a> - - <Link - onlyActiveOnIndex={false} - style={Object {}} - to="/about" + <a + href="https://about.sonarcloud.io/" > footer.about - </Link> + </a> </div> </div> `; diff --git a/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js b/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js index 802d1b9620c..821e82a83c7 100644 --- a/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js +++ b/server/sonar-web/src/main/js/app/components/help/LinksHelpSonarCloud.js @@ -58,9 +58,7 @@ export default function LinksHelpSonarCloud({ onClose } /*: Props */) { </p> <p> - <Link to="/about" onClick={onClose}> - {translate('footer.about')} - </Link> + <a href="https://about.sonarcloud.io/">{translate('footer.about')}</a> </p> </div> ); diff --git a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.js b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.js index e7b4cae4816..c6c96596281 100644 --- a/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.js +++ b/server/sonar-web/src/main/js/app/components/nav/global/GlobalNavBranding.js @@ -21,7 +21,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { Link } from 'react-router'; import { connect } from 'react-redux'; -import { getGlobalSettingValue, getCurrentUser } from '../../../../store/rootReducer'; +import { getGlobalSettingValue } from '../../../../store/rootReducer'; import { translate } from '../../../../helpers/l10n'; class GlobalNavBranding extends React.PureComponent { @@ -39,10 +39,9 @@ class GlobalNavBranding extends React.PureComponent { } render() { - const homeController = this.props.currentUser.isLoggedIn ? '/projects' : '/about'; return ( <div className="pull-left"> - <Link to={homeController} className="navbar-brand"> + <Link to="/" className="navbar-brand"> {this.renderLogo()} </Link> </div> @@ -51,7 +50,6 @@ class GlobalNavBranding extends React.PureComponent { } const mapStateToProps = state => ({ - currentUser: getCurrentUser(state), customLogoUrl: (getGlobalSettingValue(state, 'sonar.lf.logoUrl') || {}).value, customLogoWidth: (getGlobalSettingValue(state, 'sonar.lf.logoWidthPx') || {}).value }); |