From 90e2b839a32e21328bc75189ecf0910e9566e3c3 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" <70410625+michael-s-molina@users.noreply.github.com> Date: Mon, 24 Apr 2023 13:54:31 -0300 Subject: [PATCH] chore: Deprecates FilterBox (#23784) --- RESOURCES/FEATURE_FLAGS.md | 2 +- .../src/features/alerts/AlertReportModal.test.tsx | 2 +- .../src/visualizations/FilterBox/FilterBox.jsx | 3 +++ .../src/visualizations/FilterBox/FilterBoxChartPlugin.js | 6 +++++- superset/viz.py | 2 ++ 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index 49fac479c..29d84b0d9 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -76,7 +76,6 @@ These features flags are **safe for production**. They have been tested and will - ALLOW_ADHOC_SUBQUERY - DASHBOARD_CROSS_FILTERS - DASHBOARD_RBAC [(docs)](https://superset.apache.org/docs/creating-charts-dashboards/first-dashboard#manage-access-to-dashboards) -- DASHBOARD_NATIVE_FILTERS - DATAPANEL_CLOSED_BY_DEFAULT - DISABLE_LEGACY_DATASOURCE_EDITOR - DRUID_JOINS @@ -98,4 +97,5 @@ These features flags currently default to True and **will be removed in a future [//]: # "PLEASE KEEP THE LIST SORTED ALPHABETICALLY" +- DASHBOARD_NATIVE_FILTERS - GENERIC_CHART_AXES diff --git a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx index 163b8e801..fd0457aa9 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx @@ -64,7 +64,7 @@ test('renders the appropriate dropdown in Message Content section', async () => expect(await screen.findByRole('radio', { name: /chart/i })).toBeChecked(); expect( - screen.getByRole('radio', { + await screen.findByRole('radio', { name: /dashboard/i, }), ).not.toBeChecked(); diff --git a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx index b90d82289..f7e816bca 100644 --- a/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx +++ b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx @@ -122,6 +122,9 @@ const StyledFilterContainer = styled.div` `} `; +/** + * @deprecated in version 3.0. + */ class FilterBox extends React.PureComponent { constructor(props) { super(props); diff --git a/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js b/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js index 137a2b191..fbd3846e4 100644 --- a/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js +++ b/superset-frontend/src/visualizations/FilterBox/FilterBoxChartPlugin.js @@ -25,7 +25,7 @@ import controlPanel from './controlPanel'; const metadata = new ChartMetadata({ category: t('Tools'), - name: t('Filter box'), + name: t('Filter box (deprecated)'), description: t(`Chart component that lets you add a custom filter UI in your dashboard. When added to dashboard, a filter box lets users specify specific values or ranges to filter charts by. The charts that each filter box is applied to can be fine tuned as well in the dashboard view. @@ -33,8 +33,12 @@ const metadata = new ChartMetadata({ exampleGallery: [{ url: example1 }, { url: example2 }], thumbnail, useLegacyApi: true, + tags: [t('Legacy'), t('Deprecated')], }); +/** + * @deprecated in version 3.0. + */ export default class FilterBoxChartPlugin extends ChartPlugin { constructor() { super({ diff --git a/superset/viz.py b/superset/viz.py index cbfb38f90..050e8bcc2 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -50,6 +50,7 @@ import pandas as pd import polyline import simplejson as json from dateutil import relativedelta as rdelta +from deprecation import deprecated from flask import request from flask_babel import gettext as __, lazy_gettext as _ from geopy.point import Point @@ -2134,6 +2135,7 @@ class WorldMapViz(BaseViz): return data +@deprecated(deprecated_in="3.0") class FilterBoxViz(BaseViz): """A multi filter, multi-choice filter box to make dashboards interactive"""