@@ -27,7 +27,6 @@ import theme from 'sentry/utils/theme';
2727import withApi from 'sentry/utils/withApi' ;
2828import withPageFilters from 'sentry/utils/withPageFilters' ;
2929
30- import { DataSet } from './widgetBuilder/utils' ;
3130import AddWidget , { ADD_WIDGET_BUTTON_DRAG_ID } from './addWidget' ;
3231import {
3332 assignDefaultLayout ,
@@ -251,7 +250,7 @@ class Dashboard extends Component<Props, State> {
251250 pathname : `/organizations/${ organization . slug } /dashboard/${ paramDashboardId } /widget/new/` ,
252251 query : {
253252 ...location . query ,
254- dataSet : DataSet . EVENTS ,
253+ source : DashboardWidgetSource . DASHBOARDS ,
255254 } ,
256255 } ) ;
257256 return ;
@@ -261,7 +260,7 @@ class Dashboard extends Component<Props, State> {
261260 pathname : `/organizations/${ organization . slug } /dashboards/new/widget/new/` ,
262261 query : {
263262 ...location . query ,
264- dataSet : DataSet . EVENTS ,
263+ source : DashboardWidgetSource . DASHBOARDS ,
265264 } ,
266265 } ) ;
267266 } ;
@@ -321,7 +320,7 @@ class Dashboard extends Component<Props, State> {
321320 }
322321 } ;
323322
324- handleEditWidget = ( widget : Widget , index : number ) => ( ) => {
323+ handleEditWidget = ( widget : Widget ) => ( ) => {
325324 const {
326325 organization,
327326 dashboard,
@@ -338,20 +337,20 @@ class Dashboard extends Component<Props, State> {
338337
339338 if ( paramDashboardId ) {
340339 router . push ( {
341- pathname : `/organizations/${ organization . slug } /dashboard/${ paramDashboardId } /widget/${ index } /edit/` ,
340+ pathname : `/organizations/${ organization . slug } /dashboard/${ paramDashboardId } /widget/${ widget . id } /edit/` ,
342341 query : {
343342 ...location . query ,
344- dataSet : DataSet . EVENTS ,
343+ source : DashboardWidgetSource . DASHBOARDS ,
345344 } ,
346345 } ) ;
347346 return ;
348347 }
349348
350349 router . push ( {
351- pathname : `/organizations/${ organization . slug } /dashboards/new/widget/${ index } /edit/` ,
350+ pathname : `/organizations/${ organization . slug } /dashboards/new/widget/${ widget . id } /edit/` ,
352351 query : {
353352 ...location . query ,
354- dataSet : DataSet . EVENTS ,
353+ source : DashboardWidgetSource . DASHBOARDS ,
355354 } ,
356355 } ) ;
357356 }
@@ -391,7 +390,7 @@ class Dashboard extends Component<Props, State> {
391390 isEditing,
392391 widgetLimitReached,
393392 onDelete : this . handleDeleteWidget ( widget ) ,
394- onEdit : this . handleEditWidget ( widget , index ) ,
393+ onEdit : this . handleEditWidget ( widget ) ,
395394 onDuplicate : this . handleDuplicateWidget ( widget , index ) ,
396395 isPreview,
397396 } ;
0 commit comments