Skip to content

Commit ec0e8f0

Browse files
fix(insights): fixes web vital to issue link not propagating page filters (#94036)
1 parent dc57297 commit ec0e8f0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

static/app/views/insights/browser/webVitals/components/webVitalMetersWithIssues.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ import {LinkButton} from 'sentry/components/core/button/linkButton';
77
import InteractionStateLayer from 'sentry/components/core/interactionStateLayer';
88
import {Tooltip} from 'sentry/components/core/tooltip';
99
import ExternalLink from 'sentry/components/links/externalLink';
10+
import {pageFiltersToQueryParams} from 'sentry/components/organizations/pageFilters/parse';
1011
import QuestionTooltip from 'sentry/components/questionTooltip';
1112
import {IconIssues} from 'sentry/icons';
1213
import {t, tct} from 'sentry/locale';
1314
import {space} from 'sentry/styles/space';
15+
import type {PageFilters} from 'sentry/types/core';
1416
import type {Organization} from 'sentry/types/organization';
1517
import useOrganization from 'sentry/utils/useOrganization';
18+
import usePageFilters from 'sentry/utils/usePageFilters';
1619
import {ORDER} from 'sentry/views/insights/browser/webVitals/components/charts/performanceScoreChart';
1720
import {PerformanceBadge} from 'sentry/views/insights/browser/webVitals/components/performanceBadge';
1821
import {VITAL_DESCRIPTIONS} from 'sentry/views/insights/browser/webVitals/components/webVitalDescription';
@@ -107,6 +110,7 @@ function VitalMeter({
107110
showTooltip = true,
108111
}: VitalMeterProps) {
109112
const organization = useOrganization();
113+
const {selection} = usePageFilters();
110114
const webVitalExists = score !== undefined;
111115

112116
const formattedMeterValueText =
@@ -128,7 +132,7 @@ function VitalMeter({
128132
<Fragment>
129133
<MeterBarBody>
130134
<StyledIssuesButton
131-
to={getIssuesUrl({organization, webVital})}
135+
to={getIssuesUrl({organization, webVital, selection})}
132136
aria-label={t('View Performance Issues')}
133137
icon={<IconIssues />}
134138
size="xs"
@@ -235,13 +239,16 @@ function VitalContainer({
235239
const getIssuesUrl = ({
236240
organization,
237241
webVital,
242+
selection,
238243
}: {
239244
organization: Organization;
245+
selection: PageFilters;
240246
webVital: WebVitals;
241247
}) => {
242248
const query = getIssueQueryFilter(WEB_VITAL_PERFORMANCE_ISSUES[webVital]);
243249
return `/organizations/${organization.slug}/issues/?${qs.stringify({
244250
query,
251+
...pageFiltersToQueryParams(selection),
245252
})}`;
246253
};
247254

0 commit comments

Comments
 (0)