From 95f41d32aeaf74fd8517fa773a4267df50370c4a Mon Sep 17 00:00:00 2001 From: Mathieu Suen Date: Mon, 27 Jun 2022 11:39:22 +0200 Subject: [PATCH] SONAR-16518 Add option for other framworks description --- .../components/rules/OtherContextOption.tsx | 64 +++++++++++++++++++ .../resources/org/sonar/l10n/core.properties | 8 +++ 2 files changed, 72 insertions(+) create mode 100644 server/sonar-web/src/main/js/components/rules/OtherContextOption.tsx diff --git a/server/sonar-web/src/main/js/components/rules/OtherContextOption.tsx b/server/sonar-web/src/main/js/components/rules/OtherContextOption.tsx new file mode 100644 index 00000000000..2c322ba7cf2 --- /dev/null +++ b/server/sonar-web/src/main/js/components/rules/OtherContextOption.tsx @@ -0,0 +1,64 @@ +/* + * SonarQube + * Copyright (C) 2009-2022 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 '../../helpers/l10n'; +import CheckIcon from '../icons/CheckIcon'; +import ClearIcon from '../icons/ClearIcon'; +import DetachIcon from '../icons/DetachIcon'; + +export default function OtherContextOption() { + return ( + <> +

{translate('coding_rules.context.others.title')}

+

{translate('coding_rules.context.others.description.first')}

+

{translate('coding_rules.context.others.description.second')}

+

+ + + {translate('coding_rules.context.others.description.do')} + + + + {translate('coding_rules.context.others.description.dont')} + +

+

{translate('coding_rules.context.others.title_feedback')}

+

+ + + {translate('coding_rules.context.others.feedback_description.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 e89fa813f21..9dfe63930f6 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -1783,6 +1783,14 @@ coding_rules.bulk_change.no_quality_profile=No quality profile. coding_rules.can_not_bulk_change=Bulk change is only available when you have a custom Quality Profile to target. You can create a customizable Quality Profile based on a built-in one by Copying or Extending it in the Quality Profiles list. coding_rules.can_not_deactivate=This rule is inherited and cannot be deactivated. coding_rules.change_details=Change Details of Quality Profile +coding_rules.context.others.title=How to fix it in another component or framework +coding_rules.context.others.description.first=Although the main framework or component you use in your project is not listed above, you may find helpful content in the instructions we provide. +coding_rules.context.others.description.second=Caution: The libraries mentioned in these instructions may not be appropriate for your code. +coding_rules.context.others.description.do=Do use libraries that are compatible with the frameworks you are using. +coding_rules.context.others.description.dont=Don’t blindly copy and paste the fixups into your code. +coding_rules.context.others.title_feedback=Help us improve +coding_rules.context.others.feedback_description=Let us know if the instructions we provide do not work for you. Tell us which framework you use and why our solution does not work by submitting an idea on the SonarQube productboard. {link} We will do our best to provide you with more relevant instructions in the future. +coding_rules.context.others.feedback_description.link=Submit an idea coding_rules.create=Create coding_rules.create_custom_rule=Create Custom Rule coding_rules.custom_rule=Custom Rule -- 2.39.5