From: Philippe Perrin Date: Tue, 20 Apr 2021 16:46:48 +0000 (+0200) Subject: SONAR-14728 Improve UX around scanner's download from an in-app tutorial X-Git-Tag: 8.9.0.43852~53 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c7ff9d6de3670cf3ea6cc87cbdfb1823a1c5ed6b;p=sonarqube.git SONAR-14728 Improve UX around scanner's download from an in-app tutorial --- diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx index af25c9819be..0ead421f64b 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DotNetFramework.tsx @@ -19,7 +19,6 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Link } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { DotNetProps } from './DotNet'; import DotNetExecute from './DotNetExecute'; @@ -39,21 +38,23 @@ export default function DotNetFramework(props: DotNetProps) {

{translate('onboarding.analysis.msbuild.header')}

-

+

%PATH% }} + values={{ + code: %PATH%, + link: ( + + {translate('onboarding.analysis.msbuild.docs_link')} + + ) + }} />

-

- - {translate('download_verb')} - -

diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx index 06bce10a168..81ef04c99b7 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/DownloadScanner.tsx @@ -19,7 +19,6 @@ */ import * as React from 'react'; import { FormattedMessage } from 'react-intl'; -import { Link } from 'react-router'; import { translate } from 'sonar-ui-common/helpers/l10n'; import { OSs } from '../../types'; @@ -27,7 +26,7 @@ interface Props { os: OSs; } -export default function SQScanner(props: Props) { +export default function DownloadScanner(props: Props) { const { os } = props; return (
@@ -38,15 +37,18 @@ export default function SQScanner(props: Props) { id="onboarding.analysis.sq_scanner.text" values={{ dir: bin, - env_var: {os === OSs.Windows ? '%PATH%' : 'PATH'} + env_var: {os === OSs.Windows ? '%PATH%' : 'PATH'}, + link: ( + + {translate('onboarding.analysis.sq_scanner.docs_link')} + + ) }} />

-

- - {translate('download_verb')} - -

); } diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap index a1bc4455cf1..7539b8cf22d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/CLangGCCCommand-test.tsx.snap @@ -5,7 +5,7 @@ exports[`Shoud renders correctly 1`] = ` -

%PATH% , + "link": + onboarding.analysis.msbuild.docs_link + , } } />

-

- - download_verb - -

PATH , + "link": + onboarding.analysis.sq_scanner.docs_link + , } } />

-

- - download_verb - -

`; @@ -60,21 +56,17 @@ exports[`Shoud renders for "mac" correctly 1`] = ` "env_var": PATH , + "link": + onboarding.analysis.sq_scanner.docs_link + , } } />

-

- - download_verb - -

`; @@ -99,20 +91,16 @@ exports[`Shoud renders for "win" correctly 1`] = ` "env_var": %PATH% , + "link": + onboarding.analysis.sq_scanner.docs_link + , } } />

-

- - download_verb - -

`; diff --git a/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/Other-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/Other-test.tsx.snap index f031c8c142c..2d3b3086434 100644 --- a/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/Other-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/manual/commands/__tests__/__snapshots__/Other-test.tsx.snap @@ -2,7 +2,7 @@ exports[`renders correctly 1`] = `
- %PATH% environment variable -onboarding.analysis.msbuild.execute.sonarcloud=Execute the Scanner for MSBuild from your computer -onboarding.analysis.msbuild.execute.text.sonarcloud=Execute the following commands at the root of your solution. onboarding.analysis.sq_scanner.header.linux=Download and unzip the Scanner for Linux onboarding.analysis.sq_scanner.header.win=Download and unzip the Scanner for Windows onboarding.analysis.sq_scanner.header.mac=Download and unzip the Scanner for macOS -onboarding.analysis.sq_scanner.text=And add the {dir} directory to the {env_var} environment variable -onboarding.analysis.sq_scanner.text.linux=And add the bin directory to the PATH environment variable -onboarding.analysis.sq_scanner.text.win=And add the bin directory to the %PATH% environment variable -onboarding.analysis.sq_scanner.text.mac=And add the bin directory to the PATH environment variable -onboarding.analysis.sq_scanner.text.ci=And add the bin directory to the PATH environment variable -onboarding.analysis.sq_scanner.text.sonarcloud=Add the following lines to your {file} file: +onboarding.analysis.sq_scanner.text=Visit the {link} to download the latest version, and add the {dir} directory to the {env_var} environment variable onboarding.analysis.sq_scanner.execute=Execute the Scanner from your computer onboarding.analysis.sq_scanner.execute.text=Running a {instance} analysis is straighforward. You just need to execute the following commands in your project's folder. onboarding.analysis.sq_scanner.execute.text.custom=Run the following commands in your project's folder.