From a603f440f44339718d17727fd3592f1f5a4abb12 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Tue, 6 Apr 2021 11:24:50 +0200 Subject: [PATCH] SONAR-14557 Improve Issue resolution tooltip messages --- .../js/components/common/SelectListItem.tsx | 2 +- .../issue/popups/SetTransitionPopup.tsx | 17 +++- .../SetTransitionPopup-test.tsx.snap | 90 +++++++++++++++++-- .../resources/org/sonar/l10n/core.properties | 5 +- 4 files changed, 105 insertions(+), 9 deletions(-) diff --git a/server/sonar-web/src/main/js/components/common/SelectListItem.tsx b/server/sonar-web/src/main/js/components/common/SelectListItem.tsx index 4e816bbf9dd..dbfba2748a8 100644 --- a/server/sonar-web/src/main/js/components/common/SelectListItem.tsx +++ b/server/sonar-web/src/main/js/components/common/SelectListItem.tsx @@ -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 { diff --git a/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx b/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx index 5e3efddc112..93faa598e95 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx +++ b/server/sonar-web/src/main/js/components/issue/popups/SetTransitionPopup.tsx @@ -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') + + {translate('issue.transition.community_plug_link')} + + ) + }} + /> ]; } diff --git a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTransitionPopup-test.tsx.snap b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTransitionPopup-test.tsx.snap index 915afea770c..70a86d8ea52 100644 --- a/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTransitionPopup-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/issue/popups/__tests__/__snapshots__/SetTransitionPopup-test.tsx.snap @@ -17,28 +17,92 @@ exports[`should render transition popup correctly 1`] = ` + issue.transition.community_plug_link + , + } + } + /> + } > issue.transition.confirm + issue.transition.community_plug_link + , + } + } + /> + } > issue.transition.resolve + issue.transition.community_plug_link + , + } + } + /> + } > issue.transition.falsepositive + issue.transition.community_plug_link + , + } + } + /> + } > issue.transition.wontfix @@ -68,7 +132,23 @@ exports[`should render transition popup correctly for vulnerability 1`] = ` + issue.transition.community_plug_link + , + } + } + /> + } > issue.transition.confirm 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 82d61c9092f..70aaea77792 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -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 -- 2.39.5