chore(native-filters): introduce experimental feature flag (#14814)

* chore(native-filters): introduce experimental feature flag

* break out util and add tests

* fix import
This commit is contained in:
Ville Brofeldt
2021-05-26 17:20:33 +03:00
committed by GitHub
parent 6bdbd2bf50
commit e466066229
5 changed files with 159 additions and 18 deletions

View File

@@ -19,14 +19,14 @@
import React, { useEffect, useRef, useState } from 'react';
import PropTypes from 'prop-types';
import { Input, Row, Col } from 'src/common/components';
import { Behavior, t, getChartMetadataRegistry } from '@superset-ui/core';
import { t, getChartMetadataRegistry } from '@superset-ui/core';
import { useDynamicPluginContext } from 'src/components/DynamicPlugins';
import Modal from 'src/components/Modal';
import { Tooltip } from 'src/components/Tooltip';
import Label from 'src/components/Label';
import ControlHeader from 'src/explore/components/ControlHeader';
import { nativeFilterGate } from 'src/dashboard/components/nativeFilters/utils';
import './VizTypeControl.less';
import { FeatureFlag, isFeatureEnabled } from 'src/featureFlags';
const propTypes = {
description: PropTypes.string,
@@ -108,11 +108,6 @@ function VizSupportValidation({ vizType }) {
);
}
const nativeFilterGate = behaviors =>
!behaviors.includes(Behavior.NATIVE_FILTER) ||
(isFeatureEnabled(FeatureFlag.DASHBOARD_CROSS_FILTERS) &&
behaviors.includes(Behavior.INTERACTIVE_CHART));
const VizTypeControl = props => {
const [showModal, setShowModal] = useState(false);
const [filter, setFilter] = useState('');