File tree Expand file tree Collapse file tree 3 files changed +33
-36
lines changed
common/components/BugDetail/BugDuplicates Expand file tree Collapse file tree 3 files changed +33
-36
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,21 @@ import { BugCard } from 'src/common/components/BugCard/BugCardWithIcon';
22import { theme as globalTheme } from 'src/app/theme' ;
33import { Pill } from 'src/common/components/pills/Pill' ;
44import { Span } from '@appquality/unguess-design-system' ;
5- import { getLocalizedBugUrl } from 'src/hooks/useLocalizeDashboardUrl' ;
6- import i18n from 'src/i18n' ;
5+ import styled from 'styled-components' ;
6+ import { Link } from 'react-router-dom' ;
7+ import { useLocalizeRoute } from 'src/hooks/useLocalizedRoute' ;
78import { ReactComponent as FatherIcon } from './icons/father.svg' ;
89import { ReactComponent as SiblingIcon } from './icons/sibling.svg' ;
910
11+ const StyledLink = styled ( Link ) `
12+ text-decoration: none;
13+ color: inherit;
14+ &:hover {
15+ text-decoration: none;
16+ color: inherit;
17+ }
18+ ` ;
19+
1020export const BugItem = ( {
1121 isFather,
1222 campaignId,
@@ -19,13 +29,9 @@ export const BugItem = ({
1929 bugId : number ;
2030 title : string ;
2131 pills : string [ ] ;
22- } ) => {
23- const goToBug = ( ) => {
24- window . location . href = getLocalizedBugUrl ( campaignId , bugId , i18n . language ) ;
25- } ;
26-
27- return (
28- < BugCard borderColor = { globalTheme . palette . grey [ 500 ] } onClick = { goToBug } >
32+ } ) => (
33+ < StyledLink to = { useLocalizeRoute ( `campaigns/${ campaignId } /bugs/${ bugId } ` ) } >
34+ < BugCard borderColor = { globalTheme . palette . grey [ 500 ] } >
2935 { ( ) => (
3036 < >
3137 < BugCard . IconBox >
@@ -49,5 +55,5 @@ export const BugItem = ({
4955 </ >
5056 ) }
5157 </ BugCard >
52- ) ;
53- } ;
58+ </ StyledLink >
59+ ) ;
Original file line number Diff line number Diff line change @@ -8,11 +8,11 @@ import { ReactComponent as LinkIcon } from 'src/assets/icons/external-link-icon.
88import { ReactComponent as FatherIcon } from 'src/assets/icons/father-icon.svg' ;
99import { Bug } from 'src/features/api' ;
1010import { selectBug } from 'src/features/bugsPage/bugsPageSlice' ;
11- import { getLocalizedBugUrl } from 'src/hooks/useLocalizeDashboardUrl' ;
12- import i18n from 'src/i18n' ;
1311import styled from 'styled-components' ;
1412import { ShareButton } from 'src/common/components/BugDetail/ShareBug' ;
1513import TesterDetail from 'src/common/components/BugDetail/TesterDetail' ;
14+ import { Link } from 'react-router-dom' ;
15+ import { useLocalizeRoute } from 'src/hooks/useLocalizedRoute' ;
1616
1717const Container = styled . div `
1818 display: flex;
@@ -45,14 +45,6 @@ export default ({
4545} ) => {
4646 const dispatch = useAppDispatch ( ) ;
4747
48- const goToBug = ( ) => {
49- window . location . href = getLocalizedBugUrl (
50- bug . campaign_id ,
51- bug . id ,
52- i18n . language
53- ) ;
54- } ;
55-
5648 return (
5749 < Container >
5850 { ! bug . duplicated_of_id && (
@@ -70,9 +62,13 @@ export default ({
7062 />
7163
7264 < ActionDetailPreview >
73- < IconButton size = "small" onClick = { goToBug } >
74- < LinkIcon />
75- </ IconButton >
65+ < Link
66+ to = { useLocalizeRoute ( `campaigns/${ bug . campaign_id } /bugs/${ bug . id } ` ) }
67+ >
68+ < IconButton size = "small" >
69+ < LinkIcon />
70+ </ IconButton >
71+ </ Link >
7672 < ShareButton bug = { bug } />
7773 < IconButton
7874 size = "small"
Original file line number Diff line number Diff line change 11import { Anchor , PageHeader , Span } from '@appquality/unguess-design-system' ;
2- import { useNavigate } from 'react-router-dom' ;
2+ import { Link , useNavigate } from 'react-router-dom' ;
33import { HeaderSkeleton } from 'src/pages/Campaign/pageHeader/HeaderSkeleton' ;
44import { Tools } from 'src/pages/Bugs/PageHeader/Tools' ;
55import { useCampaign } from 'src/pages/Campaign/pageHeader/useCampaign' ;
@@ -42,17 +42,12 @@ const BugsPageHeader = ({ campaignId }: { campaignId: number }) => {
4242 return isUserLoading || isError ? null : (
4343 < PageHeader >
4444 < PageHeader . Breadcrumb >
45- < Anchor id = "breadcrumb-parent" onClick = { ( ) => navigate ( project . route ) } >
46- { project . name }
47- </ Anchor >
48- < Anchor
49- onClick = { ( ) => {
50- window . location . href =
51- getLocalizeoFirstLevelDashboardRoute ( campaignId ) ;
52- } }
53- >
54- { campaign . customer_title }
55- </ Anchor >
45+ < Link to = { project . route } >
46+ < Anchor id = "breadcrumb-parent" > { project . name } </ Anchor >
47+ </ Link >
48+ < Link to = { getLocalizeoFirstLevelDashboardRoute ( campaignId ) } >
49+ < Anchor > { campaign . customer_title } </ Anchor >
50+ </ Link >
5651 </ PageHeader . Breadcrumb >
5752 < PageHeader . Main infoTitle = { campaign . customer_title } >
5853 < FlexWrapper >
You can’t perform that action at this time.
0 commit comments