From 0bd2242935f663fa464515c2d1d0b7834c4b5bc7 Mon Sep 17 00:00:00 2001 From: stanislavh Date: Tue, 13 Feb 2024 16:53:41 +0100 Subject: [PATCH] SONAR-21563 Improve UX for software quality cards in branch overview --- .../branches/NewCodeMeasuresPanel.tsx | 1 - .../branches/SoftwareImpactMeasureCard.tsx | 70 ++++++++++--------- .../branches/__tests__/BranchOverview-it.tsx | 5 -- .../resources/org/sonar/l10n/core.properties | 9 ++- 4 files changed, 40 insertions(+), 45 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx index c1fe8cfce32..d7918f1f214 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/NewCodeMeasuresPanel.tsx @@ -91,7 +91,6 @@ export default function NewCodeMeasuresPanel(props: Readonly) { if (!newAcceptedIssues) { acceptedIssuesFooter = ( - {intl.formatMessage({ id: 'overview.project.no_data' })} {intl.formatMessage({ id: `overview.run_analysis_to_compute.${component.qualifier}`, diff --git a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx index 5907d3ee693..501f22da8fd 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/SoftwareImpactMeasureCard.tsx @@ -96,39 +96,42 @@ export function SoftwareImpactMeasureCard(props: Readonly
-
- {measure ? ( - - - {formatMeasure(measure.total, MetricType.ShortInteger)} - - - ) : ( - - )} - - {intl.formatMessage({ id: 'overview.measures.software_impact.total_open_issues' })} - +
+
+ {measure ? ( + + + {formatMeasure(measure.total, MetricType.ShortInteger)} + + + ) : ( + + )} + + {intl.formatMessage({ id: 'overview.measures.software_impact.total_open_issues' })} + +
+
- {intl.formatMessage({ id: 'overview.project.no_data' })} {intl.formatMessage({ id: `overview.run_analysis_to_compute.${component.qualifier}`, diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx index 429ab05477c..ba8015aa4c1 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/BranchOverview-it.tsx @@ -359,11 +359,6 @@ describe('project overview', () => { // Maintainability is not computed ui.expectSoftwareImpactMeasureCard(SoftwareQuality.Maintainability); - expect( - byText('overview.project.no_data').get( - ui.softwareImpactMeasureCard(SoftwareQuality.Maintainability).get(), - ), - ).toBeInTheDocument(); expect( byText('overview.run_analysis_to_compute.TRK').get( ui.softwareImpactMeasureCard(SoftwareQuality.Maintainability).get(), 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 fa9381ac08d..38c11900b09 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3931,7 +3931,7 @@ overview.measures.bad_reference.explanation=This branch could not be compared to overview.measures.bad_setting.link=This can be fixed in the {setting_link} setting. overview.measures.security_hotspots_reviewed=Reviewed overview.measures.software_impact.total_open_issues=Open issues -overview.measures.software_impact.count_tooltip=Issues in code can impact multiple Software Qualities. Fixing an issue can improve more than one Software Quality. +overview.measures.software_impact.count_tooltip=Issues in code can impact multiple Software Qualities, so the sum of impacts tends to be greater than the total amount of issues. overview.measures.software_impact.see_list_of_x_open_issues=See the list of {count} open {softwareQuality} issues overview.measures.software_impact.severity.see_x_open_issues=See {count} open {softwareQuality} issues with {severity} severity overview.measures.software_impact.severity.HIGH=H @@ -3961,10 +3961,9 @@ overview.project.next_steps.set_up_ci=To benefit from more of SonarQube's featur overview.project.next_steps.links.project_settings=project settings overview.project.next_steps.links.set_up_ci=set up analysis in your favorite CI overview.project.software_impact.has_rating=Software Quality {softwareQuality} has rating {rating} -overview.project.no_data=No data. -overview.run_analysis_to_compute.TRK=Run new analysis to compute. -overview.run_analysis_to_compute.APP=All projects need to be analysed. -overview.missing_project_data.APP=Some projects are missing data. All projects in the application need to be analysed. +overview.run_analysis_to_compute.TRK=Run new analysis to compute the missing data. +overview.run_analysis_to_compute.APP=Analyse all projects to compute the missing data. +overview.missing_project_data.APP=Some projects are missing data. All projects in the application need to be analysed to compute the missing data. overview.coverage_on=Coverage on overview.coverage_on_X_lines=Coverage on {count} Lines to cover -- 2.39.5