--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 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 { FormattedMessage } from 'react-intl';
+import { translate } from 'sonar-ui-common/helpers/l10n';
+
+function renderSentenceWithFieldAndValue(props: {
+ field: React.ReactNode;
+ value: React.ReactNode;
+}) {
+ const { field, value } = props;
+ return (
+ <FormattedMessage
+ id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence"
+ defaultMessage={translate(
+ 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence'
+ )}
+ values={{
+ field: <strong>{field}</strong>,
+ value: <strong>{value}</strong>
+ }}
+ />
+ );
+}
+
+export default function JavaToolInstallation() {
+ return (
+ <li>
+ {translate('onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title')}
+ <ul className="list-styled">
+ <li>
+ {renderSentenceWithFieldAndValue({
+ field: translate(
+ 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version'
+ ),
+ value: '11'
+ })}
+ {' ' /* explicit space between the two strings */}
+ {translate(
+ 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher'
+ )}
+ </li>
+ <li>
+ {renderSentenceWithFieldAndValue({
+ field: translate(
+ 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture'
+ ),
+ value: 'x64'
+ })}
+ </li>
+ <li>
+ {renderSentenceWithFieldAndValue({
+ field: translate(
+ 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source'
+ ),
+ value: translate(
+ 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed'
+ )
+ })}
+ </li>
+ </ul>
+ </li>
+ );
+}
--- /dev/null
+/*
+ * SonarQube
+ * Copyright (C) 2009-2021 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 { shallow } from 'enzyme';
+import * as React from 'react';
+import JavaToolInstallation from '../JavaToolInstallation';
+
+it('should render correctly', () => {
+ expect(shallowRender()).toMatchSnapshot();
+});
+
+function shallowRender() {
+ return shallow(<JavaToolInstallation />);
+}
--- /dev/null
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`should render correctly 1`] = `
+<li>
+ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title
+ <ul
+ className="list-styled"
+ >
+ <li>
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence"
+ id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence"
+ values={
+ Object {
+ "field": <strong>
+ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version
+ </strong>,
+ "value": <strong>
+ 11
+ </strong>,
+ }
+ }
+ />
+
+ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher
+ </li>
+ <li>
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence"
+ id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence"
+ values={
+ Object {
+ "field": <strong>
+ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture
+ </strong>,
+ "value": <strong>
+ x64
+ </strong>,
+ }
+ }
+ />
+ </li>
+ <li>
+ <FormattedMessage
+ defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence"
+ id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence"
+ values={
+ Object {
+ "field": <strong>
+ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source
+ </strong>,
+ "value": <strong>
+ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed
+ </strong>,
+ }
+ }
+ />
+ </li>
+ </ul>
+</li>
+`;
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import SentenceWithHighlights from '../../components/SentenceWithHighlights';
import { BuildTools } from '../../types';
+import JavaToolInstallation from '../JavaToolInstallation';
import AlertClassicEditor from './AlertClassicEditor';
import PrepareAnalysisCommand, { PrepareType } from './PrepareAnalysisCommand';
import PublishSteps from './PublishSteps';
kind={PrepareType.JavaMavenGradle}
projectKey={projectKey}
/>
+
+ <JavaToolInstallation />
+
<li>
{translateWithParameters(
'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java',
import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n';
import SentenceWithHighlights from '../../components/SentenceWithHighlights';
import { BuildTools } from '../../types';
+import JavaToolInstallation from '../JavaToolInstallation';
import AlertClassicEditor from './AlertClassicEditor';
import PrepareAnalysisCommand, { PrepareType } from './PrepareAnalysisCommand';
import PublishSteps from './PublishSteps';
projectKey={projectKey}
/>
+ <JavaToolInstallation />
+
<li>
{translateWithParameters(
'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java',
kind={0}
projectKey="projectKey"
/>
+ <JavaToolInstallation />
<li>
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.gradle
</li>
kind={0}
projectKey="projectKey"
/>
+ <JavaToolInstallation />
<li>
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.maven
</li>
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence=Expand the {section} and replace the {properties} with the following snippet
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.section=Advanced section
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.properties=Additional Properties
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title=Add a new Java tool installer task
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence=Under {field}, select {value}
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version=JDK version
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher=(or higher)
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture=JDK architecture
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source=JDK source
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed=Pre-installed
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java=Edit or add a new {0} task
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence=Under {section}, check {option}
onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.section=Code Analysis