From e741016a4278fb2816c1ea2f5722d7464ef3c482 Mon Sep 17 00:00:00 2001 From: guillaume-peoch-sonarsource Date: Wed, 1 Feb 2023 15:56:12 +0100 Subject: [PATCH] SONAR-18383 Remove QG status (Passed/Failed) from Header --- .../overview/branches/QualityGatePanel.tsx | 4 ++- .../branches/QualityGatePanelSection.tsx | 14 ++++----- .../QualityGatePanel-test.tsx.snap | 30 +++++++++---------- .../QualityGatePanelSection-test.tsx.snap | 30 +++++++++---------- .../pullRequests/LargeQualityGateBadge.tsx | 2 +- .../LargeQualityGateBadge-test.tsx.snap | 12 ++++---- .../src/main/js/apps/overview/styles.css | 2 +- 7 files changed, 48 insertions(+), 46 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx index dd41fa73376..1eab5de6fdf 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanel.tsx @@ -108,7 +108,9 @@ export function QualityGatePanel(props: QualityGatePanelProps) { success, })} > -

{translate('metric.level', overallLevel)}

+
+ {translate('metric.level', overallLevel)} +
{overallFailedConditionsCount > 0 diff --git a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx index fe6547c7175..faedae61120 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/QualityGatePanelSection.tsx @@ -117,13 +117,13 @@ export function QualityGatePanelSection(props: QualityGatePanelSectionProps) { onClick={toggle} >
-

{collapsed ? : } {qgStatus.name} -

+
{collapsed && displayConditions(qgStatus.failedConditions.length)} @@ -148,12 +148,12 @@ export function QualityGatePanelSection(props: QualityGatePanelSectionProps) { {newCodeFailedConditions.length > 0 && ( <> {showSectionTitles && ( -

+
{translateWithParameters( 'quality_gates.conditions.new_code_x', newCodeFailedConditions.length.toString() )} -

+ )} 0 && ( <> {showSectionTitles && ( -

+
{translateWithParameters( 'quality_gates.conditions.overall_code_x', overallFailedConditions.length.toString() )} -

+ )} -

metric.level.ERROR -

+ @@ -293,11 +293,11 @@ exports[`should render correctly for applications 2`] = `
-

metric.level.ERROR -

+
@@ -464,11 +464,11 @@ exports[`should render correctly for projects 1`] = `
-

metric.level.ERROR -

+
@@ -600,11 +600,11 @@ exports[`should render correctly for projects 2`] = `
-

metric.level.OK -

+
@@ -662,11 +662,11 @@ exports[`should render correctly for projects 3`] = `
-

metric.level.ERROR -

+
diff --git a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/QualityGatePanelSection-test.tsx.snap b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/QualityGatePanelSection-test.tsx.snap index 15613e9ec23..75b980c3018 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/QualityGatePanelSection-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/overview/branches/__tests__/__snapshots__/QualityGatePanelSection-test.tsx.snap @@ -32,11 +32,11 @@ exports[`should render correctly 1`] = ` } /> -

quality_gates.conditions.new_code_x.1 -

+ -

quality_gates.conditions.overall_code_x.1 -

+ -

@@ -240,14 +240,14 @@ exports[`should render correctly 2`] = ` > Foo -

+ -

quality_gates.conditions.new_code_x.1 -

+ -

quality_gates.conditions.overall_code_x.1 -

+ {level !== undefined && ( -

{translate('metric.level', level)}

+
{translate('metric.level', level)}
)} ); diff --git a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/LargeQualityGateBadge-test.tsx.snap b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/LargeQualityGateBadge-test.tsx.snap index 5d17f34fe39..04838bb893d 100644 --- a/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/LargeQualityGateBadge-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/overview/pullRequests/__tests__/__snapshots__/LargeQualityGateBadge-test.tsx.snap @@ -38,11 +38,11 @@ exports[`should render correctly for SQ 1`] = ` /> -

metric.level.ERROR -

+ `; @@ -84,10 +84,10 @@ exports[`should render correctly for SQ 2`] = ` /> -

metric.level.OK -

+ `; diff --git a/server/sonar-web/src/main/js/apps/overview/styles.css b/server/sonar-web/src/main/js/apps/overview/styles.css index d06f711df32..19dfba11686 100644 --- a/server/sonar-web/src/main/js/apps/overview/styles.css +++ b/server/sonar-web/src/main/js/apps/overview/styles.css @@ -111,7 +111,7 @@ height: 160px; } -.overview-quality-gate-badge-large h3 { +.overview-quality-gate-badge-large .h3 { color: white; } -- 2.39.5