From 519df72eb052c01750ad5095d7702a7b3699cc72 Mon Sep 17 00:00:00 2001 From: nikkikapadia Date: Mon, 23 Sep 2024 10:37:01 -0400 Subject: [PATCH] fix releases showing on bar charts modals --- static/app/views/dashboards/dashboard.tsx | 7 +++++-- .../app/views/dashboards/widgetCard/chart.tsx | 20 ++++++++++--------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/static/app/views/dashboards/dashboard.tsx b/static/app/views/dashboards/dashboard.tsx index 07457a82071810..c3fe5e48233852 100644 --- a/static/app/views/dashboards/dashboard.tsx +++ b/static/app/views/dashboards/dashboard.tsx @@ -54,7 +54,7 @@ import { } from './layoutUtils'; import SortableWidget from './sortableWidget'; import type {DashboardDetails, Widget} from './types'; -import {DashboardWidgetSource, WidgetType} from './types'; +import {DashboardWidgetSource, DisplayType, WidgetType} from './types'; import {connectDashboardCharts, getDashboardFiltersFromURL} from './utils'; export const DRAG_HANDLE_CLASS = 'widget-drag'; @@ -400,7 +400,10 @@ class Dashboard extends Component { isPreview, dashboardFilters: getDashboardFiltersFromURL(location) ?? dashboard.filters, - releaseSeries: this.props.releaseSeries, + releaseSeries: + widget.displayType === DisplayType.AREA || widget.displayType === DisplayType.LINE + ? this.props.releaseSeries + : undefined, }; const key = constructGridItemKey(widget); diff --git a/static/app/views/dashboards/widgetCard/chart.tsx b/static/app/views/dashboards/widgetCard/chart.tsx index a7c5f4d54cefff..34ad41d07ebccb 100644 --- a/static/app/views/dashboards/widgetCard/chart.tsx +++ b/static/app/views/dashboards/widgetCard/chart.tsx @@ -525,7 +525,12 @@ class WidgetCardChart extends Component { location.query.unselectedSeries = 'Releases'; legend.selected = getSeriesSelection(location); - const updatedReleaseSeries = releaseSeries ? releaseSeries : []; + const updatedReleaseSeries = + releaseSeries && + (widget.displayType === DisplayType.AREA || + widget.displayType === DisplayType.LINE) + ? releaseSeries + : []; return ( @@ -546,14 +551,11 @@ class WidgetCardChart extends Component { } : {}), legend, - series: - (this.props.organization.features.includes( - 'dashboards-releases-on-charts' - ) && - widget.displayType === 'line') || - widget.displayType === 'area' - ? [...series, ...updatedReleaseSeries] - : [...series], + series: this.props.organization.features.includes( + 'dashboards-releases-on-charts' + ) + ? [...series, ...updatedReleaseSeries] + : [...series], onLegendSelectChanged, forwardedRef, selection,