浏览代码

SONAR-16518 Add option for other framworks description

tags/9.6.0.59041
Mathieu Suen 1年前
父节点
当前提交
95f41d32ae

+ 64
- 0
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 (
<>
<h2>{translate('coding_rules.context.others.title')}</h2>
<p>{translate('coding_rules.context.others.description.first')}</p>
<p>{translate('coding_rules.context.others.description.second')}</p>
<p>
<span className="display-block big-spacer-left">
<CheckIcon className="spacer-right" fill="green" />
{translate('coding_rules.context.others.description.do')}
</span>
<span className="display-block big-spacer-left">
<ClearIcon className="spacer-right" fill="red" />
{translate('coding_rules.context.others.description.dont')}
</span>
</p>
<h2>{translate('coding_rules.context.others.title_feedback')}</h2>
<p>
<FormattedMessage
defaultMessage={translate('coding_rules.context.others.feedback_description')}
id="coding_rules.context.others.feedback_description"
values={{
link: (
<span className="display-block big-spacer-top big-spacer-bottom">
<a
href="https://portal.productboard.com/sonarsource/3-sonarqube/submit-idea"
rel="noopener noreferrer">
{translate('coding_rules.context.others.feedback_description.link')}
<DetachIcon className="spacer-left" />
</a>
</span>
)
}}
/>
</p>
</>
);
}

+ 8
- 0
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

正在加载...
取消
保存