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 | |
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')
16 files changed, 22 insertions, 764 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 }); diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutApp.js b/server/sonar-web/src/main/js/apps/about/components/AboutApp.js index dbb199b9b59..cc3556ca910 100644 --- a/server/sonar-web/src/main/js/apps/about/components/AboutApp.js +++ b/server/sonar-web/src/main/js/apps/about/components/AboutApp.js @@ -36,7 +36,6 @@ import { getFacet } from '../../../api/issues'; import { getAppState, getCurrentUser, getGlobalSettingValue } from '../../../store/rootReducer'; import { translate } from '../../../helpers/l10n'; import { fetchAboutPageSettings } from '../actions'; -import AboutAppSonarCloudLazyLoader from './AboutAppSonarCloudLazyLoader'; import '../styles.css'; /*:: @@ -73,7 +72,11 @@ class AboutApp extends React.PureComponent { componentDidMount() { this.mounted = true; - this.loadData(); + if (this.props.onSonarCloud && this.props.onSonarCloud.value === 'true') { + window.location = 'https://about.sonarcloud.io'; + } else { + this.loadData(); + } } componentWillUnmount() { @@ -110,6 +113,10 @@ class AboutApp extends React.PureComponent { const { customText, onSonarCloud } = this.props; const { loading, issueTypes, projectsCount } = this.state; + if (onSonarCloud && onSonarCloud.value === 'true') { + return null; + } + let bugs; let vulnerabilities; let codeSmells; @@ -119,21 +126,6 @@ class AboutApp extends React.PureComponent { codeSmells = issueTypes['CODE_SMELL'] && issueTypes['CODE_SMELL'].count; } - if (onSonarCloud && onSonarCloud.value === 'true') { - return ( - <AboutAppSonarCloudLazyLoader - appState={this.props.appState} - bugs={bugs} - codeSmells={codeSmells} - currentUser={this.props.currentUser} - customText={customText} - loading={loading} - projectsCount={projectsCount} - vulnerabilities={vulnerabilities} - /> - ); - } - return ( <div id="about-page" className="page page-limited about-page"> <div className="about-page-entry"> diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutAppSonarCloud.js b/server/sonar-web/src/main/js/apps/about/components/AboutAppSonarCloud.js deleted file mode 100644 index 8373d23cc12..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/AboutAppSonarCloud.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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 AboutProjects from './AboutProjects'; -import EntryIssueTypesSonarCloud from './EntryIssueTypesSonarCloud'; -import AboutRulesSonarCloud from './AboutRulesSonarCloud'; -import AboutCleanCode from './AboutCleanCode'; -import AboutQualityModelSonarCloud from './AboutQualityModelSonarCloud'; -import AboutQualityGates from './AboutQualityGates'; -import AboutLeakPeriod from './AboutLeakPeriod'; -import AboutStandards from './AboutStandards'; -import AboutScanners from './AboutScanners'; -import SonarCloudGetStarted from './SonarCloudGetStarted'; -import '../sonarcloud-styles.css'; - -/*:: -type Props = { - appState: { - defaultOrganization: string, - organizationsEnabled: boolean - }, - bugs: number, - codeSmells: number, - currentUser: { isLoggedIn: boolean }, - customText?: string, - loading: boolean, - projectsCount: number, - vulnerabilities: number -}; -*/ - -export default function AboutAppSonarCloud(props /*: Props */) { - const { customText } = props; - - return ( - <div id="about-page" className="about-page sqcom-about-page"> - <div className="sqcom-about-page-entry"> - <div className="page-limited"> - <div className="sqcom-about-page-intro"> - <h1 className="big-spacer-bottom"> - Continuous Code Quality<br />as a Service - </h1> - {!props.currentUser.isLoggedIn && <SonarCloudGetStarted />} - </div> - - <div className="sqcom-about-page-instance"> - <AboutProjects count={props.projectsCount} loading={props.loading} /> - <EntryIssueTypesSonarCloud - bugs={props.bugs} - codeSmells={props.codeSmells} - loading={props.loading} - vulnerabilities={props.vulnerabilities} - /> - </div> - </div> - </div> - - <AboutRulesSonarCloud appState={props.appState} /> - - <div className="page-limited"> - {customText != null && - customText.value && ( - <div - className="about-page-section" - dangerouslySetInnerHTML={{ __html: customText.value }} - /> - )} - - <AboutQualityModelSonarCloud /> - - <div className="flex-columns"> - <div className="flex-column flex-column-half about-page-group-boxes"> - <AboutCleanCode /> - </div> - <div className="flex-column flex-column-half about-page-group-boxes"> - <AboutLeakPeriod /> - </div> - </div> - - <div className="flex-columns"> - <div className="flex-column flex-column-half about-page-group-boxes"> - <AboutQualityGates /> - </div> - <div className="flex-column flex-column-half about-page-group-boxes"> - <AboutStandards appState={props.appState} /> - </div> - </div> - - <AboutScanners /> - </div> - </div> - ); -} diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutAppSonarCloudLazyLoader.js b/server/sonar-web/src/main/js/apps/about/components/AboutAppSonarCloudLazyLoader.js deleted file mode 100644 index b18c0780e7b..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/AboutAppSonarCloudLazyLoader.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import React from 'react'; - -export default class AboutAppSonarCloudLazyLoader extends React.PureComponent { - constructor(props) { - super(props); - this.state = { - AboutAppSonarCloud: null - }; - } - - componentDidMount() { - if (!this.state.AboutAppSonarCloud) { - import('./AboutAppSonarCloud').then(({ default: AboutAppSonarCloud }) => - this.setState({ AboutAppSonarCloud }) - ); - } - } - - render() { - const { AboutAppSonarCloud } = this.state; - if (AboutAppSonarCloud) { - return <AboutAppSonarCloud {...this.props} />; - } - return null; - } -} diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutQualityModelSonarCloud.js b/server/sonar-web/src/main/js/apps/about/components/AboutQualityModelSonarCloud.js deleted file mode 100644 index df5d87996eb..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/AboutQualityModelSonarCloud.js +++ /dev/null @@ -1,66 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ -import React from 'react'; -import { translate } from '../../../helpers/l10n'; -import BugIconSonarCloud from './BugIconSonarCloud'; -import VulnerabilityIconSonarCloud from './VulnerabilityIconSonarCloud'; -import CodeSmellIconSonarCloud from './CodeSmellIconSonarCloud'; - -export default function AboutQualityModelSonarCloud() { - return ( - <div className="boxed-group about-quality-model sqcom-about-quality-model"> - <h2>{translate('about_page.quality_model')}</h2> - - <div className="boxed-group-inner clearfix"> - <div className="flex-columns"> - <div className="flex-column flex-column-third"> - <div className="pull-left little-spacer-right"> - <BugIconSonarCloud /> - </div> - <p className="about-page-text overflow-hidden"> - <strong>{translate('issue.type.BUG.plural')}</strong>{' '} - {translate('about_page.quality_model.bugs')} - </p> - </div> - - <div className="flex-column flex-column-third"> - <div className="pull-left little-spacer-right"> - <VulnerabilityIconSonarCloud /> - </div> - <p className="about-page-text overflow-hidden"> - <strong>{translate('issue.type.VULNERABILITY.plural')}</strong>{' '} - {translate('about_page.quality_model.vulnerabilities')} - </p> - </div> - - <div className="flex-column flex-column-third"> - <div className="pull-left little-spacer-right"> - <CodeSmellIconSonarCloud /> - </div> - <p className="about-page-text overflow-hidden"> - <strong>{translate('issue.type.CODE_SMELL.plural')}</strong>{' '} - {translate('about_page.quality_model.code_smells')} - </p> - </div> - </div> - </div> - </div> - ); -} diff --git a/server/sonar-web/src/main/js/apps/about/components/AboutRulesSonarCloud.js b/server/sonar-web/src/main/js/apps/about/components/AboutRulesSonarCloud.js deleted file mode 100644 index 67f3037edb2..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/AboutRulesSonarCloud.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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 { Link } from 'react-router'; -import { getRulesUrl } from '../../../helpers/urls'; - -/*:: -type Props = { - appState: { - defaultOrganization: string, - organizationsEnabled: boolean - } -}; -*/ - -export default function AboutRulesSonarCloud(props /*: Props */) { - const organization = props.appState.defaultOrganization; - - return ( - <div className="sqcom-about-rules"> - <div className="page-limited"> - <Link to={getRulesUrl(null, organization)} className="sqcom-about-rules-link"> - +3,000 rules - <span className="spacer-left"> - <svg width="15" height="36" viewBox="0 0 15 36"> - <g transform="matrix(1,0,0,1,-267,-362)"> - <path - d="M268,363L281,380L269,397" - style={{ fill: 'none', stroke: '#c1d9ea', strokeWidth: 1 }} - /> - </g> - </svg> - </span> - </Link> - <Link - to={getRulesUrl({ languages: 'js' }, organization)} - className="sqcom-about-rules-link"> - JavaScript - </Link> - <Link - to={getRulesUrl({ languages: 'java' }, organization)} - className="sqcom-about-rules-link"> - Java - </Link> - <Link - to={getRulesUrl({ languages: 'c,cpp' }, organization)} - className="sqcom-about-rules-link"> - C/C++ - </Link> - <Link - to={getRulesUrl({ languages: 'cs' }, organization)} - className="sqcom-about-rules-link"> - C# - </Link> - <Link to={getRulesUrl(null, organization)} className="button"> - And More - </Link> - </div> - </div> - ); -} diff --git a/server/sonar-web/src/main/js/apps/about/components/BugIconSonarCloud.js b/server/sonar-web/src/main/js/apps/about/components/BugIconSonarCloud.js deleted file mode 100644 index 7ba3dadede8..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/BugIconSonarCloud.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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'; - -export default function BugIconSonarCloud() { - /* eslint-disable max-len */ - return ( - <svg viewBox="0 0 26 26" width="26" height="26"> - <path - style={{ fill: 'currentcolor' }} - d="M23.737 15.91l-2.298-2.297a.797.797 0 0 0-.542-.232h-2.18v-1.588l2.722-2.723a.773.773 0 0 0 .233-.542V4.243a.777.777 0 0 0-.775-.775.777.777 0 0 0-.774.775v3.962l-1.407 1.407v-.633a.777.777 0 0 0-.774-.774h-.517a4.51 4.51 0 0 0-2.852-3.446l2.698-2.698a.787.787 0 0 0 0-1.097.787.787 0 0 0-1.098 0L12.985 4.14 9.823.99a.787.787 0 0 0-1.097 0 .787.787 0 0 0 0 1.097l2.672 2.672a4.51 4.51 0 0 0-2.853 3.446H7.99a.777.777 0 0 0-.774.774v.633L5.81 8.192v-3.95a.777.777 0 0 0-.774-.774.777.777 0 0 0-.775.775v4.272c0 .206.078.4.233.542l2.723 2.723v1.6H5.035c-.207 0-.4.078-.542.233L2.195 15.91a.787.787 0 0 0 0 1.098.764.764 0 0 0 .542.232c.194 0 .4-.078.542-.232l2.078-2.078h1.86v.761l-2.789 3.64a.783.783 0 0 0-.155.477v4.505c0 .426.349.774.775.774a.777.777 0 0 0 .774-.774v-4.247l1.433-1.884a5.77 5.77 0 0 0 2.788 4.298l.077.039c.84.49 1.82.761 2.853.761a5.825 5.825 0 0 0 2.865-.761c.013-.013.039-.013.051-.026a5.75 5.75 0 0 0 2.801-4.31l1.446 1.883v4.247c0 .426.348.774.774.774a.777.777 0 0 0 .775-.774v-4.505a.811.811 0 0 0-.155-.477l-2.788-3.64v-.761H20.6l2.078 2.078a.764.764 0 0 0 .542.232c.193 0 .4-.078.542-.232a.787.787 0 0 0-.026-1.098zm-10.752-9.9c1.369 0 2.517.93 2.853 2.182h-5.705a2.954 2.954 0 0 1 2.852-2.181zm-4.22 11.527V9.754h3.433v9.254l-1.82 1.82a4.172 4.172 0 0 1-1.613-3.291zm3.046 4.04l1.149-1.15 1.148 1.15a4.188 4.188 0 0 1-1.148.167c-.388 0-.775-.064-1.15-.167zm5.356-4.04c0 1.342-.632 2.53-1.6 3.304l-1.82-1.82V9.754h3.433v7.783h-.013z" - /> - </svg> - ); -} diff --git a/server/sonar-web/src/main/js/apps/about/components/CodeSmellIconSonarCloud.js b/server/sonar-web/src/main/js/apps/about/components/CodeSmellIconSonarCloud.js deleted file mode 100644 index dc9030b2273..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/CodeSmellIconSonarCloud.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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'; - -export default function CodeSmellIconSonarCloud() { - /* eslint-disable max-len */ - return ( - <svg viewBox="0 0 26 26" width="26" height="26"> - <path - style={{ fill: 'currentcolor' }} - d="M19.957 5.099a10.455 10.455 0 0 0-7.424-3.077c-1.42 0-2.792.278-4.087.825a10.426 10.426 0 0 0-3.338 2.249 10.462 10.462 0 0 0-3.076 7.427c0 1.418.279 2.791.826 4.087a10.497 10.497 0 0 0 2.25 3.338 10.426 10.426 0 0 0 3.338 2.25c1.295.546 2.67.825 4.086.825 1.419 0 2.791-.279 4.087-.826a10.426 10.426 0 0 0 3.338-2.249 10.465 10.465 0 0 0 3.075-7.425c0-1.417-.278-2.793-.823-4.086a10.396 10.396 0 0 0-2.252-3.338zm.393 10.725a8.436 8.436 0 0 1-1.818 2.695 8.452 8.452 0 0 1-5.996 2.486 8.442 8.442 0 0 1-5.997-2.486 8.455 8.455 0 0 1-2.486-5.996 8.43 8.43 0 0 1 2.486-5.995 8.452 8.452 0 0 1 5.996-2.486 8.445 8.445 0 0 1 5.997 2.486 8.452 8.452 0 0 1 2.485 5.995 8.35 8.35 0 0 1-.667 3.3zm-7.794 4.202h-.037a7.767 7.767 0 0 1-3.426-.835.317.317 0 0 1-.13-.44l2.25-3.923a.32.32 0 0 1 .403-.132c.284.119.595.189.92.189.326 0 .639-.067.92-.19a.32.32 0 0 1 .404.133l2.255 3.922c.09.157.03.36-.133.441a7.896 7.896 0 0 1-3.426.835zm-1.58-7.457c0-.003 0-.009-.003-.013a1.56 1.56 0 0 1 2.337-1.35c.468.269.781.77.781 1.35v.013a1.557 1.557 0 0 1-3.115 0zm-1.068.015H5.384a.318.318 0 0 1-.32-.334c.03-.614.19-1.992.981-3.391l.008-.016.007-.016a7.806 7.806 0 0 1 2.428-2.554.317.317 0 0 1 .448.106l2.282 3.903a.316.316 0 0 1-.082.414 2.371 2.371 0 0 0-.914 1.605.325.325 0 0 1-.314.283zm9.776-.007h-4.526a.32.32 0 0 1-.316-.282 2.371 2.371 0 0 0-.913-1.604.322.322 0 0 1-.082-.414l2.284-3.904a.317.317 0 0 1 .449-.106 7.787 7.787 0 0 1 2.426 2.554l.016.033a7.74 7.74 0 0 1 .98 3.387.319.319 0 0 1-.318.336z" - /> - </svg> - ); -} diff --git a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypesSonarCloud.js b/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypesSonarCloud.js deleted file mode 100644 index 8a46248ae16..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/EntryIssueTypesSonarCloud.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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 { Link } from 'react-router'; -import { formatMeasure } from '../../../helpers/measures'; -import { translate } from '../../../helpers/l10n'; -import { getIssuesUrl } from '../../../helpers/urls'; -import BugIconSonarCloud from './BugIconSonarCloud'; -import VulnerabilityIconSonarCloud from './VulnerabilityIconSonarCloud'; -import CodeSmellIconSonarCloud from './CodeSmellIconSonarCloud'; - -/*:: -type Props = { - bugs: ?number, - codeSmells: ?number, - loading: boolean, - vulnerabilities: ?number -}; -*/ - -export default function EntryIssueTypesSonarCloud( - { bugs, codeSmells, loading, vulnerabilities } /*: Props */ -) { - return ( - <div className="about-page-projects"> - {loading && <i className="spinner" />} - {!loading && ( - <table className="about-page-issue-types"> - <tbody> - <tr> - <td className="about-page-issue-type-number"> - <Link - to={getIssuesUrl({ resolved: 'false', types: 'BUG', s: 'CREATION_DATE' })} - className="about-page-issue-type-link"> - {formatMeasure(bugs, 'SHORT_INT')} - </Link> - </td> - <td> - <span className="little-spacer-right"> - <BugIconSonarCloud /> - </span> - {translate('issue.type.BUG.plural')} - </td> - </tr> - <tr> - <td className="about-page-issue-type-number"> - <Link - to={getIssuesUrl({ - resolved: 'false', - types: 'VULNERABILITY', - s: 'CREATION_DATE' - })} - className="about-page-issue-type-link"> - {formatMeasure(vulnerabilities, 'SHORT_INT')} - </Link> - </td> - <td> - <span className="little-spacer-right"> - <VulnerabilityIconSonarCloud /> - </span> - {translate('issue.type.VULNERABILITY.plural')} - </td> - </tr> - <tr> - <td className="about-page-issue-type-number"> - <Link - to={getIssuesUrl({ resolved: 'false', types: 'CODE_SMELL', s: 'CREATION_DATE' })} - className="about-page-issue-type-link"> - {formatMeasure(codeSmells, 'SHORT_INT')} - </Link> - </td> - <td> - <span className="little-spacer-right"> - <CodeSmellIconSonarCloud /> - </span> - {translate('issue.type.CODE_SMELL.plural')} - </td> - </tr> - </tbody> - </table> - )} - </div> - ); -} diff --git a/server/sonar-web/src/main/js/apps/about/components/SonarCloudGetStarted.js b/server/sonar-web/src/main/js/apps/about/components/SonarCloudGetStarted.js deleted file mode 100644 index aaf4f8faa87..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/SonarCloudGetStarted.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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 OAuthProviders from '../../sessions/components/OAuthProviders'; -import { getIdentityProviders } from '../../../api/users'; - -/*:: -type State = { - identityProviders: Array<{ - backgroundColor: string, - iconPath: string, - key: string, - name: string - }>, - loading: boolean -}; -*/ - -export default class SonarCloudGetStarted extends React.PureComponent { - /*:: mounted: boolean; */ - state /*: State */ = { - identityProviders: [], - loading: true - }; - - componentDidMount() { - this.mounted = true; - this.fetchIdentityProviders(); - } - - componentWillUnmount() { - this.mounted = false; - } - - fetchIdentityProviders = () => { - this.setState({ loading: true }); - getIdentityProviders().then(({ identityProviders }) => { - if (this.mounted) { - this.setState({ identityProviders, loading: false }); - } - }); - }; - - formatLabel = (name /*: string */) => `Start with ${name}`; - - render() { - if (this.state.loading) { - return null; - } - - return ( - <div className="sqcom-get-started"> - <OAuthProviders - formatLabel={this.formatLabel} - identityProviders={this.state.identityProviders} - /> - </div> - ); - } -} diff --git a/server/sonar-web/src/main/js/apps/about/components/VulnerabilityIconSonarCloud.js b/server/sonar-web/src/main/js/apps/about/components/VulnerabilityIconSonarCloud.js deleted file mode 100644 index 442d15a1b7e..00000000000 --- a/server/sonar-web/src/main/js/apps/about/components/VulnerabilityIconSonarCloud.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2017 SonarSource SA - * mailto:info AT sonarsource DOT com - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 3 of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * 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'; - -export default function VulnerabilityIconSonarCloud() { - /* eslint-disable max-len */ - return ( - <svg viewBox="0 0 26 26" width="26" height="26"> - <path - style={{ fill: 'currentcolor' }} - d="M7.688 9.224V5.818c0-2.622 2.16-4.756 4.813-4.756 2.654 0 4.802 2.134 4.813 4.756v.931c0 .5-.413.909-.919.909a.916.916 0 0 1-.919-.909v-.93c0-1.624-1.332-2.94-2.975-2.94s-2.975 1.316-2.975 2.94v3.405h7.892c1.401 0 2.539 1.124 2.539 2.509v9.706c0 1.442-1.195 2.623-2.654 2.623H7.688c-1.46 0-2.654-1.18-2.654-2.623v-9.706c0-1.385 1.137-2.509 2.539-2.509h.115zm9.615 13.033a.814.814 0 0 0 .816-.806v-9.718a.692.692 0 0 0-.701-.692H7.573c-.39 0-.7.306-.7.692v9.718c0 .442.367.806.815.806h9.615zm-4.802-8.98c-1.045 0-1.907.84-1.907 1.884 0 .704.402 1.329.988 1.647v2.304c0 .5.414.908.92.908a.916.916 0 0 0 .918-.908v-2.316c.586-.318.988-.942.988-1.646a1.904 1.904 0 0 0-1.907-1.873zM22.99 8.804l-1.7-.681c-.47-.182-1.01.034-1.194.5a.904.904 0 0 0 .505 1.18l1.712.681c.115.046.23.068.344.068a.908.908 0 0 0 .85-.567.91.91 0 0 0-.517-1.18zm-2.837-1.703a.939.939 0 0 0 1.206.488l1.689-.715a.9.9 0 0 0 .482-1.192c-.195-.465-.735-.67-1.206-.477l-1.689.716a.876.876 0 0 0-.482 1.18zm-1.068-1.124c-.471-.181-.69-.715-.506-1.192l.69-1.68c.183-.465.723-.681 1.194-.5.471.182.69.716.506 1.181l-.69 1.692a.908.908 0 0 1-.85.567.932.932 0 0 1-.344-.068z" - /> - </svg> - ); -} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud-styles.css b/server/sonar-web/src/main/js/apps/about/sonarcloud-styles.css deleted file mode 100644 index 88db615075e..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud-styles.css +++ /dev/null @@ -1,150 +0,0 @@ -@import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700'); - -.sqcom-about-page { - font-family: 'Roboto', sans-serif; - font-size: 15px !important; - font-weight: 300; -} - -.sqcom-about-page-entry { - padding-top: 65px; - padding-bottom: 65px; - background-color: #4b9fd5; -} - -.sqcom-about-page-entry a { - color: #4b9fd5; -} - -.sqcom-about-page-entry .page-limited { - display: flex; - justify-content: space-between; - align-items: center; - padding-top: 0; - padding-bottom: 0; -} - -.sqcom-about-page-intro { -} - -.sqcom-about-page-intro > h1 { - line-height: 44px; - color: #fff; - font-size: 36px; - font-weight: 300; -} - -.sonarcloud-about-github-button { - display: inline-block; - height: 44px; - line-height: 46px; - padding-left: 20px; - padding-right: 20px; - border: none; - border-radius: 3px; - background-color: #444; - color: #fff !important; - font-size: 15px; - font-weight: 500; - text-transform: uppercase; -} - -.sonarcloud-about-github-button:hover, -.sonarcloud-about-github-button:focus { - background-color: #333; -} - -.sonarcloud-about-github-button img { - margin-top: 12px; - margin-right: 10px; -} - -.sqcom-about-page-instance { - display: flex; - align-items: stretch; -} - -.sqcom-about-page-instance .about-page-projects { - display: flex; - justify-content: center; - align-items: center; - min-width: 190px; - min-height: 105px; - margin-left: 15px; - padding: 25px; - background-color: #fff; - color: #686868; - font-size: 18px; - font-weight: 300; -} - -.sqcom-about-page-instance .about-page-projects-link { - font-weight: 400; -} - -.sqcom-about-page-instance .about-page-issue-types > li + li { - margin-top: 20px; -} - -.sqcom-about-rules { - margin-bottom: 45px; - background-color: #4193c8; -} - -.sqcom-about-rules .page-limited { - display: flex; - justify-content: space-between; - align-items: center; - padding-top: 0; - padding-bottom: 0; -} - -.sqcom-about-rules .button { - height: 33px; - line-height: 30px; - padding-left: 15px; - padding-right: 15px; - border-color: #fff; - border-radius: 3px; - color: #fff; - font-size: 14px; - font-weight: bold; - text-transform: uppercase; -} - -.sqcom-about-rules .button:hover { - background-color: #fff; - color: #4b9fd5; -} - -.sqcom-about-rules-link { - line-height: 36px; - padding: 24px 40px; - border: none; - color: #c1d9ea; - font-size: 20px; -} - -.sqcom-about-rules-link:first-child { - margin-left: -40px; -} - -.sqcom-about-rules-link:hover { - background-color: #3988bc; - color: #fff; -} - -.sqcom-about-rules-link:hover path { - fill: #fff; -} - -.sqcom-about-quality-model svg { - transform: translateY(-3px) !important; -} - -.sqcom-get-started .oauth-providers > ul { - width: 380px; - justify-content: space-between; - font-size: 14px; - margin-bottom: -30px; -} |