Browse Source

fix(dashboards): open in DDM with My projects selection (#60540)

Ogi 1 year ago
parent
commit
b01bcf926a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      static/app/views/dashboards/utils.tsx

+ 4 - 1
static/app/views/dashboards/utils.tsx

@@ -413,9 +413,12 @@ export function getWidgetDDMUrl(
       ? {start: getUtcDateString(start), end: getUtcDateString(end), utc}
       ? {start: getUtcDateString(start), end: getUtcDateString(end), utc}
       : {statsPeriod: period};
       : {statsPeriod: period};
 
 
+  // ensures that My Projects selection is properly handled
+  const project = selection.projects.length ? selection.projects : [0];
+
   const ddmLocation = getDdmUrl(organization.slug, {
   const ddmLocation = getDdmUrl(organization.slug, {
     ...datetime,
     ...datetime,
-    project: selection.projects,
+    project,
     environment: selection.environments,
     environment: selection.environments,
     widgets: _widget.queries.map(query => {
     widgets: _widget.queries.map(query => {
       const {mri, op} = fieldToMri(query.aggregates[0]);
       const {mri, op} = fieldToMri(query.aggregates[0]);