From 3d4819e32de3ebfb68291de0467f1e2360d0d2cf Mon Sep 17 00:00:00 2001 From: Grégoire Aubert Date: Mon, 8 Oct 2018 09:24:03 +0200 Subject: SONARCLOUD-132 New homepage * Create sticky menu bar * Add languages section animation * Add figures section counter animation * Animate featured projects carrousel --- .../src/main/js/@types/react-countup.d.ts | 31 ++ .../sonar-web/src/main/js/app/styles/init/misc.css | 4 + server/sonar-web/src/main/js/app/theme.js | 4 +- .../main/js/apps/about/sonarcloud/AsAService.tsx | 10 +- .../js/apps/about/sonarcloud/BranchAnalysis.tsx | 10 +- .../src/main/js/apps/about/sonarcloud/Contact.tsx | 6 +- .../src/main/js/apps/about/sonarcloud/Footer.tsx | 170 ------- .../src/main/js/apps/about/sonarcloud/Home.tsx | 347 ++++++++++---- .../src/main/js/apps/about/sonarcloud/Pricing.tsx | 45 -- .../src/main/js/apps/about/sonarcloud/SQHome.tsx | 86 ++-- .../main/js/apps/about/sonarcloud/SQStartUsing.tsx | 32 -- .../src/main/js/apps/about/sonarcloud/SQTopNav.tsx | 52 --- .../js/apps/about/sonarcloud/SonarCloudPage.tsx | 69 --- .../apps/about/sonarcloud/SonarLintIntegration.tsx | 10 +- .../main/js/apps/about/sonarcloud/StartUsing.tsx | 41 -- .../src/main/js/apps/about/sonarcloud/VSTS.tsx | 6 +- .../about/sonarcloud/__tests__/Footer-test.tsx | 26 -- .../apps/about/sonarcloud/__tests__/Home-test.tsx | 12 +- .../__tests__/__snapshots__/Home-test.tsx.snap | 506 +++++++++++++++++++++ .../sonarcloud/components/FeaturedProjects.css | 126 +++++ .../sonarcloud/components/FeaturedProjects.tsx | 308 +++++++++++++ .../js/apps/about/sonarcloud/components/Footer.css | 86 ++++ .../js/apps/about/sonarcloud/components/Footer.tsx | 171 +++++++ .../apps/about/sonarcloud/components/Languages.tsx | 111 +++++ .../about/sonarcloud/components/LoginButtons.css | 48 ++ .../about/sonarcloud/components/LoginButtons.tsx | 41 ++ .../apps/about/sonarcloud/components/NavBars.css | 102 +++++ .../apps/about/sonarcloud/components/NavBars.tsx | 91 ++++ .../apps/about/sonarcloud/components/Pricing.tsx | 45 ++ .../sonarcloud/components/SQPageContainer.tsx | 69 +++ .../about/sonarcloud/components/SQStartUsing.tsx | 32 ++ .../apps/about/sonarcloud/components/SQTopNav.tsx | 52 +++ .../about/sonarcloud/components/StartUsing.tsx | 41 ++ .../about/sonarcloud/components/Statistics.css | 42 ++ .../about/sonarcloud/components/Statistics.tsx | 105 +++++ .../components/__tests__/FeaturedProjects-test.tsx | 107 +++++ .../components/__tests__/Footer-test.tsx | 26 ++ .../components/__tests__/LoginButtons-test.tsx | 26 ++ .../components/__tests__/Statistics-test.tsx | 36 ++ .../__snapshots__/FeaturedProjects-test.tsx.snap | 244 ++++++++++ .../__snapshots__/LoginButtons-test.tsx.snap | 39 ++ .../__snapshots__/Statistics-test.tsx.snap | 43 ++ .../main/js/apps/about/sonarcloud/new_style.css | 250 ++++++++++ .../src/main/js/apps/about/sonarcloud/style.css | 160 ++----- .../src/main/js/apps/about/sonarcloud/utils.ts | 134 ++++++ .../projects/components/ProjectCardLanguages.tsx | 30 +- .../components/ProjectCardOverallMeasures.tsx | 1 + .../ProjectCardLanguages-test.tsx.snap | 76 +--- .../ProjectCardOverallMeasures-test.tsx.snap | 8 +- .../sonar-web/src/main/js/apps/projects/utils.ts | 4 +- .../js/components/common/OrganizationAvatar.css | 2 +- .../js/components/common/OrganizationAvatar.tsx | 13 +- .../src/main/js/components/nav/NavBar.tsx | 5 +- 53 files changed, 3328 insertions(+), 813 deletions(-) create mode 100644 server/sonar-web/src/main/js/@types/react-countup.d.ts delete mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx delete mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx delete mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/SQStartUsing.tsx delete mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/SQTopNav.tsx delete mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/SonarCloudPage.tsx delete mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/StartUsing.tsx delete mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Footer-test.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/__snapshots__/Home-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.css create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/FeaturedProjects.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/Footer.css create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/Footer.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/Languages.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/LoginButtons.css create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/LoginButtons.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/NavBars.css create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/NavBars.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/Pricing.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/SQPageContainer.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/SQStartUsing.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/SQTopNav.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/StartUsing.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/Statistics.css create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/Statistics.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/FeaturedProjects-test.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/Footer-test.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/LoginButtons-test.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/Statistics-test.tsx create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/FeaturedProjects-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/LoginButtons-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/components/__tests__/__snapshots__/Statistics-test.tsx.snap create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/new_style.css create mode 100644 server/sonar-web/src/main/js/apps/about/sonarcloud/utils.ts (limited to 'server/sonar-web/src/main/js') diff --git a/server/sonar-web/src/main/js/@types/react-countup.d.ts b/server/sonar-web/src/main/js/@types/react-countup.d.ts new file mode 100644 index 00000000000..138db886f88 --- /dev/null +++ b/server/sonar-web/src/main/js/@types/react-countup.d.ts @@ -0,0 +1,31 @@ +/* + * 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. + */ +declare module 'react-countup' { + interface Props { + decimal?: string; + decimals?: number; + delay?: number; + duration?: number; + end: number; + suffix?: string; + } + + export default function CountUp(props: Props): JSX.Element; +} diff --git a/server/sonar-web/src/main/js/app/styles/init/misc.css b/server/sonar-web/src/main/js/app/styles/init/misc.css index b13e0a463a7..8498249f48d 100644 --- a/server/sonar-web/src/main/js/app/styles/init/misc.css +++ b/server/sonar-web/src/main/js/app/styles/init/misc.css @@ -308,6 +308,10 @@ td.big-spacer-top { position: absolute !important; } +.position-relative { + position: relative !important; +} + .rounded { border-radius: 2px; } diff --git a/server/sonar-web/src/main/js/app/theme.js b/server/sonar-web/src/main/js/app/theme.js index 09c8c994264..400d4a99a9e 100644 --- a/server/sonar-web/src/main/js/app/theme.js +++ b/server/sonar-web/src/main/js/app/theme.js @@ -135,8 +135,8 @@ module.exports = { popupZIndex: '5000', // sonarcloud - sonarcloudOrange: '#f60', - sonarcloudOrangeDark: '#e65c00', + sonarcloudOrange500: '#fd6a00', + sonarcloudOrange700: '#db5700', sonarcloudBlack100: '#ffffff', sonarcloudBlack200: '#f9f9fb', sonarcloudBlack300: '#cfd3d7', 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 index fad4823c0e1..ed1cef669bd 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/AsAService.tsx @@ -18,16 +18,16 @@ * 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 SQPageContainer from './components/SQPageContainer'; +import SQStartUsing from './components/SQStartUsing'; +import SQTopNav from './components/SQTopNav'; import { isLoggedIn } from '../../../app/types'; import { getBaseUrl } from '../../../helpers/urls'; import './style.css'; export default function AsAService() { return ( - + {({ currentUser }) => (
@@ -85,6 +85,6 @@ export default function AsAService() { {!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 index 19c5f5dddd2..5d2695bbca2 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/BranchAnalysis.tsx @@ -18,16 +18,16 @@ * 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 SQPageContainer from './components/SQPageContainer'; +import SQStartUsing from './components/SQStartUsing'; +import SQTopNav from './components/SQTopNav'; import { isLoggedIn } from '../../../app/types'; import { getBaseUrl } from '../../../helpers/urls'; import './style.css'; export default function BranchAnalysis() { return ( - + {({ currentUser }) => (
@@ -115,6 +115,6 @@ export default function BranchAnalysis() { {!isLoggedIn(currentUser) && }
)} -
+ ); } diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx index c3b1863ea79..59d084dfe9d 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/Contact.tsx @@ -20,7 +20,7 @@ import * as React from 'react'; import { Link } from 'react-router'; import { Location } from 'history'; -import SonarCloudPage from './SonarCloudPage'; +import SQPageContainer from './components/SQPageContainer'; import Select from '../../../components/controls/Select'; import { isLoggedIn, Organization } from '../../../app/types'; import { Alert } from '../../../components/ui/Alert'; @@ -80,7 +80,7 @@ export default class Contact extends React.PureComponent { render() { return ( - + {({ currentUser, userOrganizations }) => (

Contact us

@@ -205,7 +205,7 @@ export default class Contact extends React.PureComponent {
)} -
+ ); } } 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 deleted file mode 100644 index e5336f98577..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Footer.tsx +++ /dev/null @@ -1,170 +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 * as React from 'react'; -import { Link } from 'react-router'; -import { getBaseUrl } from '../../../helpers/urls'; - -export default function Footer() { - return ( - - ); -} 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 21f62fb4f5d..ae083870881 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 @@ -18,103 +18,280 @@ * 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 Pricing from './Pricing'; -import StartUsing from './StartUsing'; -import { isLoggedIn } from '../../../app/types'; -import ChevronRightIcon from '../../../components/icons-components/ChevronRightcon'; -import './style.css'; +import { FixedNavBar, TopNavBar } from './components/NavBars'; +import FeaturedProjects from './components/FeaturedProjects'; +import Footer from './components/Footer'; +import Statistics from './components/Statistics'; +import { Languages } from './components/Languages'; +import LoginButtons from './components/LoginButtons'; +import { getBaseUrl } from '../../../helpers/urls'; +import './new_style.css'; -export default function Home() { - return ( - - {({ currentUser }) => ( -
-

Continuous Code Quality Online

-

- Analyze the quality of your source code to detect bugs, vulnerabilities
- and code smells throughout the development process. -

- -
    -
  • -

    Built on SonarQube

    -

    - The broadly used code review tool to detect bugs, code smells and vulnerability - issues. -

    -
  • - -
  • -

    17 languages

    -

    - Java, JS, C#, C/C++, Objective-C, TypeScript, Python, Go, ABAP, PL/SQL, T-SQL and - more. -

    -
  • +// TODO Get this from an external source +const STATISTICS = [ + { icon: 'rules', text: 'Static analysis rules checked', value: 9675 }, + { icon: 'locs', text: 'Lines of code analyzed', value: 20000000 }, + { icon: 'pull-request', text: 'Pull Requests decorated', value: 100675 }, + { icon: 'open-source', text: 'Open source projects inspected', value: 99675 } +]; -
  • -

    Thousands of rules

    -

    - Track down hard-to-find bugs and quality issues thanks to powerful static code - analyzers. -

    -
  • - -
  • -

    Cloud CI Integrations

    -

    - Schedule the execution of an analysis from Cloud CI engines: Travis, VSTS, AppVeyor - and more. -

    -
  • - -
  • -

    Deep code analysis

    -

    - Explore all your source files, whether in branches or pull requests, to reach a - green quality gate and promote the build. -

    -
  • +export default class Home extends React.PureComponent { + componentDidMount() { + document.documentElement.classList.add('white-page'); + document.body.classList.add('white-page'); + } -
  • -

    Fast and Scalable

    -

    Scale on-demand as your projects grow.

    -
  • -
+ componentWillUnmount() { + document.documentElement.classList.remove('white-page'); + document.body.classList.remove('white-page'); + } - + render() { + return ( +
+
+
+ + + + + + + + + +
+
+
+
+ ); + } +} - {!isLoggedIn(currentUser) && } +function PageBackgroundHeader() { + return ( +
+
+
+
+ +
+
+ ); +} -
-

Explore open source projects on SonarCloud

-

- SonarCloud offers free analysis for open source projects.
- It is public and open to anyone who wants to browse the service. +function PageTitle() { + return ( +

+
+
+

Clean Code

+

Rockstar Status

+
+ Eliminate bugs and vulnerabilities, +
+ champion quality code in your projects. +
+
+
Go ahead! Analyze your repo:
+ +

+ Free for Open Source Projects

+
+
+
+ +
+
+ ); +} + +function EnhanceWorkflow() { + return ( +
+
+

+ Enhance Your Workflow +
+ with Continuous Code Quality +

+ +
Maximize your throughput, only release clean code
+
+ Sonarcloud automatically analyzes branches and decorates pull requests +
+
+
+ ); +} -
- - Browse - +function Functionality() { + return ( +
+
+
+ +
+
+
+
+

+ Functionality +
+ that Fits Your Projects +

+
+
+
Easy to Use
+

+ With just a few clicks you’re up and running right where your code lives. Immediate + access to the latest features and enhancements. +

+
+ + {' '} + Scale on-demand as your projects grow. + + + {' '} + No contracts, stop/start anytime. + +
+
+ +
+
+
+
+ +
+
+
+
Open and transparent
+

+ Project dashboards keep teams and stakeholders informed on code quality and + releasability +

+

Display project badges and show your communities you’re all about awesome

+ +
+
+
+
+
+
Effective Collaboration
-
-

News

- - - See all - +

+ Use + SonarCloud + with your team, share best practices and have fun writing quality code! +

+
+

+ Connect with + SonarCloud + and get real-time notifications in your IDE as you work. +

+
+ +
+ +
+
- )} - +
+
+ ); +} + +function Stats() { + return ( +
+
+
+ Over 3,000 projects +
+ continuously analyzed +
+ +
+
+ ); +} + +function Projects() { + return ( +
+
+
+ Transparency makes sense +
+ and that’s why the trend is growing. +
+

+ Check out these open source projects showing users +
+ their commitment to quality. +

+ +
+ Come join the fun, it’s entirely free for open source projects ! +
+
+ +
+
+
); } diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx deleted file mode 100644 index 89d4308b71f..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/Pricing.tsx +++ /dev/null @@ -1,45 +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 * as React from 'react'; -import { Link } from 'react-router'; - -export default function Pricing() { - return ( -
-
-

Open Source Projects

-   - Free -
- -
-

Private Projects

- 14 days free trial - - From 10€ - /mo - - - see prices - -
-
- ); -} 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 1b0bfe98092..325a526dd9d 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,16 +19,17 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import SonarCloudPage from './SonarCloudPage'; -import Pricing from './Pricing'; -import StartUsing from './StartUsing'; +import LoginButtons from './components/LoginButtons'; +import Pricing from './components/Pricing'; +import SQPageContainer from './components/SQPageContainer'; +import StartUsing from './components/StartUsing'; import { isLoggedIn } from '../../../app/types'; import { getBaseUrl } from '../../../helpers/urls'; import './style.css'; export default function SQHome() { return ( - + {({ currentUser }) => (
@@ -43,7 +44,7 @@ export default function SQHome() {
)} -
+ ); } @@ -61,26 +62,7 @@ function Jumbotron() {
Log in or sign up with
- +
Java @@ -170,7 +152,7 @@ function Languages() { JavaScript @@ -178,7 +160,7 @@ function Languages() { TypeScript @@ -186,7 +168,7 @@ function Languages() { C# @@ -194,34 +176,49 @@ function Languages() { C++
  • - Go + Go
  • Python
  • - PHP + PHP
    • - VB + VB
    • Flex
    • @@ -229,7 +226,7 @@ function Languages() { HTML @@ -237,7 +234,7 @@ function Languages() { Swift @@ -245,7 +242,7 @@ function Languages() { Objective-C @@ -253,7 +250,7 @@ function Languages() { T-SQL @@ -261,7 +258,7 @@ function Languages() { PL/SQL @@ -269,12 +266,17 @@ function Languages() { ABAP
    • - XML + XML
    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 deleted file mode 100644 index f7d6693df92..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQStartUsing.tsx +++ /dev/null @@ -1,32 +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 * 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 deleted file mode 100644 index 7c0a17b8b79..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SQTopNav.tsx +++ /dev/null @@ -1,52 +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 * as React from 'react'; -import { Link } from 'react-router'; - -export default function SQTopNav() { - return ( -
      -
    • - - 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 deleted file mode 100644 index 3608dbd79eb..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarCloudPage.tsx +++ /dev/null @@ -1,69 +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 * as React from 'react'; -import { connect } from 'react-redux'; -import { withRouter, WithRouterProps } from 'react-router'; -import Footer from './Footer'; -import { getCurrentUser, getMyOrganizations, Store } 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() { - if (document.documentElement) { - document.documentElement.classList.add('white-page'); - } - document.body.classList.add('white-page'); - } - - componentWillUnmount() { - if (document.documentElement) { - 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: Store) => ({ - 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 index 69a0bceabbe..d3c6eba303a 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/SonarLintIntegration.tsx @@ -18,16 +18,16 @@ * 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 SQPageContainer from './components/SQPageContainer'; +import SQStartUsing from './components/SQStartUsing'; +import SQTopNav from './components/SQTopNav'; import { isLoggedIn } from '../../../app/types'; import { getBaseUrl } from '../../../helpers/urls'; import './style.css'; export default function SonarLintIntegration() { return ( - + {({ currentUser }) => (
    @@ -95,6 +95,6 @@ export default function SonarLintIntegration() { {!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 deleted file mode 100644 index c640474aa76..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/StartUsing.tsx +++ /dev/null @@ -1,41 +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 * as React from 'react'; -import { Link } from 'react-router'; -import ChevronRightIcon from '../../../components/icons-components/ChevronRightcon'; - -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 index f641ea825bf..c5a9523bf92 100644 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/VSTS.tsx +++ b/server/sonar-web/src/main/js/apps/about/sonarcloud/VSTS.tsx @@ -19,14 +19,14 @@ */ import * as React from 'react'; import { Link } from 'react-router'; -import SonarCloudPage from './SonarCloudPage'; +import SQPageContainer from './components/SQPageContainer'; import { isLoggedIn } from '../../../app/types'; import { getBaseUrl } from '../../../helpers/urls'; import './style.css'; export default function VSTS() { return ( - + {({ currentUser }) => (
      @@ -130,6 +130,6 @@ export default function VSTS() {
    )} - + ); } diff --git a/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Footer-test.tsx b/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Footer-test.tsx deleted file mode 100644 index 0d1eb668efa..00000000000 --- a/server/sonar-web/src/main/js/apps/about/sonarcloud/__tests__/Footer-test.tsx +++ /dev/null @@ -1,26 +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 * as React from 'react'; -import { shallow } from 'enzyme'; -import Footer from '../Footer'; - -it('should render', () => { - expect(shallow(