Skip to content

Commit

Permalink
chore: Remove CROSS_REFERENCES feature flag (#21815)
Browse files Browse the repository at this point in the history
  • Loading branch information
geido authored Oct 21, 2022
1 parent 2fe68a3 commit c2834cc
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 60 deletions.
1 change: 0 additions & 1 deletion RESOURCES/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import { Tooltip } from 'src/components/Tooltip';
import {
CategoricalColorNamespace,
css,
FeatureFlag,
isFeatureEnabled,
logging,
SupersetClient,
t,
Expand Down Expand Up @@ -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.',
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}>
Expand Down
69 changes: 29 additions & 40 deletions superset-frontend/src/views/CRUD/chart/ChartList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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, () => {
Expand Down Expand Up @@ -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(
() => [
{
Expand Down Expand Up @@ -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: {
Expand Down Expand Up @@ -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(
() => [
{
Expand Down Expand Up @@ -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'),
Expand Down
1 change: 0 additions & 1 deletion superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 0 additions & 1 deletion tests/integration_tests/superset_test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"
Expand Down

0 comments on commit c2834cc

Please sign in to comment.