Skip to content

Commit 622aa37

Browse files
authored
ref(ui): Remove withRouteAnalytics (#101655)
Replaced one of them with useRouteAnalyticsParams going to wait for #101639 first
1 parent 9209e08 commit 622aa37

File tree

3 files changed

+9
-85
lines changed

3 files changed

+9
-85
lines changed

static/app/utils/routeAnalytics/withRouteAnalytics.spec.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

static/app/utils/routeAnalytics/withRouteAnalytics.tsx

Lines changed: 0 additions & 26 deletions
This file was deleted.

static/gsApp/hooks/spendVisibility/enhancedUsageStatsOrganization.tsx

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Fragment, useEffect, useMemo} from 'react';
1+
import {Fragment, useMemo} from 'react';
22
import styled from '@emotion/styled';
33

44
import {getSeriesApiInterval} from 'sentry/components/charts/utils';
@@ -10,8 +10,7 @@ import type {DataCategoryInfo} from 'sentry/types/core';
1010
import type {Project} from 'sentry/types/project';
1111
import {defined} from 'sentry/utils';
1212
import {useApiQuery} from 'sentry/utils/queryClient';
13-
import type {WithRouteAnalyticsProps} from 'sentry/utils/routeAnalytics/withRouteAnalytics';
14-
import withRouteAnalytics from 'sentry/utils/routeAnalytics/withRouteAnalytics';
13+
import useRouteAnalyticsParams from 'sentry/utils/routeAnalytics/useRouteAnalyticsParams';
1514
import {useNavigate} from 'sentry/utils/useNavigate';
1615
import withProjects from 'sentry/utils/withProjects';
1716
import type {UsageSeries} from 'sentry/views/organizationStats/types';
@@ -204,9 +203,7 @@ function getSpikeDetails({
204203
return actualSpikes;
205204
}
206205

207-
interface EnhancedUsageStatsOrganizationProps
208-
extends WithRouteAnalyticsProps,
209-
UsageStatsOrganizationProps {
206+
interface EnhancedUsageStatsOrganizationProps extends UsageStatsOrganizationProps {
210207
isSingleProject: boolean;
211208
projects: Project[];
212209
subscription: Subscription;
@@ -229,7 +226,6 @@ function EnhancedUsageStatsOrganization({
229226
dataCategory,
230227
dataCategoryName,
231228
dataCategoryApiName,
232-
setRouteAnalyticsParams,
233229
isSingleProject,
234230
spikeCursor,
235231
clientDiscard,
@@ -305,20 +301,12 @@ function EnhancedUsageStatsOrganization({
305301
{staleTime: Infinity, retry: false, enabled: spikeThresholdsQueryEnabled}
306302
);
307303

308-
useEffect(() => {
309-
setRouteAnalyticsParams({
310-
subscription,
311-
organization,
312-
is_project_stats: isSingleProject,
313-
has_spike_data: isSingleProject && hasAccurateSpikes,
314-
});
315-
}, [
316-
hasAccurateSpikes,
317-
isSingleProject,
318-
organization,
319-
setRouteAnalyticsParams,
304+
useRouteAnalyticsParams({
320305
subscription,
321-
]);
306+
organization,
307+
is_project_stats: isSingleProject,
308+
has_spike_data: isSingleProject && hasAccurateSpikes,
309+
});
322310

323311
const newEndpointQuery = useMemo(() => {
324312
const query = endpointQuery;
@@ -496,6 +484,4 @@ const DroppedFromSpikesStat = styled('div')`
496484
font-size: ${p => p.theme.fontSize.md};
497485
`;
498486

499-
export default withRouteAnalytics(
500-
withProjects(withSubscription(EnhancedUsageStatsOrganization))
501-
);
487+
export default withProjects(withSubscription(EnhancedUsageStatsOrganization));

0 commit comments

Comments
 (0)