Skip to content

Commit 3aaa6ca

Browse files
authored
fix(spans-migration): add in check for discover split widgets for explore urls (#101199)
sorry yall i forgot to check for discover split transactions widgets 😭 👍
1 parent c369f3d commit 3aaa6ca

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/sentry/api/serializers/models/dashboard.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,13 @@ def serialize(self, obj, attrs, user, **kwargs) -> DashboardWidgetResponse:
275275
widget_type = DashboardWidgetTypes.get_type_name(obj.discover_widget_split)
276276

277277
explore_urls = None
278-
if obj.widget_type == DashboardWidgetTypes.TRANSACTION_LIKE and features.has(
278+
if (
279+
obj.widget_type == DashboardWidgetTypes.TRANSACTION_LIKE
280+
or (
281+
obj.widget_type == DashboardWidgetTypes.DISCOVER
282+
and obj.discover_widget_split == DashboardWidgetTypes.TRANSACTION_LIKE
283+
)
284+
) and features.has(
279285
"organizations:transaction-widget-deprecation-explore-view",
280286
organization=obj.dashboard.organization,
281287
actor=user,

tests/sentry/dashboards/endpoints/test_organization_dashboard_details.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ def test_explore_url_for_table_widget(self) -> None:
533533
assert params["field"].sort() == ["id", "transaction"].sort()
534534
assert "aggregateField" not in params
535535

536-
def test_explore_url_for_widget_with_env_params(self) -> None:
536+
def test_explore_url_for_widget_with_discover_split_param(self) -> None:
537537
with self.feature("organizations:transaction-widget-deprecation-explore-view"):
538538
dashboard_deprecation = Dashboard.objects.create(
539539
title="Dashboard With Transaction Widget",
@@ -547,7 +547,8 @@ def test_explore_url_for_widget_with_env_params(self) -> None:
547547
dashboard=dashboard_deprecation,
548548
title="transaction widget",
549549
display_type=DashboardWidgetDisplayTypes.LINE_CHART,
550-
widget_type=DashboardWidgetTypes.TRANSACTION_LIKE,
550+
widget_type=DashboardWidgetTypes.DISCOVER,
551+
discover_widget_split=DashboardWidgetTypes.TRANSACTION_LIKE,
551552
interval="1d",
552553
detail={"layout": {"x": 0, "y": 0, "w": 1, "h": 1, "minH": 2}},
553554
)

0 commit comments

Comments
 (0)