@@ -13,7 +13,6 @@ import {
13
13
MutableSearch ,
14
14
} from 'sentry/utils/tokenizeSearch' ;
15
15
import useLocationQuery from 'sentry/utils/url/useLocationQuery' ;
16
- import { useLocation } from 'sentry/utils/useLocation' ;
17
16
import useProjects from 'sentry/utils/useProjects' ;
18
17
import { HeaderContainer } from 'sentry/views/insights/common/components/headerContainer' ;
19
18
import { MetricReadout } from 'sentry/views/insights/common/components/metricReadout' ;
@@ -59,34 +58,27 @@ import {ModuleName, SpanFunction, SpanMetricsField} from 'sentry/views/insights/
59
58
import { InsightsLineChartWidget } from '../../common/components/insightsLineChartWidget' ;
60
59
import { useSamplesDrawer } from '../../common/utils/useSamplesDrawer' ;
61
60
62
- type Query = {
63
- aggregate ?: string ;
64
- domain ?: string ;
65
- } ;
66
-
67
61
export function HTTPDomainSummaryPage ( ) {
68
- const location = useLocation < Query > ( ) ;
69
62
const { projects} = useProjects ( ) ;
70
63
const { view} = useDomainViewFilters ( ) ;
71
64
72
- // TODO: Fetch sort information using `useLocationQuery`
73
- // @ts -expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
74
- const sortField = decodeScalar ( location . query ?. [ QueryParameterNames . TRANSACTIONS_SORT ] ) ;
75
-
76
- const sort = decodeSorts ( sortField ) . find ( isAValidSort ) ?? DEFAULT_SORT ;
77
-
78
65
const {
79
66
domain,
80
67
project : projectId ,
81
- 'user.geo.subregion' : subregions ,
68
+ [ QueryParameterNames . TRANSACTIONS_CURSOR ] : cursor ,
69
+ [ QueryParameterNames . TRANSACTIONS_SORT ] : sortField ,
70
+ [ SpanMetricsField . USER_GEO_SUBREGION ] : subregions ,
82
71
} = useLocationQuery ( {
83
72
fields : {
84
73
project : decodeScalar ,
85
74
domain : decodeScalar ,
75
+ [ QueryParameterNames . TRANSACTIONS_CURSOR ] : decodeScalar ,
76
+ [ QueryParameterNames . TRANSACTIONS_SORT ] : decodeScalar ,
86
77
[ SpanMetricsField . USER_GEO_SUBREGION ] : decodeList ,
87
78
transaction : decodeScalar ,
88
79
} ,
89
80
} ) ;
81
+ const sort = decodeSorts ( sortField ) . find ( isAValidSort ) ?? DEFAULT_SORT ;
90
82
91
83
useSamplesDrawer ( {
92
84
Component : < HTTPSamplesPanel /> ,
@@ -105,9 +97,6 @@ export function HTTPDomainSummaryPage() {
105
97
: { } ) ,
106
98
} ;
107
99
108
- // @ts -expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
109
- const cursor = decodeScalar ( location . query ?. [ QueryParameterNames . TRANSACTIONS_CURSOR ] ) ;
110
-
111
100
const { data : domainMetrics , isPending : areDomainMetricsLoading } = useSpanMetrics (
112
101
{
113
102
search : MutableSearch . fromQueryObject ( filters ) ,
0 commit comments