From d66e44f3a830007d07a83c1b248f7c752ab8c370 Mon Sep 17 00:00:00 2001 From: Nikki Kapadia <72356613+nikkikapadia@users.noreply.github.com> Date: Tue, 26 Nov 2024 14:19:39 -0500 Subject: [PATCH] chore(dashboards): Remove releases on widget charts ff (#81317) removing all instances of the `dashboards-releases-on-charts` ff because it has been fully rolled out. --- .../modals/widgetBuilder/addToDashboardModal.spec.tsx | 5 +++++ .../modals/widgetBuilder/addToDashboardModal.tsx | 1 - static/app/components/modals/widgetViewerModal.spec.tsx | 5 +++++ static/app/views/dashboards/dashboard.spec.tsx | 4 ++++ static/app/views/dashboards/detail.spec.tsx | 8 ++++++++ .../widgetBuilder/buildSteps/visualizationStep.tsx | 1 - .../views/dashboards/widgetBuilder/widgetBuilder.spec.tsx | 4 ++++ .../widgetBuilder/widgetBuilderDataset.spec.tsx | 4 ++++ .../dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx | 4 ++++ static/app/views/dashboards/widgetCard/chart.tsx | 4 +--- static/app/views/dashboards/widgetCard/index.spec.tsx | 4 ++++ .../views/dashboards/widgetLegendSelectionState.spec.tsx | 1 - .../app/views/dashboards/widgetLegendSelectionState.tsx | 6 ++---- 13 files changed, 41 insertions(+), 10 deletions(-) diff --git a/static/app/components/modals/widgetBuilder/addToDashboardModal.spec.tsx b/static/app/components/modals/widgetBuilder/addToDashboardModal.spec.tsx index 268919cd4399a9..94543d87695743 100644 --- a/static/app/components/modals/widgetBuilder/addToDashboardModal.spec.tsx +++ b/static/app/components/modals/widgetBuilder/addToDashboardModal.spec.tsx @@ -97,6 +97,11 @@ describe('add to dashboard modal', () => { body: testDashboard, }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); + eventsStatsMock = MockApiClient.addMockResponse({ url: '/organizations/org-slug/events-stats/', body: [], diff --git a/static/app/components/modals/widgetBuilder/addToDashboardModal.tsx b/static/app/components/modals/widgetBuilder/addToDashboardModal.tsx index f03b399feaf527..eaf440d36f9eab 100644 --- a/static/app/components/modals/widgetBuilder/addToDashboardModal.tsx +++ b/static/app/components/modals/widgetBuilder/addToDashboardModal.tsx @@ -306,7 +306,6 @@ function AddToDashboardModal({ widgetLegendState={widgetLegendState} onLegendSelectChanged={() => {}} legendOptions={ - organization.features.includes('dashboards-releases-on-charts') && widgetLegendState.widgetRequiresLegendUnselection(widget) ? {selected: unselectedReleasesForCharts} : undefined diff --git a/static/app/components/modals/widgetViewerModal.spec.tsx b/static/app/components/modals/widgetViewerModal.spec.tsx index 00ec22ba6afc23..8edf9f12b1edd4 100644 --- a/static/app/components/modals/widgetViewerModal.spec.tsx +++ b/static/app/components/modals/widgetViewerModal.spec.tsx @@ -131,6 +131,11 @@ describe('Modals -> WidgetViewerModal', function () { body: [], }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); + eventsMetaMock = MockApiClient.addMockResponse({ url: '/organizations/org-slug/events-meta/', body: {count: 33323612}, diff --git a/static/app/views/dashboards/dashboard.spec.tsx b/static/app/views/dashboards/dashboard.spec.tsx index ce760832a12d7e..f6bfd87e6dc6fc 100644 --- a/static/app/views/dashboards/dashboard.spec.tsx +++ b/static/app/views/dashboards/dashboard.spec.tsx @@ -86,6 +86,10 @@ describe('Dashboards > Dashboard', () => { method: 'POST', body: [], }); + MockApiClient.addMockResponse({ + url: `/organizations/org-slug/releases/stats/`, + body: [], + }); MockApiClient.addMockResponse({ url: '/organizations/org-slug/events-stats/', method: 'GET', diff --git a/static/app/views/dashboards/detail.spec.tsx b/static/app/views/dashboards/detail.spec.tsx index e5e17c81e06ea5..19672cf1c8388f 100644 --- a/static/app/views/dashboards/detail.spec.tsx +++ b/static/app/views/dashboards/detail.spec.tsx @@ -100,6 +100,10 @@ describe('Dashboards > Detail', function () { url: '/organizations/org-slug/releases/', body: [], }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); MockApiClient.addMockResponse({ url: '/organizations/org-slug/metrics/meta/', body: [], @@ -368,6 +372,10 @@ describe('Dashboards > Detail', function () { url: '/organizations/org-slug/releases/', body: [], }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); MockApiClient.addMockResponse({ url: '/organizations/org-slug/sdk-updates/', body: [], diff --git a/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx b/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx index 0f115f9d364027..668e731bf048b5 100644 --- a/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx +++ b/static/app/views/dashboards/widgetBuilder/buildSteps/visualizationStep.tsx @@ -141,7 +141,6 @@ export function VisualizationStep({ shouldResize={false} onLegendSelectChanged={() => {}} legendOptions={ - organization.features.includes('dashboards-releases-on-charts') && widgetLegendState.widgetRequiresLegendUnselection(widget) ? {selected: unselectedReleasesForCharts} : undefined diff --git a/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx b/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx index 795a6c563b3333..3c471ed285e448 100644 --- a/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx +++ b/static/app/views/dashboards/widgetBuilder/widgetBuilder.spec.tsx @@ -265,6 +265,10 @@ describe('WidgetBuilder', function () { url: '/organizations/org-slug/releases/', body: [], }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); MockApiClient.addMockResponse({ url: `/organizations/org-slug/spans/fields/`, body: [], diff --git a/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx b/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx index b4e83ee7ea1a47..9b2f23c241c1d8 100644 --- a/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx +++ b/static/app/views/dashboards/widgetBuilder/widgetBuilderDataset.spec.tsx @@ -276,6 +276,10 @@ describe('WidgetBuilder', function () { url: '/organizations/org-slug/releases/', body: [], }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); MockApiClient.addMockResponse({ url: `/organizations/org-slug/spans/fields/`, body: [], diff --git a/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx b/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx index 98c77e0f9b0718..19447f3caac89d 100644 --- a/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx +++ b/static/app/views/dashboards/widgetBuilder/widgetBuilderSortBy.spec.tsx @@ -236,6 +236,10 @@ describe('WidgetBuilder', function () { url: '/organizations/org-slug/releases/', body: [], }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); MockApiClient.addMockResponse({ url: `/organizations/org-slug/spans/fields/`, body: [], diff --git a/static/app/views/dashboards/widgetCard/chart.tsx b/static/app/views/dashboards/widgetCard/chart.tsx index 155bc26d9a0428..03ccf4723fbb41 100644 --- a/static/app/views/dashboards/widgetCard/chart.tsx +++ b/static/app/views/dashboards/widgetCard/chart.tsx @@ -297,7 +297,6 @@ class WidgetCardChart extends Component { chartZoomOptions, timeseriesResultsTypes, shouldResize, - organization, } = this.props; if (widget.displayType === 'table') { @@ -524,8 +523,7 @@ class WidgetCardChart extends Component { const forwardedRef = this.props.chartGroup ? this.handleRef : undefined; - return organization.features.includes('dashboards-releases-on-charts') && - widgetLegendState.widgetRequiresLegendUnselection(widget) ? ( + return widgetLegendState.widgetRequiresLegendUnselection(widget) ? ( WidgetCard', function () { data: [{title: 'title'}], }, }); + MockApiClient.addMockResponse({ + url: '/organizations/org-slug/releases/stats/', + body: [], + }); }); afterEach(function () { diff --git a/static/app/views/dashboards/widgetLegendSelectionState.spec.tsx b/static/app/views/dashboards/widgetLegendSelectionState.spec.tsx index eae0b7d404b9fc..e539bf53ddb284 100644 --- a/static/app/views/dashboards/widgetLegendSelectionState.spec.tsx +++ b/static/app/views/dashboards/widgetLegendSelectionState.spec.tsx @@ -49,7 +49,6 @@ describe('WidgetLegend functions util', () => { }; organization = { ...OrganizationFixture(), - features: ['dashboards-releases-on-charts'], }; dashboard = { diff --git a/static/app/views/dashboards/widgetLegendSelectionState.tsx b/static/app/views/dashboards/widgetLegendSelectionState.tsx index a88aff96132cae..20ad8817e69986 100644 --- a/static/app/views/dashboards/widgetLegendSelectionState.tsx +++ b/static/app/views/dashboards/widgetLegendSelectionState.tsx @@ -121,8 +121,7 @@ class WidgetLegendSelectionState { return location.query.unselectedSeries ? this.decodeLegendQueryParam(widget) - : this.widgetRequiresLegendUnselection(widget) && - this.organization.features.includes('dashboards-releases-on-charts') + : this.widgetRequiresLegendUnselection(widget) ? { [WidgetLegendNameEncoderDecoder.encodeSeriesNameForLegend( 'Releases', @@ -148,8 +147,7 @@ class WidgetLegendSelectionState { } formatLegendDefaultQuery(widget: Widget) { - return this.organization.features.includes('dashboards-releases-on-charts') && - this.widgetRequiresLegendUnselection(widget) + return this.widgetRequiresLegendUnselection(widget) ? `${widget.id}${WIDGET_ID_DELIMITER}Releases` : undefined; }