Skip to content

Commit 4418999

Browse files
lzhao-sentryandrewshie-sentry
authored andcommitted
fix(dashboards): pass title in url params when opening in widget editor (#93318)
### Changes Pass the new widget title via query params so that when a user selected open in widget builder from the add to dashboard modal, the title persists ### Before See: https://sentry.slack.com/archives/C01MYDW8Y7K/p1749587701335129 ### After https://github.com/user-attachments/assets/395b81ff-6fa2-4d61-b366-559ed4592da7
1 parent 857f134 commit 4418999

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

static/app/components/modals/widgetBuilder/addToDashboardModal.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ describe('add to dashboard modal', () => {
317317
await userEvent.click(screen.getByText('Open in Widget Builder'));
318318
expect(initialData.router.push).toHaveBeenCalledWith({
319319
pathname: '/organizations/org-slug/dashboard/1/widget-builder/widget/new/',
320-
query: mockWidgetAsQueryParams,
320+
query: {...mockWidgetAsQueryParams, title: 'Test title'},
321321
});
322322
});
323323

static/app/components/modals/widgetBuilder/addToDashboardModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ function AddToDashboardModal({
189189
pathname,
190190
query: {
191191
...widgetAsQueryParams,
192+
title: newWidgetTitle,
192193
...(selectedDashboard ? getSavedPageFilters(selectedDashboard) : {}),
193194
},
194195
})

0 commit comments

Comments
 (0)