@@ -21,6 +21,7 @@ import {
2121 generateProfileSummaryRouteWithQuery ,
2222} from 'sentry/utils/profiling/routes' ;
2323import { useLocation } from 'sentry/utils/useLocation' ;
24+ import { profilesRouteWithQuery } from 'sentry/views/performance/transactionSummary/transactionProfiles/utils' ;
2425
2526import { Button } from '../button' ;
2627import Link from '../links/link' ;
@@ -37,50 +38,73 @@ export function ProfilingTransactionHovercard(props: ProfilingTransactionHoverca
3738 const { project, transaction, organization} = props ;
3839 const { query} = useLocation ( ) ;
3940
40- const linkToSummary = generateProfileSummaryRouteWithQuery ( {
41+ if ( ! organization . features . includes ( 'continuous-profiling-compat' ) ) {
42+ const linkToSummary = generateProfileSummaryRouteWithQuery ( {
43+ query,
44+ orgSlug : organization . slug ,
45+ projectSlug : project . slug ,
46+ transaction,
47+ } ) ;
48+
49+ const triggerLink = (
50+ < Link
51+ to = { linkToSummary }
52+ onClick = { ( ) =>
53+ trackAnalytics ( 'profiling_views.go_to_transaction' , {
54+ organization,
55+ source : 'transaction_hovercard.trigger' ,
56+ } )
57+ }
58+ >
59+ { transaction }
60+ </ Link >
61+ ) ;
62+
63+ return (
64+ < StyledHovercard
65+ delay = { 250 }
66+ header = {
67+ < Flex justify = "space-between" align = "center" >
68+ < TextTruncateOverflow > { transaction } </ TextTruncateOverflow >
69+ < Button to = { linkToSummary } size = "xs" >
70+ { t ( 'View Profiles' ) }
71+ </ Button >
72+ </ Flex >
73+ }
74+ body = {
75+ < ProfilingTransactionHovercardBody
76+ transaction = { transaction }
77+ project = { project }
78+ organization = { organization }
79+ />
80+ }
81+ showUnderline
82+ >
83+ { triggerLink }
84+ </ StyledHovercard >
85+ ) ;
86+ }
87+
88+ const linkToSummary = profilesRouteWithQuery ( {
4189 query,
4290 orgSlug : organization . slug ,
43- projectSlug : project . slug ,
91+ projectID : project . id ,
4492 transaction,
4593 } ) ;
4694
47- const triggerLink = (
95+ return (
4896 < Link
4997 to = { linkToSummary }
5098 onClick = { ( ) =>
5199 trackAnalytics ( 'profiling_views.go_to_transaction' , {
52100 organization,
53- source : 'transaction_hovercard.trigger ' ,
101+ source : 'profiling.landing.transaction_table ' ,
54102 } )
55103 }
56104 >
57105 { transaction }
58106 </ Link >
59107 ) ;
60-
61- return (
62- < StyledHovercard
63- delay = { 250 }
64- header = {
65- < Flex justify = "space-between" align = "center" >
66- < TextTruncateOverflow > { transaction } </ TextTruncateOverflow >
67- < Button to = { linkToSummary } size = "xs" >
68- { t ( 'View Profiles' ) }
69- </ Button >
70- </ Flex >
71- }
72- body = {
73- < ProfilingTransactionHovercardBody
74- transaction = { transaction }
75- project = { project }
76- organization = { organization }
77- />
78- }
79- showUnderline
80- >
81- { triggerLink }
82- </ StyledHovercard >
83- ) ;
84108}
85109
86110export function ProfilingTransactionHovercardBody ( {
0 commit comments