@@ -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> { |
@@ -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> | |||
) | |||
}} | |||
/> | |||
]; | |||
} |
@@ -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> |
@@ -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 |