aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstanislavh <stanislav.honcharov@sonarsource.com>2024-11-29 17:06:38 +0100
committersonartech <sonartech@sonarsource.com>2024-11-29 20:03:10 +0000
commit0db921e5b3b10050d11b4ec3199e2b7ce185602c (patch)
tree35f37efaa064344e87867013b4708ef1e13506a5
parent8222a93bfa44b5f445d9c237bf2a4078b84deef4 (diff)
downloadsonarqube-0db921e5b3b10050d11b4ec3199e2b7ce185602c.tar.gz
sonarqube-0db921e5b3b10050d11b4ec3199e2b7ce185602c.zip
[NO-JIRA] Fix issue severity badge text
-rw-r--r--server/sonar-web/src/main/js/components/issue/__tests__/Issue-it.tsx2
-rw-r--r--server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx18
-rw-r--r--sonar-core/src/main/resources/org/sonar/l10n/core.properties2
3 files changed, 15 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/components/issue/__tests__/Issue-it.tsx b/server/sonar-web/src/main/js/components/issue/__tests__/Issue-it.tsx
index 1cd6cc9eb80..5c333a465b8 100644
--- a/server/sonar-web/src/main/js/components/issue/__tests__/Issue-it.tsx
+++ b/server/sonar-web/src/main/js/components/issue/__tests__/Issue-it.tsx
@@ -219,7 +219,7 @@ describe('updating', () => {
ui.softwareQualitySeverity(SoftwareImpactSeverity.Medium).query(),
).not.toBeInTheDocument();
// popover visible
- expect(byRole('heading', { name: 'severity_impact.title' }).get()).toBeInTheDocument();
+ expect(byRole('heading', { name: /severity_impact.title/ }).get()).toBeInTheDocument();
});
it('should allow updating the severity in Standard experience', async () => {
diff --git a/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx b/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx
index 14e7b8f9e54..43fb6dd9856 100644
--- a/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx
+++ b/server/sonar-web/src/main/js/components/shared/SoftwareImpactPill.tsx
@@ -119,7 +119,10 @@ export default function SoftwareImpactPill(props: Props) {
return (
<Popover
- title={translate('severity_impact.title')}
+ title={intl.formatMessage(
+ { id: 'severity_impact.title' },
+ { x: translate('severity_impact', severity) },
+ )}
description={
<>
<FormattedMessage
@@ -129,10 +132,15 @@ export default function SoftwareImpactPill(props: Props) {
quality: quality.toLowerCase(),
}}
/>
- <p className="sw-mt-2">
- <span className="sw-mr-1">{translate('severity_impact.help.line1')}</span>
- {type === 'issue' && translate('severity_impact.help.line2')}
- </p>
+ <div className="sw-mt-2">
+ {intl.formatMessage(
+ { id: `severity_impact.help.description` },
+ {
+ p1: (text) => <p>{text}</p>,
+ p: (text) => (type === 'issue' ? <p className="sw-mt-2">{text}</p> : ''),
+ },
+ )}
+ </div>
</>
}
footer={
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 e87e99fd8a4..4f70d1535a6 100644
--- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties
+++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties
@@ -3140,7 +3140,7 @@ severity.INFO=Info
severity.INFO.description=Neither a bug nor a quality flaw. Just a finding.
# New severities
-severity_impact.title=Severity of impact
+severity_impact.title={x} severity of impact
severity_impact.levels=Severity levels
severity_impact.BLOCKER=Blocker
severity_impact.BLOCKER.description=Must be fixed immediately.