Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/sentry/api/serializers/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,13 @@ def serialize(self, obj, attrs, user, **kwargs) -> DashboardWidgetResponse:
widget_type = DashboardWidgetTypes.get_type_name(obj.discover_widget_split)

explore_urls = None
if obj.widget_type == DashboardWidgetTypes.TRANSACTION_LIKE and features.has(
if (
obj.widget_type == DashboardWidgetTypes.TRANSACTION_LIKE
or (
obj.widget_type == DashboardWidgetTypes.DISCOVER
and obj.discover_widget_split == DashboardWidgetTypes.TRANSACTION_LIKE
)
) and features.has(
"organizations:transaction-widget-deprecation-explore-view",
organization=obj.dashboard.organization,
actor=user,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ def test_explore_url_for_table_widget(self) -> None:
assert params["field"].sort() == ["id", "transaction"].sort()
assert "aggregateField" not in params

def test_explore_url_for_widget_with_env_params(self) -> None:
def test_explore_url_for_widget_with_discover_split_param(self) -> None:
with self.feature("organizations:transaction-widget-deprecation-explore-view"):
dashboard_deprecation = Dashboard.objects.create(
title="Dashboard With Transaction Widget",
Expand All @@ -547,7 +547,8 @@ def test_explore_url_for_widget_with_env_params(self) -> None:
dashboard=dashboard_deprecation,
title="transaction widget",
display_type=DashboardWidgetDisplayTypes.LINE_CHART,
widget_type=DashboardWidgetTypes.TRANSACTION_LIKE,
widget_type=DashboardWidgetTypes.DISCOVER,
discover_widget_split=DashboardWidgetTypes.TRANSACTION_LIKE,
interval="1d",
detail={"layout": {"x": 0, "y": 0, "w": 1, "h": 1, "minH": 2}},
)
Expand Down
Loading