diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2022-08-25 10:45:27 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-08-29 20:02:53 +0000 |
commit | 06f6244b0ae2fd288e05fbdd0bd077a0da9066c4 (patch) | |
tree | 5c1cc37e9aee4859a31321b83d32eafad07f2c14 /server/sonar-web/src/main/js/apps/component-measures | |
parent | c757692a0a8d02998bfd8839c2612e17011013a7 (diff) | |
download | sonarqube-06f6244b0ae2fd288e05fbdd0bd077a0da9066c4.tar.gz sonarqube-06f6244b0ae2fd288e05fbdd0bd077a0da9066c4.zip |
SONAR-17027 Align the way we display links (internal & external) in the UI
Diffstat (limited to 'server/sonar-web/src/main/js/apps/component-measures')
7 files changed, 29 insertions, 28 deletions
diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx index 3911ea503b2..73319f882d7 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/components/MeasureHeader.tsx @@ -18,8 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Link } from 'react-router-dom'; import LanguageDistribution from '../../../components/charts/LanguageDistribution'; +import Link from '../../../components/common/Link'; import Tooltip from '../../../components/controls/Tooltip'; import HistoryIcon from '../../../components/icons/HistoryIcon'; import IssueTypeIcon from '../../../components/icons/IssueTypeIcon'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureHeader-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureHeader-test.tsx.snap index 8235bbe62da..3e7a651341c 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureHeader-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/components/__tests__/__snapshots__/MeasureHeader-test.tsx.snap @@ -29,7 +29,7 @@ exports[`should render correctly 1`] = ` <Tooltip overlay="component_measures.show_metric_history" > - <Link + <ForwardRef(Link) className="js-show-history spacer-left button button-small" to={ Object { @@ -39,7 +39,7 @@ exports[`should render correctly 1`] = ` } > <HistoryIcon /> - </Link> + </ForwardRef(Link)> </Tooltip> </div> <div @@ -204,7 +204,7 @@ exports[`should work with measure without value 1`] = ` <Tooltip overlay="component_measures.show_metric_history" > - <Link + <ForwardRef(Link) className="js-show-history spacer-left button button-small" to={ Object { @@ -214,7 +214,7 @@ exports[`should work with measure without value 1`] = ` } > <HistoryIcon /> - </Link> + </ForwardRef(Link)> </Tooltip> </div> <div diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx index dc5030c9208..fa15cae3a51 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/BubbleChart.tsx @@ -18,9 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Link } from 'react-router-dom'; import OriginalBubbleChart from '../../../components/charts/BubbleChart'; import ColorRatingsLegend from '../../../components/charts/ColorRatingsLegend'; +import Link from '../../../components/common/Link'; import HelpTooltip from '../../../components/controls/HelpTooltip'; import { RATING_COLORS } from '../../../helpers/constants'; import { diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx index 585601da5a6..ec93e70f7fd 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/ComponentCell.tsx @@ -18,7 +18,8 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import * as React from 'react'; -import { Link, To } from 'react-router-dom'; +import { To } from 'react-router-dom'; +import Link from '../../../components/common/Link'; import BranchIcon from '../../../components/icons/BranchIcon'; import LinkIcon from '../../../components/icons/LinkIcon'; import QualifierIcon from '../../../components/icons/QualifierIcon'; diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/ComponentCell-test.tsx b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/ComponentCell-test.tsx index 1465e2a1351..706051bd81a 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/ComponentCell-test.tsx +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/ComponentCell-test.tsx @@ -19,7 +19,7 @@ */ import { shallow } from 'enzyme'; import * as React from 'react'; -import { Link } from 'react-router-dom'; +import Link from '../../../../components/common/Link'; import { mockComponentMeasure, mockComponentMeasureEnhanced diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/BubbleChart-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/BubbleChart-test.tsx.snap index 0a648d6f8a1..d9c90ef8efd 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/BubbleChart-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/BubbleChart-test.tsx.snap @@ -46,7 +46,7 @@ exports[`should render correctly: all on x=0 1`] = ` <div className="text-center small spacer-top spacer-bottom" > - <Link + <ForwardRef(Link) to={ Object { "pathname": "/component_measures", @@ -55,7 +55,7 @@ exports[`should render correctly: all on x=0 1`] = ` } > component_measures.overview.see_data_as_list - </Link> + </ForwardRef(Link)> </div> <BubbleChart displayXGrid={true} @@ -254,7 +254,7 @@ exports[`should render correctly: default 1`] = ` <div className="text-center small spacer-top spacer-bottom" > - <Link + <ForwardRef(Link) to={ Object { "pathname": "/component_measures", @@ -263,7 +263,7 @@ exports[`should render correctly: default 1`] = ` } > component_measures.overview.see_data_as_list - </Link> + </ForwardRef(Link)> </div> <BubbleChart displayXGrid={true} @@ -463,7 +463,7 @@ exports[`should render correctly: only showing first 500 files 1`] = ` <div className="text-center small spacer-top spacer-bottom" > - <Link + <ForwardRef(Link) to={ Object { "pathname": "/component_measures", @@ -472,7 +472,7 @@ exports[`should render correctly: only showing first 500 files 1`] = ` } > component_measures.overview.see_data_as_list - </Link> + </ForwardRef(Link)> </div> <BubbleChart displayXGrid={true} diff --git a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/ComponentCell-test.tsx.snap b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/ComponentCell-test.tsx.snap index 96fcb66989e..a7bb6a51d53 100644 --- a/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/ComponentCell-test.tsx.snap +++ b/server/sonar-web/src/main/js/apps/component-measures/drilldown/__tests__/__snapshots__/ComponentCell-test.tsx.snap @@ -7,7 +7,7 @@ exports[`should render correctly for a "APP" root component and a component with <div className="text-ellipsis" > - <Link + <ForwardRef(Link) className="link-no-underline" id="component-measures-component-link-foo" to={ @@ -36,7 +36,7 @@ exports[`should render correctly for a "APP" root component and a component with develop </span> </span> - </Link> + </ForwardRef(Link)> </div> </td> `; @@ -48,7 +48,7 @@ exports[`should render correctly for a "APP" root component and a component with <div className="text-ellipsis" > - <Link + <ForwardRef(Link) className="link-no-underline" id="component-measures-component-link-foo" to={ @@ -74,7 +74,7 @@ exports[`should render correctly for a "APP" root component and a component with branches.main_branch </span> </span> - </Link> + </ForwardRef(Link)> </div> </td> `; @@ -86,7 +86,7 @@ exports[`should render correctly for a "TRK" root component and a component with <div className="text-ellipsis" > - <Link + <ForwardRef(Link) className="link-no-underline" id="component-measures-component-link-foo" to={ @@ -107,7 +107,7 @@ exports[`should render correctly for a "TRK" root component and a component with Foo </span> </span> - </Link> + </ForwardRef(Link)> </div> </td> `; @@ -119,7 +119,7 @@ exports[`should render correctly for a "TRK" root component and a component with <div className="text-ellipsis" > - <Link + <ForwardRef(Link) className="link-no-underline" id="component-measures-component-link-foo" to={ @@ -140,7 +140,7 @@ exports[`should render correctly for a "TRK" root component and a component with Foo </span> </span> - </Link> + </ForwardRef(Link)> </div> </td> `; @@ -152,7 +152,7 @@ exports[`should render correctly for a "VW" root component and a component with <div className="text-ellipsis" > - <Link + <ForwardRef(Link) className="link-no-underline" id="component-measures-component-link-foo" to={ @@ -181,7 +181,7 @@ exports[`should render correctly for a "VW" root component and a component with develop </span> </span> - </Link> + </ForwardRef(Link)> </div> </td> `; @@ -193,7 +193,7 @@ exports[`should render correctly for a "VW" root component and a component with <div className="text-ellipsis" > - <Link + <ForwardRef(Link) className="link-no-underline" id="component-measures-component-link-foo" to={ @@ -219,7 +219,7 @@ exports[`should render correctly for a "VW" root component and a component with branches.main_branch </span> </span> - </Link> + </ForwardRef(Link)> </div> </td> `; @@ -231,7 +231,7 @@ exports[`should render correctly: default 1`] = ` <div className="text-ellipsis" > - <Link + <ForwardRef(Link) className="link-no-underline" id="component-measures-component-link-foo:src/index.tsx" to={ @@ -258,7 +258,7 @@ exports[`should render correctly: default 1`] = ` index.tsx </span> </span> - </Link> + </ForwardRef(Link)> </div> </td> `; |