From 38352a0684015dcd5865a253f507cac8d4a6d259 Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Wed, 16 Jun 2021 11:01:13 +0200 Subject: [PATCH] SONAR-15033 Adding compilation info box --- .../tutorials/components/CompilationInfo.tsx | 66 +++++++++++++++++++ .../__tests__/CompilationInfo-test.tsx | 30 +++++++++ .../CompilationInfo-test.tsx.snap | 45 +++++++++++++ .../resources/org/sonar/l10n/core.properties | 4 ++ 4 files changed, 145 insertions(+) create mode 100644 server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx create mode 100644 server/sonar-web/src/main/js/components/tutorials/components/__tests__/CompilationInfo-test.tsx create mode 100644 server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CompilationInfo-test.tsx.snap diff --git a/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx b/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx new file mode 100644 index 00000000000..f86872e8751 --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx @@ -0,0 +1,66 @@ +/* + * 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 { Alert } from 'sonar-ui-common/components/ui/Alert'; +import { translate } from 'sonar-ui-common/helpers/l10n'; + +export interface CompilationInfoProps { + className?: string; +} + +export function CompilationInfo({ className = 'spacer-top spacer-bottom' }: CompilationInfoProps) { + return ( + +

+ + {translate('onboarding.tutorial.cfamilly.compilation_database_info.link')} + + ) + }} + /> +

+

+ + {translate('onboarding.tutorial.cfamilly.speed_caching.link')} + + ) + }} + /> +

+
+ ); +} diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/CompilationInfo-test.tsx b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/CompilationInfo-test.tsx new file mode 100644 index 00000000000..c54f530c5ed --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/CompilationInfo-test.tsx @@ -0,0 +1,30 @@ +/* + * 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 { CompilationInfo } from '../CompilationInfo'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +function shallowRender() { + return shallow(); +} diff --git a/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CompilationInfo-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CompilationInfo-test.tsx.snap new file mode 100644 index 00000000000..93595e2e15d --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/components/__tests__/__snapshots__/CompilationInfo-test.tsx.snap @@ -0,0 +1,45 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` + +

+ + onboarding.tutorial.cfamilly.compilation_database_info.link + , + } + } + /> +

+

+ + onboarding.tutorial.cfamilly.speed_caching.link + , + } + } + /> +

+
+`; 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 da5e28c576d..563db53dad6 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3466,6 +3466,10 @@ onboarding.tutorial.ci_outro.commit.why.no_branches=Each new push you make on yo onboarding.tutorial.ci_outro.refresh=This page will then refresh with your analysis results. onboarding.tutorial.ci_outro.refresh.why=If the page doesn't refresh after a while, please double-check the analysis configuration. onboarding.tutorial.other.project_key.sentence=Create a {file} file in your repository and paste the following code: +onboarding.tutorial.cfamilly.compilation_database_info=If you have trouble using the build wrapper, you can try using a {link} +onboarding.tutorial.cfamilly.compilation_database_info.link=compilation database +onboarding.tutorial.cfamilly.speed_caching=You can also speed up your analysis by enabling {link}. +onboarding.tutorial.cfamilly.speed_caching.link=multi-threading and caching onboarding.tutorial.choose_method=How do you want to analyze your repository? onboarding.tutorial.choose_method.manual=Locally -- 2.39.5