chore: remove SIP_34_QUERY_SEARCH_UI feature flag (#11863)

This commit is contained in:
ʈᵃᵢ 2020-12-01 09:29:16 -08:00 committed by GitHub
parent 44e80e0175
commit ffa32cde14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 21 deletions

View File

@ -88,10 +88,7 @@ class App extends React.PureComponent {
render() { render() {
let content; let content;
if (this.state.hash && this.state.hash === '#search') { if (this.state.hash && this.state.hash === '#search') {
if ( if (isFeatureEnabled(FeatureFlag.ENABLE_REACT_CRUD_VIEWS)) {
isFeatureEnabled(FeatureFlag.ENABLE_REACT_CRUD_VIEWS) &&
isFeatureEnabled(FeatureFlag.SIP_34_QUERY_SEARCH_UI)
) {
return window.location.replace('/superset/sqllab/history/'); return window.location.replace('/superset/sqllab/history/');
} }
content = ( content = (

View File

@ -33,7 +33,6 @@ export enum FeatureFlag {
DISPLAY_MARKDOWN_HTML = 'DISPLAY_MARKDOWN_HTML', DISPLAY_MARKDOWN_HTML = 'DISPLAY_MARKDOWN_HTML',
ESCAPE_MARKDOWN_HTML = 'ESCAPE_MARKDOWN_HTML', ESCAPE_MARKDOWN_HTML = 'ESCAPE_MARKDOWN_HTML',
VERSIONED_EXPORT = 'VERSIONED_EXPORT', VERSIONED_EXPORT = 'VERSIONED_EXPORT',
SIP_34_QUERY_SEARCH_UI = 'SIP_34_QUERY_SEARCH_UI',
} }
export type FeatureFlagMap = { export type FeatureFlagMap = {

View File

@ -17,7 +17,6 @@
* under the License. * under the License.
*/ */
import { t } from '@superset-ui/core'; import { t } from '@superset-ui/core';
import { isFeatureEnabled, FeatureFlag } from 'src/featureFlags';
export const commonMenuData = { export const commonMenuData = {
name: t('Data'), name: t('Data'),
@ -44,7 +43,7 @@ export const commonMenuData = {
name: 'Query History', name: 'Query History',
label: t('Query History'), label: t('Query History'),
url: '/superset/sqllab/history/', url: '/superset/sqllab/history/',
usesRouter: isFeatureEnabled(FeatureFlag.SIP_34_QUERY_SEARCH_UI), usesRouter: true,
}, },
], ],
}; };

View File

@ -186,7 +186,7 @@ function QueryList({ addDangerToast, addSuccessToast }: QueryListProps) {
{ {
accessor: QueryObjectColumns.start_time, accessor: QueryObjectColumns.start_time,
Header: t('Time'), Header: t('Time'),
size: 'lg', size: 'xl',
Cell: ({ Cell: ({
row: { row: {
original: { start_time, end_time }, original: { start_time, end_time },
@ -222,12 +222,12 @@ function QueryList({ addDangerToast, addSuccessToast }: QueryListProps) {
{ {
accessor: QueryObjectColumns.tab_name, accessor: QueryObjectColumns.tab_name,
Header: t('Tab Name'), Header: t('Tab Name'),
size: 'lg', size: 'xl',
}, },
{ {
accessor: QueryObjectColumns.database_name, accessor: QueryObjectColumns.database_name,
Header: t('Database'), Header: t('Database'),
size: 'lg', size: 'xl',
}, },
{ {
accessor: QueryObjectColumns.database, accessor: QueryObjectColumns.database,
@ -236,7 +236,7 @@ function QueryList({ addDangerToast, addSuccessToast }: QueryListProps) {
{ {
accessor: QueryObjectColumns.schema, accessor: QueryObjectColumns.schema,
Header: t('Schema'), Header: t('Schema'),
size: 'lg', size: 'xl',
}, },
{ {
Cell: ({ Cell: ({
@ -273,13 +273,13 @@ function QueryList({ addDangerToast, addSuccessToast }: QueryListProps) {
}, },
accessor: QueryObjectColumns.sql_tables, accessor: QueryObjectColumns.sql_tables,
Header: t('Tables'), Header: t('Tables'),
size: 'lg', size: 'xl',
disableSortBy: true, disableSortBy: true,
}, },
{ {
accessor: QueryObjectColumns.user, accessor: QueryObjectColumns.user,
Header: t('User'), Header: t('User'),
size: 'lg', size: 'xl',
Cell: ({ Cell: ({
row: { row: {
original: { user }, original: { user },

View File

@ -340,8 +340,8 @@ class SupersetAppInitializer:
) )
appbuilder.add_link( appbuilder.add_link(
"Query Search", "Query Search",
label=_("Query Search"), label=_("Query History"),
href="/superset/sqllab#search", href="/superset/sqllab/history",
icon="fa-search", icon="fa-search",
category_icon="fa-flask", category_icon="fa-flask",
category="SQL Lab", category="SQL Lab",

View File

@ -337,7 +337,6 @@ DEFAULT_FEATURE_FLAGS: Dict[str, bool] = {
"ROW_LEVEL_SECURITY": False, "ROW_LEVEL_SECURITY": False,
# Enables Alerts and reports new implementation # Enables Alerts and reports new implementation
"ALERT_REPORTS": False, "ALERT_REPORTS": False,
"SIP_34_QUERY_SEARCH_UI": False,
} }
# Set the default view to card/grid view if thumbnail support is enabled. # Set the default view to card/grid view if thumbnail support is enabled.

View File

@ -2774,11 +2774,8 @@ class Superset(BaseSupersetView): # pylint: disable=too-many-public-methods
@event_logger.log_this @event_logger.log_this
@expose("/sqllab/history/", methods=["GET"]) @expose("/sqllab/history/", methods=["GET"])
@event_logger.log_this @event_logger.log_this
def sqllab_search(self) -> FlaskResponse: def sqllab_history(self) -> FlaskResponse:
if not ( if not is_feature_enabled("ENABLE_REACT_CRUD_VIEWS"):
is_feature_enabled("ENABLE_REACT_CRUD_VIEWS")
and is_feature_enabled("SIP_34_QUERY_SEARCH_UI")
):
return redirect("/superset/sqllab#search", code=307) return redirect("/superset/sqllab#search", code=307)
return super().render_app_template() return super().render_app_template()