From: Stas Vilchik Date: Fri, 15 Jun 2018 09:25:03 +0000 (+0200) Subject: SONARCLOUD-62 Move /sq/* pages and terms.pdf (#382) X-Git-Tag: 7.5~955 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7a8b69cb8e9e6cd0d47b5dc3f5dc4ab9e2368661;p=sonarqube.git SONARCLOUD-62 Move /sq/* pages and terms.pdf (#382) * extract SonarCloudPage * add "As a Service" page * add "Branch analysis & PR decoration" page * add "SonarLint integration" page * add VSTS page * Move terms.pdf --- diff --git a/server/sonar-web/public/images/sonarcloud/branch-01.png b/server/sonar-web/public/images/sonarcloud/branch-01.png new file mode 100644 index 00000000000..43de1451f25 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/branch-01.png differ diff --git a/server/sonar-web/public/images/sonarcloud/branch-01@2x.png b/server/sonar-web/public/images/sonarcloud/branch-01@2x.png new file mode 100644 index 00000000000..263b0947cda Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/branch-01@2x.png differ diff --git a/server/sonar-web/public/images/sonarcloud/branch-02.png b/server/sonar-web/public/images/sonarcloud/branch-02.png new file mode 100644 index 00000000000..f772222acb4 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/branch-02.png differ diff --git a/server/sonar-web/public/images/sonarcloud/branch-02@2x.png b/server/sonar-web/public/images/sonarcloud/branch-02@2x.png new file mode 100644 index 00000000000..556232b3e36 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/branch-02@2x.png differ diff --git a/server/sonar-web/public/images/sonarcloud/branch-03.png b/server/sonar-web/public/images/sonarcloud/branch-03.png new file mode 100644 index 00000000000..effbe5613e9 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/branch-03.png differ diff --git a/server/sonar-web/public/images/sonarcloud/branch-03@2x.png b/server/sonar-web/public/images/sonarcloud/branch-03@2x.png new file mode 100644 index 00000000000..ed85c2bde14 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/branch-03@2x.png differ diff --git a/server/sonar-web/public/images/sonarcloud/gears.png b/server/sonar-web/public/images/sonarcloud/gears.png new file mode 100644 index 00000000000..231685ec991 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/gears.png differ diff --git a/server/sonar-web/public/images/sonarcloud/gears@2x.png b/server/sonar-web/public/images/sonarcloud/gears@2x.png new file mode 100644 index 00000000000..95f79dd1359 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/gears@2x.png differ diff --git a/server/sonar-web/public/images/sonarcloud/sl-notif.png b/server/sonar-web/public/images/sonarcloud/sl-notif.png new file mode 100644 index 00000000000..fdb0daf15e4 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/sl-notif.png differ diff --git a/server/sonar-web/public/images/sonarcloud/sl-notif@2x.png b/server/sonar-web/public/images/sonarcloud/sl-notif@2x.png new file mode 100644 index 00000000000..ae07309c008 Binary files /dev/null and b/server/sonar-web/public/images/sonarcloud/sl-notif@2x.png differ diff --git a/server/sonar-web/public/images/sonarcloud/windows.svg b/server/sonar-web/public/images/sonarcloud/windows.svg new file mode 100644 index 00000000000..b0155ea5706 --- /dev/null +++ b/server/sonar-web/public/images/sonarcloud/windows.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/server/sonar-web/public/sonarcloud-terms.pdf b/server/sonar-web/public/sonarcloud-terms.pdf new file mode 100644 index 00000000000..75fd88a5d5e Binary files /dev/null and b/server/sonar-web/public/sonarcloud-terms.pdf differ diff --git a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx b/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx index 44dd558676a..d1ffc010768 100644 --- a/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx +++ b/server/sonar-web/src/main/js/app/components/GlobalFooterSonarCloud.tsx @@ -41,7 +41,9 @@ export default function GlobalFooterSonarCloud() { {translate('footer.twitter')}
  • - {translate('footer.terms')} + + {translate('footer.terms')} +
  • {translate('footer.privacy')} diff --git a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap index 4593fe94ca2..89bb14e6625 100644 --- a/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap +++ b/server/sonar-web/src/main/js/app/components/__tests__/__snapshots__/GlobalFooterSonarCloud-test.tsx.snap @@ -41,8 +41,10 @@ exports[`should render correctly 1`] = ` > footer.terms diff --git a/server/sonar-web/src/main/js/apps/about/routes.ts b/server/sonar-web/src/main/js/apps/about/routes.ts index 7758ecaa78e..a042681c66c 100644 --- a/server/sonar-web/src/main/js/apps/about/routes.ts +++ b/server/sonar-web/src/main/js/apps/about/routes.ts @@ -24,12 +24,34 @@ const routes = [ { indexRoute: { component: lazyLoad( - () => - isSonarCloud() ? import('./sonarcloud/HomeContainer') : import('./components/AboutApp') + () => (isSonarCloud() ? import('./sonarcloud/Home') : import('./components/AboutApp')) ) }, childRoutes: isSonarCloud - ? [{ path: 'sq', component: lazyLoad(() => import('./sonarcloud/SQHomeContainer')) }] + ? [ + { + path: 'sq', + childRoutes: [ + { indexRoute: { component: lazyLoad(() => import('./sonarcloud/SQHome')) } }, + { + path: 'as-a-service', + component: lazyLoad(() => import('./sonarcloud/AsAService')) + }, + { + path: 'branch-analysis-and-pr-decoration', + component: lazyLoad(() => import('./sonarcloud/BranchAnalysis')) + }, + { + path: 'sonarlint-integration', + component: lazyLoad(() => import('./sonarcloud/SonarLintIntegration')) + }, + { + path: 'vsts', + component: lazyLoad(() => import('./sonarcloud/VSTS')) + } + ] + } + ] : [] } ]; diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx new file mode 100644 index 00000000000..8c4938558db --- /dev/null +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx @@ -0,0 +1,90 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 * as React from 'react'; +import SonarCloudPage from './SonarCloudPage'; +import SQStartUsing from './SQStartUsing'; +import SQTopNav from './SQTopNav'; +import { isLoggedIn } from '../../../app/types'; +import { getBaseUrl } from '../../../helpers/urls'; +import './style.css'; + +export default function AsAService() { + return ( + + {({ currentUser }) => ( +
    + + +
    + +

    As a Service

    +

    + We fully operate the SonarQube base service,
    which is hosted in Frankfurt, + Germany. +

    + +
    + +
      +
    • +

      Ready to use

      +

      + You need to worry about nothing but enjoying the service, everything else such as + hardware, provisioning, installation, configuration, monitoring is being taken care + of by us. +

      +
    • +
    • +

      Always the latest and greatest

      +

      + SonarCloud always provides the latest and greatest features of SonarQube and our + selection of plugins. As soon as a new feature is fit for production, it will ship + to SonarCloud and wait that you use it. +

      +
    • +
    • +

      Get started in minutes

      +

      + Simply sign up, create an oganization for your team, and you are ready to run your + builds to get your projects analyzed in minutes. +

      +
    • +
    • +

      Designed to scale

      +

      + You do not need to care about sizing or planning your future needs, we take care of + this and will make sure that the service can handle the analysis of your code at the + pace you decide. When you are getting close to your subscription limit, you decide + whether you want to go to the next level. +

      +
    • +
    + {!isLoggedIn(currentUser) && } +
    + )} +
    + ); +} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx new file mode 100644 index 00000000000..49b8f302b1c --- /dev/null +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx @@ -0,0 +1,119 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 * as React from 'react'; +import SonarCloudPage from './SonarCloudPage'; +import SQStartUsing from './SQStartUsing'; +import SQTopNav from './SQTopNav'; +import { isLoggedIn } from '../../../app/types'; +import { getBaseUrl } from '../../../helpers/urls'; +import './style.css'; + +export default function BranchAnalysis() { + return ( + + {({ currentUser }) => ( +
    + + +
    + +

    + Branch analysis &
    pull request decoration +

    +

    + SonarCloud comes with a built-in feature to automatically analyze
    project + branches and pull requests as soon as they get created. +

    +
    + +
      +
    • + +
      +

      Analyze branches and pull requests

      +

      + For all project branches (main, maintenance, version, feature, etc.), you get the + full experience in the project space, with a specific focus on that branch. +

      +

      + When analyzing pull requests (PRs), a Quality Gate will be generated along with + the list of issues created in the PR. +

      +

      + To save time and insure consistency, the analysis configuration is reused across + all branches of a project. +

      +
      +
    • +
    • +
      +

      Decorate PRs on VSTS and GitHub

      +

      + Pull requests get decorated directly on VSTS and GitHub. The result of the PR + analysis is available directly in the pull request itself, complementing nicely + manual reviews made by peers and enabling to make a more educated decision for + merging. +

      +
      + +
    • +
    • + +
      +

      Add a check in GitHub

      +

      + Finally, a check can be added to the PR to provide the Quality Gate status of the + PR, check that can optionally block the merge. +

      +
      +
    • +
    + +
    + There is no longer an excuse for pushing issues to the master. +
    + + {!isLoggedIn(currentUser) && } +
    + )} +
    + ); +} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx index 48cd48d5cc8..f7634e2479f 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx @@ -96,10 +96,9 @@ export default function Footer() {
  • + to="/sonarcloud-terms.pdf"> Terms
  • diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx index e5d99cc504f..629a1730dba 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Home.tsx @@ -19,33 +19,17 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import Footer from './Footer'; +import SonarCloudPage from './SonarCloudPage'; import Pricing from './Pricing'; import StartUsing from './StartUsing'; -import GlobalContainer from '../../../app/components/GlobalContainer'; -import { CurrentUser, isLoggedIn } from '../../../app/types'; +import { isLoggedIn } from '../../../app/types'; import ChevronRightIcon from '../../../components/icons-components/ChevronRightcon'; import './style.css'; -interface Props { - currentUser: CurrentUser; - location: { pathname: string }; -} - -export default class Home extends React.PureComponent { - componentDidMount() { - document.documentElement.classList.add('white-page'); - document.body.classList.add('white-page'); - } - - componentWillUnmount() { - document.documentElement.classList.remove('white-page'); - document.body.classList.remove('white-page'); - } - - render() { - return ( - } location={this.props.location}> +export default function Home() { + return ( + + {({ currentUser }) => (

    Continuous Code Quality Online

    @@ -102,7 +86,7 @@ export default class Home extends React.PureComponent { - {!isLoggedIn(this.props.currentUser) && } + {!isLoggedIn(currentUser) && }

    Explore open source projects on SonarCloud

    @@ -121,20 +105,6 @@ export default class Home extends React.PureComponent {
    - - ); - } + )} + + ); } diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/HomeContainer.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/HomeContainer.tsx deleted file mode 100644 index 3fc215348bb..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/HomeContainer.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2018 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 { connect } from 'react-redux'; -import Home from './Home'; -import { getCurrentUser } from '../../../store/rootReducer'; - -const mapStateToProps = (state: any) => ({ - currentUser: getCurrentUser(state) -}); - -export default connect(mapStateToProps)(Home); diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx index 80fce789569..f495891978d 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHome.tsx @@ -19,48 +19,32 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import Footer from './Footer'; +import SonarCloudPage from './SonarCloudPage'; import Pricing from './Pricing'; import StartUsing from './StartUsing'; -import GlobalContainer from '../../../app/components/GlobalContainer'; +import { isLoggedIn } from '../../../app/types'; import { getBaseUrl } from '../../../helpers/urls'; import './style.css'; -import { CurrentUser, isLoggedIn } from '../../../app/types'; -interface Props { - currentUser: CurrentUser; - location: { pathname: string }; -} - -export default class SQHome extends React.PureComponent { - componentDidMount() { - document.documentElement.classList.add('white-page'); - document.body.classList.add('white-page'); - } - - componentWillUnmount() { - document.documentElement.classList.remove('white-page'); - document.body.classList.remove('white-page'); - } - - render() { - return ( - } location={this.props.location}> +export default function SQHome() { + return ( + + {({ currentUser }) => (

    You use the service, we take care of the rest

    - {!isLoggedIn(this.props.currentUser) && } + {!isLoggedIn(currentUser) && }
    -
    - ); - } + )} + + ); } function Jumbotron() { @@ -76,15 +60,15 @@ function Jumbotron() {
    Log in or sign up with
    - + GitHub - + Bitbucket - + VSTS diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHomeContainer.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHomeContainer.tsx deleted file mode 100644 index 33be1be21d8..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQHomeContainer.tsx +++ /dev/null @@ -1,28 +0,0 @@ -/* - * SonarQube - * Copyright (C) 2009-2018 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 { connect } from 'react-redux'; -import SQHome from './SQHome'; -import { getCurrentUser } from '../../../store/rootReducer'; - -const mapStateToProps = (state: any) => ({ - currentUser: getCurrentUser(state) -}); - -export default connect(mapStateToProps)(SQHome); diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQStartUsing.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQStartUsing.tsx new file mode 100644 index 00000000000..f7d6693df92 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQStartUsing.tsx @@ -0,0 +1,32 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 * as React from 'react'; +import { Link } from 'react-router'; + +export default function SQStartUsing() { + return ( +
    +
    Start using SonarCloud
    + + Sign up now + +
    + ); +} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQTopNav.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQTopNav.tsx new file mode 100644 index 00000000000..0a6055820b5 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SQTopNav.tsx @@ -0,0 +1,57 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 * as React from 'react'; +import { Link } from 'react-router'; + +export default function SQTopNav() { + return ( +
      +
    • + + Home + +
    • +
    • + + As a Service + +
    • +
    • + + Branch analysis & PR decoration + +
    • +
    • + + SonarLint integration + +
    • +
    + ); +} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarCloudPage.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarCloudPage.tsx new file mode 100644 index 00000000000..84b4a99ade7 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarCloudPage.tsx @@ -0,0 +1,67 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 * as React from 'react'; +import { connect } from 'react-redux'; +import { withRouter, WithRouterProps } from 'react-router'; +import Footer from './Footer'; +import { getCurrentUser, getMyOrganizations } from '../../../store/rootReducer'; +import { CurrentUser, Organization } from '../../../app/types'; +import GlobalContainer from '../../../app/components/GlobalContainer'; + +interface StateProps { + currentUser: CurrentUser; + userOrganizations?: Organization[]; +} + +interface OwnProps { + children: (props: StateProps) => React.ReactNode; +} + +type Props = StateProps & WithRouterProps & OwnProps; + +class SonarCloudPage extends React.Component { + componentDidMount() { + document.documentElement.classList.add('white-page'); + document.body.classList.add('white-page'); + } + + componentWillUnmount() { + document.documentElement.classList.remove('white-page'); + document.body.classList.remove('white-page'); + } + + render() { + const { children, currentUser, userOrganizations } = this.props; + return ( + } location={this.props.location}> + {children({ currentUser, userOrganizations })} + + ); + } +} + +const mapStateToProps = (state: any) => ({ + currentUser: getCurrentUser(state), + userOrganizations: getMyOrganizations(state) +}); + +export default withRouter( + connect(mapStateToProps)(SonarCloudPage) +); diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx new file mode 100644 index 00000000000..17fe58eee42 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx @@ -0,0 +1,100 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 * as React from 'react'; +import SonarCloudPage from './SonarCloudPage'; +import SQStartUsing from './SQStartUsing'; +import SQTopNav from './SQTopNav'; +import { isLoggedIn } from '../../../app/types'; +import { getBaseUrl } from '../../../helpers/urls'; +import './style.css'; + +export default function SonarLintIntegration() { + return ( + + {({ currentUser }) => ( +
    + + +
    + +

    SonarLint integration

    +

    + SonarCloud can be extended with{' '} + + SonarLint + {' '} + to provide developers maximum insight
    in their IDEs on code quality and make + sure they do not introduce new issues. +

    + +
    + +
      +
    • +

      Get instant feedback

      +

      + SonarLint will provide developers with instant feedback in their IDEs as they are + writing code, like with a spell checker. SonarLint also shows already existing + issues in the code and enables developers to differentiate what issues they + introduced. +

      +
    • +
    • +

      Share quality profiles

      +

      + Teams will share the ruleset used to check quality on the project. This means that + not only everyone in the team uses the same rules but it also means that if you + update this ruleset, everybody will use immediately the updated one. +

      +
    • +
    • +

      Share configuration

      +

      + Project configuration such as exclutions, parameters and false positives get + conveyed to the IDE as they get defined, enabling the team get exactly the same view + on the project they are working on. +

      +
    • +
    • +

      Event notification

      +

      + Developers will get notified directly in their IDEs when the Quality Gate of their + project fails or when they have introduced an issue that has been picked by + SonarCloud. +

      +
    • +
    + + {!isLoggedIn(currentUser) && } +
    + )} +
    + ); +} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/StartUsing.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/StartUsing.tsx index cade5100554..c640474aa76 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/StartUsing.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/StartUsing.tsx @@ -24,7 +24,7 @@ import ChevronRightIcon from '../../../components/icons-components/ChevronRightc export default function StartUsing() { return (
    - + Start using SonarCloud
    diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/VSTS.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/VSTS.tsx new file mode 100644 index 00000000000..f641ea825bf --- /dev/null +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/VSTS.tsx @@ -0,0 +1,135 @@ +/* + * SonarQube + * Copyright (C) 2009-2018 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 * as React from 'react'; +import { Link } from 'react-router'; +import SonarCloudPage from './SonarCloudPage'; +import { isLoggedIn } from '../../../app/types'; +import { getBaseUrl } from '../../../helpers/urls'; +import './style.css'; + +export default function VSTS() { + return ( + + {({ currentUser }) => ( +
    +
      +
    • + + Home + +
    • +
    +
    +

    Get the full experience in VSTS

    +
    + +
      +
    • +

      Native extension

      +

      + Using your existing VSTS account and the SonarCloud VSTS build tasks, adding and + configuring SonarCloud analysis to an existing build is a matter of minutes. +

      +
    • +
    • +

      Branches and PR analysis

      +

      + SonarCloud comes with a built-in feature to automatically analyze project branches + and pull requests as soon as they get created. +

      +
    • +
    • +

      Built-in Quality Gate

      +

      + A quality gate is available out of the box in order to verify code quality criteria + at any time, enabling to fail build pipelines but also enabling to notify, through a + webhook, any system that code quality criteria are not met. +

      +
    • +
    • +

      Dedicated widget

      +

      + Once a project is in SonarCloud, a configurable widget can be added to the VSTS + dashboard in order to add code quality to KPIs already used on the project. +

      +
    • +
    + +
    +
    + {!isLoggedIn(currentUser) && ( +
    + SonarCloud +

    Log in or Sign up

    + + SonarCloud + +
    + )} +
    + VSTS Extension +

    Install VSTS Extension

    + + Marketplace + +
    +
    +
    + +
    +

    Analyze .NET languages and more

    +
      +
    • + C# +
    • +
    • + VB +
    • +
    • + JavaScript +
    • +
    • + TypeScript +
    • +
    • + T-SQL +
    • +
    • + C++ +
    • +
    +
    +
    + )} +
    + ); +} diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Home-test.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Home-test.tsx index 9c5caa9619c..a4368fec7a7 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Home-test.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Home-test.tsx @@ -24,15 +24,5 @@ import Home from '../Home'; jest.mock('Docs/EmbedDocsSuggestions.json', () => ({}), { virtual: true }); it('should render', () => { - expect( - shallow() - ).toBeDefined(); -}); - -it('should not render "Start using SonarCloud" button', () => { - expect( - shallow() - .find('.sc-start') - .exists() - ).toBe(false); + expect(shallow()).toBeDefined(); }); diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/style.css b/server/sonar-web/src/main/js/apps/about/sonarcloud/style.css index 1c3d8ada395..f05b2e23fcb 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/style.css +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/style.css @@ -28,6 +28,41 @@ box-shadow: 0 0 0 3px rgba(230, 92, 0, 0.25); } +.sc-black-button, +.sc-orange-button { + display: inline-flex; + align-items: center; + height: 44px; + padding: 0 15px; + line-height: 44px; + border: none; + border-radius: 4px; + + color: #fff; + font-size: 18px; + font-weight: 500; +} + +.sc-black-button { + background-color: var(--sonarcloudBlack800); +} + +.sc-black-button:hover, +.sc-black-button:focus { + color: #fff; + background-color: var(--sonarcloudBlack900); +} + +.sc-orange-button { + background-color: var(--sonarcloudOrange); +} + +.sc-orange-button:hover, +.sc-orange-button:focus { + background-color: var(--sonarcloudOrangeDark); + color: #fff; +} + .sc-page-title { line-height: 56px; margin-top: 40px; @@ -77,6 +112,10 @@ font-weight: 300; } +.sc-feature-description + .sc-feature-description { + margin-top: 16px; +} + .sc-feature-link { margin-top: 16px; color: var(--sonarcloudOrange) !important; @@ -160,15 +199,8 @@ .sc-start { display: inline-flex; align-items: center; - height: 44px; - line-height: 44px; - padding: 0 16px; - border-radius: 5px; - border: none; - color: #fff; font-size: 16px; font-weight: 700; - background-color: var(--sonarcloudOrange); } .sc-start:hover, @@ -327,25 +359,8 @@ } .sc-sq-login-button { - display: inline-flex; - align-items: center; - height: 44px; margin-top: 16px; margin-right: 16px; - padding: 0 15px; - line-height: 44px; - border: none; - border-radius: 4px; - background-color: var(--sonarcloudBlack800); - color: #fff; - font-size: 18px; - font-weight: 500; -} - -.sc-sq-login-button:hover, -.sc-sq-login-button:focus { - color: #fff; - background-color: var(--sonarcloudBlack900); } .sc-sq-login-button > img { @@ -385,6 +400,9 @@ .sc-integrations { position: relative; background-color: var(--sonarcloudBlack200); + margin-left: -20px; + margin-right: -20px; + margin-bottom: -10px; padding: 44px 0px; text-align: center; } @@ -407,7 +425,7 @@ } .sc-bottom-note { - margin: 16px 0; + margin: 26px 0 16px; font-size: 16px; font-weight: 300; text-align: center; @@ -427,3 +445,165 @@ background: url(/images/sonarcloud/sq-background.svg) no-repeat top center; background-size: auto 200vh; } + +.sc-top-nav { + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 30px; +} + +.sc-top-nav-item + .sc-top-nav-item { + margin-left: 13px; + border-left: 1px solid var(--sonarcloudBlack300); + padding-left: 13px; +} + +.sc-top-nav-link { + border-bottom-color: var(--sonarcloudBlack300); + color: var(--baseFontColor); + font-weight: 300; +} + +a.sc-top-nav-link:hover, +a.sc-top-nav-link:focus { + border-bottom-color: var(--sonarcloudOrange); + color: var(--sonarcloudOrange); +} + +.sc-top-nav-active { + border: none; + font-weight: 500; +} + +.sc-child-header { + margin-bottom: 50px; + text-align: center; +} + +.sc-child-title { + margin: 20px 0; + line-height: 45px; + font-size: 44px; + font-weight: 700; +} + +.sc-child-lead { + margin: 20px 0 35px; + line-height: 30px; + font-size: 21px; + font-weight: 300; +} + +.sc-child-lead-link { + border-bottom-color: rgba(255, 102, 0, 0.2); + color: var(--sonarcloudOrange); +} + +.sc-child-lead-link:hover, +.sc-child-lead-link:focus { + border-bottom-color: var(--sonarcloudOrangeDark); + color: var(--sonarcloudOrangeDark); +} + +.sc-child-feature { + width: calc(50% - 60px); +} + +.sc-child-start-using { + display: flex; + align-items: center; + justify-content: space-between; + width: 600px; + margin: 20px auto; + padding: 30px; + border: 1px solid rgba(207, 211, 215, 0.5); + border-radius: 5px; + box-shadow: 0 3px 3px 0 rgba(7, 7, 6, 0.05); +} + +.sc-child-start-using-text { + font-size: 21px; + font-weight: 500; +} + +.sc-child-start-using-link { + padding-right: 0; +} + +.sc-child-start-using-link::after { + content: '→'; + padding: 0 16px; + font-size: 16px; + font-weight: 300; + transition: padding 0.1s ease; +} + +.sc-child-start-using-link:hover::after, +.sc-child-start-using-link:focus::after { + padding-left: 22px; + padding-right: 10px; +} + +.sc-branch-features-list { + flex-direction: column; +} + +.sc-branch-feature { + width: auto; + margin: 0; + padding: 20px 0 40px; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +.sc-branch-feature + .sc-branch-feature { + border-top: 1px solid rgba(207, 211, 215, 0.5); +} + +.sc-branch-feature-left { + margin-left: 60px; +} + +.sc-branch-feature-right { + margin-right: 60px; +} + +.sc-branch-bottom { + padding: 20px 0; + font-size: 21px; + font-weight: 500; + text-align: center; +} + +.sc-vsts-start-wrapper { + margin-top: 20px; + margin-bottom: 50px; + text-align: center; +} + +.sc-vsts-start { + display: inline-flex; + border: 1px solid rgba(207, 211, 215, 0.5); + border-radius: 5px; + box-shadow: 0 3px 3px 0 rgba(7, 7, 6, 0.05); +} + +.sc-vsts-start-box { + display: flex; + flex-direction: column; + align-items: center; + width: 210px; + padding: 30px; +} + +.sc-vsts-start-box + .sc-vsts-start-box { + border-left: 1px solid rgba(207, 211, 215, 0.5); +} + +.sc-vsts-start-title { + margin: 16px 0 24px; + font-size: 21px; + font-weight: 300; +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java b/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java index 502d17cab79..5f255961196 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/web/ServletFilter.java @@ -142,9 +142,8 @@ public abstract class ServletFilter implements Filter { public static class Builder { private static final String WILDCARD_CHAR = "*"; private static final Collection STATIC_RESOURCES = unmodifiableList(asList( - "*.css", "*.css.map", "*.ico", "*.png", "*.jpg", "*.jpeg", "*.gif", "*.svg", "*.js", "*.js.map", - "/static/*", "/robots.txt","/favicon.ico", "/apple-touch-icon*", "/mstile*" - )); + "*.css", "*.css.map", "*.ico", "*.png", "*.jpg", "*.jpeg", "*.gif", "*.svg", "*.js", "*.js.map", "*.pdf", + "/static/*", "/robots.txt", "/favicon.ico", "/apple-touch-icon*", "/mstile*")); private final Set inclusions = new LinkedHashSet<>(); private final Set exclusions = new LinkedHashSet<>(); diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java index 84e800559ce..a9caba6f874 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/web/ServletFilterTest.java @@ -161,9 +161,9 @@ public class ServletFilterTest { @Test public void use_include_and_exclude_prefix() { ServletFilter.UrlPattern pattern = ServletFilter.UrlPattern.builder() - .includes("/foo_2") - .excludes("/foo") - .build(); + .includes("/foo_2") + .excludes("/foo") + .build(); assertThat(pattern.matches("/")).isFalse(); assertThat(pattern.matches("/foo_2")).isTrue(); assertThat(pattern.matches("/foo")).isFalse(); @@ -238,6 +238,7 @@ public class ServletFilterTest { "*.svg", "*.js", "*.js.map", + "*.pdf", "/static/*", "/robots.txt", "/favicon.ico",