mirror of https://github.com/apache/superset.git
refactor(explore): move MetricControl and FilterControl to sub-component (#12446)
* wip * wip * wip * wip * move spec * wip * wip * remove unused file * wip * wip * Update superset-frontend/spec/javascripts/explore/components/AdhocFilterEditPopoverSqlTabContent_spec.jsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * Update superset-frontend/spec/javascripts/explore/components/AdhocFilterOption_spec.jsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> * Update superset-frontend/spec/javascripts/explore/components/AdhocMetricEditPopoverTitle_spec.jsx Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com> Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
This commit is contained in:
parent
84266bfa9e
commit
9771b82c94
|
@ -19,7 +19,7 @@
|
||||||
import AdhocFilter, {
|
import AdhocFilter, {
|
||||||
EXPRESSION_TYPES,
|
EXPRESSION_TYPES,
|
||||||
CLAUSES,
|
CLAUSES,
|
||||||
} from 'src/explore/AdhocFilter';
|
} from 'src/explore/components/controls/FilterControl/AdhocFilter';
|
||||||
|
|
||||||
describe('AdhocFilter', () => {
|
describe('AdhocFilter', () => {
|
||||||
it('sets filterOptionName in constructor', () => {
|
it('sets filterOptionName in constructor', () => {
|
||||||
|
|
|
@ -16,8 +16,10 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import AdhocMetric, {
|
||||||
|
EXPRESSION_TYPES,
|
||||||
|
} from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const valueColumn = { type: 'DOUBLE', column_name: 'value' };
|
const valueColumn = { type: 'DOUBLE', column_name: 'value' };
|
||||||
|
|
||||||
|
|
|
@ -25,11 +25,11 @@ import { supersetTheme } from '@superset-ui/core';
|
||||||
import AdhocFilter, {
|
import AdhocFilter, {
|
||||||
EXPRESSION_TYPES,
|
EXPRESSION_TYPES,
|
||||||
CLAUSES,
|
CLAUSES,
|
||||||
} from 'src/explore/AdhocFilter';
|
} from 'src/explore/components/controls/FilterControl/AdhocFilter';
|
||||||
import AdhocFilterControl from 'src/explore/components/controls/AdhocFilterControl';
|
|
||||||
import { LabelsContainer } from 'src/explore/components/OptionControls';
|
import { LabelsContainer } from 'src/explore/components/OptionControls';
|
||||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
|
||||||
import { AGGREGATES, OPERATORS } from 'src/explore/constants';
|
import { AGGREGATES, OPERATORS } from 'src/explore/constants';
|
||||||
|
import AdhocFilterControl from 'src/explore/components/controls/FilterControl/AdhocFilterControl';
|
||||||
|
import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const simpleAdhocFilter = new AdhocFilter({
|
const simpleAdhocFilter = new AdhocFilter({
|
||||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||||
|
|
|
@ -25,10 +25,10 @@ import { FormGroup } from 'react-bootstrap';
|
||||||
import AdhocFilter, {
|
import AdhocFilter, {
|
||||||
EXPRESSION_TYPES,
|
EXPRESSION_TYPES,
|
||||||
CLAUSES,
|
CLAUSES,
|
||||||
} from 'src/explore/AdhocFilter';
|
} from 'src/explore/components/controls/FilterControl/AdhocFilter';
|
||||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
|
||||||
import AdhocFilterEditPopoverSimpleTabContent from 'src/explore/components/AdhocFilterEditPopoverSimpleTabContent';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import AdhocFilterEditPopoverSimpleTabContent from 'src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent';
|
||||||
|
import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const simpleAdhocFilter = new AdhocFilter({
|
const simpleAdhocFilter = new AdhocFilter({
|
||||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||||
|
|
|
@ -25,8 +25,8 @@ import { FormGroup } from 'react-bootstrap';
|
||||||
import AdhocFilter, {
|
import AdhocFilter, {
|
||||||
EXPRESSION_TYPES,
|
EXPRESSION_TYPES,
|
||||||
CLAUSES,
|
CLAUSES,
|
||||||
} from 'src/explore/AdhocFilter';
|
} from 'src/explore/components/controls/FilterControl/AdhocFilter';
|
||||||
import AdhocFilterEditPopoverSqlTabContent from 'src/explore/components/AdhocFilterEditPopoverSqlTabContent';
|
import AdhocFilterEditPopoverSqlTabContent from 'src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent';
|
||||||
|
|
||||||
const sqlAdhocFilter = new AdhocFilter({
|
const sqlAdhocFilter = new AdhocFilter({
|
||||||
expressionType: EXPRESSION_TYPES.SQL,
|
expressionType: EXPRESSION_TYPES.SQL,
|
||||||
|
|
|
@ -27,12 +27,12 @@ import Tabs from 'src/common/components/Tabs';
|
||||||
import AdhocFilter, {
|
import AdhocFilter, {
|
||||||
EXPRESSION_TYPES,
|
EXPRESSION_TYPES,
|
||||||
CLAUSES,
|
CLAUSES,
|
||||||
} from 'src/explore/AdhocFilter';
|
} from 'src/explore/components/controls/FilterControl/AdhocFilter';
|
||||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
|
||||||
import AdhocFilterEditPopover from 'src/explore/components/AdhocFilterEditPopover';
|
|
||||||
import AdhocFilterEditPopoverSimpleTabContent from 'src/explore/components/AdhocFilterEditPopoverSimpleTabContent';
|
|
||||||
import AdhocFilterEditPopoverSqlTabContent from 'src/explore/components/AdhocFilterEditPopoverSqlTabContent';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import AdhocFilterEditPopover from 'src/explore/components/controls/FilterControl/AdhocFilterEditPopover';
|
||||||
|
import AdhocFilterEditPopoverSimpleTabContent from 'src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSimpleTabContent';
|
||||||
|
import AdhocFilterEditPopoverSqlTabContent from 'src/explore/components/controls/FilterControl/AdhocFilterEditPopoverSqlTabContent';
|
||||||
|
import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const simpleAdhocFilter = new AdhocFilter({
|
const simpleAdhocFilter = new AdhocFilter({
|
||||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||||
|
|
|
@ -25,8 +25,8 @@ import Popover from 'src/common/components/Popover';
|
||||||
import AdhocFilter, {
|
import AdhocFilter, {
|
||||||
EXPRESSION_TYPES,
|
EXPRESSION_TYPES,
|
||||||
CLAUSES,
|
CLAUSES,
|
||||||
} from 'src/explore/AdhocFilter';
|
} from 'src/explore/components/controls/FilterControl/AdhocFilter';
|
||||||
import AdhocFilterOption from 'src/explore/components/AdhocFilterOption';
|
import AdhocFilterOption from 'src/explore/components/controls/FilterControl/AdhocFilterOption';
|
||||||
|
|
||||||
const simpleAdhocFilter = new AdhocFilter({
|
const simpleAdhocFilter = new AdhocFilter({
|
||||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||||
|
|
|
@ -22,7 +22,7 @@ import sinon from 'sinon';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { Tooltip } from 'src/common/components/Tooltip';
|
import { Tooltip } from 'src/common/components/Tooltip';
|
||||||
|
|
||||||
import AdhocMetricEditPopoverTitle from 'src/explore/components/AdhocMetricEditPopoverTitle';
|
import AdhocMetricEditPopoverTitle from 'src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle';
|
||||||
|
|
||||||
const title = {
|
const title = {
|
||||||
label: 'Title',
|
label: 'Title',
|
||||||
|
|
|
@ -23,9 +23,11 @@ import { shallow } from 'enzyme';
|
||||||
import { FormGroup } from 'react-bootstrap';
|
import { FormGroup } from 'react-bootstrap';
|
||||||
import Button from 'src/components/Button';
|
import Button from 'src/components/Button';
|
||||||
|
|
||||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
|
||||||
import AdhocMetricEditPopover from 'src/explore/components/AdhocMetricEditPopover';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import AdhocMetricEditPopover from 'src/explore/components/controls/MetricControl/AdhocMetricEditPopover';
|
||||||
|
import AdhocMetric, {
|
||||||
|
EXPRESSION_TYPES,
|
||||||
|
} from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ type: 'VARCHAR(255)', column_name: 'source', id: 1 },
|
{ type: 'VARCHAR(255)', column_name: 'source', id: 1 },
|
||||||
|
|
|
@ -22,9 +22,9 @@ import sinon from 'sinon';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import Popover from 'src/common/components/Popover';
|
import Popover from 'src/common/components/Popover';
|
||||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
|
||||||
import AdhocMetricOption from 'src/explore/components/AdhocMetricOption';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import AdhocMetricOption from 'src/explore/components/controls/MetricControl/AdhocMetricOption';
|
||||||
|
import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{ type: 'VARCHAR(255)', column_name: 'source' },
|
{ type: 'VARCHAR(255)', column_name: 'source' },
|
||||||
|
|
|
@ -20,9 +20,11 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import AdhocMetricStaticOption from 'src/explore/components/AdhocMetricStaticOption';
|
|
||||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import AdhocMetricStaticOption from 'src/explore/components/controls/MetricControl/AdhocMetricStaticOption';
|
||||||
|
import AdhocMetric, {
|
||||||
|
EXPRESSION_TYPES,
|
||||||
|
} from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const sumValueAdhocMetric = new AdhocMetric({
|
const sumValueAdhocMetric = new AdhocMetric({
|
||||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||||
|
|
|
@ -21,10 +21,12 @@ import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import { ColumnOption } from '@superset-ui/chart-controls';
|
import { ColumnOption } from '@superset-ui/chart-controls';
|
||||||
import FilterDefinitionOption from 'src/explore/components/FilterDefinitionOption';
|
import FilterDefinitionOption from 'src/explore/components/controls/MetricControl/FilterDefinitionOption';
|
||||||
import AdhocMetricStaticOption from 'src/explore/components/AdhocMetricStaticOption';
|
import AdhocMetricStaticOption from 'src/explore/components/controls/MetricControl/AdhocMetricStaticOption';
|
||||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import AdhocMetric, {
|
||||||
|
EXPRESSION_TYPES,
|
||||||
|
} from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const sumValueAdhocMetric = new AdhocMetric({
|
const sumValueAdhocMetric = new AdhocMetric({
|
||||||
expressionType: EXPRESSION_TYPES.SIMPLE,
|
expressionType: EXPRESSION_TYPES.SIMPLE,
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import FixedOrMetricControl from 'src/explore/components/controls/FixedOrMetricControl';
|
|
||||||
import TextControl from 'src/explore/components/controls/TextControl';
|
import TextControl from 'src/explore/components/controls/TextControl';
|
||||||
import MetricsControl from 'src/explore/components/controls/MetricsControl';
|
import FixedOrMetricControl from 'src/explore/components/controls/FixedOrMetricControl';
|
||||||
|
import MetricsControl from 'src/explore/components/controls/MetricControl/MetricsControl';
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
value: {},
|
value: {},
|
||||||
|
|
|
@ -21,7 +21,7 @@ import configureStore from 'redux-mock-store';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
import { ColumnOption, MetricOption } from '@superset-ui/chart-controls';
|
import { ColumnOption, MetricOption } from '@superset-ui/chart-controls';
|
||||||
|
|
||||||
import MetricDefinitionOption from 'src/explore/components/MetricDefinitionOption';
|
import MetricDefinitionOption from 'src/explore/components/controls/MetricControl/MetricDefinitionOption';
|
||||||
import AggregateOption from 'src/explore/components/AggregateOption';
|
import AggregateOption from 'src/explore/components/AggregateOption';
|
||||||
|
|
||||||
describe('MetricDefinitionOption', () => {
|
describe('MetricDefinitionOption', () => {
|
||||||
|
|
|
@ -20,10 +20,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import MetricDefinitionValue from 'src/explore/components/MetricDefinitionValue';
|
|
||||||
import AdhocMetricOption from 'src/explore/components/AdhocMetricOption';
|
|
||||||
import AdhocMetric from 'src/explore/AdhocMetric';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
|
import MetricDefinitionValue from 'src/explore/components/controls/MetricControl/MetricDefinitionValue';
|
||||||
|
import AdhocMetricOption from 'src/explore/components/controls/MetricControl/AdhocMetricOption';
|
||||||
|
import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const sumValueAdhocMetric = new AdhocMetric({
|
const sumValueAdhocMetric = new AdhocMetric({
|
||||||
column: { type: 'DOUBLE', column_name: 'value' },
|
column: { type: 'DOUBLE', column_name: 'value' },
|
||||||
|
|
|
@ -21,11 +21,13 @@ import React from 'react';
|
||||||
import sinon from 'sinon';
|
import sinon from 'sinon';
|
||||||
import { shallow } from 'enzyme';
|
import { shallow } from 'enzyme';
|
||||||
|
|
||||||
import MetricsControl from 'src/explore/components/controls/MetricsControl';
|
|
||||||
import { AGGREGATES } from 'src/explore/constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
import AdhocMetric, { EXPRESSION_TYPES } from 'src/explore/AdhocMetric';
|
|
||||||
import { LabelsContainer } from 'src/explore/components/OptionControls';
|
import { LabelsContainer } from 'src/explore/components/OptionControls';
|
||||||
import { supersetTheme } from '@superset-ui/core';
|
import { supersetTheme } from '@superset-ui/core';
|
||||||
|
import MetricsControl from 'src/explore/components/controls/MetricControl/MetricsControl';
|
||||||
|
import AdhocMetric, {
|
||||||
|
EXPRESSION_TYPES,
|
||||||
|
} from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
|
|
||||||
const defaultProps = {
|
const defaultProps = {
|
||||||
name: 'metrics',
|
name: 'metrics',
|
||||||
|
|
|
@ -21,12 +21,12 @@ import { ReactWrapper } from 'enzyme';
|
||||||
import { styledMount as mount } from 'spec/helpers/theming';
|
import { styledMount as mount } from 'spec/helpers/theming';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
|
||||||
import MetricsControl from 'src/explore/components/controls/MetricsControl';
|
|
||||||
import withAsyncVerification, {
|
import withAsyncVerification, {
|
||||||
ControlPropsWithExtras,
|
ControlPropsWithExtras,
|
||||||
WithAsyncVerificationOptions,
|
WithAsyncVerificationOptions,
|
||||||
} from 'src/explore/components/controls/withAsyncVerification';
|
} from 'src/explore/components/controls/withAsyncVerification';
|
||||||
import { ExtraControlProps } from '@superset-ui/chart-controls';
|
import { ExtraControlProps } from '@superset-ui/chart-controls';
|
||||||
|
import MetricsControl from 'src/explore/components/controls/MetricControl/MetricsControl';
|
||||||
|
|
||||||
const VALID_METRIC = {
|
const VALID_METRIC = {
|
||||||
metric_name: 'sum__value',
|
metric_name: 'sum__value',
|
||||||
|
|
|
@ -24,8 +24,8 @@ import { findDOMNode } from 'react-dom';
|
||||||
import { DragSource, DropTarget } from 'react-dnd';
|
import { DragSource, DropTarget } from 'react-dnd';
|
||||||
import { styled, useTheme } from '@superset-ui/core';
|
import { styled, useTheme } from '@superset-ui/core';
|
||||||
import { ColumnOption } from '@superset-ui/chart-controls';
|
import { ColumnOption } from '@superset-ui/chart-controls';
|
||||||
import Icon from '../../components/Icon';
|
import Icon from 'src/components/Icon';
|
||||||
import { savedMetricType } from '../types';
|
import { savedMetricType } from 'src/explore/components/controls/MetricControl/types';
|
||||||
|
|
||||||
const TYPE = 'label-dnd';
|
const TYPE = 'label-dnd';
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import { CUSTOM_OPERATORS } from './constants';
|
import { CUSTOM_OPERATORS } from 'src/explore/constants';
|
||||||
import { getSimpleSQLExpression } from './exploreUtils';
|
import { getSimpleSQLExpression } from 'src/explore/exploreUtils';
|
||||||
|
|
||||||
export const EXPRESSION_TYPES = {
|
export const EXPRESSION_TYPES = {
|
||||||
SIMPLE: 'SIMPLE',
|
SIMPLE: 'SIMPLE',
|
|
@ -20,25 +20,25 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { t, logging, SupersetClient, withTheme } from '@superset-ui/core';
|
import { t, logging, SupersetClient, withTheme } from '@superset-ui/core';
|
||||||
|
|
||||||
import ControlHeader from '../ControlHeader';
|
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||||
import adhocFilterType from '../../propTypes/adhocFilterType';
|
import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType';
|
||||||
import adhocMetricType from '../../propTypes/adhocMetricType';
|
import savedMetricType from 'src/explore/components/controls/MetricControl/savedMetricType';
|
||||||
import savedMetricType from '../../propTypes/savedMetricType';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import columnType from '../../propTypes/columnType';
|
import AdhocMetric from 'src/explore/components/controls/MetricControl/AdhocMetric';
|
||||||
import AdhocFilter, { CLAUSES, EXPRESSION_TYPES } from '../../AdhocFilter';
|
import { OPERATORS } from 'src/explore/constants';
|
||||||
import AdhocMetric from '../../AdhocMetric';
|
import FilterDefinitionOption from 'src/explore/components/controls/MetricControl/FilterDefinitionOption';
|
||||||
import { OPERATORS } from '../../constants';
|
|
||||||
import AdhocFilterOption from '../AdhocFilterOption';
|
|
||||||
import FilterDefinitionOption from '../FilterDefinitionOption';
|
|
||||||
import {
|
import {
|
||||||
AddControlLabel,
|
AddControlLabel,
|
||||||
AddIconButton,
|
AddIconButton,
|
||||||
HeaderContainer,
|
HeaderContainer,
|
||||||
LabelsContainer,
|
LabelsContainer,
|
||||||
} from '../OptionControls';
|
} from 'src/explore/components/OptionControls';
|
||||||
import Icon from '../../../components/Icon';
|
import Icon from 'src/components/Icon';
|
||||||
import AdhocFilterPopoverTrigger from '../AdhocFilterPopoverTrigger';
|
import DndWithHTML5Backend from 'src/explore/DndContextProvider';
|
||||||
import DndWithHTML5Backend from '../../DndContextProvider';
|
import AdhocFilterPopoverTrigger from './AdhocFilterPopoverTrigger';
|
||||||
|
import AdhocFilterOption from './AdhocFilterOption';
|
||||||
|
import AdhocFilter, { CLAUSES, EXPRESSION_TYPES } from './AdhocFilter';
|
||||||
|
import adhocFilterType from './adhocFilterType';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
|
@ -23,9 +23,9 @@ import { styled, t } from '@superset-ui/core';
|
||||||
|
|
||||||
import ErrorBoundary from 'src/components/ErrorBoundary';
|
import ErrorBoundary from 'src/components/ErrorBoundary';
|
||||||
import Tabs from 'src/common/components/Tabs';
|
import Tabs from 'src/common/components/Tabs';
|
||||||
import columnType from '../propTypes/columnType';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType';
|
||||||
import AdhocFilter, { EXPRESSION_TYPES } from '../AdhocFilter';
|
import AdhocFilter, { EXPRESSION_TYPES } from './AdhocFilter';
|
||||||
import AdhocFilterEditPopoverSimpleTabContent from './AdhocFilterEditPopoverSimpleTabContent';
|
import AdhocFilterEditPopoverSimpleTabContent from './AdhocFilterEditPopoverSimpleTabContent';
|
||||||
import AdhocFilterEditPopoverSqlTabContent from './AdhocFilterEditPopoverSqlTabContent';
|
import AdhocFilterEditPopoverSqlTabContent from './AdhocFilterEditPopoverSqlTabContent';
|
||||||
|
|
|
@ -23,9 +23,8 @@ import { Select } from 'src/common/components/Select';
|
||||||
import { Input } from 'src/common/components';
|
import { Input } from 'src/common/components';
|
||||||
import { t, SupersetClient, styled } from '@superset-ui/core';
|
import { t, SupersetClient, styled } from '@superset-ui/core';
|
||||||
|
|
||||||
import AdhocFilter, { EXPRESSION_TYPES, CLAUSES } from '../AdhocFilter';
|
import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType';
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import columnType from '../propTypes/columnType';
|
|
||||||
import {
|
import {
|
||||||
OPERATORS,
|
OPERATORS,
|
||||||
OPERATORS_OPTIONS,
|
OPERATORS_OPTIONS,
|
||||||
|
@ -35,8 +34,9 @@ import {
|
||||||
MULTI_OPERATORS,
|
MULTI_OPERATORS,
|
||||||
CUSTOM_OPERATORS,
|
CUSTOM_OPERATORS,
|
||||||
DISABLE_INPUT_OPERATORS,
|
DISABLE_INPUT_OPERATORS,
|
||||||
} from '../constants';
|
} from 'src/explore/constants';
|
||||||
import FilterDefinitionOption from './FilterDefinitionOption';
|
import FilterDefinitionOption from 'src/explore/components/controls/MetricControl/FilterDefinitionOption';
|
||||||
|
import AdhocFilter, { EXPRESSION_TYPES, CLAUSES } from './AdhocFilter';
|
||||||
|
|
||||||
const SelectWithLabel = styled(Select)`
|
const SelectWithLabel = styled(Select)`
|
||||||
.ant-select-selector::after {
|
.ant-select-selector::after {
|
|
@ -24,9 +24,9 @@ import { t } from '@superset-ui/core';
|
||||||
import { SQLEditor } from 'src/components/AsyncAceEditor';
|
import { SQLEditor } from 'src/components/AsyncAceEditor';
|
||||||
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
|
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
|
||||||
|
|
||||||
import AdhocFilter, { EXPRESSION_TYPES, CLAUSES } from '../AdhocFilter';
|
import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType';
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import columnType from '../propTypes/columnType';
|
import AdhocFilter, { EXPRESSION_TYPES, CLAUSES } from './AdhocFilter';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
adhocFilter: PropTypes.instanceOf(AdhocFilter).isRequired,
|
adhocFilter: PropTypes.instanceOf(AdhocFilter).isRequired,
|
|
@ -18,12 +18,12 @@
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import AdhocFilter from '../AdhocFilter';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import columnType from '../propTypes/columnType';
|
import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType';
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
import { DraggableOptionControlLabel } from 'src/explore/components/OptionControls';
|
||||||
|
import { OPTION_TYPES } from 'src/explore/components/optionTypes';
|
||||||
import AdhocFilterPopoverTrigger from './AdhocFilterPopoverTrigger';
|
import AdhocFilterPopoverTrigger from './AdhocFilterPopoverTrigger';
|
||||||
import { DraggableOptionControlLabel } from './OptionControls';
|
import AdhocFilter from './AdhocFilter';
|
||||||
import { OPTION_TYPES } from './optionTypes';
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
adhocFilter: PropTypes.instanceOf(AdhocFilter).isRequired,
|
adhocFilter: PropTypes.instanceOf(AdhocFilter).isRequired,
|
|
@ -21,10 +21,10 @@ import { t } from '@superset-ui/core';
|
||||||
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
|
import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls';
|
||||||
|
|
||||||
import Popover from 'src/common/components/Popover';
|
import Popover from 'src/common/components/Popover';
|
||||||
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
|
import adhocMetricType from 'src/explore/components/controls/MetricControl/adhocMetricType';
|
||||||
import AdhocFilterEditPopover from './AdhocFilterEditPopover';
|
import AdhocFilterEditPopover from './AdhocFilterEditPopover';
|
||||||
import AdhocFilter from '../AdhocFilter';
|
import AdhocFilter from './AdhocFilter';
|
||||||
import columnType from '../propTypes/columnType';
|
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
|
||||||
|
|
||||||
interface AdhocFilterPopoverTriggerProps {
|
interface AdhocFilterPopoverTriggerProps {
|
||||||
adhocFilter: AdhocFilter;
|
adhocFilter: AdhocFilter;
|
|
@ -18,8 +18,8 @@
|
||||||
*/
|
*/
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { OPERATORS } from '../constants';
|
import { OPERATORS } from 'src/explore/constants';
|
||||||
import { EXPRESSION_TYPES, CLAUSES } from '../AdhocFilter';
|
import { EXPRESSION_TYPES, CLAUSES } from './AdhocFilter';
|
||||||
|
|
||||||
export default PropTypes.oneOfType([
|
export default PropTypes.oneOfType([
|
||||||
PropTypes.shape({
|
PropTypes.shape({
|
|
@ -22,7 +22,7 @@ import { Panel } from 'react-bootstrap';
|
||||||
|
|
||||||
import Label from 'src/components/Label';
|
import Label from 'src/components/Label';
|
||||||
import TextControl from './TextControl';
|
import TextControl from './TextControl';
|
||||||
import MetricsControl from './MetricsControl';
|
import MetricsControl from './MetricControl/MetricsControl';
|
||||||
import ControlHeader from '../ControlHeader';
|
import ControlHeader from '../ControlHeader';
|
||||||
import PopoverSection from '../../../components/PopoverSection';
|
import PopoverSection from '../../../components/PopoverSection';
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* specific language governing permissions and limitations
|
* specific language governing permissions and limitations
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import { sqlaAutoGeneratedMetricRegex } from './constants';
|
import { sqlaAutoGeneratedMetricRegex } from 'src/explore/constants';
|
||||||
|
|
||||||
export const EXPRESSION_TYPES = {
|
export const EXPRESSION_TYPES = {
|
||||||
SIMPLE: 'SIMPLE',
|
SIMPLE: 'SIMPLE',
|
|
@ -30,10 +30,10 @@ import FormLabel from 'src/components/FormLabel';
|
||||||
import { SQLEditor } from 'src/components/AsyncAceEditor';
|
import { SQLEditor } from 'src/components/AsyncAceEditor';
|
||||||
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
|
import sqlKeywords from 'src/SqlLab/utils/sqlKeywords';
|
||||||
|
|
||||||
import { AGGREGATES_OPTIONS } from '../constants';
|
import { AGGREGATES_OPTIONS } from 'src/explore/constants';
|
||||||
import columnType from '../propTypes/columnType';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import savedMetricType from '../propTypes/savedMetricType';
|
import savedMetricType from './savedMetricType';
|
||||||
import AdhocMetric, { EXPRESSION_TYPES } from '../AdhocMetric';
|
import AdhocMetric, { EXPRESSION_TYPES } from './AdhocMetric';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
adhocMetric: PropTypes.instanceOf(AdhocMetric).isRequired,
|
adhocMetric: PropTypes.instanceOf(AdhocMetric).isRequired,
|
|
@ -19,12 +19,12 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { Tooltip } from 'src/common/components/Tooltip';
|
import { Tooltip } from 'src/common/components/Tooltip';
|
||||||
import AdhocMetric from '../AdhocMetric';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import columnType from '../propTypes/columnType';
|
import { DraggableOptionControlLabel } from 'src/explore/components/OptionControls';
|
||||||
import savedMetricType from '../propTypes/savedMetricType';
|
import { OPTION_TYPES } from 'src/explore/components/optionTypes';
|
||||||
import { DraggableOptionControlLabel } from './OptionControls';
|
import AdhocMetric from './AdhocMetric';
|
||||||
|
import savedMetricType from './savedMetricType';
|
||||||
import AdhocMetricPopoverTrigger from './AdhocMetricPopoverTrigger';
|
import AdhocMetricPopoverTrigger from './AdhocMetricPopoverTrigger';
|
||||||
import { OPTION_TYPES } from './optionTypes';
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
adhocMetric: PropTypes.instanceOf(AdhocMetric),
|
adhocMetric: PropTypes.instanceOf(AdhocMetric),
|
|
@ -18,10 +18,10 @@
|
||||||
*/
|
*/
|
||||||
import React, { ReactNode } from 'react';
|
import React, { ReactNode } from 'react';
|
||||||
import Popover from 'src/common/components/Popover';
|
import Popover from 'src/common/components/Popover';
|
||||||
import AdhocMetricEditPopoverTitle from 'src/explore/components/AdhocMetricEditPopoverTitle';
|
import AdhocMetricEditPopoverTitle from 'src/explore/components/controls/MetricControl/AdhocMetricEditPopoverTitle';
|
||||||
import AdhocMetricEditPopover from './AdhocMetricEditPopover';
|
import AdhocMetricEditPopover from './AdhocMetricEditPopover';
|
||||||
import AdhocMetric from '../AdhocMetric';
|
import AdhocMetric from './AdhocMetric';
|
||||||
import { savedMetricType } from '../types';
|
import { savedMetricType } from './types';
|
||||||
|
|
||||||
export type AdhocMetricPopoverTriggerProps = {
|
export type AdhocMetricPopoverTriggerProps = {
|
||||||
adhocMetric: AdhocMetric;
|
adhocMetric: AdhocMetric;
|
|
@ -20,7 +20,7 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { ColumnTypeLabel } from '@superset-ui/chart-controls';
|
import { ColumnTypeLabel } from '@superset-ui/chart-controls';
|
||||||
|
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
import adhocMetricType from './adhocMetricType';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
adhocMetric: adhocMetricType,
|
adhocMetric: adhocMetricType,
|
|
@ -20,9 +20,9 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { ColumnOption, ColumnTypeLabel } from '@superset-ui/chart-controls';
|
import { ColumnOption, ColumnTypeLabel } from '@superset-ui/chart-controls';
|
||||||
|
|
||||||
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import AdhocMetricStaticOption from './AdhocMetricStaticOption';
|
import AdhocMetricStaticOption from './AdhocMetricStaticOption';
|
||||||
import columnType from '../propTypes/columnType';
|
import adhocMetricType from './adhocMetricType';
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
option: PropTypes.oneOfType([
|
option: PropTypes.oneOfType([
|
|
@ -20,11 +20,11 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { ColumnOption, MetricOption } from '@superset-ui/chart-controls';
|
import { ColumnOption, MetricOption } from '@superset-ui/chart-controls';
|
||||||
|
|
||||||
import AggregateOption from './AggregateOption';
|
import AggregateOption from 'src/explore/components/AggregateOption';
|
||||||
import columnType from '../propTypes/columnType';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import savedMetricType from '../propTypes/savedMetricType';
|
import aggregateOptionType from 'src/explore/propTypes/aggregateOptionType';
|
||||||
import aggregateOptionType from '../propTypes/aggregateOptionType';
|
import withToasts from 'src/messageToasts/enhancers/withToasts';
|
||||||
import withToasts from '../../messageToasts/enhancers/withToasts';
|
import savedMetricType from './savedMetricType';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
option: PropTypes.oneOfType([
|
option: PropTypes.oneOfType([
|
|
@ -18,13 +18,13 @@
|
||||||
*/
|
*/
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
|
import { DraggableOptionControlLabel } from 'src/explore/components/OptionControls';
|
||||||
|
import { OPTION_TYPES } from 'src/explore/components/optionTypes';
|
||||||
import AdhocMetricOption from './AdhocMetricOption';
|
import AdhocMetricOption from './AdhocMetricOption';
|
||||||
import AdhocMetric from '../AdhocMetric';
|
import AdhocMetric from './AdhocMetric';
|
||||||
import columnType from '../propTypes/columnType';
|
import savedMetricType from './savedMetricType';
|
||||||
import savedMetricType from '../propTypes/savedMetricType';
|
import adhocMetricType from './adhocMetricType';
|
||||||
import adhocMetricType from '../propTypes/adhocMetricType';
|
|
||||||
import { DraggableOptionControlLabel } from './OptionControls';
|
|
||||||
import { OPTION_TYPES } from './optionTypes';
|
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
option: PropTypes.oneOfType([savedMetricType, adhocMetricType]).isRequired,
|
option: PropTypes.oneOfType([savedMetricType, adhocMetricType]).isRequired,
|
|
@ -20,27 +20,27 @@ import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { t, withTheme } from '@superset-ui/core';
|
import { t, withTheme } from '@superset-ui/core';
|
||||||
import { isEqual } from 'lodash';
|
import { isEqual } from 'lodash';
|
||||||
import ControlHeader from '../ControlHeader';
|
import ControlHeader from 'src/explore/components/ControlHeader';
|
||||||
import MetricDefinitionOption from '../MetricDefinitionOption';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import MetricDefinitionValue from '../MetricDefinitionValue';
|
|
||||||
import AdhocMetric from '../../AdhocMetric';
|
|
||||||
import columnType from '../../propTypes/columnType';
|
|
||||||
import savedMetricType from '../../propTypes/savedMetricType';
|
|
||||||
import adhocMetricType from '../../propTypes/adhocMetricType';
|
|
||||||
import {
|
import {
|
||||||
AGGREGATES_OPTIONS,
|
AGGREGATES_OPTIONS,
|
||||||
sqlaAutoGeneratedMetricNameRegex,
|
sqlaAutoGeneratedMetricNameRegex,
|
||||||
druidAutoGeneratedMetricRegex,
|
druidAutoGeneratedMetricRegex,
|
||||||
} from '../../constants';
|
} from 'src/explore/constants';
|
||||||
import AdhocMetricPopoverTrigger from '../AdhocMetricPopoverTrigger';
|
import Icon from 'src/components/Icon';
|
||||||
import Icon from '../../../components/Icon';
|
|
||||||
import {
|
import {
|
||||||
AddIconButton,
|
AddIconButton,
|
||||||
AddControlLabel,
|
AddControlLabel,
|
||||||
HeaderContainer,
|
HeaderContainer,
|
||||||
LabelsContainer,
|
LabelsContainer,
|
||||||
} from '../OptionControls';
|
} from 'src/explore/components/OptionControls';
|
||||||
import DndWithHTML5Backend from '../../DndContextProvider';
|
import DndWithHTML5Backend from 'src/explore/DndContextProvider';
|
||||||
|
import MetricDefinitionOption from './MetricDefinitionOption';
|
||||||
|
import MetricDefinitionValue from './MetricDefinitionValue';
|
||||||
|
import AdhocMetric from './AdhocMetric';
|
||||||
|
import savedMetricType from './savedMetricType';
|
||||||
|
import adhocMetricType from './adhocMetricType';
|
||||||
|
import AdhocMetricPopoverTrigger from './AdhocMetricPopoverTrigger';
|
||||||
|
|
||||||
const propTypes = {
|
const propTypes = {
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
|
@ -18,9 +18,9 @@
|
||||||
*/
|
*/
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
import { AGGREGATES } from '../constants';
|
import { AGGREGATES } from 'src/explore/constants';
|
||||||
import columnType from './columnType';
|
import columnType from 'src/explore/propTypes/columnType';
|
||||||
import { EXPRESSION_TYPES } from '../AdhocMetric';
|
import { EXPRESSION_TYPES } from './AdhocMetric';
|
||||||
|
|
||||||
export default PropTypes.oneOfType([
|
export default PropTypes.oneOfType([
|
||||||
PropTypes.shape({
|
PropTypes.shape({
|
|
@ -36,8 +36,8 @@ import TextControl from './TextControl';
|
||||||
import TimeSeriesColumnControl from './TimeSeriesColumnControl';
|
import TimeSeriesColumnControl from './TimeSeriesColumnControl';
|
||||||
import ViewportControl from './ViewportControl';
|
import ViewportControl from './ViewportControl';
|
||||||
import VizTypeControl from './VizTypeControl';
|
import VizTypeControl from './VizTypeControl';
|
||||||
import MetricsControl from './MetricsControl';
|
import MetricsControl from './MetricControl/MetricsControl';
|
||||||
import AdhocFilterControl from './AdhocFilterControl';
|
import AdhocFilterControl from './FilterControl/AdhocFilterControl';
|
||||||
import FilterBoxItemControl from './FilterBoxItemControl';
|
import FilterBoxItemControl from './FilterBoxItemControl';
|
||||||
|
|
||||||
const controlMap = {
|
const controlMap = {
|
||||||
|
|
Loading…
Reference in New Issue