From c2834cc14cf0db447b9759718411799eabcd8414 Mon Sep 17 00:00:00 2001 From: Geido <60598000+geido@users.noreply.github.com> Date: Fri, 21 Oct 2022 15:11:49 +0300 Subject: [PATCH] chore: Remove CROSS_REFERENCES feature flag (#21815) --- RESOURCES/FEATURE_FLAGS.md | 1 - .../src/utils/featureFlags.ts | 1 - .../components/ExploreChartHeader/index.jsx | 5 +- .../DashboardsSubMenu.tsx | 2 +- .../useExploreAdditionalActionsMenu/index.jsx | 20 +++--- .../src/views/CRUD/chart/ChartList.tsx | 69 ++++++++----------- superset/config.py | 1 - .../integration_tests/superset_test_config.py | 1 - 8 files changed, 40 insertions(+), 60 deletions(-) diff --git a/RESOURCES/FEATURE_FLAGS.md b/RESOURCES/FEATURE_FLAGS.md index 807319cd6b213..6b5b201066182 100644 --- a/RESOURCES/FEATURE_FLAGS.md +++ b/RESOURCES/FEATURE_FLAGS.md @@ -28,7 +28,6 @@ These features are considered **unfinished** and should only be used on developm [//]: # "PLEASE KEEP THE LIST SORTED ALPHABETICALLY" - CLIENT_CACHE -- CROSS_REFERENCES - DASHBOARD_CACHE - DASHBOARD_NATIVE_FILTERS_SET - DISABLE_DATASET_SOURCE_EDIT diff --git a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts index 229a88d6a6f9b..e230d4f61124f 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts +++ b/superset-frontend/packages/superset-ui-core/src/utils/featureFlags.ts @@ -25,7 +25,6 @@ export enum FeatureFlag { ALLOW_DASHBOARD_DOMAIN_SHARDING = 'ALLOW_DASHBOARD_DOMAIN_SHARDING', ALLOW_FULL_CSV_EXPORT = 'ALLOW_FULL_CSV_EXPORT', CLIENT_CACHE = 'CLIENT_CACHE', - CROSS_REFERENCES = 'CROSS_REFERENCES', DASHBOARD_CROSS_FILTERS = 'DASHBOARD_CROSS_FILTERS', DASHBOARD_EDIT_CHART_IN_NEW_TAB = 'DASHBOARD_EDIT_CHART_IN_NEW_TAB', DASHBOARD_FILTERS_EXPERIMENTAL = 'DASHBOARD_FILTERS_EXPERIMENTAL', diff --git a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx index 525d02be53265..8e7e5b6e69742 100644 --- a/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx +++ b/superset-frontend/src/explore/components/ExploreChartHeader/index.jsx @@ -24,8 +24,6 @@ import { Tooltip } from 'src/components/Tooltip'; import { CategoricalColorNamespace, css, - FeatureFlag, - isFeatureEnabled, logging, SupersetClient, t, @@ -166,8 +164,7 @@ export const ExploreChartHeader = ({ ? t('Added to %s dashboard(s)', metadata.dashboards.length) : t('Not added to any dashboard'), description: - metadata.dashboards.length > 0 && - isFeatureEnabled(FeatureFlag.CROSS_REFERENCES) + metadata.dashboards.length > 0 ? t( 'You can preview the list of dashboards on the chart settings dropdown.', ) diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx index 841f3124c0311..625f4b8949d85 100644 --- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx +++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/DashboardsSubMenu.tsx @@ -63,7 +63,7 @@ const DashboardsSubMenu = ({ margin: ${theme.gridUnit * 2}px ${theme.gridUnit * 3}px; `} value={dashboardSearch} - onChange={e => setDashboardSearch(e.currentTarget.value?.trim())} + onChange={e => setDashboardSearch(e.currentTarget.value)} /> )}
)} - {isFeatureEnabled(FeatureFlag.CROSS_REFERENCES) && ( - - - - )} + + + diff --git a/superset-frontend/src/views/CRUD/chart/ChartList.tsx b/superset-frontend/src/views/CRUD/chart/ChartList.tsx index 7600dfbf5d6bf..0bedfa96cf904 100644 --- a/superset-frontend/src/views/CRUD/chart/ChartList.tsx +++ b/superset-frontend/src/views/CRUD/chart/ChartList.tsx @@ -225,7 +225,6 @@ function ChartList(props: ChartListProps) { const initialSort = [{ id: 'changed_on_delta_humanized', desc: true }]; const enableBroadUserAccess = bootstrapData?.common?.conf?.ENABLE_BROAD_ACTIVITY_ACCESS; - const crossRefEnabled = isFeatureEnabled(FeatureFlag.CROSS_REFERENCES); const handleBulkChartExport = (chartsToExport: Chart[]) => { const ids = chartsToExport.map(({ id }) => id); handleResourceExport('chart', ids, () => { @@ -306,30 +305,6 @@ function ChartList(props: ChartListProps) { }; }; - const dashboardsCol = useMemo( - () => ({ - Cell: ({ - row: { - original: { dashboards }, - }, - }: any) => ( - ({ - title: d.dashboard_title, - id: d.id, - }), - )} - /> - ), - Header: t('Dashboards added to'), - accessor: 'dashboards', - disableSortBy: true, - size: 'xxl', - }), - [], - ); - const columns = useMemo( () => [ { @@ -407,7 +382,26 @@ function ChartList(props: ChartListProps) { disableSortBy: true, size: 'xl', }, - ...(crossRefEnabled ? [dashboardsCol] : []), + { + Cell: ({ + row: { + original: { dashboards }, + }, + }: any) => ( + ({ + title: d.dashboard_title, + id: d.id, + }), + )} + /> + ), + Header: t('Dashboards added to'), + accessor: 'dashboards', + disableSortBy: true, + size: 'xxl', + }, { Cell: ({ row: { @@ -574,19 +568,6 @@ function ChartList(props: ChartListProps) { [], ); - const dashboardsFilter: Filter = useMemo( - () => ({ - Header: t('Dashboards'), - id: 'dashboards', - input: 'select', - operator: FilterOperator.relationManyMany, - unfilteredLabel: t('All'), - fetchSelects: fetchDashboards, - paginate: true, - }), - [], - ); - const filters: Filters = useMemo( () => [ { @@ -665,7 +646,15 @@ function ChartList(props: ChartListProps) { fetchSelects: createFetchDatasets, paginate: true, }, - ...(crossRefEnabled ? [dashboardsFilter] : []), + { + Header: t('Dashboards'), + id: 'dashboards', + input: 'select', + operator: FilterOperator.relationManyMany, + unfilteredLabel: t('All'), + fetchSelects: fetchDashboards, + paginate: true, + }, ...(userId ? [favoritesFilter] : []), { Header: t('Certified'), diff --git a/superset/config.py b/superset/config.py index 46531c7ed3e29..04fdb382e04f4 100644 --- a/superset/config.py +++ b/superset/config.py @@ -469,7 +469,6 @@ def _try_json_readsha(filepath: str, length: int) -> Optional[str]: "EMBEDDABLE_CHARTS": True, "DRILL_TO_DETAIL": False, "DATAPANEL_CLOSED_BY_DEFAULT": False, - "CROSS_REFERENCES": False, } # Feature flags may also be set via 'SUPERSET_FEATURE_' prefixed environment vars. diff --git a/tests/integration_tests/superset_test_config.py b/tests/integration_tests/superset_test_config.py index b93e5cc15f033..8f1ef27f2c396 100644 --- a/tests/integration_tests/superset_test_config.py +++ b/tests/integration_tests/superset_test_config.py @@ -71,7 +71,6 @@ "ALERT_REPORTS": True, "DASHBOARD_NATIVE_FILTERS": True, "DRILL_TO_DETAIL": True, - "CROSS_REFERENCES": True, } WEBDRIVER_BASEURL = "http://0.0.0.0:8081/"