From 8122b1e03ba83bea731a3e8bd0490c57a3985ce4 Mon Sep 17 00:00:00 2001 From: stanislavh Date: Tue, 24 Oct 2023 19:24:15 +0200 Subject: [PATCH] SONAR-20742 Adjust text colors and condition rating text --- .../design-system/src/components/Link.tsx | 2 +- server/sonar-web/design-system/src/theme/light.ts | 1 - .../js/apps/overview/branches/MeasuresCard.tsx | 14 +++++++------- .../components/BranchQualityGateConditions.tsx | 6 ++++-- .../components/__tests__/BranchQualityGate-it.tsx | 4 ++-- .../main/resources/org/sonar/l10n/core.properties | 1 + 6 files changed, 15 insertions(+), 13 deletions(-) diff --git a/server/sonar-web/design-system/src/components/Link.tsx b/server/sonar-web/design-system/src/components/Link.tsx index 5d38190d3cf..07d743a85aa 100644 --- a/server/sonar-web/design-system/src/components/Link.tsx +++ b/server/sonar-web/design-system/src/components/Link.tsx @@ -205,7 +205,7 @@ export const DiscreetLink = styled(HoverLink)` DiscreetLink.displayName = 'DiscreetLink'; export const ContentLink = styled(HoverLink)` - --color: ${themeColor('pageContent')}; + --color: ${themeColor('pageTitle')}; --border: ${themeBorder('default', 'contentLinkBorder')}; `; ContentLink.displayName = 'ContentLink'; diff --git a/server/sonar-web/design-system/src/theme/light.ts b/server/sonar-web/design-system/src/theme/light.ts index eed6bd73e74..2c14207689d 100644 --- a/server/sonar-web/design-system/src/theme/light.ts +++ b/server/sonar-web/design-system/src/theme/light.ts @@ -434,7 +434,6 @@ export const lightTheme = { // quality gate texts colors qgConditionNotCayc: COLORS.red[600], qgConditionCayc: COLORS.green[600], - qgCardTitle: COLORS.blueGrey[700], // main bar mainBar: COLORS.white, diff --git a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresCard.tsx b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresCard.tsx index 7f1f825306a..7539c92037a 100644 --- a/server/sonar-web/src/main/js/apps/overview/branches/MeasuresCard.tsx +++ b/server/sonar-web/src/main/js/apps/overview/branches/MeasuresCard.tsx @@ -51,7 +51,7 @@ export default function MeasuresCard( {...rest} > - +
{value ? ( ) : ( - — + — )} {translate(label)} - +
{children &&
{children}
}
@@ -77,12 +77,12 @@ export default function MeasuresCard( ); } +const StyledNoValue = styled.span` + color: ${themeColor('pageTitle')}; +`; + export const StyledCard = styled(Card)` &.failed { border-color: ${themeColor('qgCardFailed')}; } `; - -const StyledTitleContainer = styled.div` - color: ${themeColor('qgCardTitle')}; -`; diff --git a/server/sonar-web/src/main/js/apps/overview/components/BranchQualityGateConditions.tsx b/server/sonar-web/src/main/js/apps/overview/components/BranchQualityGateConditions.tsx index 16484c8af3a..0477b195282 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/BranchQualityGateConditions.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/BranchQualityGateConditions.tsx @@ -102,6 +102,7 @@ export function FailedMetric(props: Readonly) { function FailedRatingMetric({ condition }: Readonly) { const { error, + actual, measure: { metric: { type, domain }, }, @@ -111,11 +112,12 @@ function FailedRatingMetric({ condition }: Readonly) { return ( <> {intl.formatMessage( - { id: 'overview.failed_condition.x_required' }, + { id: 'overview.failed_condition.x_rating_required' }, { - metric: `${intl.formatMessage({ + rating: `${intl.formatMessage({ id: `metric_domain.${domain}`, })} ${intl.formatMessage({ id: 'metric.type.RATING' }).toLowerCase()}`, + value: formatMeasure(actual, type), threshold: ( {formatMeasure(error, type)} ), diff --git a/server/sonar-web/src/main/js/apps/overview/components/__tests__/BranchQualityGate-it.tsx b/server/sonar-web/src/main/js/apps/overview/components/__tests__/BranchQualityGate-it.tsx index 4f42879ccb5..48a2dd79305 100644 --- a/server/sonar-web/src/main/js/apps/overview/components/__tests__/BranchQualityGate-it.tsx +++ b/server/sonar-web/src/main/js/apps/overview/components/__tests__/BranchQualityGate-it.tsx @@ -34,7 +34,7 @@ it('renders failed QG', () => { // Maintainability rating condition const maintainabilityRatingLink = byRole('link', { - name: 'overview.failed_condition.x_requiredmetric_domain.Maintainability metric.type.rating A', + name: 'overview.failed_condition.x_rating_requiredmetric_domain.Maintainability metric.type.ratingE A', }).get(); expect(maintainabilityRatingLink).toBeInTheDocument(); expect(maintainabilityRatingLink).toHaveAttribute( @@ -44,7 +44,7 @@ it('renders failed QG', () => { // Security Hotspots rating condition const securityHotspotsRatingLink = byRole('link', { - name: 'overview.failed_condition.x_requiredmetric_domain.Security Review metric.type.rating A', + name: 'overview.failed_condition.x_rating_requiredmetric_domain.Security Review metric.type.ratingE A', }).get(); expect(securityHotspotsRatingLink).toBeInTheDocument(); expect(securityHotspotsRatingLink).toHaveAttribute( 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 560ddb3d37e..e57f0450734 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -3746,6 +3746,7 @@ system.version_is_availble={version} is available #------------------------------------------------------------------------------ overview.1_condition_failed=1 failed condition overview.X_conditions_failed={0} failed conditions +overview.failed_condition.x_rating_required={rating} is {value} required {threshold} overview.failed_condition.x_required={metric} required {threshold} overview.fix_failed_conditions_with_sonarlint=Fix issues before they fail your Quality Gate with {link} in your IDE. Power up with connected mode! overview.quality_gate.status=Quality Gate Status -- 2.39.5