From 8cd18056f08bd9b2f705cab6e8be8aaf91f43834 Mon Sep 17 00:00:00 2001 From: Guillaume Peoc'h Date: Fri, 7 Oct 2022 11:43:23 +0200 Subject: [PATCH] SONAR-17001 [894147] Button: Button does not have a name --- .../activity-graph/GraphsLegendItem.tsx | 16 ++++++++++------ .../__snapshots__/GraphsLegendItem-test.tsx.snap | 1 + .../resources/org/sonar/l10n/core.properties | 1 + 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx index e131d1993bc..c26f9de9f02 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx +++ b/server/sonar-web/src/main/js/components/activity-graph/GraphsLegendItem.tsx @@ -22,6 +22,7 @@ import * as React from 'react'; import { ClearButton } from '../../components/controls/buttons'; import AlertWarnIcon from '../../components/icons/AlertWarnIcon'; import ChartLegendIcon from '../../components/icons/ChartLegendIcon'; +import { translateWithParameters } from '../../helpers/l10n'; interface Props { className?: string; @@ -40,22 +41,25 @@ export default class GraphsLegendItem extends React.PureComponent { }; render() { + const { className, name, index } = this.props; const isActionable = this.props.removeMetric != null; - const legendClass = classNames( - { 'activity-graph-legend-actionable': isActionable }, - this.props.className - ); + const legendClass = classNames({ 'activity-graph-legend-actionable': isActionable }, className); + return ( {this.props.showWarning ? ( ) : ( - + )} - {this.props.name} + {name} {isActionable && ( diff --git a/server/sonar-web/src/main/js/components/activity-graph/__tests__/__snapshots__/GraphsLegendItem-test.tsx.snap b/server/sonar-web/src/main/js/components/activity-graph/__tests__/__snapshots__/GraphsLegendItem-test.tsx.snap index d374734cb54..37369e0d970 100644 --- a/server/sonar-web/src/main/js/components/activity-graph/__tests__/__snapshots__/GraphsLegendItem-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/activity-graph/__tests__/__snapshots__/GraphsLegendItem-test.tsx.snap @@ -30,6 +30,7 @@ exports[`should render correctly a legend: with legend 1`] = ` Foo