From: Grégoire Aubert Date: Wed, 30 May 2018 09:58:36 +0000 (+0200) Subject: SONAR-10811 Update editions boxes for marketing needs X-Git-Tag: 7.5~1027 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a8e976cb9ef832197897c7d466ba6ab67c7e6625;p=sonarqube.git SONAR-10811 Update editions boxes for marketing needs --- diff --git a/server/sonar-docs/src/images/sonarsource-icon.png b/server/sonar-docs/src/images/sonarsource-icon.png new file mode 100644 index 00000000000..430eb1f3688 Binary files /dev/null and b/server/sonar-docs/src/images/sonarsource-icon.png differ diff --git a/server/sonar-docs/src/tooltips/editions/community.md b/server/sonar-docs/src/tooltips/editions/community.md deleted file mode 100644 index 61ca7e8bee5..00000000000 --- a/server/sonar-docs/src/tooltips/editions/community.md +++ /dev/null @@ -1,3 +0,0 @@ -### Community Edition - -Comes with support for 9 programming languages, numerous plugins, integration with DevOps tool chains, and ability to connect to SonarLint in the IDE. diff --git a/server/sonar-docs/src/tooltips/editions/datacenter.md b/server/sonar-docs/src/tooltips/editions/datacenter.md index 228f816a023..4976256eb49 100644 --- a/server/sonar-docs/src/tooltips/editions/datacenter.md +++ b/server/sonar-docs/src/tooltips/editions/datacenter.md @@ -1,3 +1,3 @@ -### Data Center Edition +### ![SonarSource logo](/images/sonarsource-icon.png) Data Center Edition -Enterprise Edition + component redundancy and data integrity +Support for High-Availability. Allow every node of SonarQube to be redundant, in order to keep the service up at all times without worrying about downtime or interruption. diff --git a/server/sonar-docs/src/tooltips/editions/developer.md b/server/sonar-docs/src/tooltips/editions/developer.md index 6c1bf7f0461..d2fafe1afb1 100644 --- a/server/sonar-docs/src/tooltips/editions/developer.md +++ b/server/sonar-docs/src/tooltips/editions/developer.md @@ -1,3 +1,7 @@ -### Developer Edition +### ![SonarSource logo](/images/sonarsource-icon.png) Developer Edition + +* Branch and Pull Requests analysis +* Analysis of additional languages: C/C++, Objective-C, PL/SQL, ABAP , VB.NET, TSQL , Swift +* Detection of security vulnerabilities +* SonarLint notifications -Community Edition + branch analysis, SonarLint push notifications, and 16 languages. diff --git a/server/sonar-docs/src/tooltips/editions/enterprise.md b/server/sonar-docs/src/tooltips/editions/enterprise.md index 918dddbf05b..34f709880df 100644 --- a/server/sonar-docs/src/tooltips/editions/enterprise.md +++ b/server/sonar-docs/src/tooltips/editions/enterprise.md @@ -1,3 +1,7 @@ -### Enterprise Edition +### ![SonarSource logo](/images/sonarsource-icon.png) Enterprise Edition + +* Portfolio management +* Executive reporting +* Analysis of additional languages: COBOL, PL/I, RPG & VB6 +* Parallel processing of analysis reports -Developer Edition + portfolio management, executive reporting, parallel processing of analysis reports and 20 languages. diff --git a/server/sonar-web/src/main/js/apps/marketplace/App.tsx b/server/sonar-web/src/main/js/apps/marketplace/App.tsx index 966ab400de0..486f4e2bd17 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/App.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/App.tsx @@ -119,7 +119,7 @@ export default class App extends React.PureComponent { }; render() { - const { currentEdition, standaloneMode, pendingPlugins } = this.props; + const { currentEdition = 'community', standaloneMode, pendingPlugins } = this.props; const { loadingPlugins, plugins } = this.state; const query = parseQuery(this.props.location.query); const filteredPlugins = query.search ? filterPlugins(plugins, query.search) : plugins; @@ -128,8 +128,11 @@ export default class App extends React.PureComponent {
-
+
+
+

{translate('marketplace.page.open_source_plugins')}

+
{ render() { const { currentEdition } = this.props; const { serverId, ncloc } = this.state; + const currentEditionIdx = EDITIONS.findIndex(edition => edition.key === currentEdition); + const visibleEditions = EDITIONS.slice(currentEditionIdx + 1); + + if (visibleEditions.length <= 0) { + return null; + } + return (
- {EDITIONS.map(edition => ( + {visibleEditions.map(edition => ( +

{translate('marketplace.page')}

-

{translate('marketplace.page.description')}

+

+ {translate('marketplace.page.you_are_running', currentEdition)} +

+

+ {currentEdition === 'datacenter' + ? translate('marketplace.page.description_best_edition') + : translate('marketplace.page.description')} +

); } diff --git a/server/sonar-web/src/main/js/apps/marketplace/__tests__/EditionBoxes-test.tsx b/server/sonar-web/src/main/js/apps/marketplace/__tests__/EditionBoxes-test.tsx index dd49bb10079..9c35ee382d6 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/__tests__/EditionBoxes-test.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/__tests__/EditionBoxes-test.tsx @@ -23,19 +23,41 @@ import EditionBoxes from '../EditionBoxes'; jest.mock('../utils', () => ({ EDITIONS: [ - { key: 'comunity', homeUrl: 'more_url' }, - { key: 'developer', downloadUrl: 'download_url', homeUrl: 'more_url' } + { key: 'community', name: 'Community Edition', homeUrl: 'more_url' }, + { + key: 'developer', + name: 'Developer Edition', + homeUrl: 'more_url' + }, + { + key: 'enterprise', + name: 'Enterprise Edition', + homeUrl: 'more_url' + }, + { + key: 'datacenter', + name: 'Data Center Edition', + homeUrl: 'more_url' + } ] })); -it('should display the edition boxes correctly', () => { +it('should display the available edition boxes correctly', () => { expect(getWrapper()).toMatchSnapshot(); }); -it('should display the developer edition as installed', () => { +it('should display the enterprise and datacenter edition boxes', () => { expect(getWrapper({ currentEdition: 'developer' })).toMatchSnapshot(); }); +it('should display the datacenter edition box only', () => { + expect(getWrapper({ currentEdition: 'enterprise' })).toMatchSnapshot(); +}); + +it('should not display any edition box', () => { + expect(getWrapper({ currentEdition: 'datacenter' }).type()).toBeNull(); +}); + function getWrapper(props = {}) { - return shallow(); + return shallow(); } diff --git a/server/sonar-web/src/main/js/apps/marketplace/__tests__/Header-test.tsx b/server/sonar-web/src/main/js/apps/marketplace/__tests__/Header-test.tsx new file mode 100644 index 00000000000..3e0a609c781 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/marketplace/__tests__/Header-test.tsx @@ -0,0 +1,27 @@ +/* + * 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 Header from '../Header'; + +it('should render with installed editions', () => { + expect(shallow(
)).toMatchSnapshot(); + expect(shallow(
)).toMatchSnapshot(); +}); diff --git a/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/EditionBoxes-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/EditionBoxes-test.tsx.snap index 687a2cde364..d8abf481899 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/EditionBoxes-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/EditionBoxes-test.tsx.snap @@ -1,57 +1,88 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should display the developer edition as installed 1`] = ` +exports[`should display the available edition boxes correctly 1`] = `
+
`; -exports[`should display the edition boxes correctly 1`] = ` +exports[`should display the datacenter edition box only 1`] = `
+
+`; + +exports[`should display the enterprise and datacenter edition boxes 1`] = ` +
+
`; diff --git a/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/Header-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/Header-test.tsx.snap new file mode 100644 index 00000000000..4b6c283ca46 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/marketplace/__tests__/__snapshots__/Header-test.tsx.snap @@ -0,0 +1,47 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render with installed editions 1`] = ` +
+

+ marketplace.page +

+

+ marketplace.page.you_are_running.community +

+

+ marketplace.page.description +

+
+`; + +exports[`should render with installed editions 2`] = ` +
+

+ marketplace.page +

+

+ marketplace.page.you_are_running.datacenter +

+

+ marketplace.page.description_best_edition +

+
+`; diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx index 968aa566020..55309126c7e 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/EditionBox.tsx @@ -18,10 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import CheckIcon from '../../../components/icons-components/CheckIcon'; -import { translate } from '../../../helpers/l10n'; -import DocInclude from '../../../components/docs/DocInclude'; import { Edition, getEditionUrl } from '../utils'; +import DocInclude from '../../../components/docs/DocInclude'; +import { translate } from '../../../helpers/l10n'; interface Props { currentEdition: string; @@ -30,23 +29,16 @@ interface Props { serverId?: string; } -export default function EditionBox({ currentEdition, edition, ncloc, serverId }: Props) { - const isInstalled = currentEdition === edition.key; - const url = getEditionUrl(edition, { ncloc, serverId, sourceEdition: currentEdition }); +export default function EditionBox({ edition, ncloc, serverId, currentEdition }: Props) { return (
- {isInstalled && ( - - - {translate('marketplace.installed')} - - )} -
- -
+
diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/EditionBox-test.tsx b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/EditionBox-test.tsx index 4142b022e58..f4398076daf 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/EditionBox-test.tsx +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/EditionBox-test.tsx @@ -29,13 +29,14 @@ const DEFAULT_EDITION = { }; it('should display the edition', () => { - expect(getWrapper({ ncloc: 1000, serverId: 'serverId' })).toMatchSnapshot(); + expect( + shallow( + + ) + ).toMatchSnapshot(); }); - -it('should show insalled badge', () => { - expect(getWrapper({ currentEdition: 'foo' })).toMatchSnapshot(); -}); - -function getWrapper(props = {}) { - return shallow(); -} diff --git a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionBox-test.tsx.snap b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionBox-test.tsx.snap index 39c71155bc6..69af9d6c1db 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionBox-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/marketplace/components/__tests__/__snapshots__/EditionBox-test.tsx.snap @@ -4,50 +4,18 @@ exports[`should display the edition 1`] = ` -`; - -exports[`should show insalled badge 1`] = ` -
- - - marketplace.installed - -
- -
-
diff --git a/server/sonar-web/src/main/js/apps/marketplace/style.css b/server/sonar-web/src/main/js/apps/marketplace/style.css index 0e2ef2a2831..5016e1db61b 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/style.css +++ b/server/sonar-web/src/main/js/apps/marketplace/style.css @@ -20,7 +20,6 @@ .marketplace-editions { display: flex; flex-direction: row; - justify-content: space-between; margin-left: -8px; margin-right: -8px; } @@ -33,6 +32,11 @@ justify-content: space-between; margin-left: 8px; margin-right: 8px; + max-width: 50%; +} + +.marketplace-edition .markdown img { + width: 16px; } .marketplace-edition .markdown h3 { diff --git a/server/sonar-web/src/main/js/apps/marketplace/utils.ts b/server/sonar-web/src/main/js/apps/marketplace/utils.ts index 0c93eb22f17..29ea02d891f 100644 --- a/server/sonar-web/src/main/js/apps/marketplace/utils.ts +++ b/server/sonar-web/src/main/js/apps/marketplace/utils.ts @@ -66,7 +66,7 @@ export const EDITIONS: Edition[] = [ export function getEditionUrl( edition: Edition, - data: { serverId?: string; ncloc?: number; sourceEdition: string } + data: { serverId?: string; ncloc?: number; sourceEdition?: string } ) { let url = edition.homeUrl; const query = stringify(omitNil(data)); diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 546935e89ba..f35e01ce87c 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -190,6 +190,7 @@ visibility=Visibility with=With worst=Worst yes=Yes +no=No @@ -2132,7 +2133,13 @@ workspace.no_rule=The rule has been removed or never existed. # #------------------------------------------------------------------------------ marketplace.page=Marketplace -marketplace.page.description=Discover and install new features +marketplace.page.description=Discover more features with the SonarSource Editions: +marketplace.page.description_best_edition=This Edition gives you access to all features of the SonarQube-SonarLint ecosystem, including all SonarSource code analyzers ! +marketplace.page.you_are_running.community=You are currently running a Community Edition. +marketplace.page.you_are_running.developer=You are currently running a Developer Edition. +marketplace.page.you_are_running.enterprise=You are currently running an Enterprise Edition. +marketplace.page.you_are_running.datacenter=You are currently running a Data Center Edition. +marketplace.page.open_source_plugins=Community plugins marketplace.instance_needs_to_be_restarted_to={instance} needs to be restarted in order to marketplace.install_x_plugins=install {nb} plugins marketplace.update_x_plugins=update {nb} plugins @@ -2154,6 +2161,7 @@ marketplace.checking_license=Checking your license... marketplace._installed=installed marketplace.available_under_commercial_license=Available under our commercial editions marketplace.learn_more=Learn more +marketplace.ask_for_information=Ask for more information marketplace.homepage=Homepage marketplace.issue_tracker=Issue Tracker marketplace.licensed_under_x=Licensed under {license}