Skip to content

Commit

Permalink
fix releases showing on bar charts modals
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkikapadia committed Sep 23, 2024
1 parent e768e43 commit 519df72
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
7 changes: 5 additions & 2 deletions static/app/views/dashboards/dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -400,7 +400,10 @@ class Dashboard extends Component<Props, State> {
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);
Expand Down
20 changes: 11 additions & 9 deletions static/app/views/dashboards/widgetCard/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,12 @@ class WidgetCardChart extends Component<WidgetCardChartProps> {
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 (
<TransitionChart loading={loading} reloading={loading}>
Expand All @@ -546,14 +551,11 @@ class WidgetCardChart extends Component<WidgetCardChartProps> {
}
: {}),
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,
Expand Down

0 comments on commit 519df72

Please sign in to comment.