From 3414f357922e19c57669f6ca7b711757594a6bb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CA=88=E1=B5=83=E1=B5=A2?= Date: Fri, 26 Jun 2020 17:36:50 -0700 Subject: [PATCH] refactor: better naming for config flags (#10180) --- .../javascripts/components/ListView/ListView_spec.jsx | 2 +- superset-frontend/src/components/ListView/ListView.tsx | 10 +++++----- superset-frontend/src/featureFlags.ts | 2 +- superset-frontend/src/views/chartList/ChartList.tsx | 8 ++++---- .../src/views/dashboardList/DashboardList.tsx | 8 ++++---- superset/config.py | 5 +++-- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx b/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx index 46c1e31b15..1a8df8d256 100644 --- a/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx +++ b/superset-frontend/spec/javascripts/components/ListView/ListView_spec.jsx @@ -309,7 +309,7 @@ describe('ListView with new UI filters', () => { const fetchSelectsMock = jest.fn(() => []); const newFiltersProps = { ...mockedProps, - useNewUIFilters: true, + isSIP34FilterUIEnabled: true, filters: [ { Header: 'ID', diff --git a/superset-frontend/src/components/ListView/ListView.tsx b/superset-frontend/src/components/ListView/ListView.tsx index 1017fbe13f..6f98c84af9 100644 --- a/superset-frontend/src/components/ListView/ListView.tsx +++ b/superset-frontend/src/components/ListView/ListView.tsx @@ -45,7 +45,7 @@ interface Props { name: React.ReactNode | string; onSelect: (rows: any[]) => any; }>; - useNewUIFilters?: boolean; + isSIP34FilterUIEnabled?: boolean; } const bulkSelectColumnConfig = { @@ -73,7 +73,7 @@ const ListView: FunctionComponent = ({ className = '', filters = [], bulkActions = [], - useNewUIFilters = false, + isSIP34FilterUIEnabled = false, }) => { const { getTableProps, @@ -100,7 +100,7 @@ const ListView: FunctionComponent = ({ fetchData, initialPageSize, initialSort, - initialFilters: useNewUIFilters ? filters : [], + initialFilters: isSIP34FilterUIEnabled ? filters : [], }); const filterable = Boolean(filters.length); if (filterable) { @@ -123,7 +123,7 @@ const ListView: FunctionComponent = ({
- {!useNewUIFilters && filterable && ( + {!isSIP34FilterUIEnabled && filterable && ( <> @@ -146,7 +146,7 @@ const ListView: FunctionComponent = ({ /> )} - {useNewUIFilters && filterable && ( + {isSIP34FilterUIEnabled && filterable && ( { return this.hasPerm('can_delete'); } - get isNewUIEnabled() { - return isFeatureEnabled(FeatureFlag.LIST_VIEWS_NEW_UI); + get isSIP34FilterUIEnabled() { + return isFeatureEnabled(FeatureFlag.LIST_VIEWS_SIP34_FILTER_UI); } initialSort = [{ id: 'changed_on', desc: true }]; @@ -425,7 +425,7 @@ class ChartList extends React.PureComponent { updateFilters = async () => { const { filterOperators } = this.state; - if (this.isNewUIEnabled) { + if (this.isSIP34FilterUIEnabled) { this.setState({ filters: [ { @@ -560,7 +560,7 @@ class ChartList extends React.PureComponent { initialSort={this.initialSort} filters={filters} bulkActions={bulkActions} - useNewUIFilters={this.isNewUIEnabled} + isSIP34FilterUIEnabled={this.isSIP34FilterUIEnabled} /> ); }} diff --git a/superset-frontend/src/views/dashboardList/DashboardList.tsx b/superset-frontend/src/views/dashboardList/DashboardList.tsx index 50e8bc9720..ef0ede787b 100644 --- a/superset-frontend/src/views/dashboardList/DashboardList.tsx +++ b/superset-frontend/src/views/dashboardList/DashboardList.tsx @@ -119,8 +119,8 @@ class DashboardList extends React.PureComponent { return this.hasPerm('can_mulexport'); } - get isNewUIEnabled() { - return isFeatureEnabled(FeatureFlag.LIST_VIEWS_NEW_UI); + get isSIP34FilterUIEnabled() { + return isFeatureEnabled(FeatureFlag.LIST_VIEWS_SIP34_FILTER_UI); } initialSort = [{ id: 'changed_on', desc: true }]; @@ -428,7 +428,7 @@ class DashboardList extends React.PureComponent { updateFilters = async () => { const { filterOperators } = this.state; - if (this.isNewUIEnabled) { + if (this.isSIP34FilterUIEnabled) { return this.setState({ filters: [ { @@ -563,7 +563,7 @@ class DashboardList extends React.PureComponent { initialSort={this.initialSort} filters={filters} bulkActions={bulkActions} - useNewUIFilters={this.isNewUIEnabled} + isSIP34FilterUIEnabled={this.isSIP34FilterUIEnabled} /> ); diff --git a/superset/config.py b/superset/config.py index ad4c58fe13..5ef169cbc4 100644 --- a/superset/config.py +++ b/superset/config.py @@ -306,7 +306,7 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = { "SIP_38_VIZ_REARCHITECTURE": False, "TAGGING_SYSTEM": False, "SQLLAB_BACKEND_PERSISTENCE": False, - "LIST_VIEWS_NEW_UI": False, + "LIST_VIEWS_SIP34_FILTER_UI": False, } # This is merely a default. @@ -799,7 +799,8 @@ DOCUMENTATION_URL = None DOCUMENTATION_TEXT = "Documentation" DOCUMENTATION_ICON = None # Recommended size: 16x16 -# Enables the replacement react views for all the FAB views: list, edit, show. +# Enables the replacement react views for all the FAB views (list, edit, show) with +# designs introduced in SIP-34: https://github.com/apache/incubator-superset/issues/8976 # This is a work in progress so not all features available in FAB have been implemented ENABLE_REACT_CRUD_VIEWS = False