* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { FlagMessage, Link } from 'design-system';
+import { LinkStandalone as Link } from '@sonarsource/echoes-react';
+import { FlagMessage } from 'design-system';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { DocLink } from '../../../helpers/doc-links';
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
sh "dotnet build"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
bat "dotnet build"
}
stage('SonarQube Analysis') {
def msbuildHome = tool 'Default MSBuild'
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
sh "dotnet build"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
bat "dotnet build"
}
stage('SonarQube Analysis') {
def msbuildHome = tool 'Default MSBuild'
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
sh "dotnet build"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
bat "dotnet build"
}
stage('SonarQube Analysis') {
def msbuildHome = tool 'Default MSBuild'
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
sh "dotnet \${scannerHome}/SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
sh "dotnet build"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "dotnet \${scannerHome}\\\\SonarScanner.MSBuild.dll begin /k:\\"my-project\\""
bat "dotnet build"
}
stage('SonarQube Analysis') {
def msbuildHome = tool 'Default MSBuild'
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"my-project\\""
bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
checkout scm
}
stage('SonarQube Analysis') {
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
${OSS_DEP[shell].shell} "dotnet \${scannerHome}${OSS_DEP[shell].pathSeparator}SonarScanner.MSBuild.dll begin /k:\\"${key}\\""
${OSS_DEP[shell].shell} "dotnet build"
}
stage('SonarQube Analysis') {
def msbuildHome = tool 'Default MSBuild'
- def scannerHome = tool 'SonarScanner for MSBuild'
+ def scannerHome = tool 'SonarScanner for .NET'
withSonarQubeEnv() {
bat "\\"\${scannerHome}\\\\SonarScanner.MSBuild.exe\\" begin /k:\\"${key}\\""
bat "\\"\${msbuildHome}\\\\MSBuild.exe\\" /t:Rebuild"
highlightKeys={['name']}
translationKey="onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step3"
/>
- <InlineSnippet className="sw-ml-1" snippet="SonarScanner for MSBuild" />
- <ClipboardIconButton
- className="sw-ml-2 sw-align-sub"
- copyValue="SonarScanner for MSBuild"
- />
+ <InlineSnippet className="sw-ml-1" snippet="SonarScanner for .NET" />
+ <ClipboardIconButton className="sw-ml-2 sw-align-sub" copyValue="SonarScanner for .NET" />
</ListItem>
<ListItem>
<SentenceWithHighlights
import styled from '@emotion/styled';
import { animated, config, useSpring } from '@react-spring/web';
-import { BasicSeparator, FlagVisual, Link } from 'design-system';
+import { LinkStandalone as Link } from '@sonarsource/echoes-react';
+import { BasicSeparator, FlagVisual } from 'design-system';
import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
+import withAppStateContext from '../../../app/components/app-state/withAppStateContext';
import { DocLink } from '../../../helpers/doc-links';
import { useDocUrl } from '../../../helpers/docs';
import { translate } from '../../../helpers/l10n';
import useIntersectionObserver from '../../../hooks/useIntersectionObserver';
-import { Component } from '../../../types/types';
+import { AppState } from '../../../types/appstate';
+import { EditionKey } from '../../../types/editions';
-export interface DoneNextStepsProps {
- component: Component;
+export interface Props {
+ appState: AppState;
}
-export default function DoneNextSteps({ component }: DoneNextStepsProps) {
- const isProjectAdmin = component.configuration?.showSettings;
+function DoneNextSteps({ appState }: Readonly<Props>) {
const outroRef = React.useRef<HTMLDivElement>(null);
-
+ const hasLicensedEdition = appState.edition && appState.edition !== EditionKey.community;
const intersectionEntry = useIntersectionObserver(outroRef, { freezeOnceVisible: true });
const outroAnimation = useSpring({
</strong>
{translate('onboarding.analysis.auto_refresh_after_analysis.auto_refresh')}
</p>
- <p className="sw-mt-4">
- {isProjectAdmin
- ? translate(
- 'onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci.admin',
- )
- : translate('onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci')}
- </p>
<div className="sw-mt-4">
- <span>
- {translate('onboarding.analysis.auto_refresh_after_analysis.check_these_links')}
- </span>
- <ul className="sw-flex sw-flex-col sw-gap-2 sw-mt-2">
- <li>
- <Link to={docUrl(DocLink.BranchAnalysis)}>
- {translate(
- 'onboarding.analysis.auto_refresh_after_analysis.check_these_links.branches',
- )}
- </Link>
- </li>
+ {hasLicensedEdition ? (
+ <>
+ <span>
+ {translate('onboarding.analysis.auto_refresh_after_analysis.check_these_links')}
+ </span>
+ <ul className="sw-flex sw-flex-col sw-gap-2 sw-mt-2">
+ <li>
+ <Link to={docUrl(DocLink.BranchAnalysis)}>
+ {translate(
+ 'onboarding.analysis.auto_refresh_after_analysis.check_these_links.branches',
+ )}
+ </Link>
+ </li>
- <li>
- <Link to={docUrl(DocLink.PullRequestAnalysis)}>
- {translate(
- 'onboarding.analysis.auto_refresh_after_analysis.check_these_links.pr_analysis',
- )}
- </Link>
- </li>
- </ul>
+ <li>
+ <Link to={docUrl(DocLink.PullRequestAnalysis)}>
+ {translate(
+ 'onboarding.analysis.auto_refresh_after_analysis.check_these_links.pr_analysis',
+ )}
+ </Link>
+ </li>
+ </ul>
+ </>
+ ) : (
+ <FormattedMessage
+ defaultMessage={translate(
+ 'onboarding.analysis.auto_refresh_after_analysis.community.check_these_links',
+ )}
+ id="onboarding.analysis.auto_refresh_after_analysis.community.check_these_links"
+ values={{
+ edition: (
+ <Link to="https://www.sonarsource.com/plans-and-pricing/developer/">
+ {translate(
+ 'onboarding.analysis.auto_refresh_after_analysis.community.check_these_links.edition',
+ )}
+ </Link>
+ ),
+ branches: (
+ <Link to={docUrl(DocLink.BranchAnalysis)}>
+ {translate(
+ 'onboarding.analysis.auto_refresh_after_analysis.check_these_links.branches',
+ )}
+ </Link>
+ ),
+ pull_requests: (
+ <Link to={docUrl(DocLink.PullRequestAnalysis)}>
+ {translate(
+ 'onboarding.analysis.auto_refresh_after_analysis.check_these_links.pr_analysis',
+ )}
+ </Link>
+ ),
+ }}
+ />
+ )}
</div>
</StyledDiv>
</animated.div>
);
}
+export default withAppStateContext(DoneNextSteps);
+
const StyledDiv = styled.div`
width: 840px;
margin: auto;
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2024 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 { byRole, byText } from '~sonar-aligned/helpers/testSelector';
+import { mockAppState } from '../../../../helpers/testMocks';
+import { renderApp } from '../../../../helpers/testReactTestingUtils';
+import { EditionKey } from '../../../../types/editions';
+import DoneNextSteps from '../DoneNextSteps';
+
+const ui = {
+ analysisDone: byText('onboarding.analysis.auto_refresh_after_analysis.done'),
+ autoRefresh: byText('onboarding.analysis.auto_refresh_after_analysis.auto_refresh'),
+ licensedNextStep: byText('onboarding.analysis.auto_refresh_after_analysis.check_these_links'),
+ communityNextStep: byText(
+ 'onboarding.analysis.auto_refresh_after_analysis.community.check_these_links',
+ ),
+ nextStepLinks: byRole('link'),
+};
+
+describe('Community Edition', () => {
+ it('should inform the user about available next steps', async () => {
+ renderDoneNextSteps();
+
+ expect(await ui.analysisDone.find()).toBeInTheDocument();
+ expect(await ui.autoRefresh.find()).toBeInTheDocument();
+ expect(await ui.communityNextStep.find()).toBeInTheDocument();
+ expect(await ui.nextStepLinks.findAll()).toHaveLength(3);
+ });
+});
+
+describe('Licensed Edition', () => {
+ it('should inform the user about available next steps', async () => {
+ renderDoneNextSteps(mockAppState({ edition: EditionKey.enterprise }));
+
+ expect(await ui.analysisDone.find()).toBeInTheDocument();
+ expect(await ui.autoRefresh.find()).toBeInTheDocument();
+ expect(await ui.licensedNextStep.find()).toBeInTheDocument();
+ expect(await ui.nextStepLinks.findAll()).toHaveLength(2);
+ });
+});
+
+function renderDoneNextSteps(appState = mockAppState()) {
+ return renderApp('/', <DoneNextSteps />, { appState });
+}
<FlagMessage className="sw-mt-2" variant="info">
{translate('onboarding.analysis.dotnetcore.global.text.path')}
</FlagMessage>
- <DotNetExecute commands={commands} component={component} />
+ <DotNetExecute commands={commands} />
</div>
);
}
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { CodeSnippet, Link, SubHeading } from 'design-system';
+import { LinkStandalone as Link } from '@sonarsource/echoes-react';
+import { CodeSnippet, SubHeading } from 'design-system';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { DocLink } from '../../../../helpers/doc-links';
import { useDocUrl } from '../../../../helpers/docs';
import { translate } from '../../../../helpers/l10n';
-import { Component } from '../../../../types/types';
import InstanceMessage from '../../../common/InstanceMessage';
import DoneNextSteps from '../DoneNextSteps';
export interface DotNetExecuteProps {
commands: string[];
- component: Component;
}
-export default function DotNetExecute({ commands, component }: DotNetExecuteProps) {
+export default function DotNetExecute({ commands }: Readonly<DotNetExecuteProps>) {
const docUrl = useDocUrl(DocLink.SonarScannerDotNet);
return (
}}
/>
</p>
- <DoneNextSteps component={component} />
+ <DoneNextSteps />
</>
);
}
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-import { Link, SubHeading } from 'design-system';
+import { LinkStandalone as Link } from '@sonarsource/echoes-react';
+import { SubHeading } from 'design-system';
import * as React from 'react';
import { FormattedMessage } from 'react-intl';
import { DocLink } from '../../../../helpers/doc-links';
defaultMessage={translate('onboarding.analysis.msbuild.text')}
id="onboarding.analysis.msbuild.text"
values={{
- code: <InlineSnippet snippet="%PATH%" />,
+ code: <InlineSnippet snippet="SonarScanner.MSBuild.exe" />,
+ path: <InlineSnippet snippet="%PATH%" />,
link: <Link to={docUrl}>{translate('onboarding.analysis.msbuild.docs_link')}</Link>,
}}
/>
</p>
</div>
- <DotNetExecute commands={commands} component={component} />
+ <DotNetExecute commands={commands} />
</div>
);
}
}}
/>
</p>
- <DoneNextSteps component={component} />
+ <DoneNextSteps />
</div>
);
}
}}
/>
</p>
- <DoneNextSteps component={component} />
+ <DoneNextSteps />
</div>
);
}
}}
/>
</p>
- <DoneNextSteps component={component} />
+ <DoneNextSteps />
</div>
);
}
onboarding.analysis.header=Run analysis on your project
onboarding.analysis.auto_refresh_after_analysis.done=Is my analysis done?
onboarding.analysis.auto_refresh_after_analysis.auto_refresh=If your analysis is successful, this page will automatically refresh in a few moments.
-onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci.admin=You can set up Pull Request Decoration under the project settings. To set up analysis with your favorite CI tool, see the tutorials.
-onboarding.analysis.auto_refresh_after_analysis.set_up_pr_deco_and_ci=You can request from a project administrator to set up Pull Request Decoration. To set up analysis with your favorite CI tool, see the tutorials.
-onboarding.analysis.auto_refresh_after_analysis.check_these_links=Check these useful links while you wait:
+onboarding.analysis.auto_refresh_after_analysis.check_these_links=While you're waiting, check out these links to learn how to configure Branch Analysis and Pull Request Analysis:
onboarding.analysis.auto_refresh_after_analysis.check_these_links.pr_analysis=Pull Request Analysis
onboarding.analysis.auto_refresh_after_analysis.check_these_links.branches=Branch Analysis
+onboarding.analysis.auto_refresh_after_analysis.community.check_these_links=While you're waiting, why not consider upgrading to our {edition}? It offers additional features such as {branches} and {pull_requests}.
+onboarding.analysis.auto_refresh_after_analysis.community.check_these_links.edition=Developer Edition
onboarding.build=What option best describes your project?
onboarding.build.maven=Maven
onboarding.build.objectivec=Objective-C
onboarding.build.other=Other (for JS, TS, Go, Python, PHP, ...)
-onboarding.build.dotnet.variant=Choose your build tool
+onboarding.build.dotnet.variant=Which framework do you use?
onboarding.build.dotnet.variant.dotnet_core=.NET Core
onboarding.build.dotnet.variant.dotnet_framework=.NET Framework
onboarding.analysis.java.gradle.latest_version=You can find the latest version of the Gradle plugin {link}.
onboarding.analysis.java.gradle.docs_link=official documentation of the Scanner for Gradle
-onboarding.analysis.msbuild.header=Download and unzip the Scanner for .NET
-onboarding.analysis.msbuild.text=Visit the {link} to download the latest version, and add the executable's directory to the {code} environment variable
-onboarding.analysis.msbuild.execute=Execute the Scanner for .NET
-onboarding.analysis.msbuild.execute.text=Running a {instance} analysis is straighforward. You just need to execute the following commands at the root of your solution.
-onboarding.analysis.msbuild.docs_link=official documentation of the Scanner for .NET
+onboarding.analysis.msbuild.header=Download and unzip the SonarScanner for .NET
+onboarding.analysis.msbuild.text=Visit the {link} to download the latest version for .NET framework. Make sure to add the directory containing {code} to the {path} environment variable.
+onboarding.analysis.msbuild.execute=Execute the SonarScanner for .NET
+onboarding.analysis.msbuild.execute.text=Running a {instance} analysis is straightforward. You just need to execute the following commands at the root of your solution.
+onboarding.analysis.msbuild.docs_link=documentation of the SonarScanner for .NET
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=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
-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=Running a {instance} analysis is straightforward. 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.
onboarding.analysis.sq_scanner.docs=Please visit the {link} for more details.
onboarding.analysis.sq_scanner.docs_use_case=Please visit the {link} for more details, and the {useCaseLink} to know more about this use case.
onboarding.analysis.sqscanner.docs.gradle.title=official documentation of the Scanner for Gradle
onboarding.analysis.sqscanner.docs.gradle.example_project.title=live Gradle-based example project
-onboarding.analysis.dotnetcore.global=Scanner .NET Core Global Tool
+onboarding.analysis.dotnetcore.global=Install the SonarScanner .NET Core Global Tool
onboarding.analysis.dotnetcore.global.text=As a prerequisite you need to have the sonarscanner tool installed globally using the following command:
onboarding.analysis.dotnetcore.global.text.path=Make sure dotnet tools folder is in your path. See dotnet global tools documentation for more information.
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.title.sentence=Prerequisite: Add a {default_scanner} tool.
-onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.title.sentence.default_scanner=SonarScanner for MSBuild
+onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.title.sentence.default_scanner=SonarScanner for .NET
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.info=This step needs to be done only once per jenkins instance or if you need different scanner versions.
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step1.sentence=In Jenkins, navigate to {path}.
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step1.sentence.path=Manage Jenkins > Global Tool Configuration
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step2.sentence=Under {default_scanner} click on {add_scanner_for_msbuild}.
-onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step2.sentence.default_scanner=SonarScanner for MSBuild
-onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step2.sentence.add_scanner_for_msbuild=Add SonarScanner for MSBuild
+onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step2.sentence.default_scanner=SonarScanner for .NET
+onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step2.sentence.add_scanner_for_msbuild=Add SonarScanner for .NET
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step3.sentence=Choose a {name} that will be used in the last step:
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step3.sentence.name=Name
onboarding.tutorial.with.jenkins.dotnet.scanner.prereqs.step4.sentence=Check {install_auto}