Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Removing DASHBOARD_CROSS_FILTERS flag and all that comes with it. #31794

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion RESOURCES/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ These features flags currently default to True and **will be removed in a future
[//]: # "PLEASE KEEP THE LIST SORTED ALPHABETICALLY"

- AVOID_COLORS_COLLISION
- DASHBOARD_CROSS_FILTERS
- DRILL_TO_DETAIL
- ENABLE_JAVASCRIPT_CONTROLS
- KV_STORE
1 change: 1 addition & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This file documents any backwards-incompatible changes in Superset and
assists people when migrating to a new version.

## Next
- [31794](/~https://github.com/apache/superset/pull/31794) Removed the previously deprecated `DASHBOARD_CROSS_FILTERS` feature flag.
- [31774](/~https://github.com/apache/superset/pull/31774): Fixes the spelling of the `USE-ANALAGOUS-COLORS` feature flag. Please update any scripts/configuration item to use the new/corrected `USE-ANALOGOUS-COLORS` flag spelling.
- [31582](/~https://github.com/apache/superset/pull/31582) Removed the legacy Area, Bar, Event Flow, Heatmap, Histogram, Line, Sankey, and Sankey Loop charts. They were all automatically migrated to their ECharts counterparts with the exception of the Event Flow and Sankey Loop charts which were removed as they were not actively maintained and not widely used. If you were using the Event Flow or Sankey Loop charts, you will need to find an alternative solution.
- [31198](/~https://github.com/apache/superset/pull/31198) Disallows by default the use of the following ClickHouse functions: "version", "currentDatabase", "hostName".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ export enum FeatureFlag {
AvoidColorsCollision = 'AVOID_COLORS_COLLISION',
ChartPluginsExperimental = 'CHART_PLUGINS_EXPERIMENTAL',
ConfirmDashboardDiff = 'CONFIRM_DASHBOARD_DIFF',
/** @deprecated */
DashboardCrossFilters = 'DASHBOARD_CROSS_FILTERS',
DashboardVirtualization = 'DASHBOARD_VIRTUALIZATION',
DashboardRbac = 'DASHBOARD_RBAC',
DatapanelClosedByDefault = 'DATAPANEL_CLOSED_BY_DEFAULT',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ const ChartContextMenu = (
canDrillBy &&
isDisplayed(ContextMenuItem.DrillBy);

const showCrossFilters =
isFeatureEnabled(FeatureFlag.DashboardCrossFilters) &&
isDisplayed(ContextMenuItem.CrossFilter);
const showCrossFilters = isDisplayed(ContextMenuItem.CrossFilter);

const isCrossFilteringSupportedByChart = getChartMetadataRegistry()
.get(formData.viz_type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ const CONTEXT_MENU_TEST_ID = 'chart-context-menu';

// @ts-ignore
global.featureFlags = {
[FeatureFlag.DashboardCrossFilters]: true,
[FeatureFlag.DrillToDetail]: true,
[FeatureFlag.DrillBy]: true,
};
Expand Down
7 changes: 1 addition & 6 deletions superset-frontend/src/components/Chart/ChartRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import {
logging,
Behavior,
t,
isFeatureEnabled,
FeatureFlag,
getChartMetadataRegistry,
VizType,
} from '@superset-ui/core';
Expand Down Expand Up @@ -90,10 +88,7 @@ class ChartRenderer extends Component {
)?.suppressContextMenu;
this.state = {
showContextMenu:
props.source === ChartSource.Dashboard &&
!suppressContextMenu &&
(isFeatureEnabled(FeatureFlag.DrillToDetail) ||
isFeatureEnabled(FeatureFlag.DashboardCrossFilters)),
props.source === ChartSource.Dashboard && !suppressContextMenu,
inContextMenu: false,
legendState: undefined,
};
Expand Down
24 changes: 10 additions & 14 deletions superset-frontend/src/dashboard/actions/dashboardState.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,16 +353,14 @@ export function saveDashboardRequest(data, id, saveType) {
if (lastModifiedTime) {
dispatch(saveDashboardRequestSuccess(lastModifiedTime));
}
if (isFeatureEnabled(FeatureFlag.DashboardCrossFilters)) {
const { chartConfiguration, globalChartConfiguration } =
handleChartConfiguration();
dispatch(
saveChartConfiguration({
chartConfiguration,
globalChartConfiguration,
}),
);
}
const { chartConfiguration, globalChartConfiguration } =
handleChartConfiguration();
dispatch(
saveChartConfiguration({
chartConfiguration,
globalChartConfiguration,
}),
);
dispatch(saveDashboardFinished());
dispatch(addSuccessToast(t('This dashboard was saved successfully.')));
return response;
Expand Down Expand Up @@ -437,10 +435,8 @@ export function saveDashboardRequest(data, id, saveType) {
) {
let chartConfiguration = {};
let globalChartConfiguration = {};
if (isFeatureEnabled(FeatureFlag.DashboardCrossFilters)) {
({ chartConfiguration, globalChartConfiguration } =
handleChartConfiguration());
}
({ chartConfiguration, globalChartConfiguration } =
handleChartConfiguration());
const updatedDashboard =
saveType === SAVE_TYPE_OVERWRITE_CONFIRMED
? data
Expand Down
15 changes: 13 additions & 2 deletions superset-frontend/src/dashboard/actions/dashboardState.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ describe('dashboardState actions', () => {
present: mockDashboardData.positions,
future: {},
},
charts: {},
};
const newDashboardData = mockDashboardData;

Expand Down Expand Up @@ -153,7 +154,12 @@ describe('dashboardState actions', () => {

it('dispatches SET_OVERRIDE_CONFIRM when an inspect value has diff', async () => {
const id = 192;
const { getState, dispatch } = setup();
const { getState, dispatch } = setup({
charts: {
123: { id: 123 },
456: { id: 456 },
},
});
const thunk = saveDashboardRequest(
newDashboardData,
id,
Expand All @@ -172,7 +178,12 @@ describe('dashboardState actions', () => {

it('should post dashboard data with after confirm the overwrite values', async () => {
const id = 192;
const { getState, dispatch } = setup();
const { getState, dispatch } = setup({
charts: {
123: { id: 123 },
456: { id: 456 },
},
});
const confirmedDashboardData = {
...newDashboardData,
css: updatedCss,
Expand Down
18 changes: 8 additions & 10 deletions superset-frontend/src/dashboard/actions/hydrate.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,14 @@ export const hydrateDashboard =
filterConfig: metadata?.native_filter_configuration || [],
});

if (isFeatureEnabled(FeatureFlag.DashboardCrossFilters)) {
const { chartConfiguration, globalChartConfiguration } =
getCrossFiltersConfiguration(
dashboardLayout.present,
metadata,
chartQueries,
);
metadata.chart_configuration = chartConfiguration;
metadata.global_chart_configuration = globalChartConfiguration;
}
const { chartConfiguration, globalChartConfiguration } =
getCrossFiltersConfiguration(
dashboardLayout.present,
metadata,
chartQueries,
);
metadata.chart_configuration = chartConfiguration;
metadata.global_chart_configuration = globalChartConfiguration;

const { roles } = user;
const canEdit = canUserEditDashboard(dashboard, user);
Expand Down
7 changes: 2 additions & 5 deletions superset-frontend/src/dashboard/components/Dashboard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
import { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { isFeatureEnabled, t, FeatureFlag } from '@superset-ui/core';
import { t } from '@superset-ui/core';

import { PluginContext } from 'src/components/DynamicPlugins';
import Loading from 'src/components/Loading';
Expand Down Expand Up @@ -163,10 +163,7 @@ class Dashboard extends PureComponent {
editMode,
} = this.props;
const { appliedFilters, appliedOwnDataCharts } = this;
if (
isFeatureEnabled(FeatureFlag.DashboardCrossFilters) &&
!chartConfiguration
) {
if (!chartConfiguration) {
// For a first loading we need to wait for cross filters charts data loaded to get all active filters
// for correct comparing of filters to avoid unnecessary requests
return;
Expand Down
Loading
Loading