]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-14557 Improve Issue resolution tooltip messages
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Tue, 6 Apr 2021 09:24:50 +0000 (11:24 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 9 Apr 2021 20:03:53 +0000 (20:03 +0000)
server/sonar-web/src/main/js/components/common/SelectListItem.tsx
server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx
server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTransitionPopup-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 4e816bbf9ddaaea67bf07127bafa2423bf64b6dc..dbfba2748a89b82f2f33d248fdaa1fa031f0624b 100644 (file)
@@ -27,7 +27,7 @@ interface Props {
   item: string;
   onHover?: (item: string) => void;
   onSelect?: (item: string) => void;
-  title?: string;
+  title?: React.ReactNode;
 }
 
 export default class SelectListItem extends React.PureComponent<Props> {
index 5e3efddc1124ae1cbb1ea12a3e6621049dff66a0..93faa598e95bcb9562c443eb13a95ef43168eee7 100644 (file)
@@ -18,6 +18,7 @@
  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  */
 import * as React from 'react';
+import { FormattedMessage } from 'react-intl';
 import { DropdownOverlay } from 'sonar-ui-common/components/controls/Dropdown';
 import { hasMessage, translate } from 'sonar-ui-common/helpers/l10n';
 import SelectList from '../../common/SelectList';
@@ -56,6 +57,20 @@ function translateTransition(transition: string, isManualVulnerability: boolean)
       ]
     : [
         translate('issue.transition', transition),
-        translate('issue.transition', transition, 'description')
+        <FormattedMessage
+          key="description"
+          defaultMessage={translate('issue.transition', transition, 'description')}
+          id={`issue.transition.${transition}.description`}
+          values={{
+            community_plug_link: (
+              <a
+                href="https://community.sonarsource.com/"
+                rel="noopener noreferrer"
+                target="_blank">
+                {translate('issue.transition.community_plug_link')}
+              </a>
+            )
+          }}
+        />
       ];
 }
index 915afea770c7480a5b6f8c74d8a55f5a409650a8..70a86d8ea5278bf37de077f66eb31f2914a669db 100644 (file)
@@ -17,28 +17,92 @@ exports[`should render transition popup correctly 1`] = `
     <SelectListItem
       item="confirm"
       key="confirm"
-      title="issue.transition.confirm.description"
+      title={
+        <FormattedMessage
+          defaultMessage="issue.transition.confirm.description"
+          id="issue.transition.confirm.description"
+          values={
+            Object {
+              "community_plug_link": <a
+                href="https://community.sonarsource.com/"
+                rel="noopener noreferrer"
+                target="_blank"
+              >
+                issue.transition.community_plug_link
+              </a>,
+            }
+          }
+        />
+      }
     >
       issue.transition.confirm
     </SelectListItem>
     <SelectListItem
       item="resolve"
       key="resolve"
-      title="issue.transition.resolve.description"
+      title={
+        <FormattedMessage
+          defaultMessage="issue.transition.resolve.description"
+          id="issue.transition.resolve.description"
+          values={
+            Object {
+              "community_plug_link": <a
+                href="https://community.sonarsource.com/"
+                rel="noopener noreferrer"
+                target="_blank"
+              >
+                issue.transition.community_plug_link
+              </a>,
+            }
+          }
+        />
+      }
     >
       issue.transition.resolve
     </SelectListItem>
     <SelectListItem
       item="falsepositive"
       key="falsepositive"
-      title="issue.transition.falsepositive.description"
+      title={
+        <FormattedMessage
+          defaultMessage="issue.transition.falsepositive.description"
+          id="issue.transition.falsepositive.description"
+          values={
+            Object {
+              "community_plug_link": <a
+                href="https://community.sonarsource.com/"
+                rel="noopener noreferrer"
+                target="_blank"
+              >
+                issue.transition.community_plug_link
+              </a>,
+            }
+          }
+        />
+      }
     >
       issue.transition.falsepositive
     </SelectListItem>
     <SelectListItem
       item="wontfix"
       key="wontfix"
-      title="issue.transition.wontfix.description"
+      title={
+        <FormattedMessage
+          defaultMessage="issue.transition.wontfix.description"
+          id="issue.transition.wontfix.description"
+          values={
+            Object {
+              "community_plug_link": <a
+                href="https://community.sonarsource.com/"
+                rel="noopener noreferrer"
+                target="_blank"
+              >
+                issue.transition.community_plug_link
+              </a>,
+            }
+          }
+        />
+      }
     >
       issue.transition.wontfix
     </SelectListItem>
@@ -68,7 +132,23 @@ exports[`should render transition popup correctly for vulnerability 1`] = `
     <SelectListItem
       item="confirm"
       key="confirm"
-      title="issue.transition.confirm.description"
+      title={
+        <FormattedMessage
+          defaultMessage="issue.transition.confirm.description"
+          id="issue.transition.confirm.description"
+          values={
+            Object {
+              "community_plug_link": <a
+                href="https://community.sonarsource.com/"
+                rel="noopener noreferrer"
+                target="_blank"
+              >
+                issue.transition.community_plug_link
+              </a>,
+            }
+          }
+        />
+      }
     >
       issue.transition.confirm
     </SelectListItem>
index 82d61c9092fbd46ba231f6313bd05747e0c440e2..70aaea7779285daa2efd48d42f2925964df5e636 100644 (file)
@@ -786,6 +786,7 @@ issue.why_this_issue=Why is this an issue?
 issue.why_this_issue.long=Why is this an issue? Open the rule's details at the bottom of the page.
 issue.type.type_x_click_to_change=Type: {0}, click to change
 issue.severity.severity_x_click_to_change=Severity: {0}, click to change
+issue.transition.community_plug_link=SonarSource Community
 issue.transition.status_x_click_to_change=Issue status: {0}, click to change
 issue.transition=Transition
 issue.transition.confirm=Confirm
@@ -795,13 +796,13 @@ issue.transition.unconfirm.description=This issue should be reviewed again to de
 issue.transition.resolve=Resolve as fixed
 issue.transition.resolve.description=This issue has been fixed in the code and is waiting for the next analysis to close it - or reopen it if it was not actually fixed.
 issue.transition.falsepositive=Resolve as false positive
-issue.transition.falsepositive.description=This issue can be ignored because it is due to a limitation of the analysis engine. Its effort won't be counted.
+issue.transition.falsepositive.description=This issue can be suppressed as it was not raised accurately. Please report false-positives to the {community_plug_link}!
 issue.transition.reopen=Reopen
 issue.transition.reopen.description=This issue is not resolved, and should be reviewed again.
 issue.transition.close=Close
 issue.transition.close.description=
 issue.transition.wontfix=Resolve as won't fix
-issue.transition.wontfix.description=This issue can be ignored because the rule is irrelevant in this context. Its effort won't be counted.
+issue.transition.wontfix.description=This issue can be suppressed because the rule is irrelevant in this context.
 issue.transition.setinreview=Set as In Review
 issue.transition.setinreview.description=A review is in progress to check for a vulnerability
 issue.transition.openasvulnerability=Open as Vulnerability