You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by di...@apache.org on 2022/10/21 12:11:57 UTC
[superset] branch master updated: chore: Remove CROSS_REFERENCES feature flag (#21815)
This is an automated email from the ASF dual-hosted git repository.
diegopucci pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new c2834cc14c chore: Remove CROSS_REFERENCES feature flag (#21815)
c2834cc14c is described below
commit c2834cc14cf0db447b9759718411799eabcd8414
Author: Geido <60...@users.noreply.github.com>
AuthorDate: Fri Oct 21 15:11:49 2022 +0300
chore: Remove CROSS_REFERENCES feature flag (#21815)
---
RESOURCES/FEATURE_FLAGS.md | 1 -
.../superset-ui-core/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 -
tests/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 807319cd6b..6b5b201066 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 229a88d6a6..e230d4f611 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 525d02be53..8e7e5b6e69 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 841f3124c0..625f4b8949 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)}
/>
)}
<div
diff --git a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
index da66c60957..fa794e871c 100644
--- a/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
+++ b/superset-frontend/src/explore/components/useExploreAdditionalActionsMenu/index.jsx
@@ -255,17 +255,15 @@ export const useExploreAdditionalActionsMenu = (
{t('Edit chart properties')}
</Menu.Item>
)}
- {isFeatureEnabled(FeatureFlag.CROSS_REFERENCES) && (
- <Menu.SubMenu
- title={t('Dashboards added to')}
- key={MENU_KEYS.DASHBOARDS_ADDED_TO}
- >
- <DashboardsSubMenu
- chartId={slice?.slice_id}
- dashboards={dashboards}
- />
- </Menu.SubMenu>
- )}
+ <Menu.SubMenu
+ title={t('Dashboards added to')}
+ key={MENU_KEYS.DASHBOARDS_ADDED_TO}
+ >
+ <DashboardsSubMenu
+ chartId={slice?.slice_id}
+ dashboards={dashboards}
+ />
+ </Menu.SubMenu>
<Menu.Divider />
</>
<Menu.SubMenu title={t('Download')} key={MENU_KEYS.DOWNLOAD_SUBMENU}>
diff --git a/superset-frontend/src/views/CRUD/chart/ChartList.tsx b/superset-frontend/src/views/CRUD/chart/ChartList.tsx
index 7600dfbf5d..0bedfa96cf 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) => (
- <CrossLinks
- crossLinks={ensureIsArray(dashboards).map(
- (d: ChartLinkedDashboard) => ({
- 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) => (
+ <CrossLinks
+ crossLinks={ensureIsArray(dashboards).map(
+ (d: ChartLinkedDashboard) => ({
+ 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 46531c7ed3..04fdb382e0 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -469,7 +469,6 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
"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 b93e5cc15f..8f1ef27f2c 100644
--- a/tests/integration_tests/superset_test_config.py
+++ b/tests/integration_tests/superset_test_config.py
@@ -71,7 +71,6 @@ FEATURE_FLAGS = {
"ALERT_REPORTS": True,
"DASHBOARD_NATIVE_FILTERS": True,
"DRILL_TO_DETAIL": True,
- "CROSS_REFERENCES": True,
}
WEBDRIVER_BASEURL = "http://0.0.0.0:8081/"