From 215124b586bd8b5ca560fa563182579f749c2f86 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Tue, 16 Feb 2021 21:59:27 +0800 Subject: [PATCH 01/22] initial dnd --- .../explore/components/DatasourcePanel.tsx | 20 +++- .../DatasourcePanelDragWrapper.tsx | 42 +++++++ .../components/DatasourcePanel/types.ts | 29 +++++ .../src/explore/components/OptionControls.tsx | 20 ++-- .../DropGroupByControl/DropGroupByControl.tsx | 111 ++++++++++++++++++ .../DropGroupByControl/components/Option.tsx | 56 +++++++++ .../components/OptionWrapper.tsx | 82 +++++++++++++ .../controls/DropGroupByControl/types.ts | 37 ++++++ .../src/explore/components/controls/index.js | 2 + 9 files changed, 386 insertions(+), 13 deletions(-) create mode 100644 superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx create mode 100644 superset-frontend/src/explore/components/DatasourcePanel/types.ts create mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx create mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx create mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx create mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts diff --git a/superset-frontend/src/explore/components/DatasourcePanel.tsx b/superset-frontend/src/explore/components/DatasourcePanel.tsx index 37121bb7b52..016a149be5c 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel.tsx @@ -28,8 +28,10 @@ import { import { debounce } from 'lodash'; import { matchSorter, rankings } from 'match-sorter'; import { FAST_DEBOUNCE } from 'src/constants'; -import { ExploreActions } from 'src/explore/actions/exploreActions'; -import Control from 'src/explore/components/Control'; +import { ExploreActions } from '../actions/exploreActions'; +import Control from './Control'; +import DatasourcePanelDragWrapper from "./DatasourcePanel/DatasourcePanelDragWrapper"; +import { DatasourcePanelDndType } from "./DatasourcePanel/types"; interface DatasourceControl extends ControlConfig { datasource?: DatasourceMeta; @@ -204,7 +206,12 @@ export default function DataSourcePanel({ {metricSlice.map(m => ( - + + + ))} @@ -217,7 +224,12 @@ export default function DataSourcePanel({ {columnSlice.map(col => ( - + + + ))} diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx new file mode 100644 index 00000000000..ea0e8f2eabc --- /dev/null +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx @@ -0,0 +1,42 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React, { ReactNode } from 'react'; +import { useDrag } from 'react-dnd'; +import { DatasourcePanelDndItemInterface } from './types'; + +interface DragItemControlProps extends DatasourcePanelDndItemInterface { + children?: ReactNode; +} + +export default function DatasourcePanelDragWrapper(props: DragItemControlProps) { + const [, drag] = useDrag({ + item: { + metricOrColumnName: props.metricOrColumnName, + type: props.type, + }, + }) + + return ( + <> +
+ { props.children } +
+ + ) +} diff --git a/superset-frontend/src/explore/components/DatasourcePanel/types.ts b/superset-frontend/src/explore/components/DatasourcePanel/types.ts new file mode 100644 index 00000000000..c03ff47a85b --- /dev/null +++ b/superset-frontend/src/explore/components/DatasourcePanel/types.ts @@ -0,0 +1,29 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export enum DatasourcePanelDndType { + METRIC = 'metric', + COLUMN = 'column', +} + +export interface DatasourcePanelDndItemInterface { + metricOrColumnName: string; + type: + | typeof DatasourcePanelDndType.METRIC + | typeof DatasourcePanelDndType.COLUMN; +} diff --git a/superset-frontend/src/explore/components/OptionControls.tsx b/superset-frontend/src/explore/components/OptionControls.tsx index 5e5dd5e29b3..28f4e7078eb 100644 --- a/superset-frontend/src/explore/components/OptionControls.tsx +++ b/superset-frontend/src/explore/components/OptionControls.tsx @@ -27,14 +27,14 @@ import { Tooltip } from 'src/common/components/Tooltip'; import Icon from 'src/components/Icon'; import { savedMetricType } from 'src/explore/components/controls/MetricControl/types'; -const DragContainer = styled.div` +export const DragContainer = styled.div` margin-bottom: ${({ theme }) => theme.gridUnit}px; :last-child { margin-bottom: 0; } `; -const OptionControlContainer = styled.div<{ +export const OptionControlContainer = styled.div<{ isAdhoc?: boolean; }>` display: flex; @@ -47,7 +47,7 @@ const OptionControlContainer = styled.div<{ cursor: ${({ isAdhoc }) => (isAdhoc ? 'pointer' : 'default')}; `; -const Label = styled.div` +export const Label = styled.div` display: flex; max-width: 100%; overflow: hidden; @@ -63,13 +63,13 @@ const Label = styled.div` } `; -const CaretContainer = styled.div` +export const CaretContainer = styled.div` height: 100%; border-left: solid 1px ${({ theme }) => theme.colors.grayscale.dark2}0C; margin-left: auto; `; -const CloseContainer = styled.div` +export const CloseContainer = styled.div` height: 100%; width: ${({ theme }) => theme.gridUnit * 6}px; border-right: solid 1px ${({ theme }) => theme.colors.grayscale.dark2}0C; @@ -92,7 +92,9 @@ export const LabelsContainer = styled.div` border-radius: ${({ theme }) => theme.gridUnit}px; `; -export const AddControlLabel = styled.div` +export const AddControlLabel = styled.div<{ + cancelHover?: boolean; +}>` display: flex; align-items: center; width: 100%; @@ -102,14 +104,14 @@ export const AddControlLabel = styled.div` color: ${({ theme }) => theme.colors.grayscale.light1}; border: dashed 1px ${({ theme }) => theme.colors.grayscale.light2}; border-radius: ${({ theme }) => theme.gridUnit}px; - cursor: pointer; + cursor: ${({ cancelHover }) => cancelHover ? 'inherit' : 'pointer'}; :hover { - background-color: ${({ theme }) => theme.colors.grayscale.light4}; + background-color: ${({ cancelHover, theme }) => cancelHover ? 'inherit' : theme.colors.grayscale.light4}; } :active { - background-color: ${({ theme }) => theme.colors.grayscale.light3}; + background-color: ${({ cancelHover, theme }) => cancelHover ? 'inherit' : theme.colors.grayscale.light3}; } `; diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx new file mode 100644 index 00000000000..b598c6a41e2 --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx @@ -0,0 +1,111 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React, { useState } from 'react'; +import { useDrop } from 'react-dnd'; +import { isEmpty } from 'lodash'; +import { t, withTheme, SupersetTheme } from '@superset-ui/core'; +import { BaseControlConfig, ColumnMeta } from '@superset-ui/chart-controls'; +import ControlHeader from 'src/explore/components/ControlHeader'; +import { + AddControlLabel, + HeaderContainer, + LabelsContainer, +} from 'src/explore/components/OptionControls'; +import { + DatasourcePanelDndType, + DatasourcePanelDndItemInterface, +} from 'src/explore/components/DatasourcePanel/types'; +import Icon from 'src/components/Icon'; +import OptionWrapper from './components/OptionWrapper'; + +interface DropGroupByControlProps extends BaseControlConfig { + name: string; + value: string[]; + onChange: (value: string[]) => void; + options: { string: ColumnMeta }; + theme: SupersetTheme; +} + +function DropGroupByControl(props: DropGroupByControlProps) { + const [groupByValues, setGroupByValues] = useState(props.value ?? []) + const [, datasourcePanelDrop] = useDrop({ + accept: DatasourcePanelDndType.COLUMN, + drop: (item: DatasourcePanelDndItemInterface) => { + if (!groupByValues.includes(item.metricOrColumnName)) { + const newValue = groupByValues.concat([item.metricOrColumnName]); + setGroupByValues(newValue); + props.onChange(newValue); + } + }, + collect: (monitor) => ({ + isOver: monitor.isOver(), + canDrop: monitor.canDrop(), + }), + }) + + const dbColumnsInCurrentControl: ColumnMeta[] = []; + groupByValues.forEach((value) => { + if (value in props.options) { + dbColumnsInCurrentControl.push(props.options[value]); + } + }); + + const onClickClose = (columnName: string) => { + const newGroupByValues = groupByValues.filter((value) => value !== columnName) + setGroupByValues(newGroupByValues); + props.onChange(newGroupByValues); + } + + const PlaceHolderRenderer = () => + + + {t('Drop Columns')} + + + const OptionsRenderer = () => { + return ( + <> + {dbColumnsInCurrentControl.map((column) => + )} + + ) + } + + return ( + <> +
+ + + + + { isEmpty(dbColumnsInCurrentControl) ? : } + +
+ + ); +} + +export default withTheme(DropGroupByControl); diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx new file mode 100644 index 00000000000..d6b862cd332 --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React from 'react'; +import { withTheme } from '@superset-ui/core'; +import { ColumnOption } from '@superset-ui/chart-controls'; +import Icon from 'src/components/Icon'; +import { + CaretContainer, + CloseContainer, + OptionControlContainer, + Label, +} from 'src/explore/components/OptionControls'; +import { OptionProps } from '../types' + +function Option(props: OptionProps) { + return ( + + props.clickClose(props.column.column_name)} + > + + + + {props.withCaret && ( + + + + )} + + ); +} + +export default withTheme(Option); diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx new file mode 100644 index 00000000000..ab65e87ad07 --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx @@ -0,0 +1,82 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import React, { useRef } from 'react'; +import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd'; +import DropItemOption from './Option'; +import { DragContainer } from 'src/explore/components/OptionControls'; +import { OptionWrapperProps, GroupByItemInterface, GroupByItemType } from "../types"; + +export default function OptionWrapper(props: OptionWrapperProps) { + const ref = useRef(null); + const [, drag] = useDrag({ + item: { column: props.column, type: GroupByItemType }, + }) + const [, drop] = useDrop({ + accept: GroupByItemType, + + drop: (item: GroupByItemInterface) => { + }, + + hover(item: GroupByItemInterface, monitor: DropTargetMonitor) { + // if (!ref.current) { + // return; + // } + // const dragIndex = item.index; + // const hoverIndex = index; + // // Don't replace items with themselves + // if (dragIndex === hoverIndex) { + // return; + // } + // // Determine rectangle on screen + // const hoverBoundingRect = ref.current?.getBoundingClientRect(); + // // Get vertical middle + // const hoverMiddleY = + // (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2; + // // Determine mouse position + // const clientOffset = monitor.getClientOffset(); + // // Get pixels to the top + // const hoverClientY = clientOffset?.y + // ? clientOffset?.y - hoverBoundingRect.top + // : 0; + // // Only perform the move when the mouse has crossed half of the items height + // // When dragging downwards, only move when the cursor is below 50% + // // When dragging upwards, only move when the cursor is above 50% + // // Dragging downwards + // if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) { + // return; + // } + // // Dragging upwards + // if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) { + // return; + // } + // // Time to actually perform the action + // // onMoveLabel?.(dragIndex, hoverIndex); + // // Note: we're mutating the monitor item here! + // // Generally it's better to avoid mutations, + // // but it's good here for the sake of performance + // // to avoid expensive index searches. + // // eslint-disable-next-line no-param-reassign + // item.index = hoverIndex; + }, + }) + + drag(drop(ref)); + + return +} diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts new file mode 100644 index 00000000000..9530f0fbc01 --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts @@ -0,0 +1,37 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { SupersetTheme } from '@superset-ui/core'; +import { ColumnMeta } from '@superset-ui/chart-controls' + +export interface OptionWrapperProps { + column: ColumnMeta; + withCaret?: boolean; + clickClose: (columnName: string) => void; +} + +export interface OptionProps extends OptionWrapperProps { + theme: SupersetTheme; +} + +export const GroupByItemType = 'groupByItem'; + +export interface GroupByItemInterface { + column: ColumnMeta; + type: typeof GroupByItemType; +} diff --git a/superset-frontend/src/explore/components/controls/index.js b/superset-frontend/src/explore/components/controls/index.js index ba82c3c2303..07d6c0ada0d 100644 --- a/superset-frontend/src/explore/components/controls/index.js +++ b/superset-frontend/src/explore/components/controls/index.js @@ -39,6 +39,7 @@ import VizTypeControl from './VizTypeControl'; import MetricsControl from './MetricControl/MetricsControl'; import AdhocFilterControl from './FilterControl/AdhocFilterControl'; import FilterBoxItemControl from './FilterBoxItemControl'; +import DropGroupByControl from "./DropGroupByControl/DropGroupByControl"; const controlMap = { AnnotationLayerControl, @@ -50,6 +51,7 @@ const controlMap = { ColorSchemeControl, DatasourceControl, DateFilterControl, + DropGroupByControl, FixedOrMetricControl, HiddenControl, SelectAsyncControl, From e142b6a1d65ff659ed92254eef2fa154aa5cddb4 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Wed, 17 Feb 2021 12:00:47 +0800 Subject: [PATCH 02/22] shift group by items --- .../DatasourcePanelDragWrapper.tsx | 6 +- .../components/DatasourcePanel/types.ts | 5 +- .../DropGroupByControl/DropGroupByControl.tsx | 13 ++- .../components/OptionWrapper.tsx | 96 +++++++++++-------- .../controls/DropGroupByControl/types.ts | 7 +- 5 files changed, 75 insertions(+), 52 deletions(-) diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx index ea0e8f2eabc..fd5de3b28a5 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx @@ -18,13 +18,13 @@ */ import React, { ReactNode } from 'react'; import { useDrag } from 'react-dnd'; -import { DatasourcePanelDndItemInterface } from './types'; +import { DatasourcePanelDndItemProps } from './types'; -interface DragItemControlProps extends DatasourcePanelDndItemInterface { +interface DatasourcePanelDragWrapperProps extends DatasourcePanelDndItemProps { children?: ReactNode; } -export default function DatasourcePanelDragWrapper(props: DragItemControlProps) { +export default function DatasourcePanelDragWrapper(props: DatasourcePanelDragWrapperProps) { const [, drag] = useDrag({ item: { metricOrColumnName: props.metricOrColumnName, diff --git a/superset-frontend/src/explore/components/DatasourcePanel/types.ts b/superset-frontend/src/explore/components/DatasourcePanel/types.ts index c03ff47a85b..ebf4f9edfb7 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/types.ts +++ b/superset-frontend/src/explore/components/DatasourcePanel/types.ts @@ -17,11 +17,12 @@ * under the License. */ export enum DatasourcePanelDndType { - METRIC = 'metric', + // todo: The new `metric` conflicts with the existing metric type + METRIC = 'datasource-panel-metric', COLUMN = 'column', } -export interface DatasourcePanelDndItemInterface { +export interface DatasourcePanelDndItemProps { metricOrColumnName: string; type: | typeof DatasourcePanelDndType.METRIC diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx index b598c6a41e2..772870b4dc2 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx @@ -29,7 +29,7 @@ import { } from 'src/explore/components/OptionControls'; import { DatasourcePanelDndType, - DatasourcePanelDndItemInterface, + DatasourcePanelDndItemProps, } from 'src/explore/components/DatasourcePanel/types'; import Icon from 'src/components/Icon'; import OptionWrapper from './components/OptionWrapper'; @@ -46,7 +46,7 @@ function DropGroupByControl(props: DropGroupByControlProps) { const [groupByValues, setGroupByValues] = useState(props.value ?? []) const [, datasourcePanelDrop] = useDrop({ accept: DatasourcePanelDndType.COLUMN, - drop: (item: DatasourcePanelDndItemInterface) => { + drop: (item: DatasourcePanelDndItemProps) => { if (!groupByValues.includes(item.metricOrColumnName)) { const newValue = groupByValues.concat([item.metricOrColumnName]); setGroupByValues(newValue); @@ -66,12 +66,17 @@ function DropGroupByControl(props: DropGroupByControlProps) { } }); - const onClickClose = (columnName: string) => { + function onClickClose(columnName: string) { const newGroupByValues = groupByValues.filter((value) => value !== columnName) setGroupByValues(newGroupByValues); props.onChange(newGroupByValues); } + function onChangeGroupByValues(values: string[]){ + setGroupByValues(values); + props.onChange(values); + } + const PlaceHolderRenderer = () => )} ) diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx index ab65e87ad07..f981ee80c08 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx @@ -18,65 +18,77 @@ */ import React, { useRef } from 'react'; import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd'; -import DropItemOption from './Option'; +import Option from './Option'; import { DragContainer } from 'src/explore/components/OptionControls'; import { OptionWrapperProps, GroupByItemInterface, GroupByItemType } from "../types"; export default function OptionWrapper(props: OptionWrapperProps) { + const { groupByValues, column, onChangeGroupByValues } = props; const ref = useRef(null); + + const item: GroupByItemInterface = { + dragIndex: groupByValues.indexOf(column.column_name), + dropIndex: -1, + type: GroupByItemType + } const [, drag] = useDrag({ - item: { column: props.column, type: GroupByItemType }, + item, + collect: monitor => ({ + isDragging: monitor.isDragging(), + }), }) + const [, drop] = useDrop({ accept: GroupByItemType, drop: (item: GroupByItemInterface) => { + let newValues = [...props.groupByValues]; + newValues[item.dragIndex] = groupByValues[item.dropIndex]; + newValues[item.dropIndex] = groupByValues[item.dragIndex]; + onChangeGroupByValues(newValues); }, hover(item: GroupByItemInterface, monitor: DropTargetMonitor) { - // if (!ref.current) { - // return; - // } - // const dragIndex = item.index; - // const hoverIndex = index; - // // Don't replace items with themselves - // if (dragIndex === hoverIndex) { - // return; - // } - // // Determine rectangle on screen - // const hoverBoundingRect = ref.current?.getBoundingClientRect(); - // // Get vertical middle - // const hoverMiddleY = - // (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2; - // // Determine mouse position - // const clientOffset = monitor.getClientOffset(); - // // Get pixels to the top - // const hoverClientY = clientOffset?.y - // ? clientOffset?.y - hoverBoundingRect.top - // : 0; - // // Only perform the move when the mouse has crossed half of the items height - // // When dragging downwards, only move when the cursor is below 50% - // // When dragging upwards, only move when the cursor is above 50% - // // Dragging downwards - // if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) { - // return; - // } - // // Dragging upwards - // if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) { - // return; - // } - // // Time to actually perform the action - // // onMoveLabel?.(dragIndex, hoverIndex); - // // Note: we're mutating the monitor item here! - // // Generally it's better to avoid mutations, - // // but it's good here for the sake of performance - // // to avoid expensive index searches. - // // eslint-disable-next-line no-param-reassign - // item.index = hoverIndex; + if (!ref.current) { + return; + } + const dragIndex = item.dragIndex; + const hoverIndex = groupByValues.indexOf(column.column_name); + + // Don't replace items with themselves + if (dragIndex === hoverIndex) { + return; + } + // Determine rectangle on screen + const hoverBoundingRect = ref.current?.getBoundingClientRect(); + // Get vertical middle + const hoverMiddleY = + (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2; + // Determine mouse position + const clientOffset = monitor.getClientOffset(); + // Get pixels to the top + const hoverClientY = clientOffset?.y + ? clientOffset?.y - hoverBoundingRect.top + : 0; + // Only perform the move when the mouse has crossed half of the items height + // When dragging downwards, only move when the cursor is below 50% + // When dragging upwards, only move when the cursor is above 50% + // Dragging downwards + if (dragIndex < hoverIndex && hoverClientY < hoverMiddleY) { + return; + } + // Dragging upwards + if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) { + return; + } + // Time to actually perform the action + // eslint-disable-next-line no-param-reassign + item.dragIndex = dragIndex; + item.dropIndex = hoverIndex; }, }) drag(drop(ref)); - return + return } diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts index 9530f0fbc01..64982358399 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts @@ -21,8 +21,10 @@ import { ColumnMeta } from '@superset-ui/chart-controls' export interface OptionWrapperProps { column: ColumnMeta; - withCaret?: boolean; + groupByValues: string[]; clickClose: (columnName: string) => void; + onChangeGroupByValues: (values: string[]) => void; + withCaret?: boolean; } export interface OptionProps extends OptionWrapperProps { @@ -32,6 +34,7 @@ export interface OptionProps extends OptionWrapperProps { export const GroupByItemType = 'groupByItem'; export interface GroupByItemInterface { - column: ColumnMeta; type: typeof GroupByItemType; + dragIndex: number; + dropIndex: number; } From 3ee03ed2f3d35158d05afca2cdf6db15b0421e81 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Wed, 17 Feb 2021 12:14:05 +0800 Subject: [PATCH 03/22] lint --- .../explore/components/DatasourcePanel.tsx | 4 +- .../DatasourcePanelDragWrapper.tsx | 12 ++-- .../src/explore/components/OptionControls.tsx | 8 ++- .../DropGroupByControl/DropGroupByControl.tsx | 57 ++++++++++--------- .../DropGroupByControl/components/Option.tsx | 12 ++-- .../components/OptionWrapper.tsx | 34 +++++++---- .../controls/DropGroupByControl/types.ts | 2 +- .../src/explore/components/controls/index.js | 2 +- 8 files changed, 74 insertions(+), 57 deletions(-) diff --git a/superset-frontend/src/explore/components/DatasourcePanel.tsx b/superset-frontend/src/explore/components/DatasourcePanel.tsx index 016a149be5c..a69fc6e7a98 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel.tsx @@ -30,8 +30,8 @@ import { matchSorter, rankings } from 'match-sorter'; import { FAST_DEBOUNCE } from 'src/constants'; import { ExploreActions } from '../actions/exploreActions'; import Control from './Control'; -import DatasourcePanelDragWrapper from "./DatasourcePanel/DatasourcePanelDragWrapper"; -import { DatasourcePanelDndType } from "./DatasourcePanel/types"; +import DatasourcePanelDragWrapper from './DatasourcePanel/DatasourcePanelDragWrapper'; +import { DatasourcePanelDndType } from './DatasourcePanel/types'; interface DatasourceControl extends ControlConfig { datasource?: DatasourceMeta; diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx index fd5de3b28a5..92c7bfea1a3 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx @@ -24,19 +24,19 @@ interface DatasourcePanelDragWrapperProps extends DatasourcePanelDndItemProps { children?: ReactNode; } -export default function DatasourcePanelDragWrapper(props: DatasourcePanelDragWrapperProps) { +export default function DatasourcePanelDragWrapper( + props: DatasourcePanelDragWrapperProps, +) { const [, drag] = useDrag({ item: { metricOrColumnName: props.metricOrColumnName, type: props.type, }, - }) + }); return ( <> -
- { props.children } -
+
{props.children}
- ) + ); } diff --git a/superset-frontend/src/explore/components/OptionControls.tsx b/superset-frontend/src/explore/components/OptionControls.tsx index 28f4e7078eb..db86c0efd6b 100644 --- a/superset-frontend/src/explore/components/OptionControls.tsx +++ b/superset-frontend/src/explore/components/OptionControls.tsx @@ -104,14 +104,16 @@ export const AddControlLabel = styled.div<{ color: ${({ theme }) => theme.colors.grayscale.light1}; border: dashed 1px ${({ theme }) => theme.colors.grayscale.light2}; border-radius: ${({ theme }) => theme.gridUnit}px; - cursor: ${({ cancelHover }) => cancelHover ? 'inherit' : 'pointer'}; + cursor: ${({ cancelHover }) => (cancelHover ? 'inherit' : 'pointer')}; :hover { - background-color: ${({ cancelHover, theme }) => cancelHover ? 'inherit' : theme.colors.grayscale.light4}; + background-color: ${({ cancelHover, theme }) => + cancelHover ? 'inherit' : theme.colors.grayscale.light4}; } :active { - background-color: ${({ cancelHover, theme }) => cancelHover ? 'inherit' : theme.colors.grayscale.light3}; + background-color: ${({ cancelHover, theme }) => + cancelHover ? 'inherit' : theme.colors.grayscale.light3}; } `; diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx index 772870b4dc2..f5910856032 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx @@ -43,7 +43,9 @@ interface DropGroupByControlProps extends BaseControlConfig { } function DropGroupByControl(props: DropGroupByControlProps) { - const [groupByValues, setGroupByValues] = useState(props.value ?? []) + const [groupByValues, setGroupByValues] = useState( + props.value ?? [], + ); const [, datasourcePanelDrop] = useDrop({ accept: DatasourcePanelDndType.COLUMN, drop: (item: DatasourcePanelDndItemProps) => { @@ -53,53 +55,52 @@ function DropGroupByControl(props: DropGroupByControlProps) { props.onChange(newValue); } }, - collect: (monitor) => ({ + collect: monitor => ({ isOver: monitor.isOver(), canDrop: monitor.canDrop(), }), - }) + }); const dbColumnsInCurrentControl: ColumnMeta[] = []; - groupByValues.forEach((value) => { + groupByValues.forEach(value => { if (value in props.options) { dbColumnsInCurrentControl.push(props.options[value]); } }); function onClickClose(columnName: string) { - const newGroupByValues = groupByValues.filter((value) => value !== columnName) + const newGroupByValues = groupByValues.filter( + value => value !== columnName, + ); setGroupByValues(newGroupByValues); props.onChange(newGroupByValues); } - function onChangeGroupByValues(values: string[]){ + function onChangeGroupByValues(values: string[]) { setGroupByValues(values); props.onChange(values); } - const PlaceHolderRenderer = () => + const PlaceHolderRenderer = () => ( - + {t('Drop Columns')} + ); - const OptionsRenderer = () => { - return ( - <> - {dbColumnsInCurrentControl.map((column) => - )} - - ) - } + const OptionsRenderer = () => ( + <> + {dbColumnsInCurrentControl.map(column => ( + + ))} + + ); return ( <> @@ -108,7 +109,11 @@ function DropGroupByControl(props: DropGroupByControlProps) { - { isEmpty(dbColumnsInCurrentControl) ? : } + {isEmpty(dbColumnsInCurrentControl) ? ( + + ) : ( + + )} diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx index d6b862cd332..e07c871c9fc 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx @@ -26,7 +26,7 @@ import { OptionControlContainer, Label, } from 'src/explore/components/OptionControls'; -import { OptionProps } from '../types' +import { OptionProps } from '../types'; function Option(props: OptionProps) { return ( @@ -39,14 +39,14 @@ function Option(props: OptionProps) { {props.withCaret && ( - + )} diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx index f981ee80c08..e6014999eb0 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx @@ -18,9 +18,13 @@ */ import React, { useRef } from 'react'; import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd'; -import Option from './Option'; import { DragContainer } from 'src/explore/components/OptionControls'; -import { OptionWrapperProps, GroupByItemInterface, GroupByItemType } from "../types"; +import Option from './Option'; +import { + OptionWrapperProps, + GroupByItemInterface, + GroupByItemType, +} from '../types'; export default function OptionWrapper(props: OptionWrapperProps) { const { groupByValues, column, onChangeGroupByValues } = props; @@ -29,30 +33,32 @@ export default function OptionWrapper(props: OptionWrapperProps) { const item: GroupByItemInterface = { dragIndex: groupByValues.indexOf(column.column_name), dropIndex: -1, - type: GroupByItemType - } + type: GroupByItemType, + }; const [, drag] = useDrag({ item, collect: monitor => ({ isDragging: monitor.isDragging(), }), - }) + }); const [, drop] = useDrop({ accept: GroupByItemType, drop: (item: GroupByItemInterface) => { - let newValues = [...props.groupByValues]; - newValues[item.dragIndex] = groupByValues[item.dropIndex]; - newValues[item.dropIndex] = groupByValues[item.dragIndex]; - onChangeGroupByValues(newValues); + if (item.dragIndex > -1 && item.dropIndex > -1) { + const newValues = [...props.groupByValues]; + newValues[item.dragIndex] = groupByValues[item.dropIndex]; + newValues[item.dropIndex] = groupByValues[item.dragIndex]; + onChangeGroupByValues(newValues); + } }, hover(item: GroupByItemInterface, monitor: DropTargetMonitor) { if (!ref.current) { return; } - const dragIndex = item.dragIndex; + const { dragIndex } = item; const hoverIndex = groupByValues.indexOf(column.column_name); // Don't replace items with themselves @@ -86,9 +92,13 @@ export default function OptionWrapper(props: OptionWrapperProps) { item.dragIndex = dragIndex; item.dropIndex = hoverIndex; }, - }) + }); drag(drop(ref)); - return + return ( + + + ); } diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts index 64982358399..b58e165628b 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts @@ -17,7 +17,7 @@ * under the License. */ import { SupersetTheme } from '@superset-ui/core'; -import { ColumnMeta } from '@superset-ui/chart-controls' +import { ColumnMeta } from '@superset-ui/chart-controls'; export interface OptionWrapperProps { column: ColumnMeta; diff --git a/superset-frontend/src/explore/components/controls/index.js b/superset-frontend/src/explore/components/controls/index.js index 07d6c0ada0d..adef9679e70 100644 --- a/superset-frontend/src/explore/components/controls/index.js +++ b/superset-frontend/src/explore/components/controls/index.js @@ -39,7 +39,7 @@ import VizTypeControl from './VizTypeControl'; import MetricsControl from './MetricControl/MetricsControl'; import AdhocFilterControl from './FilterControl/AdhocFilterControl'; import FilterBoxItemControl from './FilterBoxItemControl'; -import DropGroupByControl from "./DropGroupByControl/DropGroupByControl"; +import DropGroupByControl from './DropGroupByControl/DropGroupByControl'; const controlMap = { AnnotationLayerControl, From f073c1e22a97cd8b85b1c2bd0d7c4aca714f5daf Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Thu, 18 Feb 2021 00:52:40 +0800 Subject: [PATCH 04/22] fix shift options --- .../DatasourcePanelDragWrapper.tsx | 4 +- .../components/DatasourcePanel/types.ts | 2 +- .../DropGroupByControl/DropGroupByControl.tsx | 49 ++++++++++--------- .../components/OptionWrapper.tsx | 32 ++++++------ .../controls/DropGroupByControl/types.ts | 5 +- .../controls/DropGroupByControl/utils.ts | 33 +++++++++++++ 6 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/utils.ts diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx index 92c7bfea1a3..48f06ea898c 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx @@ -18,9 +18,9 @@ */ import React, { ReactNode } from 'react'; import { useDrag } from 'react-dnd'; -import { DatasourcePanelDndItemProps } from './types'; +import { DatasourcePanelDndItem } from './types'; -interface DatasourcePanelDragWrapperProps extends DatasourcePanelDndItemProps { +interface DatasourcePanelDragWrapperProps extends DatasourcePanelDndItem { children?: ReactNode; } diff --git a/superset-frontend/src/explore/components/DatasourcePanel/types.ts b/superset-frontend/src/explore/components/DatasourcePanel/types.ts index ebf4f9edfb7..d426f787de9 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/types.ts +++ b/superset-frontend/src/explore/components/DatasourcePanel/types.ts @@ -22,7 +22,7 @@ export enum DatasourcePanelDndType { COLUMN = 'column', } -export interface DatasourcePanelDndItemProps { +export interface DatasourcePanelDndItem { metricOrColumnName: string; type: | typeof DatasourcePanelDndType.METRIC diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx index f5910856032..9418ff6f8c5 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx @@ -29,10 +29,11 @@ import { } from 'src/explore/components/OptionControls'; import { DatasourcePanelDndType, - DatasourcePanelDndItemProps, + DatasourcePanelDndItem, } from 'src/explore/components/DatasourcePanel/types'; import Icon from 'src/components/Icon'; import OptionWrapper from './components/OptionWrapper'; +import { getOptionsFromGroupByValues } from './utils'; interface DropGroupByControlProps extends BaseControlConfig { name: string; @@ -43,42 +44,42 @@ interface DropGroupByControlProps extends BaseControlConfig { } function DropGroupByControl(props: DropGroupByControlProps) { - const [groupByValues, setGroupByValues] = useState( - props.value ?? [], + const { value: groupByValues, options } = props; + const [groupByOptions, setGroupByOptions] = useState( + getOptionsFromGroupByValues(options, groupByValues), ); + const [, datasourcePanelDrop] = useDrop({ accept: DatasourcePanelDndType.COLUMN, - drop: (item: DatasourcePanelDndItemProps) => { - if (!groupByValues.includes(item.metricOrColumnName)) { - const newValue = groupByValues.concat([item.metricOrColumnName]); - setGroupByValues(newValue); - props.onChange(newValue); - } + + drop: (item: DatasourcePanelDndItem) => { + const newGroupByValues = groupByValues.concat([item.metricOrColumnName]); + setGroupByOptions(getOptionsFromGroupByValues(options, newGroupByValues)); + props.onChange(newGroupByValues); }, + + canDrop: (item: DatasourcePanelDndItem) => + !groupByValues.includes(item.metricOrColumnName), + collect: monitor => ({ isOver: monitor.isOver(), canDrop: monitor.canDrop(), }), }); - const dbColumnsInCurrentControl: ColumnMeta[] = []; - groupByValues.forEach(value => { - if (value in props.options) { - dbColumnsInCurrentControl.push(props.options[value]); - } - }); - function onClickClose(columnName: string) { const newGroupByValues = groupByValues.filter( value => value !== columnName, ); - setGroupByValues(newGroupByValues); + setGroupByOptions(getOptionsFromGroupByValues(options, newGroupByValues)); props.onChange(newGroupByValues); } - function onChangeGroupByValues(values: string[]) { - setGroupByValues(values); - props.onChange(values); + function onShiftOptions(dragIndex: number, dropIndex: number) { + const val = [...groupByValues]; + [val[dropIndex], val[dragIndex]] = [val[dragIndex], val[dropIndex]]; + setGroupByOptions(getOptionsFromGroupByValues(options, val)); + props.onChange(val); } const PlaceHolderRenderer = () => ( @@ -90,13 +91,13 @@ function DropGroupByControl(props: DropGroupByControlProps) { const OptionsRenderer = () => ( <> - {dbColumnsInCurrentControl.map(column => ( + {groupByOptions.map(column => ( ))} @@ -109,7 +110,7 @@ function DropGroupByControl(props: DropGroupByControlProps) { - {isEmpty(dbColumnsInCurrentControl) ? ( + {isEmpty(groupByOptions) ? ( ) : ( diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx index e6014999eb0..4074022cbf9 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx @@ -17,7 +17,12 @@ * under the License. */ import React, { useRef } from 'react'; -import { useDrag, useDrop, DropTargetMonitor } from 'react-dnd'; +import { + useDrag, + useDrop, + DropTargetMonitor, + DragSourceMonitor, +} from 'react-dnd'; import { DragContainer } from 'src/explore/components/OptionControls'; import Option from './Option'; import { @@ -27,17 +32,16 @@ import { } from '../types'; export default function OptionWrapper(props: OptionWrapperProps) { - const { groupByValues, column, onChangeGroupByValues } = props; + const { index, onShiftOptions } = props; const ref = useRef(null); const item: GroupByItemInterface = { - dragIndex: groupByValues.indexOf(column.column_name), - dropIndex: -1, + dragIndex: index, type: GroupByItemType, }; const [, drag] = useDrag({ item, - collect: monitor => ({ + collect: (monitor: DragSourceMonitor) => ({ isDragging: monitor.isDragging(), }), }); @@ -45,21 +49,12 @@ export default function OptionWrapper(props: OptionWrapperProps) { const [, drop] = useDrop({ accept: GroupByItemType, - drop: (item: GroupByItemInterface) => { - if (item.dragIndex > -1 && item.dropIndex > -1) { - const newValues = [...props.groupByValues]; - newValues[item.dragIndex] = groupByValues[item.dropIndex]; - newValues[item.dropIndex] = groupByValues[item.dragIndex]; - onChangeGroupByValues(newValues); - } - }, - - hover(item: GroupByItemInterface, monitor: DropTargetMonitor) { + hover: (item: GroupByItemInterface, monitor: DropTargetMonitor) => { if (!ref.current) { return; } const { dragIndex } = item; - const hoverIndex = groupByValues.indexOf(column.column_name); + const hoverIndex = index; // Don't replace items with themselves if (dragIndex === hoverIndex) { @@ -87,10 +82,11 @@ export default function OptionWrapper(props: OptionWrapperProps) { if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) { return; } + // Time to actually perform the action + onShiftOptions(dragIndex, hoverIndex); // eslint-disable-next-line no-param-reassign - item.dragIndex = dragIndex; - item.dropIndex = hoverIndex; + item.dragIndex = hoverIndex; }, }); diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts index b58e165628b..f44dd8f6e0f 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts @@ -21,9 +21,9 @@ import { ColumnMeta } from '@superset-ui/chart-controls'; export interface OptionWrapperProps { column: ColumnMeta; - groupByValues: string[]; + index: number; clickClose: (columnName: string) => void; - onChangeGroupByValues: (values: string[]) => void; + onShiftOptions: (dragIndex: number, dropIndex: number) => void; withCaret?: boolean; } @@ -36,5 +36,4 @@ export const GroupByItemType = 'groupByItem'; export interface GroupByItemInterface { type: typeof GroupByItemType; dragIndex: number; - dropIndex: number; } diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils.ts new file mode 100644 index 00000000000..a8e31f259fa --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils.ts @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { ColumnMeta } from '@superset-ui/chart-controls'; + +export function getOptionsFromGroupByValues( + options: { string: ColumnMeta }, + groupByValues: string[], +): ColumnMeta[] { + return groupByValues + .map(value => { + if (value in options) { + return options[value]; + } + return null; + }) + .filter(Boolean); +} From f797e55e1ca0c1f15d5de9510cb48aa507c70be7 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Thu, 18 Feb 2021 00:59:45 +0800 Subject: [PATCH 05/22] wip --- .../controls/DropGroupByControl/DropGroupByControl.tsx | 4 ++-- .../explore/components/controls/DropGroupByControl/types.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx index 9418ff6f8c5..9cf77c09d7d 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx @@ -75,9 +75,9 @@ function DropGroupByControl(props: DropGroupByControlProps) { props.onChange(newGroupByValues); } - function onShiftOptions(dragIndex: number, dropIndex: number) { + function onShiftOptions(dragIndex: number, hoverIndex: number) { const val = [...groupByValues]; - [val[dropIndex], val[dragIndex]] = [val[dragIndex], val[dropIndex]]; + [val[hoverIndex], val[dragIndex]] = [val[dragIndex], val[hoverIndex]]; setGroupByOptions(getOptionsFromGroupByValues(options, val)); props.onChange(val); } diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts index f44dd8f6e0f..896e9c96b6c 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts @@ -23,7 +23,7 @@ export interface OptionWrapperProps { column: ColumnMeta; index: number; clickClose: (columnName: string) => void; - onShiftOptions: (dragIndex: number, dropIndex: number) => void; + onShiftOptions: (dragIndex: number, hoverIndex: number) => void; withCaret?: boolean; } From 6563283a05fe92324a3b049cfb4abd8f359bfb37 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Thu, 18 Feb 2021 22:13:19 +0800 Subject: [PATCH 06/22] wip --- .../DropGroupByControl/DropGroupByControl.tsx | 76 +++++++++---------- .../DropGroupByControl/components/Option.tsx | 2 +- .../components/OptionWrapper.tsx | 6 +- .../controls/DropGroupByControl/types.ts | 3 +- .../DropGroupByControl/utils/controlOption.ts | 58 ++++++++++++++ .../{utils.ts => utils/index.ts} | 16 +--- 6 files changed, 104 insertions(+), 57 deletions(-) create mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts rename superset-frontend/src/explore/components/controls/DropGroupByControl/{utils.ts => utils/index.ts} (70%) diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx index 9cf77c09d7d..26fa2185884 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx @@ -33,7 +33,7 @@ import { } from 'src/explore/components/DatasourcePanel/types'; import Icon from 'src/components/Icon'; import OptionWrapper from './components/OptionWrapper'; -import { getOptionsFromGroupByValues } from './utils'; +import { OptionSelector } from './utils'; interface DropGroupByControlProps extends BaseControlConfig { name: string; @@ -45,17 +45,18 @@ interface DropGroupByControlProps extends BaseControlConfig { function DropGroupByControl(props: DropGroupByControlProps) { const { value: groupByValues, options } = props; + const optionSelector = new OptionSelector(options, groupByValues); const [groupByOptions, setGroupByOptions] = useState( - getOptionsFromGroupByValues(options, groupByValues), + optionSelector.groupByOptions, ); const [, datasourcePanelDrop] = useDrop({ accept: DatasourcePanelDndType.COLUMN, drop: (item: DatasourcePanelDndItem) => { - const newGroupByValues = groupByValues.concat([item.metricOrColumnName]); - setGroupByOptions(getOptionsFromGroupByValues(options, newGroupByValues)); - props.onChange(newGroupByValues); + optionSelector.add(item.metricOrColumnName); + setGroupByOptions(optionSelector.groupByOptions); + props.onChange(optionSelector.getValues()); }, canDrop: (item: DatasourcePanelDndItem) => @@ -67,41 +68,42 @@ function DropGroupByControl(props: DropGroupByControlProps) { }), }); - function onClickClose(columnName: string) { - const newGroupByValues = groupByValues.filter( - value => value !== columnName, - ); - setGroupByOptions(getOptionsFromGroupByValues(options, newGroupByValues)); - props.onChange(newGroupByValues); + function onClickClose(index: number) { + optionSelector.del(index); + setGroupByOptions(optionSelector.groupByOptions); + props.onChange(optionSelector.getValues()); } function onShiftOptions(dragIndex: number, hoverIndex: number) { - const val = [...groupByValues]; - [val[hoverIndex], val[dragIndex]] = [val[dragIndex], val[hoverIndex]]; - setGroupByOptions(getOptionsFromGroupByValues(options, val)); - props.onChange(val); + optionSelector.swap(dragIndex, hoverIndex); + setGroupByOptions(optionSelector.groupByOptions); } - const PlaceHolderRenderer = () => ( - - - {t('Drop Columns')} - - ); + function onDrop() { + props.onChange(optionSelector.getValues()); + } - const OptionsRenderer = () => ( - <> - {groupByOptions.map(column => ( - - ))} - - ); + function placeHolderRenderer() { + return ( + + + {t('Drop Columns')} + + ); + } + + function optionsRenderer() { + return groupByOptions.map((column, idx) => ( + + )); + } return ( <> @@ -110,11 +112,7 @@ function DropGroupByControl(props: DropGroupByControlProps) { - {isEmpty(groupByOptions) ? ( - - ) : ( - - )} + {isEmpty(groupByOptions) ? placeHolderRenderer() : optionsRenderer()} diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx index e07c871c9fc..a8eddf42aab 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx @@ -34,7 +34,7 @@ function Option(props: OptionProps) { props.clickClose(props.column.column_name)} + onClick={() => props.clickClose(props.index)} > diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx index 4074022cbf9..465e75db402 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx @@ -32,7 +32,7 @@ import { } from '../types'; export default function OptionWrapper(props: OptionWrapperProps) { - const { index, onShiftOptions } = props; + const { index, onShiftOptions, onDrop } = props; const ref = useRef(null); const item: GroupByItemInterface = { @@ -49,6 +49,10 @@ export default function OptionWrapper(props: OptionWrapperProps) { const [, drop] = useDrop({ accept: GroupByItemType, + drop: () => { + onDrop(); + }, + hover: (item: GroupByItemInterface, monitor: DropTargetMonitor) => { if (!ref.current) { return; diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts index 896e9c96b6c..99cf3001c15 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts @@ -22,8 +22,9 @@ import { ColumnMeta } from '@superset-ui/chart-controls'; export interface OptionWrapperProps { column: ColumnMeta; index: number; - clickClose: (columnName: string) => void; + clickClose: (index: number) => void; onShiftOptions: (dragIndex: number, hoverIndex: number) => void; + onDrop: () => void; withCaret?: boolean; } diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts new file mode 100644 index 00000000000..0c6416e0f4e --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts @@ -0,0 +1,58 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +import { ColumnMeta } from '@superset-ui/chart-controls'; + +export class OptionSelector { + groupByOptions: ColumnMeta[]; + + options: { string: ColumnMeta }; + + constructor(options: { string: ColumnMeta }, groupByValues: string[]) { + this.options = options; + this.groupByOptions = groupByValues + .map(value => { + if (value in options) { + return options[value]; + } + return null; + }) + .filter(Boolean); + } + + add(value: string) { + if (value in this.options) { + this.groupByOptions.push(this.options[value]); + } + } + + del(idx: number) { + this.groupByOptions.splice(idx, 1); + } + + swap = (a: number, b: number) => { + [this.groupByOptions[a], this.groupByOptions[b]] = [ + this.groupByOptions[b], + this.groupByOptions[a], + ]; + }; + + getValues(): string[] { + return this.groupByOptions.map(option => option.column_name); + } +} diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts similarity index 70% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/utils.ts rename to superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts index a8e31f259fa..d864edb037b 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts @@ -16,18 +16,4 @@ * specific language governing permissions and limitations * under the License. */ -import { ColumnMeta } from '@superset-ui/chart-controls'; - -export function getOptionsFromGroupByValues( - options: { string: ColumnMeta }, - groupByValues: string[], -): ColumnMeta[] { - return groupByValues - .map(value => { - if (value in options) { - return options[value]; - } - return null; - }) - .filter(Boolean); -} +export * from './controlOption'; From ad28813207680834bee0c74eb994fd384b4f3825 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 19 Feb 2021 00:11:50 +0800 Subject: [PATCH 07/22] fix shift action --- .../controls/DropGroupByControl/DropGroupByControl.tsx | 4 ---- .../DropGroupByControl/components/OptionWrapper.tsx | 6 +----- .../explore/components/controls/DropGroupByControl/types.ts | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx index 26fa2185884..c87047bc27b 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx @@ -77,9 +77,6 @@ function DropGroupByControl(props: DropGroupByControlProps) { function onShiftOptions(dragIndex: number, hoverIndex: number) { optionSelector.swap(dragIndex, hoverIndex); setGroupByOptions(optionSelector.groupByOptions); - } - - function onDrop() { props.onChange(optionSelector.getValues()); } @@ -100,7 +97,6 @@ function DropGroupByControl(props: DropGroupByControlProps) { column={column} clickClose={onClickClose} onShiftOptions={onShiftOptions} - onDrop={onDrop} /> )); } diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx index 465e75db402..4074022cbf9 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx @@ -32,7 +32,7 @@ import { } from '../types'; export default function OptionWrapper(props: OptionWrapperProps) { - const { index, onShiftOptions, onDrop } = props; + const { index, onShiftOptions } = props; const ref = useRef(null); const item: GroupByItemInterface = { @@ -49,10 +49,6 @@ export default function OptionWrapper(props: OptionWrapperProps) { const [, drop] = useDrop({ accept: GroupByItemType, - drop: () => { - onDrop(); - }, - hover: (item: GroupByItemInterface, monitor: DropTargetMonitor) => { if (!ref.current) { return; diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts index 99cf3001c15..a361a305910 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts @@ -24,7 +24,6 @@ export interface OptionWrapperProps { index: number; clickClose: (index: number) => void; onShiftOptions: (dragIndex: number, hoverIndex: number) => void; - onDrop: () => void; withCaret?: boolean; } From 8b699d721238ac618f53d08dcdcc91e3ac4e4228 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 19 Feb 2021 13:48:34 +0800 Subject: [PATCH 08/22] support scalar dimentions --- ...roupByControl.tsx => DropGroupByLabel.tsx} | 16 ++++----- .../controls/DropGroupByControl/index.ts | 19 +++++++++++ .../DropGroupByControl/utils/controlOption.ts | 33 ++++++++++++++++--- .../src/explore/components/controls/index.js | 2 +- 4 files changed, 57 insertions(+), 13 deletions(-) rename superset-frontend/src/explore/components/controls/DropGroupByControl/{DropGroupByControl.tsx => DropGroupByLabel.tsx} (89%) create mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/index.ts diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByLabel.tsx similarity index 89% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx rename to superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByLabel.tsx index c87047bc27b..bb19918438e 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByControl.tsx +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByLabel.tsx @@ -35,17 +35,17 @@ import Icon from 'src/components/Icon'; import OptionWrapper from './components/OptionWrapper'; import { OptionSelector } from './utils'; -interface DropGroupByControlProps extends BaseControlConfig { +interface DropGroupByControlLabel extends BaseControlConfig { name: string; - value: string[]; - onChange: (value: string[]) => void; + value: string[] | string | null; + onChange: (value: string[] | string | null) => void; options: { string: ColumnMeta }; theme: SupersetTheme; } -function DropGroupByControl(props: DropGroupByControlProps) { - const { value: groupByValues, options } = props; - const optionSelector = new OptionSelector(options, groupByValues); +function DropGroupByLabel(props: DropGroupByControlLabel) { + const { value, options } = props; + const optionSelector = new OptionSelector(options, value); const [groupByOptions, setGroupByOptions] = useState( optionSelector.groupByOptions, ); @@ -60,7 +60,7 @@ function DropGroupByControl(props: DropGroupByControlProps) { }, canDrop: (item: DatasourcePanelDndItem) => - !groupByValues.includes(item.metricOrColumnName), + !optionSelector.has(item.metricOrColumnName), collect: monitor => ({ isOver: monitor.isOver(), @@ -115,4 +115,4 @@ function DropGroupByControl(props: DropGroupByControlProps) { ); } -export default withTheme(DropGroupByControl); +export default withTheme(DropGroupByLabel); diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/index.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/index.ts new file mode 100644 index 00000000000..77401389256 --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/index.ts @@ -0,0 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export { default } from './DropGroupByLabel'; diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts index 0c6416e0f4e..8eb5bcfb6bb 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts @@ -23,8 +23,21 @@ export class OptionSelector { options: { string: ColumnMeta }; - constructor(options: { string: ColumnMeta }, groupByValues: string[]) { + scalar: boolean; + + constructor( + options: { string: ColumnMeta }, + values: string[] | string | null, + ) { this.options = options; + let groupByValues: string[]; + if (Array.isArray(values)) { + groupByValues = values; + this.scalar = false; + } else { + groupByValues = values ? [values] : []; + this.scalar = true; + } this.groupByOptions = groupByValues .map(value => { if (value in options) { @@ -45,14 +58,26 @@ export class OptionSelector { this.groupByOptions.splice(idx, 1); } - swap = (a: number, b: number) => { + swap(a: number, b: number) { [this.groupByOptions[a], this.groupByOptions[b]] = [ this.groupByOptions[b], this.groupByOptions[a], ]; - }; + } - getValues(): string[] { + has(groupBy: string): boolean { + if (this.scalar) { + return !!this.getValues(); + } + return !!this.getValues()?.includes(groupBy); + } + + getValues(): string[] | string | null { + if (this.scalar) { + return this.groupByOptions.length > 0 + ? this.groupByOptions[0].column_name + : null; + } return this.groupByOptions.map(option => option.column_name); } } diff --git a/superset-frontend/src/explore/components/controls/index.js b/superset-frontend/src/explore/components/controls/index.js index adef9679e70..1b128c876fc 100644 --- a/superset-frontend/src/explore/components/controls/index.js +++ b/superset-frontend/src/explore/components/controls/index.js @@ -39,7 +39,7 @@ import VizTypeControl from './VizTypeControl'; import MetricsControl from './MetricControl/MetricsControl'; import AdhocFilterControl from './FilterControl/AdhocFilterControl'; import FilterBoxItemControl from './FilterBoxItemControl'; -import DropGroupByControl from './DropGroupByControl/DropGroupByControl'; +import DropGroupByControl from './DropGroupByControl'; const controlMap = { AnnotationLayerControl, From f59bf84a0db5eeba891205c4876ad07848602c15 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 19 Feb 2021 21:39:38 +0800 Subject: [PATCH 09/22] control rename to DndColumnSelectControl --- .../DndColumnSelectLabel.tsx} | 6 +++--- .../components/Option.tsx | 0 .../components/OptionWrapper.tsx | 0 .../controls/DndColumnSelectControl/index.ts | 19 +++++++++++++++++++ .../types.ts | 0 .../utils}/index.ts | 2 +- .../utils/optionSelector.ts} | 0 .../DropGroupByControl/utils/index.ts | 2 +- .../src/explore/components/controls/index.js | 4 ++-- 9 files changed, 26 insertions(+), 7 deletions(-) rename superset-frontend/src/explore/components/controls/{DropGroupByControl/DropGroupByLabel.tsx => DndColumnSelectControl/DndColumnSelectLabel.tsx} (95%) rename superset-frontend/src/explore/components/controls/{DropGroupByControl => DndColumnSelectControl}/components/Option.tsx (100%) rename superset-frontend/src/explore/components/controls/{DropGroupByControl => DndColumnSelectControl}/components/OptionWrapper.tsx (100%) create mode 100644 superset-frontend/src/explore/components/controls/DndColumnSelectControl/index.ts rename superset-frontend/src/explore/components/controls/{DropGroupByControl => DndColumnSelectControl}/types.ts (100%) rename superset-frontend/src/explore/components/controls/{DropGroupByControl => DndColumnSelectControl/utils}/index.ts (94%) rename superset-frontend/src/explore/components/controls/{DropGroupByControl/utils/controlOption.ts => DndColumnSelectControl/utils/optionSelector.ts} (100%) diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx similarity index 95% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByLabel.tsx rename to superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx index bb19918438e..53e22b3d415 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/DropGroupByLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx @@ -35,7 +35,7 @@ import Icon from 'src/components/Icon'; import OptionWrapper from './components/OptionWrapper'; import { OptionSelector } from './utils'; -interface DropGroupByControlLabel extends BaseControlConfig { +interface LabelProps extends BaseControlConfig { name: string; value: string[] | string | null; onChange: (value: string[] | string | null) => void; @@ -43,7 +43,7 @@ interface DropGroupByControlLabel extends BaseControlConfig { theme: SupersetTheme; } -function DropGroupByLabel(props: DropGroupByControlLabel) { +function DndColumnSelectLabel(props: LabelProps) { const { value, options } = props; const optionSelector = new OptionSelector(options, value); const [groupByOptions, setGroupByOptions] = useState( @@ -115,4 +115,4 @@ function DropGroupByLabel(props: DropGroupByControlLabel) { ); } -export default withTheme(DropGroupByLabel); +export default withTheme(DndColumnSelectLabel); diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/Option.tsx similarity index 100% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/components/Option.tsx rename to superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/Option.tsx diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/OptionWrapper.tsx similarity index 100% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/components/OptionWrapper.tsx rename to superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/OptionWrapper.tsx diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/index.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/index.ts new file mode 100644 index 00000000000..439f42449aa --- /dev/null +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/index.ts @@ -0,0 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +export { default } from './DndColumnSelectLabel'; diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/types.ts similarity index 100% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/types.ts rename to superset-frontend/src/explore/components/controls/DndColumnSelectControl/types.ts diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/index.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/index.ts similarity index 94% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/index.ts rename to superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/index.ts index 77401389256..7a11e06f4e3 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/index.ts +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/index.ts @@ -16,4 +16,4 @@ * specific language governing permissions and limitations * under the License. */ -export { default } from './DropGroupByLabel'; +export * from './optionSelector'; diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts similarity index 100% rename from superset-frontend/src/explore/components/controls/DropGroupByControl/utils/controlOption.ts rename to superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts index d864edb037b..7a11e06f4e3 100644 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts +++ b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts @@ -16,4 +16,4 @@ * specific language governing permissions and limitations * under the License. */ -export * from './controlOption'; +export * from './optionSelector'; diff --git a/superset-frontend/src/explore/components/controls/index.js b/superset-frontend/src/explore/components/controls/index.js index 1b128c876fc..aa86e08cf3b 100644 --- a/superset-frontend/src/explore/components/controls/index.js +++ b/superset-frontend/src/explore/components/controls/index.js @@ -39,7 +39,7 @@ import VizTypeControl from './VizTypeControl'; import MetricsControl from './MetricControl/MetricsControl'; import AdhocFilterControl from './FilterControl/AdhocFilterControl'; import FilterBoxItemControl from './FilterBoxItemControl'; -import DropGroupByControl from './DropGroupByControl'; +import DndColumnSelectControl from './DndColumnSelectControl'; const controlMap = { AnnotationLayerControl, @@ -51,7 +51,7 @@ const controlMap = { ColorSchemeControl, DatasourceControl, DateFilterControl, - DropGroupByControl, + DndColumnSelectControl, FixedOrMetricControl, HiddenControl, SelectAsyncControl, From c985c2503791b08d8fb073ded71cb1b59ed319a7 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 19 Feb 2021 23:41:57 +0800 Subject: [PATCH 10/22] remove unused files --- .../DropGroupByControl/utils/index.ts | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts diff --git a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts b/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts deleted file mode 100644 index 7a11e06f4e3..00000000000 --- a/superset-frontend/src/explore/components/controls/DropGroupByControl/utils/index.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -export * from './optionSelector'; From 507ca477210ee272a88e627a475a39c156ed401d Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Mon, 22 Feb 2021 20:23:02 +0800 Subject: [PATCH 11/22] added feature flag --- superset-frontend/src/featureFlags.ts | 1 + superset/config.py | 1 + 2 files changed, 2 insertions(+) diff --git a/superset-frontend/src/featureFlags.ts b/superset-frontend/src/featureFlags.ts index a7bd2cac6b7..7cf3c1a09cb 100644 --- a/superset-frontend/src/featureFlags.ts +++ b/superset-frontend/src/featureFlags.ts @@ -40,6 +40,7 @@ export enum FeatureFlag { VERSIONED_EXPORT = 'VERSIONED_EXPORT', GLOBAL_ASYNC_QUERIES = 'GLOBAL_ASYNC_QUERIES', ENABLE_TEMPLATE_PROCESSING = 'ENABLE_TEMPLATE_PROCESSING', + ENABLE_EXPLORE_DRAG_AND_DROP = 'ENABLE_EXPLORE_DRAG_AND_DROP', } export type FeatureFlagMap = { diff --git a/superset/config.py b/superset/config.py index 8e3f395d60d..e295a0e7550 100644 --- a/superset/config.py +++ b/superset/config.py @@ -345,6 +345,7 @@ def _try_json_readsha( # pylint: disable=unused-argument # Enable experimental feature to search for other dashboards "OMNIBAR": False, "DASHBOARD_RBAC": False, + "ENABLE_EXPLORE_DRAG_AND_DROP": True, } # Set the default view to card/grid view if thumbnail support is enabled. From d4e2a589ad3a1e6151e9762c7bc2e07ae9d83feb Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Mon, 22 Feb 2021 20:37:33 +0800 Subject: [PATCH 12/22] ff to False by default --- superset/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/config.py b/superset/config.py index e295a0e7550..622ff056bc6 100644 --- a/superset/config.py +++ b/superset/config.py @@ -345,7 +345,7 @@ def _try_json_readsha( # pylint: disable=unused-argument # Enable experimental feature to search for other dashboards "OMNIBAR": False, "DASHBOARD_RBAC": False, - "ENABLE_EXPLORE_DRAG_AND_DROP": True, + "ENABLE_EXPLORE_DRAG_AND_DROP": False, } # Set the default view to card/grid view if thumbnail support is enabled. From d97ed8db7090c9ca195cb395c3b100934cdf3a6d Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Tue, 23 Feb 2021 11:42:41 +0800 Subject: [PATCH 13/22] fix ut --- .../explore/components/DatasourcePanel_spec.jsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx b/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx index 4ffef7e33c3..48167953894 100644 --- a/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx @@ -17,6 +17,8 @@ * under the License. */ import React from 'react'; +import { HTML5Backend } from 'react-dnd-html5-backend' +import { DndProvider } from 'react-dnd' import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import DatasourcePanel from 'src/explore/components/DatasourcePanel'; @@ -55,26 +57,26 @@ describe('datasourcepanel', () => { } it('should render', () => { - const { container } = render(); + const { container } = render(); expect(container).toBeVisible(); }); it('should display items in controls', () => { - render(); + render(); expect(screen.getByText('birth_names')).toBeTruthy(); expect(screen.getByText('Columns')).toBeTruthy(); expect(screen.getByText('Metrics')).toBeTruthy(); }); it('should render search results', () => { - const { container } = render(); + const { container } = render(); const c = container.getElementsByClassName('option-label'); expect(c).toHaveLength(5); }); it('should render 0 search results', () => { - const { container } = render(); + const { container } = render(); const c = container.getElementsByClassName('option-label'); const searchInput = screen.getByPlaceholderText('Search Metrics & Columns'); @@ -85,7 +87,7 @@ describe('datasourcepanel', () => { }); it('should render and sort search results', () => { - const { container } = render(); + const { container } = render(); const c = container.getElementsByClassName('option-label'); const searchInput = screen.getByPlaceholderText('Search Metrics & Columns'); From 6b6327b818dcffea769f5d4e2ae6f925be1a9043 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Tue, 23 Feb 2021 11:49:27 +0800 Subject: [PATCH 14/22] lint --- .../components/DatasourcePanel_spec.jsx | 34 +++++++++++++++---- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx b/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx index 48167953894..656c9cdfd0e 100644 --- a/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx @@ -17,8 +17,8 @@ * under the License. */ import React from 'react'; -import { HTML5Backend } from 'react-dnd-html5-backend' -import { DndProvider } from 'react-dnd' +import { HTML5Backend } from 'react-dnd-html5-backend'; +import { DndProvider } from 'react-dnd'; import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import DatasourcePanel from 'src/explore/components/DatasourcePanel'; @@ -57,26 +57,42 @@ describe('datasourcepanel', () => { } it('should render', () => { - const { container } = render(); + const { container } = render( + + + , + ); expect(container).toBeVisible(); }); it('should display items in controls', () => { - render(); + render( + + + , + ); expect(screen.getByText('birth_names')).toBeTruthy(); expect(screen.getByText('Columns')).toBeTruthy(); expect(screen.getByText('Metrics')).toBeTruthy(); }); it('should render search results', () => { - const { container } = render(); + const { container } = render( + + + , + ); const c = container.getElementsByClassName('option-label'); expect(c).toHaveLength(5); }); it('should render 0 search results', () => { - const { container } = render(); + const { container } = render( + + + , + ); const c = container.getElementsByClassName('option-label'); const searchInput = screen.getByPlaceholderText('Search Metrics & Columns'); @@ -87,7 +103,11 @@ describe('datasourcepanel', () => { }); it('should render and sort search results', () => { - const { container } = render(); + const { container } = render( + + + , + ); const c = container.getElementsByClassName('option-label'); const searchInput = screen.getByPlaceholderText('Search Metrics & Columns'); From 7296a54546ad3f04d6c7d778d8bf85e3c2b8434d Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Tue, 23 Feb 2021 20:36:08 +0800 Subject: [PATCH 15/22] improve code smell --- .../components/DatasourcePanel_spec.jsx | 36 ++++++------------- .../DatasourcePanelDragWrapper.tsx | 6 +--- .../DndColumnSelectLabel.tsx | 28 +++++++-------- .../components/Option.tsx | 15 ++++---- .../components/OptionWrapper.tsx | 8 ++--- .../controls/DndColumnSelectControl/types.ts | 7 +--- 6 files changed, 33 insertions(+), 67 deletions(-) diff --git a/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx b/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx index 656c9cdfd0e..df57ee1df3b 100644 --- a/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx +++ b/superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx @@ -51,48 +51,38 @@ describe('datasourcepanel', () => { actions: {}, }; + const setup = props => ( + + + + ); + function search(value, input) { userEvent.clear(input); userEvent.type(input, value); } it('should render', () => { - const { container } = render( - - - , - ); + const { container } = render(setup(props)); expect(container).toBeVisible(); }); it('should display items in controls', () => { - render( - - - , - ); + render(setup(props)); expect(screen.getByText('birth_names')).toBeTruthy(); expect(screen.getByText('Columns')).toBeTruthy(); expect(screen.getByText('Metrics')).toBeTruthy(); }); it('should render search results', () => { - const { container } = render( - - - , - ); + const { container } = render(setup(props)); const c = container.getElementsByClassName('option-label'); expect(c).toHaveLength(5); }); it('should render 0 search results', () => { - const { container } = render( - - - , - ); + const { container } = render(setup(props)); const c = container.getElementsByClassName('option-label'); const searchInput = screen.getByPlaceholderText('Search Metrics & Columns'); @@ -103,11 +93,7 @@ describe('datasourcepanel', () => { }); it('should render and sort search results', () => { - const { container } = render( - - - , - ); + const { container } = render(setup(props)); const c = container.getElementsByClassName('option-label'); const searchInput = screen.getByPlaceholderText('Search Metrics & Columns'); diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx index 48f06ea898c..bea1982bf29 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx @@ -34,9 +34,5 @@ export default function DatasourcePanelDragWrapper( }, }); - return ( - <> -
{props.children}
- - ); + return
{props.children}
; } diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx index 53e22b3d415..7f5d8f31026 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx @@ -19,7 +19,7 @@ import React, { useState } from 'react'; import { useDrop } from 'react-dnd'; import { isEmpty } from 'lodash'; -import { t, withTheme, SupersetTheme } from '@superset-ui/core'; +import { t, useTheme } from '@superset-ui/core'; import { BaseControlConfig, ColumnMeta } from '@superset-ui/chart-controls'; import ControlHeader from 'src/explore/components/ControlHeader'; import { @@ -40,10 +40,10 @@ interface LabelProps extends BaseControlConfig { value: string[] | string | null; onChange: (value: string[] | string | null) => void; options: { string: ColumnMeta }; - theme: SupersetTheme; } -function DndColumnSelectLabel(props: LabelProps) { +export default function DndColumnSelectLabel(props: LabelProps) { + const theme = useTheme(); const { value, options } = props; const optionSelector = new OptionSelector(options, value); const [groupByOptions, setGroupByOptions] = useState( @@ -83,7 +83,7 @@ function DndColumnSelectLabel(props: LabelProps) { function placeHolderRenderer() { return ( - + {t('Drop Columns')} ); @@ -102,17 +102,13 @@ function DndColumnSelectLabel(props: LabelProps) { } return ( - <> -
- - - - - {isEmpty(groupByOptions) ? placeHolderRenderer() : optionsRenderer()} - -
- +
+ + + + + {isEmpty(groupByOptions) ? placeHolderRenderer() : optionsRenderer()} + +
); } - -export default withTheme(DndColumnSelectLabel); diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/Option.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/Option.tsx index a8eddf42aab..22cbb037a13 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/Option.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/Option.tsx @@ -17,7 +17,7 @@ * under the License. */ import React from 'react'; -import { withTheme } from '@superset-ui/core'; +import { useTheme } from '@superset-ui/core'; import { ColumnOption } from '@superset-ui/chart-controls'; import Icon from 'src/components/Icon'; import { @@ -28,7 +28,9 @@ import { } from 'src/explore/components/OptionControls'; import { OptionProps } from '../types'; -function Option(props: OptionProps) { +export default function Option(props: OptionProps) { + const theme = useTheme(); + return ( props.clickClose(props.index)} > - + {props.withCaret && ( - + )} ); } - -export default withTheme(Option); diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/OptionWrapper.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/OptionWrapper.tsx index 4074022cbf9..13e18aadcfb 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/OptionWrapper.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/components/OptionWrapper.tsx @@ -25,13 +25,9 @@ import { } from 'react-dnd'; import { DragContainer } from 'src/explore/components/OptionControls'; import Option from './Option'; -import { - OptionWrapperProps, - GroupByItemInterface, - GroupByItemType, -} from '../types'; +import { OptionProps, GroupByItemInterface, GroupByItemType } from '../types'; -export default function OptionWrapper(props: OptionWrapperProps) { +export default function OptionWrapper(props: OptionProps) { const { index, onShiftOptions } = props; const ref = useRef(null); diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/types.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/types.ts index a361a305910..450956fabc2 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/types.ts +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/types.ts @@ -16,10 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { SupersetTheme } from '@superset-ui/core'; import { ColumnMeta } from '@superset-ui/chart-controls'; -export interface OptionWrapperProps { +export interface OptionProps { column: ColumnMeta; index: number; clickClose: (index: number) => void; @@ -27,10 +26,6 @@ export interface OptionWrapperProps { withCaret?: boolean; } -export interface OptionProps extends OptionWrapperProps { - theme: SupersetTheme; -} - export const GroupByItemType = 'groupByItem'; export interface GroupByItemInterface { From 671eaedf0a182d514e489f88ac22af954aaa465f Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Wed, 24 Feb 2021 17:38:20 +0800 Subject: [PATCH 16/22] added indicator --- .../DatasourcePanelDragWrapper.tsx | 19 ++++++++++++++++++- .../src/explore/components/OptionControls.tsx | 17 +++++++++++++++++ .../DndColumnSelectLabel.tsx | 11 ++++++----- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx index bea1982bf29..d5a346d735e 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel/DatasourcePanelDragWrapper.tsx @@ -18,8 +18,21 @@ */ import React, { ReactNode } from 'react'; import { useDrag } from 'react-dnd'; +import { styled } from '@superset-ui/core'; import { DatasourcePanelDndItem } from './types'; +const DatasourceItemContainer = styled.div` + display: flex; + align-items: center; + width: 100%; + height: ${({ theme }) => theme.gridUnit * 6}px; + cursor: pointer; + + :hover { + background-color: ${({ theme }) => theme.colors.grayscale.light2}; + } +`; + interface DatasourcePanelDragWrapperProps extends DatasourcePanelDndItem { children?: ReactNode; } @@ -34,5 +47,9 @@ export default function DatasourcePanelDragWrapper( }, }); - return
{props.children}
; + return ( + + {props.children} + + ); } diff --git a/superset-frontend/src/explore/components/OptionControls.tsx b/superset-frontend/src/explore/components/OptionControls.tsx index db86c0efd6b..d0053f41790 100644 --- a/superset-frontend/src/explore/components/OptionControls.tsx +++ b/superset-frontend/src/explore/components/OptionControls.tsx @@ -92,6 +92,23 @@ export const LabelsContainer = styled.div` border-radius: ${({ theme }) => theme.gridUnit}px; `; +export const DndLabelsContainer = styled.div<{ + canDrop?: boolean; + isOver?: boolean; +}>` + padding: ${({ theme }) => theme.gridUnit}px; + border: ${({ canDrop, isOver, theme }) => { + if (isOver && canDrop) { + return `dashed 1px ${theme.colors.info.dark1}`; + } + if (isOver && !canDrop) { + return `dashed 1px ${theme.colors.error.dark1}`; + } + return `solid 1px ${theme.colors.grayscale.light2}`; + }}; + border-radius: ${({ theme }) => theme.gridUnit}px; +`; + export const AddControlLabel = styled.div<{ cancelHover?: boolean; }>` diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx index 7f5d8f31026..c313864de7c 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx @@ -24,12 +24,12 @@ import { BaseControlConfig, ColumnMeta } from '@superset-ui/chart-controls'; import ControlHeader from 'src/explore/components/ControlHeader'; import { AddControlLabel, + DndLabelsContainer, HeaderContainer, - LabelsContainer, } from 'src/explore/components/OptionControls'; import { - DatasourcePanelDndType, DatasourcePanelDndItem, + DatasourcePanelDndType, } from 'src/explore/components/DatasourcePanel/types'; import Icon from 'src/components/Icon'; import OptionWrapper from './components/OptionWrapper'; @@ -50,7 +50,7 @@ export default function DndColumnSelectLabel(props: LabelProps) { optionSelector.groupByOptions, ); - const [, datasourcePanelDrop] = useDrop({ + const [{ isOver, canDrop }, datasourcePanelDrop] = useDrop({ accept: DatasourcePanelDndType.COLUMN, drop: (item: DatasourcePanelDndItem) => { @@ -65,6 +65,7 @@ export default function DndColumnSelectLabel(props: LabelProps) { collect: monitor => ({ isOver: monitor.isOver(), canDrop: monitor.canDrop(), + type: monitor.getItemType(), }), }); @@ -106,9 +107,9 @@ export default function DndColumnSelectLabel(props: LabelProps) { - + {isEmpty(groupByOptions) ? placeHolderRenderer() : optionsRenderer()} - + ); } From 49989ea18195f27a361b59235104e503ce0abac8 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Wed, 24 Feb 2021 20:51:35 +0800 Subject: [PATCH 17/22] replace value when column is scalcar --- .../DndColumnSelectLabel.tsx | 6 +++++- .../utils/optionSelector.ts | 17 ++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx index c313864de7c..768a193591b 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx @@ -54,7 +54,11 @@ export default function DndColumnSelectLabel(props: LabelProps) { accept: DatasourcePanelDndType.COLUMN, drop: (item: DatasourcePanelDndItem) => { - optionSelector.add(item.metricOrColumnName); + if (optionSelector.isScalar && !isEmpty(optionSelector.groupByOptions)) { + optionSelector.replace(0, item.metricOrColumnName); + } else { + optionSelector.add(item.metricOrColumnName); + } setGroupByOptions(optionSelector.groupByOptions); props.onChange(optionSelector.getValues()); }, diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts index 8eb5bcfb6bb..18bcf6e415a 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts @@ -23,7 +23,7 @@ export class OptionSelector { options: { string: ColumnMeta }; - scalar: boolean; + isScalar: boolean; constructor( options: { string: ColumnMeta }, @@ -33,10 +33,10 @@ export class OptionSelector { let groupByValues: string[]; if (Array.isArray(values)) { groupByValues = values; - this.scalar = false; + this.isScalar = false; } else { groupByValues = values ? [values] : []; - this.scalar = true; + this.isScalar = true; } this.groupByOptions = groupByValues .map(value => { @@ -58,6 +58,12 @@ export class OptionSelector { this.groupByOptions.splice(idx, 1); } + replace(idx: number, value: string) { + if (this.groupByOptions[idx]) { + this.groupByOptions[idx] = this.options[value]; + } + } + swap(a: number, b: number) { [this.groupByOptions[a], this.groupByOptions[b]] = [ this.groupByOptions[b], @@ -66,14 +72,11 @@ export class OptionSelector { } has(groupBy: string): boolean { - if (this.scalar) { - return !!this.getValues(); - } return !!this.getValues()?.includes(groupBy); } getValues(): string[] | string | null { - if (this.scalar) { + if (this.isScalar) { return this.groupByOptions.length > 0 ? this.groupByOptions[0].column_name : null; From 64f8d4d84ef5fa5a025edd8dcb5b1193cacec10f Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Thu, 25 Feb 2021 09:57:08 +0800 Subject: [PATCH 18/22] scalar to isArray --- .../DndColumnSelectControl/utils/optionSelector.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts index 18bcf6e415a..7b5039ac03a 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts @@ -23,7 +23,7 @@ export class OptionSelector { options: { string: ColumnMeta }; - isScalar: boolean; + isArray: boolean; constructor( options: { string: ColumnMeta }, @@ -33,10 +33,10 @@ export class OptionSelector { let groupByValues: string[]; if (Array.isArray(values)) { groupByValues = values; - this.isScalar = false; + this.isArray = false; } else { groupByValues = values ? [values] : []; - this.isScalar = true; + this.isArray = true; } this.groupByOptions = groupByValues .map(value => { @@ -76,7 +76,7 @@ export class OptionSelector { } getValues(): string[] | string | null { - if (this.isScalar) { + if (this.isArray) { return this.groupByOptions.length > 0 ? this.groupByOptions[0].column_name : null; From 41126f661dce09c317c27264349397b04da60e2c Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Thu, 25 Feb 2021 10:02:57 +0800 Subject: [PATCH 19/22] var rename --- .../controls/DndColumnSelectControl/DndColumnSelectLabel.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx index 768a193591b..1e1b0156ec5 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx @@ -54,7 +54,7 @@ export default function DndColumnSelectLabel(props: LabelProps) { accept: DatasourcePanelDndType.COLUMN, drop: (item: DatasourcePanelDndItem) => { - if (optionSelector.isScalar && !isEmpty(optionSelector.groupByOptions)) { + if (optionSelector.isArray && !isEmpty(optionSelector.groupByOptions)) { optionSelector.replace(0, item.metricOrColumnName); } else { optionSelector.add(item.metricOrColumnName); From 44d2bec7cf1c2d591be74f51eb8454619e4dc001 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Thu, 25 Feb 2021 19:29:54 +0800 Subject: [PATCH 20/22] minor fix --- .../DndColumnSelectControl/DndColumnSelectLabel.tsx | 2 +- .../controls/DndColumnSelectControl/utils/optionSelector.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx index 1e1b0156ec5..9c3fe06c00b 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx @@ -54,7 +54,7 @@ export default function DndColumnSelectLabel(props: LabelProps) { accept: DatasourcePanelDndType.COLUMN, drop: (item: DatasourcePanelDndItem) => { - if (optionSelector.isArray && !isEmpty(optionSelector.groupByOptions)) { + if (!optionSelector.isArray && !isEmpty(optionSelector.groupByOptions)) { optionSelector.replace(0, item.metricOrColumnName); } else { optionSelector.add(item.metricOrColumnName); diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts index 7b5039ac03a..eb885e6df64 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts @@ -33,10 +33,10 @@ export class OptionSelector { let groupByValues: string[]; if (Array.isArray(values)) { groupByValues = values; - this.isArray = false; + this.isArray = true; } else { groupByValues = values ? [values] : []; - this.isArray = true; + this.isArray = false; } this.groupByOptions = groupByValues .map(value => { @@ -76,7 +76,7 @@ export class OptionSelector { } getValues(): string[] | string | null { - if (this.isArray) { + if (!this.isArray) { return this.groupByOptions.length > 0 ? this.groupByOptions[0].column_name : null; From 1854cd783c2cd9659f9e6a427062ec6b4f785fe4 Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 26 Feb 2021 15:08:38 +0800 Subject: [PATCH 21/22] update dependence --- superset-frontend/package-lock.json | 691 +++++++++--------- superset-frontend/package.json | 56 +- .../FilterControl/AdhocFilterControl.jsx | 2 +- 3 files changed, 360 insertions(+), 389 deletions(-) diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index 2e2f420eaae..0f74a842b12 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -13,34 +13,34 @@ "@babel/runtime-corejs3": "^7.12.5", "@data-ui/sparkline": "^0.0.84", "@emotion/core": "^10.0.35", - "@superset-ui/chart-controls": "^0.17.10", - "@superset-ui/core": "^0.17.10", - "@superset-ui/legacy-plugin-chart-calendar": "^0.17.10", - "@superset-ui/legacy-plugin-chart-chord": "^0.17.10", - "@superset-ui/legacy-plugin-chart-country-map": "^0.17.10", - "@superset-ui/legacy-plugin-chart-event-flow": "^0.17.10", - "@superset-ui/legacy-plugin-chart-force-directed": "^0.17.10", - "@superset-ui/legacy-plugin-chart-heatmap": "^0.17.10", - "@superset-ui/legacy-plugin-chart-histogram": "^0.17.10", - "@superset-ui/legacy-plugin-chart-horizon": "^0.17.10", - "@superset-ui/legacy-plugin-chart-map-box": "^0.17.10", - "@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.10", - "@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.10", - "@superset-ui/legacy-plugin-chart-partition": "^0.17.10", - "@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.10", - "@superset-ui/legacy-plugin-chart-rose": "^0.17.10", - "@superset-ui/legacy-plugin-chart-sankey": "^0.17.10", - "@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.10", - "@superset-ui/legacy-plugin-chart-sunburst": "^0.17.10", - "@superset-ui/legacy-plugin-chart-treemap": "^0.17.10", - "@superset-ui/legacy-plugin-chart-world-map": "^0.17.10", - "@superset-ui/legacy-preset-chart-big-number": "^0.17.10", - "@superset-ui/legacy-preset-chart-deckgl": "^0.4.2", - "@superset-ui/legacy-preset-chart-nvd3": "^0.17.10", - "@superset-ui/plugin-chart-echarts": "^0.17.10", - "@superset-ui/plugin-chart-table": "^0.17.10", - "@superset-ui/plugin-chart-word-cloud": "^0.17.10", - "@superset-ui/preset-chart-xy": "^0.17.10", + "@superset-ui/chart-controls": "^0.17.12", + "@superset-ui/core": "^0.17.11", + "@superset-ui/legacy-plugin-chart-calendar": "^0.17.12", + "@superset-ui/legacy-plugin-chart-chord": "^0.17.12", + "@superset-ui/legacy-plugin-chart-country-map": "^0.17.12", + "@superset-ui/legacy-plugin-chart-event-flow": "^0.17.12", + "@superset-ui/legacy-plugin-chart-force-directed": "^0.17.12", + "@superset-ui/legacy-plugin-chart-heatmap": "^0.17.12", + "@superset-ui/legacy-plugin-chart-histogram": "^0.17.12", + "@superset-ui/legacy-plugin-chart-horizon": "^0.17.12", + "@superset-ui/legacy-plugin-chart-map-box": "^0.17.12", + "@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.12", + "@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.12", + "@superset-ui/legacy-plugin-chart-partition": "^0.17.12", + "@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.12", + "@superset-ui/legacy-plugin-chart-rose": "^0.17.12", + "@superset-ui/legacy-plugin-chart-sankey": "^0.17.12", + "@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.12", + "@superset-ui/legacy-plugin-chart-sunburst": "^0.17.12", + "@superset-ui/legacy-plugin-chart-treemap": "^0.17.12", + "@superset-ui/legacy-plugin-chart-world-map": "^0.17.12", + "@superset-ui/legacy-preset-chart-big-number": "^0.17.12", + "@superset-ui/legacy-preset-chart-deckgl": "^0.4.6", + "@superset-ui/legacy-preset-chart-nvd3": "^0.17.12", + "@superset-ui/plugin-chart-echarts": "^0.17.12", + "@superset-ui/plugin-chart-table": "^0.17.12", + "@superset-ui/plugin-chart-word-cloud": "^0.17.12", + "@superset-ui/preset-chart-xy": "^0.17.12", "@vx/responsive": "^0.0.195", "abortcontroller-polyfill": "^1.1.9", "antd": "^4.9.4", @@ -303,8 +303,6 @@ "integrity": "sha512-+y4ZnePpvWs1fc/LhZRTHkTesbXkyBYuOB+5CyodZqrEuETXi3zOVfpAQIdgC3lXbHLTDG9dQosxR9BhvLKDLQ==", "dev": true, "dependencies": { - "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents", - "chokidar": "^3.4.0", "commander": "^4.0.1", "convert-source-map": "^1.1.0", "fs-readdir-recursive": "^1.1.0", @@ -7110,7 +7108,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -7714,7 +7711,6 @@ "jest-resolve": "^26.6.2", "jest-util": "^26.6.2", "jest-worker": "^26.6.2", - "node-notifier": "^8.0.0", "slash": "^3.0.0", "source-map": "^0.6.0", "string-length": "^4.0.1", @@ -7903,7 +7899,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -8335,7 +8330,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -10122,8 +10116,7 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -10805,9 +10798,6 @@ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.22.0.tgz", "integrity": "sha512-lLJ/Wt9yy0AiSYBf212kK3mM5L8ycwlyTlSxHBAneXLR0nzFMlZ5y7riFPF3E33zXOF2IH95xdY5jIyZbM9z/w==", "dev": true, - "dependencies": { - "clipboard": "^2.0.0" - }, "optionalDependencies": { "clipboard": "^2.0.0" } @@ -14134,11 +14124,11 @@ } }, "node_modules/@superset-ui/chart-controls": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.10.tgz", - "integrity": "sha512-KnvTV1oE28gkeAy4rJuGhykDzrUUhtEDE4cRj0ySB2xxvh7NsYYMjoDwVCmO3hsAGTsM2Mwd/n1bKSH45ZrVig==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.12.tgz", + "integrity": "sha512-2IMaFR6sU8IM8TyGb3km8RMkkVp3zhqIMA11OI0pb8lyBJIxdbz8wpGoASpHCCBRhLyt7U0TV7yOePotFGklbw==", "dependencies": { - "@superset-ui/core": "0.17.10", + "@superset-ui/core": "0.17.11", "lodash": "^4.17.15", "prop-types": "^15.7.2" }, @@ -14151,9 +14141,9 @@ } }, "node_modules/@superset-ui/core": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.17.10.tgz", - "integrity": "sha512-tcHU2fJ7vxk5NwbQudlAykkfaIOIpGe0kSa0wQdn2AnffIAUt5Ueq8RHlrH4HKU5rGD8aJs/CzUsDiipkof/Ow==", + "version": "0.17.11", + "resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.17.11.tgz", + "integrity": "sha512-PNJAHjQMELyn8MADB5lp9jDx9SwgxMwR5e2SZDq0vBrcg+LNZCgvkptwXZ7bOTbTwavPVEWgwXa1A9v2TKvFRA==", "dependencies": { "@babel/runtime": "^7.1.2", "@emotion/core": "^10.0.28", @@ -14242,12 +14232,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-calendar": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.10.tgz", - "integrity": "sha512-kWpvIpvKRYcvOnv8uQDoIgADj3ZRnlx2/PV2U9ji7vbPFJZVth7VeUpYw7fEOJfTeiLPruqRJ8EesRY1iVMYxw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.12.tgz", + "integrity": "sha512-NYf5x3e4AIPeqmyq1Cog66zn3KgmpGXtwIp4RS2J2CIEWVZmvWaR8Xyjy1HifQWsFpmN+MjGr8L9lag6ejZZeQ==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-array": "^2.0.3", "d3-selection": "^1.4.0", "d3-tip": "^0.9.1", @@ -14266,24 +14256,24 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-chord": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.10.tgz", - "integrity": "sha512-urNihzkh8TH317ZjHH/uDVgez6TQE+/anTJW+FU8+prVXdxM8/6TNwUKtGI9t0dQVMsnK3ex1NlyLfbKkpYzZw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.12.tgz", + "integrity": "sha512-O7hjn02qPhD6qE21B6/EwvGVtcGDBJHlrcoJRjDhn8G0xNude7bwb0YlEHCZwlmvTinZD12rJv4l994V8/e5fg==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.6.2", "react": "^16.13.1" } }, "node_modules/@superset-ui/legacy-plugin-chart-country-map": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.10.tgz", - "integrity": "sha512-ZIG4dGMj444PgTAMoANGT8M7R3e4UCmkkDZRP33BPbs4RpKa1iXUCZ5Au76RwdDiaVfKsR0tyoXEG+bfa/Hk0Q==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.12.tgz", + "integrity": "sha512-92wIkd1ve5sVz3wEZ1YBGoeUj2dupcpVyIsazT9t3YuEOwa4fuhm8w7FLJ2mS3U791j9KI63RsPM08mssl38sA==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-array": "^2.0.3", "prop-types": "^15.6.2" @@ -14298,13 +14288,13 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-event-flow": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.10.tgz", - "integrity": "sha512-L6n4gYdMAeWWv0jzpwl7UjY8wsei9rebFql3/8AQUjc+og1uK4DmFPTZu23Suqc71I6SNfjTlg8KJZSY89MtDA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.12.tgz", + "integrity": "sha512-zm6udN2qJirAQZhtLnwjOe+xJfKmpYoGRz7zejLOYHTbkqlv7D+GoB0M/GXiEo6vUbV289Cms9KsrsUh7gYvSw==", "dependencies": { "@data-ui/event-flow": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "prop-types": "^15.6.2" }, "peerDependencies": { @@ -14312,12 +14302,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-force-directed": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.10.tgz", - "integrity": "sha512-hauxW3bUDp4KalraRH02Dyw7Vp17MTORrpT8vAyOfyu56IyvXM9rcZa7T/ti12LygXOaBA/r9HmCjshn83hZlQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.12.tgz", + "integrity": "sha512-+2aljLZ6wO7D90l/EhgzsK+CKxOX+ldArovKXyUlBkWozaXBw27cA8I5Rj3tdbwbDMlN/bYxw44hnExVjKTYMQ==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.7.2" }, @@ -14326,12 +14316,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-heatmap": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.10.tgz", - "integrity": "sha512-W+K7gn7iV1PWiSFpTyi2FcFl0GX9EPbVII9RfjjEnlVVXFpNFxmjY+uV7BH/9VCz5125AeUv29xaX1wOo2ChhQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.12.tgz", + "integrity": "sha512-5K+dZ0688mn5KNza/b3SZ6h2d2VxY8gAXKaFBwyPjeabfexg5Sj1Squb5l4p7oTh1FSmLcAty0fXCwZALEh45g==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-svg-legend": "^1.x", "d3-tip": "^0.9.1", @@ -14339,14 +14329,14 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-histogram": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.10.tgz", - "integrity": "sha512-LnLF0xYLin4P8G/L9dotPvFIE9U0qpmHnrqrRBb43vlBYlGa7IDTMhQlx+p5QYGvFK6mUnEEHwTam4WfjugOvA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.12.tgz", + "integrity": "sha512-GNI0fmutspJvdNIDSeiOgXvpFwkqEB48ZiN/lf2/Vpjp1RY5fZDs+I3HlFo0XOveB5SkE2LMwIysO1ex7+ql+g==", "dependencies": { "@data-ui/histogram": "^0.0.84", "@data-ui/theme": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@vx/legend": "^0.0.198", "@vx/responsive": "^0.0.199", "@vx/scale": "^0.0.197", @@ -14415,12 +14405,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-horizon": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.10.tgz", - "integrity": "sha512-Cy5kX+gL4xi6Oe+6w7KTUqU0nZL49x+lYBe4COynW4KAzRMPakBB4MaDaFKjANVxMLK3WzUJgWjg1vfrdlhaQg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.12.tgz", + "integrity": "sha512-YQUMV494vP0Lu4pTdELsdR5CbXzQ78BRX0nxnyBXdXVb5UTxCVgXAhU7Q/eQQv2zJ3OXqUpQian2vCeTxqyvfA==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-array": "^2.0.3", "d3-scale": "^3.0.1", "prop-types": "^15.6.2" @@ -14450,12 +14440,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-map-box": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.10.tgz", - "integrity": "sha512-sS2ir6haVfDM0GhwTpK4pIyT6kUTK41SRFqneOTX8dXoBQ0cQ0T+JniR24emh2a8wk1KUD6lv8Uo7EKfjoGIKw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.12.tgz", + "integrity": "sha512-G0RznxH5LH6dj9mdgLV2Z0MObjruOWCgGqsbItDbo1wi4iR8SuNGHDQgAnv24MlGiMSrp5mOYcUSlzSRFl96KA==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "immutable": "^3.8.2", "mapbox-gl": "^0.53.0", "prop-types": "^15.6.2", @@ -14476,12 +14466,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-paired-t-test": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.10.tgz", - "integrity": "sha512-uNrjMF59WkYcPj3MndnP2Cg7KLw4C9hL8601UIT3jgX4WP5JAd8G8Foq4C3NzIAQich5pS9fn7rVXOmggFTkNA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.12.tgz", + "integrity": "sha512-e5FWzHzKpbB2tf5PabVIw1e7VXiBm+A6G9XvhmqNTLtFSlrQeehtje7pumjo6xYBeYwGcXJTLpgaQmplWaJ72w==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "distributions": "^1.0.0", "prop-types": "^15.6.2", "reactable": "^1.1.0" @@ -14491,12 +14481,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-parallel-coordinates": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.10.tgz", - "integrity": "sha512-GRcW+CFPugGUxLBi/X41x0xoXYgySqeBKHjoy8YSy4epoQfB401IX1urr2EUi0ajYycxElv6NMBaE4ymuSxYjA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.12.tgz", + "integrity": "sha512-34vtDU3bMwNQk6dst6uC+4R5MwZ6VoUs6y+I5ZdqcLZj1uiu4TPvcOyPKzvXvtOBXkWmb6CKMagWXeg0Lei/Sg==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.7.2" }, @@ -14505,12 +14495,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-partition": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.10.tgz", - "integrity": "sha512-L4hl4zxl5Vc0ZFELaYnJYCvYlxP9PxuF+ANTA7jstbZ5sDKcvaI+yJQdcI+6408HId42qoWGqa2K53F+SW3IGw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.12.tgz", + "integrity": "sha512-4qSUzL5z3UwWjRpCIdSgwrjaHmj29rDzaPm77Aq0DVqNBTqk9dvQcwPeQPYjR/TrfuMB9jJ3rJYZqPI5F42lnw==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-hierarchy": "^1.1.8", "prop-types": "^15.6.2" @@ -14520,24 +14510,24 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-pivot-table": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.10.tgz", - "integrity": "sha512-3lQrDnFNRNaYnI7vpFUNnuvMkmoFBCGlmS3sPUIcyh9VMeXJra3IzMERXWlj1c6PROeYw7vfKbjzJrlnTaikpQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.12.tgz", + "integrity": "sha512-DgMVuUd/G1gUOg2mzqp+0GB0V9ri6o+bGijW37rISjqyDHpwbYUMaWp/64/thjNfYa/D0x6OgGqai6/kdzPutA==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "datatables.net-bs": "^1.10.15", "prop-types": "^15.6.2" } }, "node_modules/@superset-ui/legacy-plugin-chart-rose": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.10.tgz", - "integrity": "sha512-7NxQDBiMsMhdzw6TPGUqK1qmkOGuDA8p1N1kg+79vsQpIY1yfuSDExLX0Ix6fzIoT5ZYEZpRI61xHIOCkWdD2w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.12.tgz", + "integrity": "sha512-ZIxSf153T4MW6Nbsld41TIk04sxwqA7d9EhL7NutAkN7yGgz8/dtlNvt2JfAQCVLbJnrH2b7xR+4FDYd+/ks2g==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "nvd3": "1.8.6", "prop-types": "^15.6.2" @@ -14547,12 +14537,12 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-sankey": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.10.tgz", - "integrity": "sha512-sgKD0OKBI0iKVsCAuA5epaGhEoB2hv3qgBqtzCcgdxGI/QVUZ8CwdPFVAbU4gXgLxezAUiM+XSXzs42Z3W1UiA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.12.tgz", + "integrity": "sha512-Wj3qLsN9Chfe6mvjRK7c9OfAeQij+JL0qDz01fa9FNKxMjNNi7eZkRb4mH6CkfYxJlLWjpVx1anInz+aCaoj4Q==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-sankey": "^0.4.2", "prop-types": "^15.6.2" @@ -14562,47 +14552,47 @@ } }, "node_modules/@superset-ui/legacy-plugin-chart-sankey-loop": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.10.tgz", - "integrity": "sha512-lYTNlXUIP5ryDjwRNrqZFXGj9LtV3KPEWAJrB9IS0cPU0+D88Nfc3eNnuvxj2xQvpcXztTMrCK9QSpRqOAlC1g==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.12.tgz", + "integrity": "sha512-iqV3phKISwD5o+NniWXa4J5eFmGt03twmFZLAtNXR39AnG4HKHQxB7rwcQPYJA9U4A4TkgxCxQCxyndTb3VmOA==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-sankey-diagram": "^0.7.3", "d3-selection": "^1.4.0", "prop-types": "^15.6.2" } }, "node_modules/@superset-ui/legacy-plugin-chart-sunburst": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.10.tgz", - "integrity": "sha512-mYldzaWJR7hBrHgpzsFqySwIw8TOi8wmNMa8/0SS9vE3Cj+xhXweQtzmR6KwnU21U1cL+yvENQi0aHs10Kt5GA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.12.tgz", + "integrity": "sha512-Ml7uxXqpaMiTEzXFzM1hLOo5z8yQn3HUiXhV77W9OSjg05Y6uCai+d9TeAKiwLEU0OKCzku8jkOj35Cv5ZMPLg==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.6.2" } }, "node_modules/@superset-ui/legacy-plugin-chart-treemap": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.10.tgz", - "integrity": "sha512-ghQNXUqpDEFJyY9/nnd9RQjeUwgH2JOOW6T8Hmt6qJcF91k3djS7LLSxWNLCCUa1M3bZt3AAxsr4+6b4Y8BAXA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.12.tgz", + "integrity": "sha512-kHoslysbX070nuI1zhYGFKWxS6sldpX0TRuGyDLM4anUApuw7y/+jZeOAu6Ws+T6akkVmJpis0fkKrkbeFFrNQ==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-hierarchy": "^1.1.8", "d3-selection": "^1.4.0", "prop-types": "^15.6.2" } }, "node_modules/@superset-ui/legacy-plugin-chart-world-map": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.10.tgz", - "integrity": "sha512-EvECxrRxL7kVu5LuiIBmaFXIGGJM1q8nXYEdHcA6sJzvLwM55J6lpkLuokHihmTiMdI2qmejQKJ3/omzS+D7yA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.12.tgz", + "integrity": "sha512-9nHlbcdpoUe0vEi7t/QtOcXDxTqz0W3zl2+s4hUNtEsHGdKNrVeir4f3sq1zF+OOLReKHBoL7MFv6cF8JUNMNA==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-array": "^2.4.0", "d3-color": "^1.4.1", @@ -14627,13 +14617,13 @@ "integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q==" }, "node_modules/@superset-ui/legacy-preset-chart-big-number": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.10.tgz", - "integrity": "sha512-Xvpb1gwc5aY9zz1xs3AXoxLvpcGlsh7zaQbt4wU0eXvovdhCPHX0TCaOvY6Q8X8tbM7MeM82hjwOxO16NwJZbA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.12.tgz", + "integrity": "sha512-GQNXqSA827Fch3eNaCaPMYERvWNRdaUqH00Suqq6BG+aYW+rKhIHaYBsY0eF/w1GRfZ+YjAh/yYyY21P+N/hqg==", "dependencies": { "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/d3-color": "^1.2.2", "@types/shortid": "^0.0.29", "d3-color": "^1.2.3", @@ -14644,9 +14634,9 @@ } }, "node_modules/@superset-ui/legacy-preset-chart-deckgl": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-deckgl/-/legacy-preset-chart-deckgl-0.4.2.tgz", - "integrity": "sha512-lr9K0KihVgaCjE72Zu/nd3YoU/q2EDX7qd73y95vzoXBgIA2cMfIkAmEnOe2Komb51ed9hzz0MnudfZHZk1cfw==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-deckgl/-/legacy-preset-chart-deckgl-0.4.6.tgz", + "integrity": "sha512-xXGNj7WQHMA+QpeiHMrinwWhOwskD9ucXoe10AfFFgar9TwvCE6wpgRwnoyF0hjoaXnMqpYyFbzlucCf3WSfVQ==", "dependencies": { "@math.gl/web-mercator": "^3.2.2", "@types/d3-array": "^2.0.0", @@ -14668,19 +14658,19 @@ "xss": "^1.0.6" }, "peerDependencies": { - "@superset-ui/chart-controls": "^0.16.3", - "@superset-ui/core": "^0.16.3", + "@superset-ui/chart-controls": "^0.17.12", + "@superset-ui/core": "^0.17.11", "react": "^15 || ^16" } }, "node_modules/@superset-ui/legacy-preset-chart-nvd3": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.17.10.tgz", - "integrity": "sha512-oCuvPwyZyvQLz5iCpK2coNJWKs4SD7OyGwFCtfmqBabAt1wt1+mZ0/YfQNJygguwDSRz8nWGaRbtMTGvcrfU6w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.17.12.tgz", + "integrity": "sha512-e55scJz7FKnn82vtYSxQIbtNFiN7Ftx5guw76Rcm2hkx2bu2TWTgSq7J/4BuTgaSCZsDEt48PNWIeJsfiu+HFQ==", "dependencies": { "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-tip": "^0.9.1", "dompurify": "^2.0.6", @@ -14697,12 +14687,12 @@ } }, "node_modules/@superset-ui/plugin-chart-echarts": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.10.tgz", - "integrity": "sha512-2bd2VEUShPFG6CUljHNt7pE2diHW8vrbi5DAWgxV3TkVnjCg4g0CCTS6mmxUhLi9gqV6V0jV4XYWvMg3GIPI0w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.12.tgz", + "integrity": "sha512-qMyfxv7XPUc+6k5QzJbhooCv2Jqjq/lS9B3VThU4sMZNuqiPmUPBykl7pdw+1TTX7QOJV73C35jm+YU0FAoL1A==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/mathjs": "^6.0.7", "d3-array": "^1.2.0", "echarts": "^5.0.2", @@ -14713,13 +14703,13 @@ } }, "node_modules/@superset-ui/plugin-chart-table": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.10.tgz", - "integrity": "sha512-9FPypGUeCh8wQeTy3N9R4ewTAkVFb3jGnY7XbSiL3PfZzd0+AgKyA+fBV98IOdXJHJj45uIrREpAzYuKQa58rw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.12.tgz", + "integrity": "sha512-izJkv2rFUAg1aDgLD/nRbgmVw04b6wx5GrbqGjMFv1Y4fR13ZlSgz/QuVVFM7vj9UgQVcz3PA+DNEkiABGKRgA==", "dependencies": { "@emotion/core": "^10.0.28", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/d3-array": "^2.0.0", "@types/react-table": "^7.0.19", "d3-array": "^2.4.0", @@ -14745,12 +14735,12 @@ } }, "node_modules/@superset-ui/plugin-chart-word-cloud": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.10.tgz", - "integrity": "sha512-1Le/sHAve6VRad/uFcGIuNFvvpSx54duhJHnAnZAVwhAgW/OVm+7ohtEPjHvJdsAPZDpWFsgi601UuTDsSUvfw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.12.tgz", + "integrity": "sha512-QIJmig3nC/cdx1Ch06OqOnypYvHnkKzpd+YSj3WMXhEn5p2SRS0mqgM1n56/QvNbJegHi+xEuaZKZ4Cek3409g==", "dependencies": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/d3-cloud": "^1.2.1", "@types/d3-scale": "^2.0.2", "d3-cloud": "^1.2.5", @@ -14784,14 +14774,14 @@ } }, "node_modules/@superset-ui/preset-chart-xy": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.10.tgz", - "integrity": "sha512-ym3zRIjOh+qNB1H1kPRZjmM0woC2Zkr/uhYI0cjpaGgXVr5B0AelT1ntpXQyu+Pse3Tj0XLVWzi+x4ZK79JmyQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.12.tgz", + "integrity": "sha512-UwXjsNKzAhYyjV+NJksr7nQ8YN3RUwzemxkHjpHX7tvIIquci3jqcCVbP8Ml19YxAs9o5gf+i6uUvn4Vtag+qw==", "dependencies": { "@data-ui/theme": "^0.0.84", "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@vx/axis": "^0.0.198", "@vx/legend": "^0.0.198", "@vx/scale": "^0.0.197", @@ -20180,7 +20170,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -21999,7 +21988,6 @@ "anymatch": "^2.0.0", "async-each": "^1.0.0", "braces": "^2.3.0", - "fsevents": "^1.2.2", "glob-parent": "^3.1.0", "inherits": "^2.0.1", "is-binary-path": "^1.0.0", @@ -22761,7 +22749,6 @@ "integrity": "sha512-gnB85c3MGC7Nm9I/FkiasNBOKjOiO1RNuXXarQms37q4QMpWdlbBgD/VnOStA2faG1dpXMv31RFApjX1/QdgWQ==", "dev": true, "dependencies": { - "colors": "^1.1.2", "object-assign": "^4.1.0", "string-width": "^4.2.0" }, @@ -26392,8 +26379,7 @@ "esprima": "^3.1.3", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -32504,7 +32490,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -33270,6 +33255,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -33344,7 +33330,6 @@ "@jest/types": "^24.9.0", "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", - "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", "jest-serializer": "^24.9.0", @@ -34118,7 +34103,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -35765,7 +35749,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -36088,7 +36071,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -36459,7 +36441,6 @@ "@types/node": "*", "anymatch": "^3.0.3", "fb-watchman": "^2.0.0", - "fsevents": "^2.1.2", "graceful-fs": "^4.2.4", "jest-regex-util": "^26.0.0", "jest-serializer": "^26.6.2", @@ -37620,8 +37601,7 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -38142,11 +38122,8 @@ "dependencies": { "errno": "^0.1.1", "graceful-fs": "^4.1.2", - "image-size": "~0.5.0", "make-dir": "^2.1.0", "mime": "^1.4.1", - "native-request": "^1.0.5", - "source-map": "~0.6.0", "tslib": "^1.10.0" }, "bin": { @@ -43855,9 +43832,6 @@ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.23.0.tgz", "integrity": "sha512-c29LVsqOaLbBHuIbsTxaKENh1N2EQBOHaWv7gkHN4dgRbxSREqDnDbtFJYdpPauS4YCplMSNCABQ6Eeor69bAA==", "dev": true, - "dependencies": { - "clipboard": "^2.0.0" - }, "optionalDependencies": { "clipboard": "^2.0.0" } @@ -45192,9 +45166,9 @@ } }, "node_modules/react": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", - "integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==", + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", + "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -45476,7 +45450,6 @@ "dependencies": { "anymatch": "~3.1.1", "braces": "~3.0.2", - "fsevents": "~2.3.1", "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", @@ -46162,20 +46135,23 @@ "dev": true }, "node_modules/react-dom": { - "version": "16.13.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.0.tgz", - "integrity": "sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==", + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", + "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.19.0" + "scheduler": "^0.19.1" + }, + "peerDependencies": { + "react": "^16.14.0" } }, "node_modules/react-dom/node_modules/scheduler": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.0.tgz", - "integrity": "sha512-xowbVaTPe9r7y7RUejcK73/j8tt2jfiyTednOvHbA8JoClvMYCp+r8QegLwK/n8zWQAtZb1fFnER4XLBZXrCxA==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", + "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", "dependencies": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" @@ -46819,9 +46795,6 @@ "version": "1.22.0", "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.22.0.tgz", "integrity": "sha512-lLJ/Wt9yy0AiSYBf212kK3mM5L8ycwlyTlSxHBAneXLR0nzFMlZ5y7riFPF3E33zXOF2IH95xdY5jIyZbM9z/w==", - "dependencies": { - "clipboard": "^2.0.0" - }, "optionalDependencies": { "clipboard": "^2.0.0" } @@ -49759,8 +49732,7 @@ "esprima": "^4.0.1", "estraverse": "^4.2.0", "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" + "optionator": "^0.8.1" }, "bin": { "escodegen": "bin/escodegen.js", @@ -53185,10 +53157,8 @@ "integrity": "sha512-aWAgTW4MoSJzZPAicljkO1hsi1oKj/RRq/OJQh2PKI2UKL04c2Bs+MBOB+BBABHTXJpf9mCwHN7ANCvYsvY2sg==", "dev": true, "dependencies": { - "chokidar": "^3.4.1", "graceful-fs": "^4.1.2", - "neo-async": "^2.5.0", - "watchpack-chokidar2": "^2.0.0" + "neo-async": "^2.5.0" }, "optionalDependencies": { "chokidar": "^3.4.1", @@ -53234,6 +53204,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -54101,7 +54072,6 @@ "anymatch": "^2.0.0", "async-each": "^1.0.1", "braces": "^2.3.2", - "fsevents": "^1.2.7", "glob-parent": "^3.1.0", "inherits": "^2.0.3", "is-binary-path": "^1.0.0", @@ -54280,6 +54250,7 @@ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, + "hasInstallScript": true, "optional": true, "os": [ "darwin" @@ -68531,19 +68502,19 @@ } }, "@superset-ui/chart-controls": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.10.tgz", - "integrity": "sha512-KnvTV1oE28gkeAy4rJuGhykDzrUUhtEDE4cRj0ySB2xxvh7NsYYMjoDwVCmO3hsAGTsM2Mwd/n1bKSH45ZrVig==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/chart-controls/-/chart-controls-0.17.12.tgz", + "integrity": "sha512-2IMaFR6sU8IM8TyGb3km8RMkkVp3zhqIMA11OI0pb8lyBJIxdbz8wpGoASpHCCBRhLyt7U0TV7yOePotFGklbw==", "requires": { - "@superset-ui/core": "0.17.10", + "@superset-ui/core": "0.17.11", "lodash": "^4.17.15", "prop-types": "^15.7.2" } }, "@superset-ui/core": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.17.10.tgz", - "integrity": "sha512-tcHU2fJ7vxk5NwbQudlAykkfaIOIpGe0kSa0wQdn2AnffIAUt5Ueq8RHlrH4HKU5rGD8aJs/CzUsDiipkof/Ow==", + "version": "0.17.11", + "resolved": "https://registry.npmjs.org/@superset-ui/core/-/core-0.17.11.tgz", + "integrity": "sha512-PNJAHjQMELyn8MADB5lp9jDx9SwgxMwR5e2SZDq0vBrcg+LNZCgvkptwXZ7bOTbTwavPVEWgwXa1A9v2TKvFRA==", "requires": { "@babel/runtime": "^7.1.2", "@emotion/core": "^10.0.28", @@ -68626,12 +68597,12 @@ } }, "@superset-ui/legacy-plugin-chart-calendar": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.10.tgz", - "integrity": "sha512-kWpvIpvKRYcvOnv8uQDoIgADj3ZRnlx2/PV2U9ji7vbPFJZVth7VeUpYw7fEOJfTeiLPruqRJ8EesRY1iVMYxw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-calendar/-/legacy-plugin-chart-calendar-0.17.12.tgz", + "integrity": "sha512-NYf5x3e4AIPeqmyq1Cog66zn3KgmpGXtwIp4RS2J2CIEWVZmvWaR8Xyjy1HifQWsFpmN+MjGr8L9lag6ejZZeQ==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-array": "^2.0.3", "d3-selection": "^1.4.0", "d3-tip": "^0.9.1", @@ -68649,24 +68620,24 @@ } }, "@superset-ui/legacy-plugin-chart-chord": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.10.tgz", - "integrity": "sha512-urNihzkh8TH317ZjHH/uDVgez6TQE+/anTJW+FU8+prVXdxM8/6TNwUKtGI9t0dQVMsnK3ex1NlyLfbKkpYzZw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-chord/-/legacy-plugin-chart-chord-0.17.12.tgz", + "integrity": "sha512-O7hjn02qPhD6qE21B6/EwvGVtcGDBJHlrcoJRjDhn8G0xNude7bwb0YlEHCZwlmvTinZD12rJv4l994V8/e5fg==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.6.2", "react": "^16.13.1" } }, "@superset-ui/legacy-plugin-chart-country-map": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.10.tgz", - "integrity": "sha512-ZIG4dGMj444PgTAMoANGT8M7R3e4UCmkkDZRP33BPbs4RpKa1iXUCZ5Au76RwdDiaVfKsR0tyoXEG+bfa/Hk0Q==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-country-map/-/legacy-plugin-chart-country-map-0.17.12.tgz", + "integrity": "sha512-92wIkd1ve5sVz3wEZ1YBGoeUj2dupcpVyIsazT9t3YuEOwa4fuhm8w7FLJ2mS3U791j9KI63RsPM08mssl38sA==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-array": "^2.0.3", "prop-types": "^15.6.2" @@ -68683,34 +68654,34 @@ } }, "@superset-ui/legacy-plugin-chart-event-flow": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.10.tgz", - "integrity": "sha512-L6n4gYdMAeWWv0jzpwl7UjY8wsei9rebFql3/8AQUjc+og1uK4DmFPTZu23Suqc71I6SNfjTlg8KJZSY89MtDA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-event-flow/-/legacy-plugin-chart-event-flow-0.17.12.tgz", + "integrity": "sha512-zm6udN2qJirAQZhtLnwjOe+xJfKmpYoGRz7zejLOYHTbkqlv7D+GoB0M/GXiEo6vUbV289Cms9KsrsUh7gYvSw==", "requires": { "@data-ui/event-flow": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-force-directed": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.10.tgz", - "integrity": "sha512-hauxW3bUDp4KalraRH02Dyw7Vp17MTORrpT8vAyOfyu56IyvXM9rcZa7T/ti12LygXOaBA/r9HmCjshn83hZlQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-force-directed/-/legacy-plugin-chart-force-directed-0.17.12.tgz", + "integrity": "sha512-+2aljLZ6wO7D90l/EhgzsK+CKxOX+ldArovKXyUlBkWozaXBw27cA8I5Rj3tdbwbDMlN/bYxw44hnExVjKTYMQ==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.7.2" } }, "@superset-ui/legacy-plugin-chart-heatmap": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.10.tgz", - "integrity": "sha512-W+K7gn7iV1PWiSFpTyi2FcFl0GX9EPbVII9RfjjEnlVVXFpNFxmjY+uV7BH/9VCz5125AeUv29xaX1wOo2ChhQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-heatmap/-/legacy-plugin-chart-heatmap-0.17.12.tgz", + "integrity": "sha512-5K+dZ0688mn5KNza/b3SZ6h2d2VxY8gAXKaFBwyPjeabfexg5Sj1Squb5l4p7oTh1FSmLcAty0fXCwZALEh45g==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-svg-legend": "^1.x", "d3-tip": "^0.9.1", @@ -68718,14 +68689,14 @@ } }, "@superset-ui/legacy-plugin-chart-histogram": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.10.tgz", - "integrity": "sha512-LnLF0xYLin4P8G/L9dotPvFIE9U0qpmHnrqrRBb43vlBYlGa7IDTMhQlx+p5QYGvFK6mUnEEHwTam4WfjugOvA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-histogram/-/legacy-plugin-chart-histogram-0.17.12.tgz", + "integrity": "sha512-GNI0fmutspJvdNIDSeiOgXvpFwkqEB48ZiN/lf2/Vpjp1RY5fZDs+I3HlFo0XOveB5SkE2LMwIysO1ex7+ql+g==", "requires": { "@data-ui/histogram": "^0.0.84", "@data-ui/theme": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@vx/legend": "^0.0.198", "@vx/responsive": "^0.0.199", "@vx/scale": "^0.0.197", @@ -68793,12 +68764,12 @@ } }, "@superset-ui/legacy-plugin-chart-horizon": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.10.tgz", - "integrity": "sha512-Cy5kX+gL4xi6Oe+6w7KTUqU0nZL49x+lYBe4COynW4KAzRMPakBB4MaDaFKjANVxMLK3WzUJgWjg1vfrdlhaQg==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-horizon/-/legacy-plugin-chart-horizon-0.17.12.tgz", + "integrity": "sha512-YQUMV494vP0Lu4pTdELsdR5CbXzQ78BRX0nxnyBXdXVb5UTxCVgXAhU7Q/eQQv2zJ3OXqUpQian2vCeTxqyvfA==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-array": "^2.0.3", "d3-scale": "^3.0.1", "prop-types": "^15.6.2" @@ -68827,12 +68798,12 @@ } }, "@superset-ui/legacy-plugin-chart-map-box": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.10.tgz", - "integrity": "sha512-sS2ir6haVfDM0GhwTpK4pIyT6kUTK41SRFqneOTX8dXoBQ0cQ0T+JniR24emh2a8wk1KUD6lv8Uo7EKfjoGIKw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-map-box/-/legacy-plugin-chart-map-box-0.17.12.tgz", + "integrity": "sha512-G0RznxH5LH6dj9mdgLV2Z0MObjruOWCgGqsbItDbo1wi4iR8SuNGHDQgAnv24MlGiMSrp5mOYcUSlzSRFl96KA==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "immutable": "^3.8.2", "mapbox-gl": "^0.53.0", "prop-types": "^15.6.2", @@ -68849,118 +68820,118 @@ } }, "@superset-ui/legacy-plugin-chart-paired-t-test": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.10.tgz", - "integrity": "sha512-uNrjMF59WkYcPj3MndnP2Cg7KLw4C9hL8601UIT3jgX4WP5JAd8G8Foq4C3NzIAQich5pS9fn7rVXOmggFTkNA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-paired-t-test/-/legacy-plugin-chart-paired-t-test-0.17.12.tgz", + "integrity": "sha512-e5FWzHzKpbB2tf5PabVIw1e7VXiBm+A6G9XvhmqNTLtFSlrQeehtje7pumjo6xYBeYwGcXJTLpgaQmplWaJ72w==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "distributions": "^1.0.0", "prop-types": "^15.6.2", "reactable": "^1.1.0" } }, "@superset-ui/legacy-plugin-chart-parallel-coordinates": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.10.tgz", - "integrity": "sha512-GRcW+CFPugGUxLBi/X41x0xoXYgySqeBKHjoy8YSy4epoQfB401IX1urr2EUi0ajYycxElv6NMBaE4ymuSxYjA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-parallel-coordinates/-/legacy-plugin-chart-parallel-coordinates-0.17.12.tgz", + "integrity": "sha512-34vtDU3bMwNQk6dst6uC+4R5MwZ6VoUs6y+I5ZdqcLZj1uiu4TPvcOyPKzvXvtOBXkWmb6CKMagWXeg0Lei/Sg==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.7.2" } }, "@superset-ui/legacy-plugin-chart-partition": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.10.tgz", - "integrity": "sha512-L4hl4zxl5Vc0ZFELaYnJYCvYlxP9PxuF+ANTA7jstbZ5sDKcvaI+yJQdcI+6408HId42qoWGqa2K53F+SW3IGw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-partition/-/legacy-plugin-chart-partition-0.17.12.tgz", + "integrity": "sha512-4qSUzL5z3UwWjRpCIdSgwrjaHmj29rDzaPm77Aq0DVqNBTqk9dvQcwPeQPYjR/TrfuMB9jJ3rJYZqPI5F42lnw==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-hierarchy": "^1.1.8", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-pivot-table": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.10.tgz", - "integrity": "sha512-3lQrDnFNRNaYnI7vpFUNnuvMkmoFBCGlmS3sPUIcyh9VMeXJra3IzMERXWlj1c6PROeYw7vfKbjzJrlnTaikpQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-pivot-table/-/legacy-plugin-chart-pivot-table-0.17.12.tgz", + "integrity": "sha512-DgMVuUd/G1gUOg2mzqp+0GB0V9ri6o+bGijW37rISjqyDHpwbYUMaWp/64/thjNfYa/D0x6OgGqai6/kdzPutA==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "datatables.net-bs": "^1.10.15", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-rose": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.10.tgz", - "integrity": "sha512-7NxQDBiMsMhdzw6TPGUqK1qmkOGuDA8p1N1kg+79vsQpIY1yfuSDExLX0Ix6fzIoT5ZYEZpRI61xHIOCkWdD2w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-rose/-/legacy-plugin-chart-rose-0.17.12.tgz", + "integrity": "sha512-ZIxSf153T4MW6Nbsld41TIk04sxwqA7d9EhL7NutAkN7yGgz8/dtlNvt2JfAQCVLbJnrH2b7xR+4FDYd+/ks2g==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "nvd3": "1.8.6", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-sankey": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.10.tgz", - "integrity": "sha512-sgKD0OKBI0iKVsCAuA5epaGhEoB2hv3qgBqtzCcgdxGI/QVUZ8CwdPFVAbU4gXgLxezAUiM+XSXzs42Z3W1UiA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey/-/legacy-plugin-chart-sankey-0.17.12.tgz", + "integrity": "sha512-Wj3qLsN9Chfe6mvjRK7c9OfAeQij+JL0qDz01fa9FNKxMjNNi7eZkRb4mH6CkfYxJlLWjpVx1anInz+aCaoj4Q==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-sankey": "^0.4.2", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-sankey-loop": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.10.tgz", - "integrity": "sha512-lYTNlXUIP5ryDjwRNrqZFXGj9LtV3KPEWAJrB9IS0cPU0+D88Nfc3eNnuvxj2xQvpcXztTMrCK9QSpRqOAlC1g==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sankey-loop/-/legacy-plugin-chart-sankey-loop-0.17.12.tgz", + "integrity": "sha512-iqV3phKISwD5o+NniWXa4J5eFmGt03twmFZLAtNXR39AnG4HKHQxB7rwcQPYJA9U4A4TkgxCxQCxyndTb3VmOA==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-sankey-diagram": "^0.7.3", "d3-selection": "^1.4.0", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-sunburst": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.10.tgz", - "integrity": "sha512-mYldzaWJR7hBrHgpzsFqySwIw8TOi8wmNMa8/0SS9vE3Cj+xhXweQtzmR6KwnU21U1cL+yvENQi0aHs10Kt5GA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-sunburst/-/legacy-plugin-chart-sunburst-0.17.12.tgz", + "integrity": "sha512-Ml7uxXqpaMiTEzXFzM1hLOo5z8yQn3HUiXhV77W9OSjg05Y6uCai+d9TeAKiwLEU0OKCzku8jkOj35Cv5ZMPLg==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-treemap": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.10.tgz", - "integrity": "sha512-ghQNXUqpDEFJyY9/nnd9RQjeUwgH2JOOW6T8Hmt6qJcF91k3djS7LLSxWNLCCUa1M3bZt3AAxsr4+6b4Y8BAXA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-treemap/-/legacy-plugin-chart-treemap-0.17.12.tgz", + "integrity": "sha512-kHoslysbX070nuI1zhYGFKWxS6sldpX0TRuGyDLM4anUApuw7y/+jZeOAu6Ws+T6akkVmJpis0fkKrkbeFFrNQ==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3-hierarchy": "^1.1.8", "d3-selection": "^1.4.0", "prop-types": "^15.6.2" } }, "@superset-ui/legacy-plugin-chart-world-map": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.10.tgz", - "integrity": "sha512-EvECxrRxL7kVu5LuiIBmaFXIGGJM1q8nXYEdHcA6sJzvLwM55J6lpkLuokHihmTiMdI2qmejQKJ3/omzS+D7yA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-plugin-chart-world-map/-/legacy-plugin-chart-world-map-0.17.12.tgz", + "integrity": "sha512-9nHlbcdpoUe0vEi7t/QtOcXDxTqz0W3zl2+s4hUNtEsHGdKNrVeir4f3sq1zF+OOLReKHBoL7MFv6cF8JUNMNA==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-array": "^2.4.0", "d3-color": "^1.4.1", @@ -68984,13 +68955,13 @@ } }, "@superset-ui/legacy-preset-chart-big-number": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.10.tgz", - "integrity": "sha512-Xvpb1gwc5aY9zz1xs3AXoxLvpcGlsh7zaQbt4wU0eXvovdhCPHX0TCaOvY6Q8X8tbM7MeM82hjwOxO16NwJZbA==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-big-number/-/legacy-preset-chart-big-number-0.17.12.tgz", + "integrity": "sha512-GQNXqSA827Fch3eNaCaPMYERvWNRdaUqH00Suqq6BG+aYW+rKhIHaYBsY0eF/w1GRfZ+YjAh/yYyY21P+N/hqg==", "requires": { "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/d3-color": "^1.2.2", "@types/shortid": "^0.0.29", "d3-color": "^1.2.3", @@ -68998,9 +68969,9 @@ } }, "@superset-ui/legacy-preset-chart-deckgl": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-deckgl/-/legacy-preset-chart-deckgl-0.4.2.tgz", - "integrity": "sha512-lr9K0KihVgaCjE72Zu/nd3YoU/q2EDX7qd73y95vzoXBgIA2cMfIkAmEnOe2Komb51ed9hzz0MnudfZHZk1cfw==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-deckgl/-/legacy-preset-chart-deckgl-0.4.6.tgz", + "integrity": "sha512-xXGNj7WQHMA+QpeiHMrinwWhOwskD9ucXoe10AfFFgar9TwvCE6wpgRwnoyF0hjoaXnMqpYyFbzlucCf3WSfVQ==", "requires": { "@math.gl/web-mercator": "^3.2.2", "@types/d3-array": "^2.0.0", @@ -69023,13 +68994,13 @@ } }, "@superset-ui/legacy-preset-chart-nvd3": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.17.10.tgz", - "integrity": "sha512-oCuvPwyZyvQLz5iCpK2coNJWKs4SD7OyGwFCtfmqBabAt1wt1+mZ0/YfQNJygguwDSRz8nWGaRbtMTGvcrfU6w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/legacy-preset-chart-nvd3/-/legacy-preset-chart-nvd3-0.17.12.tgz", + "integrity": "sha512-e55scJz7FKnn82vtYSxQIbtNFiN7Ftx5guw76Rcm2hkx2bu2TWTgSq7J/4BuTgaSCZsDEt48PNWIeJsfiu+HFQ==", "requires": { "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "d3": "^3.5.17", "d3-tip": "^0.9.1", "dompurify": "^2.0.6", @@ -69043,12 +69014,12 @@ } }, "@superset-ui/plugin-chart-echarts": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.10.tgz", - "integrity": "sha512-2bd2VEUShPFG6CUljHNt7pE2diHW8vrbi5DAWgxV3TkVnjCg4g0CCTS6mmxUhLi9gqV6V0jV4XYWvMg3GIPI0w==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-echarts/-/plugin-chart-echarts-0.17.12.tgz", + "integrity": "sha512-qMyfxv7XPUc+6k5QzJbhooCv2Jqjq/lS9B3VThU4sMZNuqiPmUPBykl7pdw+1TTX7QOJV73C35jm+YU0FAoL1A==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/mathjs": "^6.0.7", "d3-array": "^1.2.0", "echarts": "^5.0.2", @@ -69056,13 +69027,13 @@ } }, "@superset-ui/plugin-chart-table": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.10.tgz", - "integrity": "sha512-9FPypGUeCh8wQeTy3N9R4ewTAkVFb3jGnY7XbSiL3PfZzd0+AgKyA+fBV98IOdXJHJj45uIrREpAzYuKQa58rw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-table/-/plugin-chart-table-0.17.12.tgz", + "integrity": "sha512-izJkv2rFUAg1aDgLD/nRbgmVw04b6wx5GrbqGjMFv1Y4fR13ZlSgz/QuVVFM7vj9UgQVcz3PA+DNEkiABGKRgA==", "requires": { "@emotion/core": "^10.0.28", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/d3-array": "^2.0.0", "@types/react-table": "^7.0.19", "d3-array": "^2.4.0", @@ -69085,12 +69056,12 @@ } }, "@superset-ui/plugin-chart-word-cloud": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.10.tgz", - "integrity": "sha512-1Le/sHAve6VRad/uFcGIuNFvvpSx54duhJHnAnZAVwhAgW/OVm+7ohtEPjHvJdsAPZDpWFsgi601UuTDsSUvfw==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/plugin-chart-word-cloud/-/plugin-chart-word-cloud-0.17.12.tgz", + "integrity": "sha512-QIJmig3nC/cdx1Ch06OqOnypYvHnkKzpd+YSj3WMXhEn5p2SRS0mqgM1n56/QvNbJegHi+xEuaZKZ4Cek3409g==", "requires": { - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@types/d3-cloud": "^1.2.1", "@types/d3-scale": "^2.0.2", "d3-cloud": "^1.2.5", @@ -69122,14 +69093,14 @@ } }, "@superset-ui/preset-chart-xy": { - "version": "0.17.10", - "resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.10.tgz", - "integrity": "sha512-ym3zRIjOh+qNB1H1kPRZjmM0woC2Zkr/uhYI0cjpaGgXVr5B0AelT1ntpXQyu+Pse3Tj0XLVWzi+x4ZK79JmyQ==", + "version": "0.17.12", + "resolved": "https://registry.npmjs.org/@superset-ui/preset-chart-xy/-/preset-chart-xy-0.17.12.tgz", + "integrity": "sha512-UwXjsNKzAhYyjV+NJksr7nQ8YN3RUwzemxkHjpHX7tvIIquci3jqcCVbP8Ml19YxAs9o5gf+i6uUvn4Vtag+qw==", "requires": { "@data-ui/theme": "^0.0.84", "@data-ui/xy-chart": "^0.0.84", - "@superset-ui/chart-controls": "0.17.10", - "@superset-ui/core": "0.17.10", + "@superset-ui/chart-controls": "0.17.12", + "@superset-ui/core": "0.17.11", "@vx/axis": "^0.0.198", "@vx/legend": "^0.0.198", "@vx/scale": "^0.0.197", @@ -94918,9 +94889,9 @@ } }, "react": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react/-/react-16.13.1.tgz", - "integrity": "sha512-YMZQQq32xHLX0bz5Mnibv1/LHb3Sqzngu7xstSM+vrkE5Kzr9xE0yMByK5kMoTK30YVJE61WfbxIFFvfeDKT1w==", + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react/-/react-16.14.0.tgz", + "integrity": "sha512-0X2CImDkJGApiAlcf0ODKIneSwBPhqJawOa5wCtKbu7ZECrmS26NvtSILynQ66cgkT/RJ4LidJOc3bUESwmU8g==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", @@ -95711,20 +95682,20 @@ } }, "react-dom": { - "version": "16.13.0", - "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.13.0.tgz", - "integrity": "sha512-y09d2c4cG220DzdlFkPTnVvGTszVvNpC73v+AaLGLHbkpy3SSgvYq8x0rNwPJ/Rk/CicTNgk0hbHNw1gMEZAXg==", + "version": "16.14.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.14.0.tgz", + "integrity": "sha512-1gCeQXDLoIqMgqD3IO2Ah9bnf0w9kzhwN5q4FGnHZ67hBm9yePzB5JJAIQCc8x3pFnNlwFq4RidZggNAAkzWWw==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1", "prop-types": "^15.6.2", - "scheduler": "^0.19.0" + "scheduler": "^0.19.1" }, "dependencies": { "scheduler": { - "version": "0.19.0", - "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.0.tgz", - "integrity": "sha512-xowbVaTPe9r7y7RUejcK73/j8tt2jfiyTednOvHbA8JoClvMYCp+r8QegLwK/n8zWQAtZb1fFnER4XLBZXrCxA==", + "version": "0.19.1", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.19.1.tgz", + "integrity": "sha512-n/zwRWRYSUj0/3g/otKDRPMh6qv2SYMWNq85IEa8iZyAv8od9zDYpGSnpBEjNgcMNq6Scbu5KfIPxNF72R/2EA==", "requires": { "loose-envify": "^1.1.0", "object-assign": "^4.1.1" diff --git a/superset-frontend/package.json b/superset-frontend/package.json index 984a9e17a23..7ba65670052 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -65,34 +65,34 @@ "@babel/runtime-corejs3": "^7.12.5", "@data-ui/sparkline": "^0.0.84", "@emotion/core": "^10.0.35", - "@superset-ui/chart-controls": "^0.17.10", - "@superset-ui/core": "^0.17.10", - "@superset-ui/legacy-plugin-chart-calendar": "^0.17.10", - "@superset-ui/legacy-plugin-chart-chord": "^0.17.10", - "@superset-ui/legacy-plugin-chart-country-map": "^0.17.10", - "@superset-ui/legacy-plugin-chart-event-flow": "^0.17.10", - "@superset-ui/legacy-plugin-chart-force-directed": "^0.17.10", - "@superset-ui/legacy-plugin-chart-heatmap": "^0.17.10", - "@superset-ui/legacy-plugin-chart-histogram": "^0.17.10", - "@superset-ui/legacy-plugin-chart-horizon": "^0.17.10", - "@superset-ui/legacy-plugin-chart-map-box": "^0.17.10", - "@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.10", - "@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.10", - "@superset-ui/legacy-plugin-chart-partition": "^0.17.10", - "@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.10", - "@superset-ui/legacy-plugin-chart-rose": "^0.17.10", - "@superset-ui/legacy-plugin-chart-sankey": "^0.17.10", - "@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.10", - "@superset-ui/legacy-plugin-chart-sunburst": "^0.17.10", - "@superset-ui/legacy-plugin-chart-treemap": "^0.17.10", - "@superset-ui/legacy-plugin-chart-world-map": "^0.17.10", - "@superset-ui/legacy-preset-chart-big-number": "^0.17.10", - "@superset-ui/legacy-preset-chart-deckgl": "^0.4.2", - "@superset-ui/legacy-preset-chart-nvd3": "^0.17.10", - "@superset-ui/plugin-chart-echarts": "^0.17.10", - "@superset-ui/plugin-chart-table": "^0.17.10", - "@superset-ui/plugin-chart-word-cloud": "^0.17.10", - "@superset-ui/preset-chart-xy": "^0.17.10", + "@superset-ui/chart-controls": "^0.17.12", + "@superset-ui/core": "^0.17.11", + "@superset-ui/legacy-plugin-chart-calendar": "^0.17.12", + "@superset-ui/legacy-plugin-chart-chord": "^0.17.12", + "@superset-ui/legacy-plugin-chart-country-map": "^0.17.12", + "@superset-ui/legacy-plugin-chart-event-flow": "^0.17.12", + "@superset-ui/legacy-plugin-chart-force-directed": "^0.17.12", + "@superset-ui/legacy-plugin-chart-heatmap": "^0.17.12", + "@superset-ui/legacy-plugin-chart-histogram": "^0.17.12", + "@superset-ui/legacy-plugin-chart-horizon": "^0.17.12", + "@superset-ui/legacy-plugin-chart-map-box": "^0.17.12", + "@superset-ui/legacy-plugin-chart-paired-t-test": "^0.17.12", + "@superset-ui/legacy-plugin-chart-parallel-coordinates": "^0.17.12", + "@superset-ui/legacy-plugin-chart-partition": "^0.17.12", + "@superset-ui/legacy-plugin-chart-pivot-table": "^0.17.12", + "@superset-ui/legacy-plugin-chart-rose": "^0.17.12", + "@superset-ui/legacy-plugin-chart-sankey": "^0.17.12", + "@superset-ui/legacy-plugin-chart-sankey-loop": "^0.17.12", + "@superset-ui/legacy-plugin-chart-sunburst": "^0.17.12", + "@superset-ui/legacy-plugin-chart-treemap": "^0.17.12", + "@superset-ui/legacy-plugin-chart-world-map": "^0.17.12", + "@superset-ui/legacy-preset-chart-big-number": "^0.17.12", + "@superset-ui/legacy-preset-chart-deckgl": "^0.4.6", + "@superset-ui/legacy-preset-chart-nvd3": "^0.17.12", + "@superset-ui/plugin-chart-echarts": "^0.17.12", + "@superset-ui/plugin-chart-table": "^0.17.12", + "@superset-ui/plugin-chart-word-cloud": "^0.17.12", + "@superset-ui/preset-chart-xy": "^0.17.12", "@vx/responsive": "^0.0.195", "abortcontroller-polyfill": "^1.1.9", "antd": "^4.9.4", diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx index fd2ea23a637..9ae816a5a82 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterControl.jsx @@ -270,7 +270,7 @@ class AdhocFilterControl extends React.Component { optionsForSelect(props) { const options = [ ...props.columns, - ...[...(props.formData.metrics || []), props.formData.metric].map( + ...[...(props.formData?.metrics || []), props.formData?.metric].map( metric => metric && (typeof metric === 'string' From 3510e15e2cc450ab5c89a68634c7a731fc230a2a Mon Sep 17 00:00:00 2001 From: Yongjie Zhao Date: Fri, 26 Feb 2021 15:33:13 +0800 Subject: [PATCH 22/22] minor fix --- .../src/explore/components/DatasourcePanel.tsx | 2 +- .../DndColumnSelectControl/DndColumnSelectLabel.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/superset-frontend/src/explore/components/DatasourcePanel.tsx b/superset-frontend/src/explore/components/DatasourcePanel.tsx index a69fc6e7a98..e89e41f0f7c 100644 --- a/superset-frontend/src/explore/components/DatasourcePanel.tsx +++ b/superset-frontend/src/explore/components/DatasourcePanel.tsx @@ -28,7 +28,7 @@ import { import { debounce } from 'lodash'; import { matchSorter, rankings } from 'match-sorter'; import { FAST_DEBOUNCE } from 'src/constants'; -import { ExploreActions } from '../actions/exploreActions'; +import { ExploreActions } from 'src/explore/actions/exploreActions'; import Control from './Control'; import DatasourcePanelDragWrapper from './DatasourcePanel/DatasourcePanelDragWrapper'; import { DatasourcePanelDndType } from './DatasourcePanel/types'; diff --git a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx index 9c3fe06c00b..a08ef9eddd4 100644 --- a/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx +++ b/superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx @@ -85,7 +85,7 @@ export default function DndColumnSelectLabel(props: LabelProps) { props.onChange(optionSelector.getValues()); } - function placeHolderRenderer() { + function renderPlaceHolder() { return ( @@ -94,7 +94,7 @@ export default function DndColumnSelectLabel(props: LabelProps) { ); } - function optionsRenderer() { + function renderOptions() { return groupByOptions.map((column, idx) => ( - {isEmpty(groupByOptions) ? placeHolderRenderer() : optionsRenderer()} + {isEmpty(groupByOptions) ? renderPlaceHolder() : renderOptions()} );