From 4ab1fece350ac03ecb41c125ec8935d38670f656 Mon Sep 17 00:00:00 2001 From: Jeremy Davis Date: Wed, 13 Mar 2019 17:26:07 +0100 Subject: [PATCH] SONAR-11668 Jump to measures list view from dashboard --- .../components/MeasureContent.tsx | 4 +- .../components/MeasureViewSelect.tsx | 6 +- .../main/js/apps/component-measures/style.css | 2 +- .../js/components/shared/DrilldownLink.tsx | 78 +++++++------------ .../shared/__tests__/DrilldownLink-test.tsx | 54 +++++++++++++ .../__snapshots__/DrilldownLink-test.tsx.snap | 38 +++++++++ server/sonar-web/src/main/js/helpers/urls.ts | 6 +- .../resources/org/sonar/l10n/core.properties | 3 +- 8 files changed, 132 insertions(+), 59 deletions(-) create mode 100644 server/sonar-web/src/main/js/components/shared/__tests__/DrilldownLink-test.tsx create mode 100644 server/sonar-web/src/main/js/components/shared/__tests__/__snapshots__/DrilldownLink-test.tsx.snap diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx index 7b3f6325b36..55d400e4ec3 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureContent.tsx @@ -35,6 +35,7 @@ import { isDiffMetric, getPeriodValue } from '../../../helpers/measures'; import { RequestData } from '../../../helpers/request'; import { getProjectUrl } from '../../../helpers/urls'; import { getMeasures } from '../../../api/measures'; +import { translate } from '../../../helpers/l10n'; interface Props { branchLike?: T.BranchLike; @@ -335,8 +336,9 @@ export default class MeasureContent extends React.PureComponent { {!isFile && metric && ( <> +
{translate('component_measures.view_as')}
{ ); }; - renderValue = (value: { icon: JSX.Element }) => { - return value.icon; - }; - render() { return (