Skip to content

Commit

Permalink
refactor: Removes the deprecated VERSIONED_EXPORT feature flag (apach…
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored and sfirke committed Mar 22, 2024
1 parent 2ed0886 commit 76f0ff2
Show file tree
Hide file tree
Showing 18 changed files with 427 additions and 752 deletions.
1 change: 0 additions & 1 deletion RESOURCES/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,3 @@ These features flags currently default to True and **will be removed in a future
- ENABLE_JAVASCRIPT_CONTROLS
- GENERIC_CHART_AXES
- KV_STORE
- VERSIONED_EXPORT
1 change: 1 addition & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ assists people when migrating to a new version.

### Breaking Changes

- [26347](https://github.com/apache/superset/issues/26347): Removes the deprecated `VERSIONED_EXPORT` feature flag. The previous value of the feature flag was `True` and now the feature is permanently enabled.
- [26328](https://github.com/apache/superset/issues/26328): Removes the deprecated Filter Box code and it's associated dependencies `react-select` and `array-move`. It also removes the `DeprecatedSelect` and `AsyncSelect` components that were exclusively used by filter boxes. Existing filter boxes will be automatically migrated to native filters.
- [26330](https://github.com/apache/superset/issues/26330): Removes the deprecated `DASHBOARD_FILTERS_EXPERIMENTAL` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed.
- [26344](https://github.com/apache/superset/issues/26344): Removes the deprecated `ENABLE_EXPLORE_JSON_CSRF_PROTECTION` feature flag. The previous value of the feature flag was `False` and now the feature is permanently removed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export enum FeatureFlag {
TAGGING_SYSTEM = 'TAGGING_SYSTEM',
THUMBNAILS = 'THUMBNAILS',
USE_ANALAGOUS_COLORS = 'USE_ANALAGOUS_COLORS',
VERSIONED_EXPORT = 'VERSIONED_EXPORT',
}
export type ScheduleQueriesProps = {
JSONSCHEMA: {
Expand Down
3 changes: 1 addition & 2 deletions superset-frontend/src/features/charts/ChartCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,7 @@ export default function ChartCard({
const history = useHistory();
const canEdit = hasPerm('can_write');
const canDelete = hasPerm('can_write');
const canExport =
hasPerm('can_export') && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT);
const canExport = hasPerm('can_export');
const theme = useTheme();

const menu = (
Expand Down
31 changes: 14 additions & 17 deletions superset-frontend/src/pages/ChartList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,7 @@ function ChartList(props: ChartListProps) {
const canCreate = hasPerm('can_write');
const canEdit = hasPerm('can_write');
const canDelete = hasPerm('can_write');
const canExport =
hasPerm('can_export') && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT);
const canExport = hasPerm('can_export');
const initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];
const handleBulkChartExport = (chartsToExport: Chart[]) => {
const ids = chartsToExport.map(({ id }) => id);
Expand Down Expand Up @@ -777,21 +776,19 @@ function ChartList(props: ChartListProps) {
},
});

if (isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT)) {
subMenuButtons.push({
name: (
<Tooltip
id="import-tooltip"
title={t('Import charts')}
placement="bottomRight"
>
<Icons.Import data-test="import-button" />
</Tooltip>
),
buttonStyle: 'link',
onClick: openChartImportModal,
});
}
subMenuButtons.push({
name: (
<Tooltip
id="import-tooltip"
title={t('Import charts')}
placement="bottomRight"
>
<Icons.Import data-test="import-button" />
</Tooltip>
),
buttonStyle: 'link',
onClick: openChartImportModal,
});
}

return (
Expand Down
31 changes: 14 additions & 17 deletions superset-frontend/src/pages/DashboardList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ function DashboardList(props: DashboardListProps) {
const canCreate = hasPerm('can_write');
const canEdit = hasPerm('can_write');
const canDelete = hasPerm('can_write');
const canExport =
hasPerm('can_export') && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT);
const canExport = hasPerm('can_export');

const initialSort = [{ id: 'changed_on_delta_humanized', desc: true }];

Expand Down Expand Up @@ -659,21 +658,19 @@ function DashboardList(props: DashboardListProps) {
},
});

if (isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT)) {
subMenuButtons.push({
name: (
<Tooltip
id="import-tooltip"
title={t('Import dashboards')}
placement="bottomRight"
>
<Icons.Import data-test="import-button" />
</Tooltip>
),
buttonStyle: 'link',
onClick: openDashboardImportModal,
});
}
subMenuButtons.push({
name: (
<Tooltip
id="import-tooltip"
title={t('Import dashboards')}
placement="bottomRight"
>
<Icons.Import data-test="import-button" />
</Tooltip>
),
buttonStyle: 'link',
onClick: openDashboardImportModal,
});
}
return (
<>
Expand Down
5 changes: 1 addition & 4 deletions superset-frontend/src/pages/DatabaseList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* under the License.
*/
import {
isFeatureEnabled,
FeatureFlag,
getExtensionsRegistry,
styled,
SupersetClient,
Expand Down Expand Up @@ -216,8 +214,7 @@ function DatabaseList({
const canCreate = hasPerm('can_write');
const canEdit = hasPerm('can_write');
const canDelete = hasPerm('can_write');
const canExport =
hasPerm('can_export') && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT);
const canExport = hasPerm('can_export');

const { canUploadCSV, canUploadColumnar, canUploadExcel } = uploadUserPerms(
roles,
Expand Down
33 changes: 14 additions & 19 deletions superset-frontend/src/pages/DatasetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
* under the License.
*/
import {
isFeatureEnabled,
FeatureFlag,
getExtensionsRegistry,
styled,
SupersetClient,
Expand Down Expand Up @@ -207,8 +205,7 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
const canDelete = hasPerm('can_write');
const canCreate = hasPerm('can_write');
const canDuplicate = hasPerm('can_duplicate');
const canExport =
hasPerm('can_export') && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT);
const canExport = hasPerm('can_export');

const initialSort = SORT_BY;

Expand Down Expand Up @@ -654,21 +651,19 @@ const DatasetList: FunctionComponent<DatasetListProps> = ({
buttonStyle: 'primary',
});

if (isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT)) {
buttonArr.push({
name: (
<Tooltip
id="import-tooltip"
title={t('Import datasets')}
placement="bottomRight"
>
<Icons.Import data-test="import-button" />
</Tooltip>
),
buttonStyle: 'link',
onClick: openDatasetImportModal,
});
}
buttonArr.push({
name: (
<Tooltip
id="import-tooltip"
title={t('Import datasets')}
placement="bottomRight"
>
<Icons.Import data-test="import-button" />
</Tooltip>
),
buttonStyle: 'link',
onClick: openDatasetImportModal,
});
}

menuData.buttons = buttonArr;
Expand Down
5 changes: 2 additions & 3 deletions superset-frontend/src/pages/SavedQueryList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ function SavedQueryList({
const canCreate = hasPerm('can_write');
const canEdit = hasPerm('can_write');
const canDelete = hasPerm('can_write');
const canExport =
hasPerm('can_export') && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT);
const canExport = hasPerm('can_export');

const handleSavedQueryPreview = useCallback(
(id: number) => {
Expand Down Expand Up @@ -204,7 +203,7 @@ function SavedQueryList({
buttonStyle: 'primary',
});

if (canCreate && isFeatureEnabled(FeatureFlag.VERSIONED_EXPORT)) {
if (canCreate) {
subMenuButtons.push({
name: (
<Tooltip
Expand Down
Loading

0 comments on commit 76f0ff2

Please sign in to comment.