]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-16518 Add option for other framworks description
authorMathieu Suen <mathieu.suen@sonarsource.com>
Mon, 27 Jun 2022 09:39:22 +0000 (11:39 +0200)
committersonartech <sonartech@sonarsource.com>
Thu, 30 Jun 2022 20:03:09 +0000 (20:03 +0000)
server/sonar-web/src/main/js/components/rules/OtherContextOption.tsx [new file with mode: 0644]
sonar-core/src/main/resources/org/sonar/l10n/core.properties

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 (file)
index 0000000..2c322ba
--- /dev/null
@@ -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>
+    </>
+  );
+}
index e89fa813f218446e2a35a38026722c77423c071d..9dfe63930f6883a83a28850d38250cff27862e97 100644 (file)
@@ -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