From 802009a633fd36a79c229aa084ab5c3f69b323ba Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Sun, 23 Apr 2023 12:15:55 -0300 Subject: [PATCH 1/2] chore: Deprecates FilterBox --- RESOURCES/FEATURE_FLAGS.md | 2 +- .../src/visualizations/FilterBox/FilterBox.jsx | 3 +++ .../src/visualizations/FilterBox/FilterBoxChartPlugin.js | 6 +++++- superset/viz.py | 2 ++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index 49fac479cb922..29d84b0d9e3ad 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/visualizations/FilterBox/FilterBox.jsx b/superset-frontend/src/visualizations/FilterBox/FilterBox.jsx index b90d82289e67f..f7e816bcaf20c 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 137a2b191af24..fbd3846e467cf 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 cbfb38f90bd23..050e8bcc26bfe 100644 --- a/superset/viz.py +++ b/superset/viz.py @@ -50,6 +50,7 @@ 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 @@ def get_data(self, df: pd.DataFrame) -> VizData: return data +@deprecated(deprecated_in="3.0") class FilterBoxViz(BaseViz): """A multi filter, multi-choice filter box to make dashboards interactive""" From 49c4879e8fa51313ead37a098b1c2bfd769a08a1 Mon Sep 17 00:00:00 2001 From: "Michael S. Molina" Date: Sun, 23 Apr 2023 14:07:34 -0300 Subject: [PATCH 2/2] Fixes test --- superset-frontend/src/features/alerts/AlertReportModal.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/features/alerts/AlertReportModal.test.tsx b/superset-frontend/src/features/alerts/AlertReportModal.test.tsx index 163b8e801ec3b..fd0457aa9fc33 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();