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/14 12:10:10 UTC

[superset] 01/01: Remove feature flag

This is an automated email from the ASF dual-hosted git repository.

diegopucci pushed a commit to branch chore/rm-crossreferences-feat-flag
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5871c0c9b85d802884d340018d5891f47eee230f
Author: geido <di...@gmail.com>
AuthorDate: Fri Oct 14 15:08:17 2022 +0300

    Remove feature flag
---
 .../superset-ui-core/src/utils/featureFlags.ts     |  1 -
 .../components/ExploreChartHeader/index.jsx        |  5 +-
 .../useExploreAdditionalActionsMenu/index.jsx      | 20 +++----
 .../src/views/CRUD/chart/ChartList.tsx             | 69 +++++++++-------------
 superset/config.py                                 |  1 -
 tests/integration_tests/superset_test_config.py    |  1 -
 6 files changed, 39 insertions(+), 58 deletions(-)

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/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 aec2dba890..a436efc858 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -466,7 +466,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/"