You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/02/18 14:27:17 UTC

[GitHub] [superset] zhaoyongjie opened a new pull request #13210: feat(explore): group by Control drag-and-drop

zhaoyongjie opened a new pull request #13210:
URL: https://github.com/apache/superset/pull/13210


   ### SUMMARY
   This is part of explore drag-and-drop Control. Add group by DND control, 
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   ![image](https://user-images.githubusercontent.com/2016594/108371093-5aadb280-7238-11eb-935f-99fd7268090e.png)
   
   
   ### TEST PLAN
   <!--- What steps should be taken to verify the changes -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [x] Changes UI
   - [ ] Requires DB Migration.
   - [ ] Confirm DB Migration upgrade and downgrade tested.
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581065044



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       I wonder if we could make this component more generic, so we could reuse it with filters and metrics. It'd be great if we were able to pass optionsRenderer, children and other values as props. Though I don't know if it's in scope of this PR - next iteration maybe?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-786724116


   Todo: for group-by that only accepts dimensions , add red indicator for metrics drop. @zhaoyongjie 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-788097589


   @yardz
   issue found 
   in master, once you set this feature flag to True, new Echarts Graph is now working. 
   
   To reproduce 
   1. 
   ```
   DEFAULT_FEATURE_FLAGS = {
   ...
   ...
       "ENABLE_EXPLORE_DRAG_AND_DROP": True,
   }
   ```
   2. Create a Graph by 
   - clicking the top right + button to create new chart
   - Select Graph(in the last row) from the gallery
   - Select any dataset 
   - create, see error.  
   Expected behavior 
   
   https://user-images.githubusercontent.com/67837651/109529299-73a13980-7a6a-11eb-8d57-1b02713d3d82.mov
   
   thanks! 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (e93c259) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **increase** coverage by `2.84%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.15%   79.99%   +2.84%     
   ==========================================
     Files         866      300     -566     
     Lines       45005    24379   -20626     
     Branches     5357        0    -5357     
   ==========================================
   - Hits        34723    19502   -15221     
   + Misses      10159     4877    -5282     
   + Partials      123        0     -123     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `79.99% <ø> (-0.82%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `74.23% <0.00%> (-16.54%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `84.58% <0.00%> (-6.00%)` | :arrow_down: |
   | [superset/databases/commands/test\_connection.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3Rlc3RfY29ubmVjdGlvbi5weQ==) | `84.78% <0.00%> (-4.35%)` | :arrow_down: |
   | [superset/databases/api.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2FwaS5weQ==) | `88.30% <0.00%> (-3.63%)` | :arrow_down: |
   | ... and [581 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e93c259](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582148090



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       `We currently only support max 50 columns in the column list. While it's possible to filter the list, it is currently not possible to browse the full list like it is in the current select control.`
   
   the panel search bar is very robust which supports key word search in column & metric names, label/verbose name, description, and even warning, information. when # of column reach 50, i doubt scrolling through the list is the primary way to look for drop objects. 
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (9c823cc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.17%`.
   > The diff coverage is `64.46%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   71.98%   -5.18%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45252     +247     
     Branches     5357     5470     +113     
   ==========================================
   - Hits        34723    32573    -2150     
   - Misses      10159    12469    +2310     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `80.38% <90.57%> (-0.43%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | [...nd/src/explore/components/ExploreViewContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci5qc3g=) | `2.42% <0.00%> (-75.76%)` | :arrow_down: |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `0.00% <0.00%> (-38.89%)` | :arrow_down: |
   | ... and [282 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (306899c) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.16%`.
   > The diff coverage is `60.37%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   76.99%   -0.17%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45243     +238     
     Branches     5357     5470     +113     
   ==========================================
   + Hits        34723    34834     +111     
   - Misses      10159    10286     +127     
     Partials      123      123              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.20% <22.15%> (-0.31%)` | :arrow_down: |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `80.72% <89.84%> (-0.09%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `38.70% <0.00%> (-0.18%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [57 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581983073



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       (regarding making a more generic component vs a specific component) Agree with both - this should be made generic, but as a first POC behind a FF I'm ok with this being more specific and making it more generic later.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580995522



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/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';

Review comment:
       got it




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582080120



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       This contentious point is almost the same as whether we should have "+" AND "ghost" button for click-to-select, and should we still support FilterBox after having native filter. 
   Most us believe the "ghost" button is more intuitive, while many from the community still prefer the existing way for various reason. In my roadmap google sheet, I stated that the biggest drives of implementing this feature are competitive, marketability, UX improvement.
   Competitive - Tableau only offers DND, no `select`. The question I have for ya'll is that how can we find out whether offering `select` as well ADD any value? We will find out later during usability or A/B testing. This should be a decision supported by data, let's not make decision for the users. 
   Marketability - Self explanatory, this driver doesn't affect final decision much
   User Experience - keep both under FF, run test, if having both significantly impact UX in a positive way, why not keeping both? 
   
   Cost - this is more a stakeholder question. do we want to spend 2x time to maintain 2 sets of feature that achieve basically the same goal, or do we want to spend our engineering/product/QA effort on a set of new feature that brings more value and offers higher ROI? 
   
   Let's hand over the ball to our designer @mihir174, I'm sure he will take all your feedback and come up with the best solution for our users. 
   
   @kgabryje @villebro 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582007287



##########
File path: superset-frontend/src/explore/components/OptionControls.tsx
##########
@@ -92,7 +92,26 @@ export const LabelsContainer = styled.div`
   border-radius: ${({ theme }) => theme.gridUnit}px;
 `;
 
-export const AddControlLabel = styled.div`
+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}`;
+    }

Review comment:
       I think that we should also add an indicator for `canDrop && !isOver` so that user knows where he can drag a column




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (c6e5934) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **increase** coverage by `3.54%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.18%   80.73%   +3.54%     
   ==========================================
     Files         881      300     -581     
     Lines       45499    24420   -21079     
     Branches     5447        0    -5447     
   ==========================================
   - Hits        35119    19715   -15404     
   + Misses      10256     4705    -5551     
   + Partials      124        0     -124     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | hive | `79.97% <ø> (-0.01%)` | :arrow_down: |
   | javascript | `?` | |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.73% <ø> (-0.13%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `82.47% <0.00%> (-5.99%)` | :arrow_down: |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `82.14% <0.00%> (-3.58%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.55% <0.00%> (-0.28%)` | :arrow_down: |
   | [...erset-frontend/src/components/DatabaseSelector.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRGF0YWJhc2VTZWxlY3Rvci50c3g=) | | |
   | [...erset-frontend/src/profile/components/Security.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Byb2ZpbGUvY29tcG9uZW50cy9TZWN1cml0eS50c3g=) | | |
   | [superset-frontend/src/filters/components/index.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9pbmRleC50cw==) | | |
   | [...ontend/src/filters/components/Select/buildQuery.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvYnVpbGRRdWVyeS50cw==) | | |
   | [superset-frontend/src/api/dataset.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2FwaS9kYXRhc2V0LnRz) | | |
   | [superset-frontend/src/components/ErrorBoundary.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRXJyb3JCb3VuZGFyeS5qc3g=) | | |
   | ... and [569 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-785228920


   Additional to https://github.com/apache/superset/pull/13210#discussion_r582080120 on whether we should keep `SELECT`  
   1. SELECT has limitation in realizing complex hierarchy/grouping interaction. dimension/columns, metrics grouping and hierarchy are very common BI tool which which we currently lack. 
   
   2. When there are multiple DROP targets, dnd help set some drop restrictions. For example, If target A is dropped, target B will not accept drop values. (There are cases in PivotTable where  groupby and column restrict each other)
   
   3. performance. do we need to render options in dimensions/columns and metrics twice with both? 
   
   @villebro @kgabryje @ktmud @mistercrunch let's keep the discussion going so Design can have enough information to go on. but let's merge this PR soon as it's currently blocking follow up PRs.  
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (c6e5934) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **increase** coverage by `3.24%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.18%   80.43%   +3.24%     
   ==========================================
     Files         881      300     -581     
     Lines       45499    24420   -21079     
     Branches     5447        0    -5447     
   ==========================================
   - Hits        35119    19642   -15477     
   + Misses      10256     4778    -5478     
   + Partials      124        0     -124     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | hive | `?` | |
   | javascript | `?` | |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.43% <ø> (-0.43%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `74.23% <0.00%> (-16.54%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.62% <0.00%> (-6.84%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `85.57% <0.00%> (-0.49%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.55% <0.00%> (-0.28%)` | :arrow_down: |
   | [...hboard/components/menu/BackgroundStyleDropdown.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL21lbnUvQmFja2dyb3VuZFN0eWxlRHJvcGRvd24uanN4) | | |
   | [...-frontend/src/datasource/ChangeDatasourceModal.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2RhdGFzb3VyY2UvQ2hhbmdlRGF0YXNvdXJjZU1vZGFsLnRzeA==) | | |
   | [superset-frontend/src/components/Timer.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvVGltZXIudHN4) | | |
   | ... and [572 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (88330ff) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **decrease** coverage by `0.72%`.
   > The diff coverage is `16.19%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   72.29%   71.57%   -0.73%     
   ==========================================
     Files         864      783      -81     
     Lines       44883    40363    -4520     
     Branches     5403     4144    -1259     
   ==========================================
   - Hits        32450    28889    -3561     
   + Misses      12224    11474     -750     
   + Partials      209        0     -209     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.24% <16.19%> (?)` | |
   | javascript | `?` | |
   | python | `80.39% <ø> (-0.44%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `68.29% <ø> (-10.88%)` | :arrow_down: |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `0.00% <0.00%> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.51% <100.00%> (+0.63%)` | :arrow_up: |
   | ... and [507 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...3c9039e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r583433765



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,119 @@
+/**
+ * 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, useTheme } from '@superset-ui/core';
+import { BaseControlConfig, ColumnMeta } from '@superset-ui/chart-controls';
+import ControlHeader from 'src/explore/components/ControlHeader';
+import {
+  AddControlLabel,
+  DndLabelsContainer,
+  HeaderContainer,
+} from 'src/explore/components/OptionControls';
+import {
+  DatasourcePanelDndItem,
+  DatasourcePanelDndType,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {
+  const theme = useTheme();
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [{ isOver, canDrop }, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      if (!optionSelector.isArray && !isEmpty(optionSelector.groupByOptions)) {
+        optionSelector.replace(0, item.metricOrColumnName);
+      } else {
+        optionSelector.add(item.metricOrColumnName);
+      }
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+      type: monitor.getItemType(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {

Review comment:
       Thank You, Jesse!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `0.24%`.
   > The diff coverage is `35.09%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   76.93%   -0.25%     
   ==========================================
     Files         881      885       +4     
     Lines       45499    45581      +82     
     Branches     5447     5475      +28     
   ==========================================
   - Hits        35119    35069      -50     
   - Misses      10256    10389     +133     
   + Partials      124      123       -1     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.83% <17.21%> (-0.25%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `62.06% <35.09%> (-0.50%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `80.84% <ø> (-0.01%)` | :arrow_down: |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `66.66% <55.55%> (-5.63%)` | :arrow_down: |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `76.92% <100.00%> (+0.92%)` | :arrow_up: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | ... and [43 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...1854cd7](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582207003



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       @junlincc Trust me, most users are lazy and would not want to type. Browsing the list to add columns is probably a much more common use case than you thought. For example, in Airbnb, in one of the datasources, there are many metrics with "nights_booked" in the name, when users want to find a specific metric related to "nights_booked" but couldn't remember the exact name, even after they typed "nights_booked", they may still need to browse through more than 50 options.
   
   Re: offering DnD only or both interactions:
   
   I think one of the biggest advantage of Superset is the ability to create adhoc metric very easily. I'm struggling to imagine how that workflow of conveniently creating adhoc metrics/columns would look like without a popover. If we are going to build a popover anyway, why not keep both DnD and click? With proper design and abstraction, the code complexity should be manageable.
   
   Re: code maintenance:
   
   That said, current code indeed is very complex, and is not even in TypeScript, so I'm in support of writing the new control bit by bit from scratch. But I also think it would make sense to be generic from the get go and make sure the architecture can support all use cases---because we already have so much learning from the existing controls.
   
   It would be nice if we can focus on collecting all feature requests first and do an architecture review before diving deep into implementing the full feature for a specific control type. This POC is a good starting point to kick off the conversation, but let's make sure we get things right to avoid wasted work.
   
   I'm also not sure how to run user testing in this case, do we ask users to choose between DnD and click? Do we do that after all features for DnD are implemented or before? What if users pick click because DnD is not easy to use enough? These controls need an overhaul anyway so I can't imagine a case where we will abandon the new solution over some unfavorable use feedbacks (that's probably fixable).
   
   It is also not true that we will need to spend 2x of time to maintain two sets of features. Current select controls can have a code freeze while we work on the new controls with more advanced features and better architecture. We would probably need that to stay focused.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581625455



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       @kgabryje thanks for suggesting!
   Yes, users may take awhile to get used to the new behavior, but if we keep both select and dnd, my concern is 
   it will increase the complexity of the component 
   1)  we have two sets of each control to maintain, also if one breaks, it will likely affect the other as well?  
   2) more overhead if we wanna introduce new feature, for example in metrics. 
   We could keep both until we officially turn feature flag off though and run some usability tests to compare both solutions. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-784216416


   > @zhaoyongjie Yongjie, thanks for the POC! super excited about it. can you add manual text plan and instruction of turning on the feature flag in description? thanks!
   
   I have added in PR description.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (d71bf1b) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `0.20%`.
   > The diff coverage is `50.25%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   76.98%   -0.21%     
   ==========================================
     Files         881      894      +13     
     Lines       45499    45664     +165     
     Branches     5447     5490      +43     
   ==========================================
   + Hits        35119    35155      +36     
   - Misses      10256    10385     +129     
     Partials      124      124              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.63% <24.18%> (-0.45%)` | :arrow_down: |
   | hive | `79.95% <ø> (-0.02%)` | :arrow_down: |
   | javascript | `62.40% <50.25%> (-0.16%)` | :arrow_down: |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.73% <ø> (-0.12%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `66.66% <55.55%> (-5.63%)` | :arrow_down: |
   | [...et-frontend/src/components/Pagination/Ellipsis.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9FbGxpcHNpcy50c3g=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Item.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9JdGVtLnRzeA==) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Next.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9OZXh0LnRzeA==) | `100.00% <100.00%> (ø)` | |
   | ... and [26 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-785228920


   Additional to https://github.com/apache/superset/pull/13210#discussion_r582080120 on whether we should keep `SELECT`  
   1. SELECT has limitation in realizing complex hierarchy/grouping interaction. dimension/columns, metrics grouping and hierarchy are very common BI tool which which we currently lack. 
   
   2. When there are multiple DROP targets, dnd help set some drop restrictions. For example, If target A is dropped, target B will not accept drop values. (There are cases in PivotTable where  groupby and column restrict each other)
   
   3. performance. do we need to render options in dimensions/columns and metrics twice with both? 
   
   @villebro @kgabryje @ktmud @mistercrunch let's keep the discussion going so Design can have enough information to go on. 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.08%`.
   > The diff coverage is `61.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   72.07%   -5.09%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45551     +546     
     Branches     5357     5475     +118     
   ==========================================
   - Hits        34723    32830    -1893     
   - Misses      10159    12511    +2352     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.73% <90.57%> (-0.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | ... and [299 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (d71bf1b) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `5.14%`.
   > The diff coverage is `50.25%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   72.03%   -5.15%     
   ==========================================
     Files         881      894      +13     
     Lines       45499    45606     +107     
     Branches     5447     5490      +43     
   ==========================================
   - Hits        35119    32854    -2265     
   - Misses      10256    12540    +2284     
   - Partials      124      212      +88     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | hive | `?` | |
   | javascript | `62.40% <50.25%> (-0.16%)` | :arrow_down: |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.32% <ø> (-0.02%)` | :arrow_down: |
   | presto | `?` | |
   | python | `80.41% <ø> (-0.45%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `64.51% <55.55%> (-7.78%)` | :arrow_down: |
   | [...et-frontend/src/components/Pagination/Ellipsis.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9FbGxpcHNpcy50c3g=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Item.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9JdGVtLnRzeA==) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Next.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9OZXh0LnRzeA==) | `100.00% <100.00%> (ø)` | |
   | ... and [250 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...1854cd7](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580995168



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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';

Review comment:
       Got it. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (6fc8b3c) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `15.01%`.
   > The diff coverage is `35.81%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13210       +/-   ##
   ===========================================
   - Coverage   77.15%   62.13%   -15.02%     
   ===========================================
     Files         866      581      -285     
     Lines       45005    20829    -24176     
     Branches     5357     5469      +112     
   ===========================================
   - Hits        34723    12942    -21781     
   + Misses      10159     7677     -2482     
   - Partials      123      210       +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.13% <35.81%> (-0.07%)` | :arrow_down: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.33% <3.33%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `27.77% <27.77%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `64.51% <55.55%> (-7.78%)` | :arrow_down: |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `80.00% <100.00%> (+4.00%)` | :arrow_up: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...omponents/controls/DndColumnSelectControl/index.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2luZGV4LnRz) | `100.00% <100.00%> (ø)` | |
   | ... and [537 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...6fc8b3c](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581077986



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       This is a good question! 
   Code reuse can refine the logic, but it may make the logic difficult to understand. We should iterate it in the future. We have to consider all kinds of components. 
   e.g.
   - various Filter(datetime filter, numeric filter, text filter)
   - various dimension selection(simple dimension, dimension set, dimension hierarchy)
   
   The current DND should be just a prototype. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582352812



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts
##########
@@ -0,0 +1,86 @@
+/**
+ * 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 };
+
+  isScalar: boolean;
+
+  constructor(
+    options: { string: ColumnMeta },
+    values: string[] | string | null,
+  ) {
+    this.options = options;
+    let groupByValues: string[];
+    if (Array.isArray(values)) {
+      groupByValues = values;
+      this.isScalar = false;
+    } else {
+      groupByValues = values ? [values] : [];
+      this.isScalar = true;
+    }

Review comment:
       +1 on change this to `isArray` check since we may want to support other more complex `option` in the future (e.g. `AdhocFilter` and `AdhocMetric`).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-785429376


   @junlincc This PR was ready for review for only 2 days. I think we should not rush to merge this into `master` for something as fundamental as this.
   
   If it's for convenience of reviewing and unblocking future PRs, let's make a feature branch in `apache/superset`.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (3c9039e) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **increase** coverage by `4.40%`.
   > The diff coverage is `37.50%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   72.29%   76.70%   +4.40%     
   ==========================================
     Files         864      874      +10     
     Lines       44883    45088     +205     
     Branches     5403     5447      +44     
   ==========================================
   + Hits        32450    34584    +2134     
   + Misses      12224    10377    -1847     
   + Partials      209      127      -82     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.84% <16.19%> (?)` | |
   | javascript | `61.99% <37.50%> (-0.25%)` | :arrow_down: |
   | python | `80.39% <ø> (-0.44%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.33% <3.33%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `30.55% <30.55%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `63.63% <63.63%> (ø)` | |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `76.92% <100.00%> (-2.25%)` | :arrow_down: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `72.61% <100.00%> (+2.73%)` | :arrow_up: |
   | ... and [239 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...3c9039e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582207003



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       @junlincc Trust me, most users are lazy and would not want to type. Browsing the list to add columns is probably a much more common use case than you thought. For example, in Airbnb, in one of the datasources, there are many metrics with "nights_booked" in the name, when users want to find a specific metric related to "nights_booked" but couldn't remember the exact name, even after they typed "nights_booked", they may still need to browse through more than 50 options.
   
   Re: offering DnD only or both interactions:
   
   I think one of the biggest advantage of Superset is the ability to create adhoc metric very easily. I'm struggling to imagine how that workflow of conveniently creating adhoc metrics/columns would look like without a popover. If we are going to build a popover anyway, why not keep both DnD and click? With proper design and abstraction, the code complexity should be manageable.
   
   Re: code maintenance:
   
   That said, current code indeed is very complex, and is not even in TypeScript, so I'm in support of writing the new control bit by bit from scratch. But I also think it would make sense to be generic from the get go and make sure the architecture can support all use cases---because we already have so much learning from the existing controls.
   
   It would be nice if we can focus on collecting all feature requests first and do an architecture review (maybe a SIP) before diving deep into implementing the full feature for a specific control type. This POC is a good starting point to kick off the conversation, but let's make sure we get things right to avoid wasted work.
   
   I'm also not sure how to run user testing in this case, do we ask users to choose between DnD and click? Do we do that after all features for DnD are implemented or before? What if users pick click because DnD is not easy to use enough? These controls need an overhaul anyway so I can't imagine a case where we will abandon the new solution over some unfavorable use feedbacks (that's probably fixable).
   
   It is also not true that we will need to spend 2x of time to maintain two sets of features. Current select controls can have a code freeze while we work on the new controls with more advanced features and better architecture. We would probably need that to stay focused.

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       @junlincc Trust me, most users are lazy and would not want to type. Browsing the list to add columns is probably a much more common use case than you thought. For example, in Airbnb, in one of the datasources, there are many metrics with "nights_booked" in the name, when users want to find a specific metric related to "nights_booked" but couldn't remember the exact name, even after they typed "nights_booked", they may still need to browse through more than 50 options.
   
   Re: offering DnD only or both interactions:
   
   I think one of the biggest advantage of Superset is the ability to create adhoc metric very easily. I'm struggling to imagine how that workflow of conveniently creating adhoc metrics/columns would look like without a popover. If we are going to build a popover anyway, why not keep both DnD and click? With proper design and abstraction, the code complexity should be manageable.
   
   Re: code maintenance:
   
   That said, current code indeed is very complex, and is not even in TypeScript, so I'm in support of writing the new control bit by bit from scratch. But I also think it would make sense to be generic from the get go and make sure the architecture can support all use cases---because we already have so much learning from the existing controls.
   
   It would be nice if we can focus on collecting all feature requests first and do an architecture review (maybe in a SIP?) before diving deep into implementing the full feature for a specific control type. This POC is a good starting point to kick off the conversation, but let's make sure we get things right to avoid wasted work.
   
   I'm also not sure how to run user testing in this case, do we ask users to choose between DnD and click? Do we do that after all features for DnD are implemented or before? What if users pick click because DnD is not easy to use enough? These controls need an overhaul anyway so I can't imagine a case where we will abandon the new solution over some unfavorable use feedbacks (that's probably fixable).
   
   It is also not true that we will need to spend 2x of time to maintain two sets of features. Current select controls can have a code freeze while we work on the new controls with more advanced features and better architecture. We would probably need that to stay focused.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582080120



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       This contentious point is almost the same as whether we should have "+" AND "ghost" button for click-to-select, and should we still support FilterBox after having native filter. 
   Most us believe the "ghost" button is more intuitive, while many from the community still prefer the existing way for various reason. In my roadmap google sheet, I stated that the biggest drives of implementing this feature are competitive, marketability, UX improvement.
   Competitive - Tableau only offers DND, no `select`. The question I have for ya'll is that how can we find out whether offering `select` as well ADD any value? We will find out later during usability or A/B testing. This should be a decision supported by data, let's not make decision for the users. 
   Marketability - Self explanatory, this driver doesn't affect final decision much
   User Experience - keep both under FF, run test, if having both significantly impact UX in a positive way, why not keeping both? 
   
   Cost - this is more a stakeholder question. do we want to spend 2x time to maintain 2 sets of feature that achieve basically the same goal, or do we want to spend our engineering/product/QA effort on something new that offers higher ROI? 
   
   @kgabryje @villebro 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582148090



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       `We currently only support max 50 columns in the column list. While it's possible to filter the list, it is currently not possible to browse the full list like it is in the current select control.`
   
   the panel search bar is very robust which supports key word search column & metric names, label/verbose name search, description, warning, information. when # of column reach 50, i doubt scrolling through the list is the primary way to look for drop objects. 
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581990148



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts
##########
@@ -0,0 +1,86 @@
+/**
+ * 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 };
+
+  isScalar: boolean;
+
+  constructor(
+    options: { string: ColumnMeta },
+    values: string[] | string | null,
+  ) {
+    this.options = options;
+    let groupByValues: string[];
+    if (Array.isArray(values)) {
+      groupByValues = values;
+      this.isScalar = false;
+    } else {
+      groupByValues = values ? [values] : [];
+      this.isScalar = true;
+    }

Review comment:
       This might just be me, but I feel the term `scalar` can cause confusion here (in mathematics a scalar is a real number, which in the context of JS would be `number`). I'd rather use `isArray` to highlight that this refers to distinguishing between arrays and non-arrays.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783899436


   @zhaoyongjie Yongjie, thanks for the PR! super excited about it. can you add manual text plan and instruction of turning on the feature flag in description? thanks! 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580866797



##########
File path: superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx
##########
@@ -55,26 +57,42 @@ describe('datasourcepanel', () => {
   }
 
   it('should render', () => {
-    const { container } = render(<DatasourcePanel {...props} />);
+    const { container } = render(
+      <DndProvider backend={HTML5Backend}>

Review comment:
       Should we create a `setup` function to DRY it up?
   ```
   const setup = (props) => (
        <DndProvider backend={HTML5Backend}>
           <DatasourcePanel {...props} />
         </DndProvider>
   )
   ```

##########
File path: 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 { DatasourcePanelDndItem } from './types';
+
+interface DatasourcePanelDragWrapperProps extends DatasourcePanelDndItem {
+  children?: ReactNode;
+}
+
+export default function DatasourcePanelDragWrapper(
+  props: DatasourcePanelDragWrapperProps,
+) {
+  const [, drag] = useDrag({
+    item: {
+      metricOrColumnName: props.metricOrColumnName,
+      type: props.type,
+    },
+  });
+
+  return (
+    <>

Review comment:
       Why do we need this `<></>`?

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/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';

Review comment:
       Can we `useTheme` instead?

##########
File path: superset-frontend/src/explore/components/DatasourcePanel.tsx
##########
@@ -204,7 +206,12 @@ export default function DataSourcePanel({
             </div>
             {metricSlice.map(m => (
               <LabelContainer key={m.metric_name} className="column">
-                <MetricOption metric={m} showType />
+                <DatasourcePanelDragWrapper
+                  metricOrColumnName={m.metric_name}
+                  type={DatasourcePanelDndType.METRIC}
+                >
+                  <MetricOption metric={m} showType />

Review comment:
       What do you think about using a `cursor: move` instead of default here?

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       Don't we want to allow users to add groupby "normally" - by selecting from options instead of drag and dropping? CC @junlincc 

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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';

Review comment:
       Can we `useTheme` instead?

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>
+        <Icon name="plus-small" color={props.theme.colors.grayscale.light1} />
+        {t('Drop Columns')}
+      </AddControlLabel>
+    );
+  }
+
+  function optionsRenderer() {
+    return groupByOptions.map((column, idx) => (
+      <OptionWrapper
+        key={idx}
+        index={idx}
+        column={column}
+        clickClose={onClickClose}
+        onShiftOptions={onShiftOptions}
+      />
+    ));
+  }
+
+  return (
+    <>

Review comment:
       Do we need `<></>` here?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-785429376






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (d71bf1b) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `0.36%`.
   > The diff coverage is `50.25%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   76.82%   -0.37%     
   ==========================================
     Files         881      894      +13     
     Lines       45499    45664     +165     
     Branches     5447     5490      +43     
   ==========================================
   - Hits        35119    35081      -38     
   - Misses      10256    10459     +203     
     Partials      124      124              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.63% <24.18%> (-0.45%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `62.40% <50.25%> (-0.16%)` | :arrow_down: |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.43% <ø> (-0.43%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `66.66% <55.55%> (-5.63%)` | :arrow_down: |
   | [...et-frontend/src/components/Pagination/Ellipsis.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9FbGxpcHNpcy50c3g=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Item.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9JdGVtLnRzeA==) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Next.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9OZXh0LnRzeA==) | `100.00% <100.00%> (ø)` | |
   | ... and [30 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580982788



##########
File path: superset-frontend/src/explore/components/DatasourcePanel.tsx
##########
@@ -204,7 +206,12 @@ export default function DataSourcePanel({
             </div>
             {metricSlice.map(m => (
               <LabelContainer key={m.metric_name} className="column">
-                <MetricOption metric={m} showType />
+                <DatasourcePanelDragWrapper
+                  metricOrColumnName={m.metric_name}
+                  type={DatasourcePanelDndType.METRIC}
+                >
+                  <MetricOption metric={m} showType />

Review comment:
       sorry, what is `cursor: move` on this?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783899436


   @zhaoyongjie Yongjie, thanks for the POC! super excited about it. can you add manual text plan and instruction of turning on the feature flag in description? thanks! 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (d71bf1b) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `1.40%`.
   > The diff coverage is `50.25%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   75.78%   -1.41%     
   ==========================================
     Files         881      894      +13     
     Lines       45499    45663     +164     
     Branches     5447     5490      +43     
   ==========================================
   - Hits        35119    34606     -513     
   - Misses      10256    10915     +659     
   - Partials      124      142      +18     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.69% <24.18%> (-0.39%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `62.40% <50.25%> (-0.16%)` | :arrow_down: |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.43% <ø> (-0.43%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `66.66% <55.55%> (-5.63%)` | :arrow_down: |
   | [...et-frontend/src/components/Pagination/Ellipsis.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9FbGxpcHNpcy50c3g=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Item.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9JdGVtLnRzeA==) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Next.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9OZXh0LnRzeA==) | `100.00% <100.00%> (ø)` | |
   | ... and [96 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...1854cd7](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-786740315


   > Todo: for group-by that only accepts dimensions , add red indicator for metrics drop. @zhaoyongjie
   
   copy that, this feature need more polish, thank you.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (58beef1) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **decrease** coverage by `14.44%`.
   > The diff coverage is `16.19%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13210       +/-   ##
   ===========================================
   - Coverage   72.29%   57.85%   -14.45%     
   ===========================================
     Files         864      485      -379     
     Lines       44883    16077    -28806     
     Branches     5403     4142     -1261     
   ===========================================
   - Hits        32450     9301    -23149     
   + Misses      12224     6776     -5448     
   + Partials      209        0      -209     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.85% <16.19%> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `68.29% <ø> (-10.88%)` | :arrow_down: |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `0.00% <0.00%> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.51% <100.00%> (+0.63%)` | :arrow_up: |
   | [...omponents/controls/DndColumnSelectControl/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3R5cGVzLnRz) | `100.00% <100.00%> (ø)` | |
   | ... and [794 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...58beef1](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582207003



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       @junlincc Trust me, most users are lazy and would not want to type. Browsing the list to add columns is probably a much more common use case than you thought. For example, in Airbnb, in one of the datasources, there are many metrics with "nights_booked" in the name, when users want to find a specific metric related to "nights_booked" but couldn't remember the exact name, even after they typed "nights_booked", they may still need to browse through more than 50 items.
   
   Re: offering DnD only or both interactions and code generalization:
   
   I think one of the biggest advantage of Superset is the ability to create adhoc metric very easily. I'm struggling to imagine how that workflow of conveniently creating adhoc metrics/columns would look like without a popover. If we are going to build a popover anyway, why not keep both DnD and click? With proper design and abstraction, the code complexity should be manageable.
   
   Re: code maintenance:
   
   That said, current code indeed is very complex, and is not even in TypeScript, so I'm in support of writing the new control bit by bit from scratch. But I also think it would make sense to be generic from the get go and make sure the architecture can support all use cases---because we already have so much learning from the existing controls.
   
   It would be nice if we can focus on collecting all feature requests first and do an architecture review before diving deep into implementing the full feature for a specific control type. This POC is a good starting point to kick off the conversation, but let's make sure we get things right to avoid wasted work.
   
   I'm also not sure how to run user testing in this case, do we ask users to choose between DnD and click? Do we do that after all features for DnD are implemented or before? What if users pick click because DnD is not easy to use enough? These controls need an overhaul anyway so I can't imagine a case where we will abandon the new solution over some unfavorable use feedbacks (that's probably fixable).
   
   It is also not true that we will need to spend 2x of time to maintain two sets of features. Current select controls can have a code freeze while we work on the new controls with more advanced features and better architecture. We would probably need that to stay focused.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581947346



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       (regarding dnd only vs also supporting traditional clicking the control) I personally feel it's better to offer the users the option of using the traditional approach, especially as long there is a sensible control which you can click. While e.g. Tableau AFAIK only supports dnd interaction, in that UI it makes more sense, but in Superset I feel it's still a perfectly valid path to adding filters/metrics/columns.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582207003



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       @junlincc Trust me, most users are lazy and would not want to type. Browsing the list to add columns is probably a much more common use case than you thought. For example, in Airbnb, in one of the datasources, there are many metrics with "nights_booked" in the name, when users want to find a specific metric related to "nights_booked" but couldn't remember the exact name, even after they typed "nights_booked", they may still need to browse through more than 50 options.
   
   Re: offering DnD only or both interactions:
   
   I think one of the biggest advantage of Superset is the ability to create adhoc metric very easily. I'm struggling to imagine how that workflow of conveniently creating adhoc metrics/columns would look like without a popover. If we are going to build a popover anyway, why not keep both DnD and click? With proper design and abstraction, the code complexity should be manageable.
   
   Re: code maintenance:
   
   That said, current code indeed is very complex, and is not even in TypeScript, so I'm in support of writing the new control bit by bit from scratch. But I also think it would make sense to be generic from the get go and make sure the architecture can support all use cases---because we already have so much learning from the existing controls.
   
   It would be nice if we can focus on collecting all feature requests first and do an architecture review (maybe in a SIP?) before diving deep into implementing the full feature for a specific control type. This POC is a good starting point to kick off the conversation, but let's make sure we get things right to avoid wasted work.
   
   I'm also not sure how to run user testing in this case, do we ask users to choose between DnD and click? Do we do that after all features for DnD are implemented or before? What if users pick click because DnD is not easy to use enough? These controls need an overhaul anyway so I can't imagine a case where we will abandon the new solution just because of some unfavorable use feedbacks (that's probably fixable).
   
   It is also not true that we will need to spend 2x of time to maintain two sets of features. Current select controls can have a code freeze while we work on the new controls with more advanced features and better architecture. We would probably need that to stay focused.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581012403



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       Hmm, I suppose it's a product decision and we can wait for Junlin's input, but I'd go for allowing users to choose the way they want to interact with our control panel. Removing normal select in favour of dnd feels like a step back to me




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (9c823cc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.14%`.
   > The diff coverage is `64.46%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   72.00%   -5.15%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45252     +247     
     Branches     5357     5470     +113     
   ==========================================
   - Hits        34723    32584    -2139     
   - Misses      10159    12458    +2299     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `80.43% <90.57%> (-0.38%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | [...nd/src/explore/components/ExploreViewContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci5qc3g=) | `2.42% <0.00%> (-75.76%)` | :arrow_down: |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `0.00% <0.00%> (-38.89%)` | :arrow_down: |
   | ... and [279 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-788097589


   @yardz
   issue found 
   in master, once you set this feature flag to True, new Echarts Graph is not working. 
   
   To reproduce 
   1. 
   ```
   DEFAULT_FEATURE_FLAGS = {
   ...
   ...
       "ENABLE_EXPLORE_DRAG_AND_DROP": True,
   }
   ```
   2. Create a Graph by 
   - clicking the top right + button to create new chart
   - Select Graph(in the last row) from the gallery
   - Select any dataset 
   - create, see error.  
   Expected behavior 
   
   https://user-images.githubusercontent.com/67837651/109529299-73a13980-7a6a-11eb-8d57-1b02713d3d82.mov
   
   thanks! 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (88330ff) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **increase** coverage by `8.09%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   72.29%   80.39%   +8.09%     
   ==========================================
     Files         864      298     -566     
     Lines       44883    24284   -20599     
     Branches     5403        0    -5403     
   ==========================================
   - Hits        32450    19524   -12926     
   + Misses      12224     4760    -7464     
   + Partials      209        0     -209     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `80.39% <ø> (-0.44%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `74.23% <0.00%> (-16.54%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.62% <0.00%> (-6.69%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `85.57% <0.00%> (-0.53%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.55% <0.00%> (-0.34%)` | :arrow_down: |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `56.32% <0.00%> (-0.16%)` | :arrow_down: |
   | [...et-frontend/src/SqlLab/components/TableElement.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmxlRWxlbWVudC5qc3g=) | | |
   | [...et-frontend/src/explore/controlPanels/sections.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29udHJvbFBhbmVscy9zZWN0aW9ucy5qc3g=) | | |
   | ... and [561 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...3c9039e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.25%`.
   > The diff coverage is `61.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   71.89%   -5.26%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45523     +518     
     Branches     5357     5475     +118     
   ==========================================
   - Hits        34723    32729    -1994     
   - Misses      10159    12584    +2425     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.41% <90.57%> (-0.40%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | ... and [310 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r583127546



##########
File path: 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';

Review comment:
       ```suggestion
   import { ExploreActions } from 'src/explore/actions/exploreActions';
   ```

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,119 @@
+/**
+ * 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, useTheme } from '@superset-ui/core';
+import { BaseControlConfig, ColumnMeta } from '@superset-ui/chart-controls';
+import ControlHeader from 'src/explore/components/ControlHeader';
+import {
+  AddControlLabel,
+  DndLabelsContainer,
+  HeaderContainer,
+} from 'src/explore/components/OptionControls';
+import {
+  DatasourcePanelDndItem,
+  DatasourcePanelDndType,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {
+  const theme = useTheme();
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [{ isOver, canDrop }, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      if (!optionSelector.isArray && !isEmpty(optionSelector.groupByOptions)) {
+        optionSelector.replace(0, item.metricOrColumnName);
+      } else {
+        optionSelector.add(item.metricOrColumnName);
+      }
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+      type: monitor.getItemType(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {

Review comment:
       Nit:
   
   ```suggestion
     function renderPlaceholder() {
   ```
   
   `function placeHolderRenderer` feels like the function will return a renderer itself.

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts
##########
@@ -0,0 +1,86 @@
+/**
+ * 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 {

Review comment:
       I think it's possible to make this generic, too, so you can support complex options (adhoc metrics, etc) in the list:
   
   ```ts
   import { ensureIsArray } from '@superset-ui/core';
   
   /**
    * Get value from an option array.
    */
   type GetValue<T> = (
     option: T | string,
     index?: number,
     array?: (T | string)[],
   ) => T | string;
   
   /**
    * Get option from a value array.
    */
   type GetOption<T> = (
     value: T | string,
     index?: number,
     array?: (T | string)[],
   ) => T;
   
   /**
    * Select options from a known list by option value. Ignores invalid options.
    *
    * @param options - all known options, a dict of value to option.
    * @param selected - value of selected options
    * @param getValue - how to get value from each option
    */
   export class OptionSelector<T> {
     options: { [key: string]: T };
   
     /**
      * Selected values, always an array.
      * If an item is string, then we look it up from options.
      */
     selected: (T | string)[];
   
     getValue: GetValue<T>;
   
     getOption: GetOption<T>;
   
     constructor({
       options,
       selected,
       getValue = x => x,
       getOption = x => (typeof x === 'string' ? this.options[x] : x),
     }: {
       options: { [key: string]: T };
       selected: (T | string)[] | T | string | null;
       getValue?: GetValue<T>;
       getOption?: GetOption<T>;
     }) {
       this.options = options;
       this.selected = ensureIsArray(selected)
         .map(getValue)
         .filter(x => (typeof x === 'string' ? x in options : Boolean(x)));
       this.getOption = getOption;
       this.getValue = getValue;
     }
   
     add(option: T) {
       const value = this.getValue(option);
       if (typeof value === 'string' || value in this.options) {
         this.selected.push(value);
       }
     }
   
     has(option: T): boolean {
       return this.selected.includes(this.getValue(option));
     }
   
     replace(idx: number, value: T | string) {
       this.selected[idx] = value;
     }
   
     del(idx: number) {
       this.selected.splice(idx, 1);
     }
   
     swap(a: number, b: number) {
       [this.selected[a], this.selected[b]] = [this.selected[b], this.selected[a]];
     }
   
     /**
      * Return selected options from value.
      */
     selectedOptions(): T[] {
       return this.selected.map(this.getOption);
     }
   }
   
   // since `isMulti` should be managed in the control state:
   isMulti ? optionSelector.selectedOptions() : optionSelector.selectedOptions()[0];
   ```
   
   Just a rough prototype but you get the idea.

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,119 @@
+/**
+ * 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, useTheme } from '@superset-ui/core';
+import { BaseControlConfig, ColumnMeta } from '@superset-ui/chart-controls';
+import ControlHeader from 'src/explore/components/ControlHeader';
+import {
+  AddControlLabel,
+  DndLabelsContainer,
+  HeaderContainer,
+} from 'src/explore/components/OptionControls';
+import {
+  DatasourcePanelDndItem,
+  DatasourcePanelDndType,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {
+  const theme = useTheme();
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [{ isOver, canDrop }, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      if (!optionSelector.isArray && !isEmpty(optionSelector.groupByOptions)) {
+        optionSelector.replace(0, item.metricOrColumnName);
+      } else {
+        optionSelector.add(item.metricOrColumnName);
+      }
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),

Review comment:
       Currently only columns have a `canDrop` indicator when dropping to a column select control, if you drag a metric, nothing will happen. It would be nice to allow drag & drop anything to any drop area while showing a useful `can't drop` warning when appropriate.
   
   E.g.
   
   <img width="1184" alt="Screen Shot 2021-02-25 at 10 32 42 AM" src="https://user-images.githubusercontent.com/335541/109213860-f7ef7600-7765-11eb-93ad-afdf068a05af.png">
   
   Example error messages:
   
   - Column already added
   - Cannot group by a metric

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,119 @@
+/**
+ * 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, useTheme } from '@superset-ui/core';
+import { BaseControlConfig, ColumnMeta } from '@superset-ui/chart-controls';
+import ControlHeader from 'src/explore/components/ControlHeader';
+import {
+  AddControlLabel,
+  DndLabelsContainer,
+  HeaderContainer,
+} from 'src/explore/components/OptionControls';
+import {
+  DatasourcePanelDndItem,
+  DatasourcePanelDndType,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;

Review comment:
       I think you may still need a `isMulti` flag because `null` could represents empty select for multiple selects as well.

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/types.ts
##########
@@ -0,0 +1,34 @@
+/**
+ * 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 interface OptionProps {
+  column: ColumnMeta;
+  index: number;
+  clickClose: (index: number) => void;
+  onShiftOptions: (dragIndex: number, hoverIndex: number) => void;
+  withCaret?: boolean;
+}
+
+export const GroupByItemType = 'groupByItem';

Review comment:
       One way to make this more generic:
   
   ```suggestion
   /**
    * All possible draggable items for the chart controls.
    */
   export enum DndItemType {
      // an existing column in table
      column = 'column',
      // a selected column option in ColumnSelectControl
      columnOption = 'columnOption',
      // an adhoc column option in ColumnSelectControl
      adhocColumnOption = 'adhocColumn',
      
      // a saved metric
      metric = 'metric',
      // a selected saved metric in MetricsControl
      metricOption = 'metricOption',
      // an adhoc metric option in MetricsControl
      adhocMetricOption = 'adhocMetric',
      
      // an adhoc filter option
      filterOption = 'filterOption',
    }
   ```
   
   - If a `DndItemType.metric` or `DndItemType.metricOption` is dropped to a group by (column select) control, reject and show a warning;
   - if a `DndItemType.column` or `columnOption` is dropped to metric control, create an adhoc metric using this column.
   - If a `metric`, `metricOption`, `column`, or `columnOption` is dragged to the adhoc filter control or sort by control, create a new filter using the metric or column.

##########
File path: superset-frontend/src/explore/components/DatasourcePanel/types.ts
##########
@@ -0,0 +1,30 @@
+/**
+ * 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 {
+  // todo: The new `metric` conflicts with the existing metric type
+  METRIC = 'datasource-panel-metric',
+  COLUMN = 'column',
+}
+
+export interface DatasourcePanelDndItem {
+  metricOrColumnName: string;
+  type:
+    | typeof DatasourcePanelDndType.METRIC
+    | typeof DatasourcePanelDndType.COLUMN;

Review comment:
       This should also work:
   
   ```suggestion
     type: DatasourcePanelDndType;
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582080120



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       This contentious point is almost the same as whether we should have "+" AND "ghost" button for click-to-select, and should we still support FilterBox after having native filter. 
   Most us believe the "ghost" button is more intuitive, while many from the community still prefer the existing way for various reason. In my roadmap google sheet, I stated that the biggest drives of implementing this feature are competitive, marketability, UX improvement.
   Competitive - Tableau only offers DND, no `select`. The question I have for ya'll is that how can we find out whether offering `select` as well ADD any value? We will find out later during usability or A/B testing. This should be a decision supported by data, let's not make decision for the users. 
   Marketability - Self explanatory, this driver doesn't affect final decision much
   User Experience - keep both under FF, run test, if having both significantly impact UX in a positive way, why not keeping both? 
   
   Cost - this is more a stakeholder question. do we want to spend 2x time to maintain 2 sets of feature that achieve basically the same goal, or do we want to spend our engineering/product/QA effort on something new that offer higher ROI? 
   
   @kgabryje @villebro 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581041787



##########
File path: superset-frontend/src/explore/components/DatasourcePanel.tsx
##########
@@ -204,7 +206,12 @@ export default function DataSourcePanel({
             </div>
             {metricSlice.map(m => (
               <LabelContainer key={m.metric_name} className="column">
-                <MetricOption metric={m} showType />
+                <DatasourcePanelDragWrapper
+                  metricOrColumnName={m.metric_name}
+                  type={DatasourcePanelDndType.METRIC}
+                >
+                  <MetricOption metric={m} showType />

Review comment:
       All right, I will add indicator style on this component and drop component.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581077986



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       This is a good question! 
   Code reuse can refine the logic, but it may make the logic difficult to understand. We should iterate it in the future. We have to consider all kinds of components. 
   e.g.
   - various Filter(datetime filter, numeric filter, text filter)
   - various dimension selection(simple dimension dimension set, dimension hierarchy)
   
   The current DND should be just a prototype. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582701919



##########
File path: 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.isScalar = false;
+      this.isArray = false;

Review comment:
       Shouldn't this be `this.isArray = true`?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (3c9039e) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **decrease** coverage by `10.30%`.
   > The diff coverage is `37.50%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13210       +/-   ##
   ===========================================
   - Coverage   72.29%   61.99%   -10.31%     
   ===========================================
     Files         864      576      -288     
     Lines       44883    20774    -24109     
     Branches     5403     5447       +44     
   ===========================================
   - Hits        32450    12879    -19571     
   + Misses      12224     7686     -4538     
     Partials      209      209               
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.99% <37.50%> (-0.25%)` | :arrow_down: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.33% <3.33%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `30.55% <30.55%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `63.63% <63.63%> (ø)` | |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `80.00% <100.00%> (+0.83%)` | :arrow_up: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.23% <100.00%> (+0.35%)` | :arrow_up: |
   | [...omponents/controls/DndColumnSelectControl/index.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2luZGV4LnRz) | `100.00% <100.00%> (ø)` | |
   | ... and [315 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...3c9039e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582080120



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       This contentious point is almost the same as whether we should have "+" AND "ghost" button for click-to-select, and should we still support FilterBox after having native filter. 
   Most us believe the "ghost" button is more intuitive, while many from the community still prefer the existing way for various reason. In my roadmap google sheet, I stated that the biggest drives of implementing this feature are competitive, marketability, UX improvement.
   Competitive - Tableau only offers DND, no `select`. The question I have for ya'll is that how can we find out whether offering `select` as well ADD any value? We will find out later during usability or A/B testing. This should be a decision supported by data, let's not make decision for the users. 
   Marketability - Self explanatory, this driver doesn't affect final decision
   User Experience - keep both under FF, run test, if having both significantly impact UX in a positive way, why not keeping both? 
   
   Cost - this is more a stakeholder question. do we want to spend 2x time to maintain 2 sets of feature that achieve basically the same goal, or do we want to spend our engineering/product/QA effort on something new that offer higher ROI? 
   
   @kgabryje @villebro 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (9c823cc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.14%`.
   > The diff coverage is `64.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   77.00%   -0.15%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45282     +277     
     Branches     5357     5470     +113     
   ==========================================
   + Hits        34723    34869     +146     
   - Misses      10159    10290     +131     
     Partials      123      123              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.19% <22.15%> (-0.32%)` | :arrow_down: |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `80.73% <90.57%> (-0.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `38.70% <0.00%> (-0.18%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [63 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580984118



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       I guess, `select control` and `drag and drag control` need choose one of two. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (c6e5934) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **increase** coverage by `3.55%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.18%   80.73%   +3.55%     
   ==========================================
     Files         881      300     -581     
     Lines       45499    24420   -21079     
     Branches     5447        0    -5447     
   ==========================================
   - Hits        35119    19716   -15403     
   + Misses      10256     4704    -5552     
   + Partials      124        0     -124     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | hive | `79.97% <ø> (ø)` | |
   | javascript | `?` | |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.73% <ø> (-0.12%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `82.47% <0.00%> (-5.99%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.55% <0.00%> (-0.28%)` | :arrow_down: |
   | [...rontend/src/SqlLab/components/TabbedSqlEditors.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1RhYmJlZFNxbEVkaXRvcnMuanN4) | | |
   | [...s/ErrorMessage/getErrorMessageComponentRegistry.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvRXJyb3JNZXNzYWdlL2dldEVycm9yTWVzc2FnZUNvbXBvbmVudFJlZ2lzdHJ5LnRz) | | |
   | [...src/explore/components/controls/SpatialControl.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9TcGF0aWFsQ29udHJvbC5qc3g=) | | |
   | [...et-frontend/src/dashboard/components/Dashboard.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Rhc2hib2FyZC5qc3g=) | | |
   | [...rc/explore/components/controls/TextAreaControl.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9UZXh0QXJlYUNvbnRyb2wuanN4) | | |
   | [...set-frontend/src/common/components/ProgressBar.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL1Byb2dyZXNzQmFyLnRzeA==) | | |
   | [...frontend/src/explore/components/DataTablesPane.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhVGFibGVzUGFuZS50c3g=) | | |
   | ... and [568 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (d71bf1b) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `5.13%`.
   > The diff coverage is `50.25%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   72.05%   -5.14%     
   ==========================================
     Files         881      894      +13     
     Lines       45499    45634     +135     
     Branches     5447     5490      +43     
   ==========================================
   - Hits        35119    32881    -2238     
   - Misses      10256    12541    +2285     
   - Partials      124      212      +88     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | hive | `?` | |
   | javascript | `62.40% <50.25%> (-0.16%)` | :arrow_down: |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.43% <ø> (-0.43%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `64.51% <55.55%> (-7.78%)` | :arrow_down: |
   | [...et-frontend/src/components/Pagination/Ellipsis.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9FbGxpcHNpcy50c3g=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Item.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9JdGVtLnRzeA==) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Next.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9OZXh0LnRzeA==) | `100.00% <100.00%> (ø)` | |
   | ... and [242 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...1854cd7](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581044124



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       The code logic of the selector is already very complicated. And it is difficult to add complex logic (such as hierarchical). I suggest referring to modern BI design. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581981699



##########
File path: superset-frontend/src/explore/components/OptionControls.tsx
##########
@@ -92,7 +92,26 @@ export const LabelsContainer = styled.div`
   border-radius: ${({ theme }) => theme.gridUnit}px;
 `;
 
-export const AddControlLabel = styled.div`
+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}`;
+    }

Review comment:
       It feels like `dashed 1px` doesn't stick out quite enough. IMO `2px` looked better, but then the default `1 px` causes this to resize when hovering in/out, so that doesn't work quite so well without addditional tuning of the default borders.

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       Agree with both - this should be made generic, but as a first POC behind a FF I'm ok with this being more specific and making it more generic later.

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       I personally feel it's better to offer the users the option of using the traditional approach, especially as long there is a sensible control which you can click. While e.g. Tableau AFAIK only supports dnd interaction, in that UI it makes more sense, but in Superset I feel it's still a perfectly valid path to adding filters/metrics/columns.

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts
##########
@@ -0,0 +1,86 @@
+/**
+ * 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 };
+
+  isScalar: boolean;
+
+  constructor(
+    options: { string: ColumnMeta },
+    values: string[] | string | null,
+  ) {
+    this.options = options;
+    let groupByValues: string[];
+    if (Array.isArray(values)) {
+      groupByValues = values;
+      this.isScalar = false;
+    } else {
+      groupByValues = values ? [values] : [];
+      this.isScalar = true;
+    }

Review comment:
       This might just be me, but I feel the term `scalar` can cause confusion here (in mathematics a scalar is a real number, which in the context of JS would be `number`). I'd rather use `isArray` to highlight that this refers to distinguishing between a arrays and non-arrays.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.24%`.
   > The diff coverage is `61.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   71.91%   -5.25%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45551     +546     
     Branches     5357     5475     +118     
   ==========================================
   - Hits        34723    32756    -1967     
   - Misses      10159    12585    +2426     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.43% <90.57%> (-0.38%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | ... and [303 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582148090



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       `We currently only support max 50 columns in the column list. While it's possible to filter the list, it is currently not possible to browse the full list like it is in the current select control.`
   
   the panel search bar is very robust which supports key word search in column & metric names, label/verbose name, description, and even warning, information. when # of column reach 50, i doubt scrolling through the list is the primary way to look for the objects. 
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (a61f208) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `15.13%`.
   > The diff coverage is `36.02%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13210       +/-   ##
   ===========================================
   - Coverage   77.15%   62.01%   -15.14%     
   ===========================================
     Files         866      576      -290     
     Lines       45005    20792    -24213     
     Branches     5357     5453       +96     
   ===========================================
   - Hits        34723    12894    -21829     
   + Misses      10159     7689     -2470     
   - Partials      123      209       +86     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.01% <36.02%> (-0.19%)` | :arrow_down: |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.33% <3.33%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `27.77% <27.77%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `80.00% <100.00%> (+4.00%)` | :arrow_up: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.23% <100.00%> (-2.06%)` | :arrow_down: |
   | [...omponents/controls/DndColumnSelectControl/index.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2luZGV4LnRz) | `100.00% <100.00%> (ø)` | |
   | ... and [525 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...a61f208](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (d71bf1b) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `0.20%`.
   > The diff coverage is `50.25%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   76.98%   -0.21%     
   ==========================================
     Files         881      894      +13     
     Lines       45499    45664     +165     
     Branches     5447     5490      +43     
   ==========================================
   + Hits        35119    35155      +36     
   - Misses      10256    10385     +129     
     Partials      124      124              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.63% <24.18%> (-0.45%)` | :arrow_down: |
   | hive | `79.97% <ø> (ø)` | |
   | javascript | `62.40% <50.25%> (-0.16%)` | :arrow_down: |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.73% <ø> (-0.12%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `66.66% <55.55%> (-5.63%)` | :arrow_down: |
   | [...et-frontend/src/components/Pagination/Ellipsis.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9FbGxpcHNpcy50c3g=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Item.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9JdGVtLnRzeA==) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Next.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9OZXh0LnRzeA==) | `100.00% <100.00%> (ø)` | |
   | ... and [26 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-786347942


   🟢 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.27%`.
   > The diff coverage is `62.02%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   76.87%   -0.28%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45581     +576     
     Branches     5357     5475     +118     
   ==========================================
   + Hits        34723    35042     +319     
   - Misses      10159    10416     +257     
     Partials      123      123              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.83% <20.49%> (-0.68%)` | :arrow_down: |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.73% <90.57%> (-0.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | ... and [88 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (a61f208) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.46%`.
   > The diff coverage is `36.02%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   71.69%   -5.47%     
   ==========================================
     Files         866      875       +9     
     Lines       45005    45100      +95     
     Branches     5357     5453      +96     
   ==========================================
   - Hits        34723    32333    -2390     
   - Misses      10159    12558    +2399     
   - Partials      123      209      +86     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.01% <36.02%> (-0.19%)` | :arrow_down: |
   | python | `79.96% <ø> (-0.85%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.33% <3.33%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `27.77% <27.77%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `80.00% <100.00%> (+4.00%)` | :arrow_up: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.23% <100.00%> (-2.06%)` | :arrow_down: |
   | ... and [249 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...a61f208](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie merged pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie merged pull request #13210:
URL: https://github.com/apache/superset/pull/13210


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582349830



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       @zhaoyongjie could you elaborate on what is a dimension set and dimension hierarchy? They sound like pretty advanced feature and I'm not sure they should be a concern in implementing the first draft of a generic component.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.36%`.
   > The diff coverage is `62.02%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   76.78%   -0.37%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45581     +576     
     Branches     5357     5475     +118     
   ==========================================
   + Hits        34723    34999     +276     
   - Misses      10159    10455     +296     
   - Partials      123      127       +4     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.44% <20.49%> (-1.07%)` | :arrow_down: |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.73% <90.57%> (-0.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | ... and [92 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582080120



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       This contentious point is almost the same as whether we should have "+" AND "ghost" button for click-to-select, and should we still support FilterBox after having native filter. 
   Most of us believe that the "ghost" button is more intuitive, while many from the community still prefer the existing way for various reasons. In my roadmap google sheet, I stated that the biggest drives of implementing this feature are competitive, marketability, UX improvement.
   Competitive - Tableau only offers DND, no SELECT. The question I have for ya'll is that how can we find out whether offering SELECT as well ADD any value, and what that would be? We will find out later during usability or A/B testing. This should be a decision supported by data, let's not make decision for the users. 
   Marketability - Self explanatory, this driver doesn't affect final decision much
   User Experience - keep both under FF, run test, if having both significantly impact UX in a positive way, why not keeping both? 
   
   Cost - this is more a stakeholder question. do we want to spend 2x time to maintain 2 sets of feature that achieve basically the same goal, or do we want to spend our engineering/product/QA effort on a set of new feature that brings more value and offers higher ROI? 
   
   Let's hand over the ball to our designer @mihir174, I'm sure he will take all our feedback and come up with the best solution forusers. 
   
   @kgabryje @villebro 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581077986



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       This is a good question! 
   Code reuse can refined the logic, but it may make the logic difficult to understand. We should iterate it in the future. We have to consider all kinds of component. 
   e.g.
   - various Filter(datetime filter, numeric filter, text filter)
   - various dimension selection(simple dimension dimension set, dimension hierarchy)
   
   The current DND should be just a prototype. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582080120



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       This contentious point is almost the same as whether we should have "+" AND "ghost" button for click-to-select, and should we still support FilterBox after having native filter. 
   Most us believe the "ghost" button is more intuitive, while many from the community still prefer the existing way for various reason. In my roadmap google sheet, I stated that the biggest drives of implementing this feature are competitive, marketability, UX improvement.
   Competitive - Tableau only offers DND, no `select`. The question I have for ya'll is that how can we find out whether offering `select` as well ADD any value? We will find out later during usability or A/B testing. This should be a decision supported by data, let's not make decision for the users. 
   Marketability - Self explanatory, this driver doesn't affect final decision much
   User Experience - keep both under FF, run test, if having both significantly impact UX in a positive way, why not keeping both? 
   
   Cost - this is more a stakeholder question. do we want to spend 2x time to maintain 2 sets of feature that achieve basically the same goal, or do we want to spend our engineering/product/QA effort on a set of new feature that brings more value and offers higher ROI? 
   
   Let's hand over the ball to our designer @mihir174, I'm sure he will take all our feedback and come up with the best solution forusers. 
   
   @kgabryje @villebro 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (3510e15) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `4.51%`.
   > The diff coverage is `35.52%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   72.67%   -4.52%     
   ==========================================
     Files         881      594     -287     
     Lines       45499    21244   -24255     
     Branches     5447     5490      +43     
   ==========================================
   - Hits        35119    15439   -19680     
   + Misses      10256     5681    -4575     
     Partials      124      124              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.63% <17.88%> (-0.45%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `62.40% <35.52%> (-0.16%)` | :arrow_down: |
   | mysql | `?` | |
   | postgres | `?` | |
   | presto | `?` | |
   | python | `?` | |
   | sqlite | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `66.66% <55.55%> (-5.63%)` | :arrow_down: |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `76.92% <100.00%> (+0.92%)` | :arrow_up: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...omponents/controls/DndColumnSelectControl/index.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2luZGV4LnRz) | `100.00% <100.00%> (ø)` | |
   | ... and [319 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582207003



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       @junlincc Trust me, most users are lazy and would not want to type. Browsing the list to add columns is probably a much more common use case than you thought. For example, in Airbnb, in one of the datasources, there are many metrics with "nights_booked" in the name, when users want to find a specific metric related to "nights_booked" but couldn't remember the exact name, even after they typed "nights_booked", they may still need to browse through more than 50 options.
   
   Re: offering DnD only or both interactions:
   
   I think one of the biggest advantage of Superset is the ability to create adhoc metric very easily. I'm struggling to imagine how that workflow of conveniently creating adhoc metrics/columns would look like without a popover. If we are going to build a popover anyway, why not keep both DnD and click? With proper design and abstraction, the code complexity should be manageable.
   
   Re: code maintenance:
   
   That said, current code indeed is very complex, and is not even in TypeScript, so I'm in support of writing the new control bit by bit from scratch. But I also think it would make sense to be generic from the get go and make sure the architecture can support all use cases---because we already have so much learning from the existing controls.
   
   It would be nice if we can focus on collecting all feature requests first and do an architecture review (maybe in a SIP?) before diving deep into implementing the full feature for a specific control type. This POC is a good starting point to kick off the conversation, but let's make sure we get things right to avoid wasted work.
   
   I'm also not sure how to run user testing in this case, do we ask users to choose between DnD and click? Do we do that after all features for DnD are implemented or before? What if users pick click because DnD is not easy to use enough? These controls need an overhaul anyway so I can't imagine a case where we will abandon the new solution just because of some unfavorable use feedbacks (which are probably fixable).
   
   It is also not true that we will need to spend 2x of time to maintain two sets of features. Current select controls can have a code freeze while we work on the new controls with more advanced features and better architecture. We would probably need that to stay focused.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `2.04%`.
   > The diff coverage is `61.89%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   75.10%   -2.05%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45579     +574     
     Branches     5357     5475     +118     
   ==========================================
   - Hits        34723    34234     -489     
   - Misses      10159    11200    +1041     
   - Partials      123      145      +22     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `52.54% <18.81%> (-5.98%)` | :arrow_down: |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.73% <90.57%> (-0.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `85.71% <ø> (-1.03%)` | :arrow_down: |
   | ... and [199 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (9c823cc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.14%`.
   > The diff coverage is `64.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   77.00%   -0.15%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45282     +277     
     Branches     5357     5470     +113     
   ==========================================
   + Hits        34723    34869     +146     
   - Misses      10159    10290     +131     
     Partials      123      123              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.19% <22.15%> (-0.32%)` | :arrow_down: |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `80.73% <90.57%> (-0.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `38.70% <0.00%> (-0.18%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [63 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (58beef1) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **decrease** coverage by `14.04%`.
   > The diff coverage is `16.19%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13210       +/-   ##
   ===========================================
   - Coverage   72.29%   58.25%   -14.05%     
   ===========================================
     Files         864      485      -379     
     Lines       44883    16077    -28806     
     Branches     5403     4142     -1261     
   ===========================================
   - Hits        32450     9365    -23085     
   + Misses      12224     6712     -5512     
   + Partials      209        0      -209     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.25% <16.19%> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `68.29% <ø> (-10.88%)` | :arrow_down: |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `0.00% <0.00%> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.51% <100.00%> (+0.63%)` | :arrow_up: |
   | [...omponents/controls/DndColumnSelectControl/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3R5cGVzLnRz) | `100.00% <100.00%> (ø)` | |
   | ... and [794 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...58beef1](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (7eb35bc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **increase** coverage by `2.85%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.15%   80.01%   +2.85%     
   ==========================================
     Files         866      300     -566     
     Lines       45005    24418   -20587     
     Branches     5357        0    -5357     
   ==========================================
   - Hits        34723    19537   -15186     
   + Misses      10159     4881    -5278     
   + Partials      123        0     -123     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `80.01% <ø> (-0.80%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `74.23% <0.00%> (-16.54%)` | :arrow_down: |
   | [superset/databases/commands/create.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL2NyZWF0ZS5weQ==) | `83.67% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/databases/commands/update.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3VwZGF0ZS5weQ==) | `85.71% <0.00%> (-8.17%)` | :arrow_down: |
   | [superset/db\_engine\_specs/sqlite.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3NxbGl0ZS5weQ==) | `90.62% <0.00%> (-6.25%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `84.58% <0.00%> (-6.00%)` | :arrow_down: |
   | [superset/reports/notifications/slack.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL3NsYWNrLnB5) | `83.72% <0.00%> (-5.47%)` | :arrow_down: |
   | [superset/databases/commands/test\_connection.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGF0YWJhc2VzL2NvbW1hbmRzL3Rlc3RfY29ubmVjdGlvbi5weQ==) | `84.78% <0.00%> (-4.35%)` | :arrow_down: |
   | ... and [586 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-785228920


   Addition thoughts about whether we should keep select or not. 
   1. SELECT has limitation in realizing complex hierarchy/grouping interaction. dimension/columns, metrics grouping and hierarchy are very common BI tool, I will send more example in Tableau and PowerBI. 
   
   2. When there are multiple DROP targets, dnd help set some drop restrictions. For example, If target A is dropped, target B will not accept drop values. (There are cases in PivotTable where  groupby and column restrict each other)
   
   3. performance. do we need to render options in dimensions/columns and metrics twice? 
   
   
   
   
   Performance considerations: Now all targets have to repeat columns/metrics, which is completely unnecessary


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580983177



##########
File path: 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 { DatasourcePanelDndItem } from './types';
+
+interface DatasourcePanelDragWrapperProps extends DatasourcePanelDndItem {
+  children?: ReactNode;
+}
+
+export default function DatasourcePanelDragWrapper(
+  props: DatasourcePanelDragWrapperProps,
+) {
+  const [, drag] = useDrag({
+    item: {
+      metricOrColumnName: props.metricOrColumnName,
+      type: props.type,
+    },
+  });
+
+  return (
+    <>

Review comment:
       good catch. I will remove it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] junlincc edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
junlincc edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-785228920


   Addition thoughts about whether we should keep select or not. 
   1. SELECT has limitation in realizing complex hierarchy/grouping interaction. dimension/columns, metrics grouping and hierarchy are very common BI tool which which we currently lack. 
   
   2. When there are multiple DROP targets, dnd help set some drop restrictions. For example, If target A is dropped, target B will not accept drop values. (There are cases in PivotTable where  groupby and column restrict each other)
   
   3. performance. do we need to render options in dimensions/columns and metrics twice? 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (9c823cc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **increase** coverage by `2.81%`.
   > The diff coverage is `90.57%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.15%   79.96%   +2.81%     
   ==========================================
     Files         866      300     -566     
     Lines       45005    24392   -20613     
     Branches     5357        0    -5357     
   ==========================================
   - Hits        34723    19506   -15217     
   + Misses      10159     4886    -5273     
   + Partials      123        0     -123     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `79.96% <90.57%> (-0.85%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `0.00% <ø> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <ø> (ø)` | |
   | [superset/connectors/druid/models.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9kcnVpZC9tb2RlbHMucHk=) | `82.06% <50.00%> (-0.08%)` | :arrow_down: |
   | [superset/reports/notifications/slack.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL3NsYWNrLnB5) | `83.72% <71.42%> (-5.47%)` | :arrow_down: |
   | [superset/common/query\_context.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHQucHk=) | `81.52% <75.00%> (-3.28%)` | :arrow_down: |
   | [superset/common/query\_object.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdC5weQ==) | `90.27% <81.25%> (-1.27%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `90.40% <87.50%> (-0.18%)` | :arrow_down: |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `88.45% <92.85%> (+0.18%)` | :arrow_up: |
   | [superset/reports/notifications/email.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL2VtYWlsLnB5) | `97.82% <93.33%> (-2.18%)` | :arrow_down: |
   | ... and [579 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (88330ff) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **increase** coverage by `8.09%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   72.29%   80.39%   +8.09%     
   ==========================================
     Files         864      298     -566     
     Lines       44883    24284   -20599     
     Branches     5403        0    -5403     
   ==========================================
   - Hits        32450    19524   -12926     
   + Misses      12224     4760    -7464     
   + Partials      209        0     -209     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `80.39% <ø> (-0.44%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `74.23% <0.00%> (-16.54%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.62% <0.00%> (-6.69%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `85.57% <0.00%> (-0.53%)` | :arrow_down: |
   | [superset/models/core.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2NvcmUucHk=) | `88.55% <0.00%> (-0.34%)` | :arrow_down: |
   | [superset/viz.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdml6LnB5) | `56.32% <0.00%> (-0.16%)` | :arrow_down: |
   | [...-frontend/src/explore/reducers/saveModalReducer.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvcmVkdWNlcnMvc2F2ZU1vZGFsUmVkdWNlci5qcw==) | | |
   | [superset-frontend/src/common/components/Badge.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0JhZGdlLnRzeA==) | | |
   | ... and [561 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...3c9039e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io commented on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (58beef1) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **decrease** coverage by `13.72%`.
   > The diff coverage is `16.19%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #13210       +/-   ##
   ===========================================
   - Coverage   72.29%   58.57%   -13.73%     
   ===========================================
     Files         864      442      -422     
     Lines       44883    13394    -31489     
     Branches     5403     3548     -1855     
   ===========================================
   - Hits        32450     7845    -24605     
   + Misses      12224     5549     -6675     
   + Partials      209        0      -209     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.57% <16.19%> (?)` | |
   | javascript | `?` | |
   | python | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `68.29% <ø> (-10.88%)` | :arrow_down: |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `0.00% <0.00%> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.51% <100.00%> (+0.63%)` | :arrow_up: |
   | [...omponents/controls/DndColumnSelectControl/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3R5cGVzLnRz) | `100.00% <100.00%> (ø)` | |
   | ... and [812 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...58beef1](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582759067



##########
File path: 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.isScalar = false;
+      this.isArray = false;

Review comment:
       thanks for reminding me. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.08%`.
   > The diff coverage is `61.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   72.07%   -5.09%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45551     +546     
     Branches     5357     5475     +118     
   ==========================================
   - Hits        34723    32830    -1893     
   - Misses      10159    12511    +2352     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.73% <90.57%> (-0.08%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | ... and [299 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582436382



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts
##########
@@ -0,0 +1,86 @@
+/**
+ * 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 };
+
+  isScalar: boolean;
+
+  constructor(
+    options: { string: ColumnMeta },
+    values: string[] | string | null,
+  ) {
+    this.options = options;
+    let groupByValues: string[];
+    if (Array.isArray(values)) {
+      groupByValues = values;
+      this.isScalar = false;
+    } else {
+      groupByValues = values ? [values] : [];
+      this.isScalar = true;
+    }

Review comment:
       `scalar` in linear algebra, relative to `vector`. refer to SQLAlachemy and Pandas variable naming. 
   
   `isArray` more straightforward, I changed this variable name.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581819157



##########
File path: superset-frontend/src/explore/components/DatasourcePanel.tsx
##########
@@ -204,7 +206,12 @@ export default function DataSourcePanel({
             </div>
             {metricSlice.map(m => (
               <LabelContainer key={m.metric_name} className="column">
-                <MetricOption metric={m} showType />
+                <DatasourcePanelDragWrapper
+                  metricOrColumnName={m.metric_name}
+                  type={DatasourcePanelDndType.METRIC}
+                >
+                  <MetricOption metric={m} showType />

Review comment:
       The style `pointer: move` on the datasource panel looks strange. the UI behavior we can ask @mihir174 
   
   https://user-images.githubusercontent.com/2016594/108982934-4ac72000-76c9-11eb-9735-c3cd04557926.mp4
   
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (88330ff) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **increase** coverage by `8.03%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   72.29%   80.33%   +8.03%     
   ==========================================
     Files         864      298     -566     
     Lines       44883    24256   -20627     
     Branches     5403        0    -5403     
   ==========================================
   - Hits        32450    19485   -12965     
   + Misses      12224     4771    -7453     
   + Partials      209        0     -209     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `?` | |
   | python | `80.33% <ø> (-0.51%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/db\_engines/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lcy9oaXZlLnB5) | `0.00% <0.00%> (-85.72%)` | :arrow_down: |
   | [superset/sql\_validators/postgres.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvc3FsX3ZhbGlkYXRvcnMvcG9zdGdyZXMucHk=) | `50.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [superset/db\_engine\_specs/hive.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2hpdmUucHk=) | `74.23% <0.00%> (-16.54%)` | :arrow_down: |
   | [superset/db\_engine\_specs/presto.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3ByZXN0by5weQ==) | `81.62% <0.00%> (-6.69%)` | :arrow_down: |
   | [superset/db\_engine\_specs/postgres.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL3Bvc3RncmVzLnB5) | `93.42% <0.00%> (-2.64%)` | :arrow_down: |
   | [superset/models/dashboard.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvbW9kZWxzL2Rhc2hib2FyZC5weQ==) | `75.62% <0.00%> (-2.21%)` | :arrow_down: |
   | [superset/views/database/mixins.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdmlld3MvZGF0YWJhc2UvbWl4aW5zLnB5) | `81.03% <0.00%> (-1.73%)` | :arrow_down: |
   | [superset/db\_engine\_specs/base.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvZGJfZW5naW5lX3NwZWNzL2Jhc2UucHk=) | `85.57% <0.00%> (-0.53%)` | :arrow_down: |
   | [superset/reports/notifications/base.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL2Jhc2UucHk=) | `95.00% <0.00%> (-0.46%)` | :arrow_down: |
   | ... and [572 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...3c9039e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581077986



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       This is a good question! 
   Code reuse can refined the logic, but it may make the logic difficult to understand. We should iterate it in the future.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580982204



##########
File path: superset-frontend/spec/javascripts/explore/components/DatasourcePanel_spec.jsx
##########
@@ -55,26 +57,42 @@ describe('datasourcepanel', () => {
   }
 
   it('should render', () => {
-    const { container } = render(<DatasourcePanel {...props} />);
+    const { container } = render(
+      <DndProvider backend={HTML5Backend}>

Review comment:
       good point, I will change it to setup function




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581044124



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       The code logic of the selector is already very complicated, and it is difficult to add complex logic (such as hierarchical). I suggest referring to modern BI design. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581077986



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       This is a good question! 
   Code reuse can refined the logic, but it may make the logic difficult to understand. We should iterate it in the future.
   eg: 
   - various Filter(datetime filter, numeric filter, text filter)
   - various dimension selection(simple dimension dimension set, dimension hierarchy)
   
   The current DND should be just a prototype. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (c6e5934) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **increase** coverage by `3.66%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.18%   80.85%   +3.66%     
   ==========================================
     Files         881      300     -581     
     Lines       45499    24420   -21079     
     Branches     5447        0    -5447     
   ==========================================
   - Hits        35119    19745   -15374     
   + Misses      10256     4675    -5581     
   + Partials      124        0     -124     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | hive | `79.97% <ø> (ø)` | |
   | javascript | `?` | |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `80.01% <ø> (ø)` | |
   | python | `80.85% <ø> (ø)` | |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...rontend/src/dashboard/components/DashboardGrid.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL0Rhc2hib2FyZEdyaWQuanN4) | | |
   | [...perset-frontend/src/views/CRUD/welcome/Welcome.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvd2VsY29tZS9XZWxjb21lLnRzeA==) | | |
   | [superset-frontend/src/messageToasts/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL21lc3NhZ2VUb2FzdHMvdHlwZXMudHM=) | | |
   | [...set-frontend/src/dashboard/reducers/datasources.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9yZWR1Y2Vycy9kYXRhc291cmNlcy5qcw==) | | |
   | [...ntend/src/dashboard/util/getRevertedFilterScope.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC91dGlsL2dldFJldmVydGVkRmlsdGVyU2NvcGUudHM=) | | |
   | [...c/filters/components/Select/SelectFilterPlugin.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9TZWxlY3QvU2VsZWN0RmlsdGVyUGx1Z2luLnRzeA==) | | |
   | [...tend/src/explore/components/DisplayQueryButton.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EaXNwbGF5UXVlcnlCdXR0b24uanN4) | | |
   | [...ws/CRUD/data/savedquery/SavedQueryPreviewModal.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0NSVUQvZGF0YS9zYXZlZHF1ZXJ5L1NhdmVkUXVlcnlQcmV2aWV3TW9kYWwudHN4) | | |
   | [...tend/src/SqlLab/components/ScheduleQueryButton.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL1NxbExhYi9jb21wb25lbnRzL1NjaGVkdWxlUXVlcnlCdXR0b24uanN4) | | |
   | ... and [566 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...3510e15](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582013002



##########
File path: superset-frontend/src/explore/components/OptionControls.tsx
##########
@@ -92,7 +92,26 @@ export const LabelsContainer = styled.div`
   border-radius: ${({ theme }) => theme.gridUnit}px;
 `;
 
-export const AddControlLabel = styled.div`
+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}`;
+    }

Review comment:
       > I think that we should also add an indicator for `canDrop && !isOver` so that user knows where he can drag a column
   
   Yeah I like that idea 👍 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (3c9039e) into [master](https://codecov.io/gh/apache/superset/commit/9b5e66b728190e0dde5e6ddfb0f018cbdd8e5283?el=desc) (9b5e66b) will **decrease** coverage by `0.38%`.
   > The diff coverage is `37.50%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   72.29%   71.91%   -0.39%     
   ==========================================
     Files         864      874      +10     
     Lines       44883    45058     +175     
     Branches     5403     5447      +44     
   ==========================================
   - Hits        32450    32403      -47     
   - Misses      12224    12446     +222     
     Partials      209      209              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `61.99% <37.50%> (-0.25%)` | :arrow_down: |
   | python | `80.39% <ø> (-0.44%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.33% <3.33%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `30.55% <30.55%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `63.63% <63.63%> (ø)` | |
   | [...rontend/src/explore/components/DatasourcePanel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwudHN4) | `80.00% <100.00%> (+0.83%)` | :arrow_up: |
   | [...nts/DatasourcePanel/DatasourcePanelDragWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvRGF0YXNvdXJjZVBhbmVsRHJhZ1dyYXBwZXIudHN4) | `100.00% <100.00%> (ø)` | |
   | [...nd/src/explore/components/DatasourcePanel/types.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9EYXRhc291cmNlUGFuZWwvdHlwZXMudHM=) | `100.00% <100.00%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `70.23% <100.00%> (+0.35%)` | :arrow_up: |
   | ... and [27 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [9b5e66b...3c9039e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.28%`.
   > The diff coverage is `61.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   71.86%   -5.29%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45523     +518     
     Branches     5357     5475     +118     
   ==========================================
   - Hits        34723    32717    -2006     
   - Misses      10159    12596    +2437     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.36% <90.57%> (-0.45%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | ... and [313 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.21%`.
   > The diff coverage is `62.02%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   76.93%   -0.22%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45581     +576     
     Branches     5357     5475     +118     
   ==========================================
   + Hits        34723    35069     +346     
   - Misses      10159    10389     +230     
     Partials      123      123              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.83% <20.49%> (-0.68%)` | :arrow_down: |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `80.84% <90.57%> (+0.03%)` | :arrow_up: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | ... and [86 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940






----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r580984118



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       I thank, `select control` and `drag and drag control` need choose one of two. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (9c823cc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.40%`.
   > The diff coverage is `64.46%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   71.74%   -5.41%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45224     +219     
     Branches     5357     5470     +113     
   ==========================================
   - Hits        34723    32448    -2275     
   - Misses      10159    12566    +2407     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `79.96% <90.57%> (-0.85%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | [...nd/src/explore/components/ExploreViewContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9FeHBsb3JlVmlld0NvbnRhaW5lci5qc3g=) | `2.42% <0.00%> (-75.76%)` | :arrow_down: |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `0.00% <0.00%> (-38.89%)` | :arrow_down: |
   | ... and [301 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **increase** coverage by `2.81%`.
   > The diff coverage is `90.57%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   + Coverage   77.15%   79.96%   +2.81%     
   ==========================================
     Files         866      300     -566     
     Lines       45005    24392   -20613     
     Branches     5357        0    -5357     
   ==========================================
   - Hits        34723    19506   -15217     
   + Misses      10159     4886    -5273     
   + Partials      123        0     -123     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `?` | |
   | python | `79.96% <90.57%> (-0.85%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [superset/reports/commands/log\_prune.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9jb21tYW5kcy9sb2dfcHJ1bmUucHk=) | `0.00% <ø> (ø)` | |
   | [superset/utils/cache.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY2FjaGUucHk=) | `76.34% <ø> (ø)` | |
   | [superset/utils/date\_parser.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvZGF0ZV9wYXJzZXIucHk=) | `96.87% <ø> (ø)` | |
   | [superset/connectors/druid/models.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9kcnVpZC9tb2RlbHMucHk=) | `82.06% <50.00%> (-0.08%)` | :arrow_down: |
   | [superset/reports/notifications/slack.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvcmVwb3J0cy9ub3RpZmljYXRpb25zL3NsYWNrLnB5) | `83.72% <71.42%> (-5.47%)` | :arrow_down: |
   | [superset/common/query\_context.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X2NvbnRleHQucHk=) | `81.52% <75.00%> (-3.28%)` | :arrow_down: |
   | [superset/common/query\_object.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29tbW9uL3F1ZXJ5X29iamVjdC5weQ==) | `90.27% <81.25%> (-1.27%)` | :arrow_down: |
   | [superset/connectors/sqla/models.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29ubmVjdG9ycy9zcWxhL21vZGVscy5weQ==) | `90.40% <87.50%> (-0.18%)` | :arrow_down: |
   | [superset/utils/core.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvdXRpbHMvY29yZS5weQ==) | `88.45% <92.85%> (+0.18%)` | :arrow_up: |
   | ... and [565 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (306899c) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.16%`.
   > The diff coverage is `60.37%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   76.99%   -0.17%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45243     +238     
     Branches     5357     5470     +113     
   ==========================================
   + Hits        34723    34834     +111     
   - Misses      10159    10286     +127     
     Partials      123      123              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.20% <22.15%> (-0.31%)` | :arrow_down: |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `80.72% <89.84%> (-0.09%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `38.70% <0.00%> (-0.18%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [57 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...ff34d6e](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (9c823cc) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `0.31%`.
   > The diff coverage is `64.92%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   76.84%   -0.32%     
   ==========================================
     Files         866      881      +15     
     Lines       45005    45282     +277     
     Branches     5357     5470     +113     
   ==========================================
   + Hits        34723    34795      +72     
   - Misses      10159    10364     +205     
     Partials      123      123              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `58.19% <22.15%> (-0.32%)` | :arrow_down: |
   | javascript | `62.12% <44.35%> (-0.08%)` | :arrow_down: |
   | python | `80.43% <90.57%> (-0.38%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.95% <ø> (ø)` | |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `100.00% <ø> (ø)` | |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `86.73% <ø> (ø)` | |
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset-frontend/src/views/App.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3ZpZXdzL0FwcC50c3g=) | `38.70% <0.00%> (-0.18%)` | :arrow_down: |
   | [...-frontend/src/visualizations/presets/MainPreset.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL3Zpc3VhbGl6YXRpb25zL3ByZXNldHMvTWFpblByZXNldC5qcw==) | `100.00% <ø> (ø)` | |
   | ... and [67 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...7eb35bc](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (997fe1e) into [master](https://codecov.io/gh/apache/superset/commit/99a0c8a8a129502d6253e000c14db31ab8b0bb19?el=desc) (99a0c8a) will **decrease** coverage by `5.49%`.
   > The diff coverage is `61.76%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.15%   71.65%   -5.50%     
   ==========================================
     Files         866      885      +19     
     Lines       45005    45523     +518     
     Branches     5357     5475     +118     
   ==========================================
   - Hits        34723    32620    -2103     
   - Misses      10159    12693    +2534     
   - Partials      123      210      +87     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `?` | |
   | javascript | `62.06% <52.10%> (-0.15%)` | :arrow_down: |
   | python | `79.96% <90.57%> (-0.85%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...rc/common/components/Collapse/Collapse.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL0NvbGxhcHNlLnN0b3JpZXMudHN4) | `0.00% <0.00%> (ø)` | |
   | [...-frontend/src/common/components/Collapse/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL0NvbGxhcHNlL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...-frontend/src/common/components/common.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2NvbW1vbi5zdG9yaWVzLnRzeA==) | `0.00% <ø> (ø)` | |
   | [superset-frontend/src/common/components/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbW1vbi9jb21wb25lbnRzL2luZGV4LnRzeA==) | `100.00% <ø> (ø)` | |
   | [...et-frontend/src/components/Icons/icons.stories.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvSWNvbnMvaWNvbnMuc3Rvcmllcy5qc3g=) | `0.00% <0.00%> (ø)` | |
   | [superset-frontend/src/components/ListView/utils.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXcvdXRpbHMudHM=) | `85.12% <ø> (-0.83%)` | :arrow_down: |
   | [...c/components/ListViewCard/ListViewCard.stories.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL0xpc3RWaWV3Q2FyZC5zdG9yaWVzLnRzeA==) | `0.00% <0.00%> (ø)` | |
   | [...set-frontend/src/components/ListViewCard/index.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTGlzdFZpZXdDYXJkL2luZGV4LnRzeA==) | `100.00% <ø> (+5.45%)` | :arrow_up: |
   | [...set-frontend/src/components/ModalTrigger/index.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvTW9kYWxUcmlnZ2VyL2luZGV4LmpzeA==) | `95.65% <ø> (-4.35%)` | :arrow_down: |
   | [.../src/explore/components/ControlPanelsContainer.jsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9Db250cm9sUGFuZWxzQ29udGFpbmVyLmpzeA==) | `75.51% <ø> (-11.23%)` | :arrow_down: |
   | ... and [325 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [99a0c8a...e248373](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] codecov-io edited a comment on pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #13210:
URL: https://github.com/apache/superset/pull/13210#issuecomment-783353940


   # [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=h1) Report
   > Merging [#13210](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=desc) (d71bf1b) into [master](https://codecov.io/gh/apache/superset/commit/cd3f5214fa0b5e7e9d45d31a2babb1475de37952?el=desc) (cd3f521) will **decrease** coverage by `0.36%`.
   > The diff coverage is `50.25%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/13210/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l)](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree)
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #13210      +/-   ##
   ==========================================
   - Coverage   77.18%   76.82%   -0.37%     
   ==========================================
     Files         881      894      +13     
     Lines       45499    45664     +165     
     Branches     5447     5490      +43     
   ==========================================
   - Hits        35119    35081      -38     
   - Misses      10256    10459     +203     
     Partials      124      124              
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | cypress | `57.63% <24.18%> (-0.45%)` | :arrow_down: |
   | hive | `?` | |
   | javascript | `62.40% <50.25%> (-0.16%)` | :arrow_down: |
   | mysql | `80.30% <ø> (ø)` | |
   | postgres | `80.34% <ø> (ø)` | |
   | presto | `?` | |
   | python | `80.43% <ø> (-0.43%)` | :arrow_down: |
   | sqlite | `79.96% <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=tree) | Coverage Δ | |
   |---|---|---|
   | [...-frontend/src/explore/components/controls/index.js](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9pbmRleC5qcw==) | `100.00% <ø> (ø)` | |
   | [superset/config.py](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQvY29uZmlnLnB5) | `90.74% <ø> (ø)` | |
   | [...ols/DndColumnSelectControl/utils/optionSelector.ts](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL3V0aWxzL29wdGlvblNlbGVjdG9yLnRz) | `3.22% <3.22%> (ø)` | |
   | [...ndColumnSelectControl/components/OptionWrapper.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uV3JhcHBlci50c3g=) | `18.18% <18.18%> (ø)` | |
   | [...ls/DndColumnSelectControl/DndColumnSelectLabel.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL0RuZENvbHVtblNlbGVjdExhYmVsLnRzeA==) | `26.31% <26.31%> (ø)` | |
   | [...trols/DndColumnSelectControl/components/Option.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9EbmRDb2x1bW5TZWxlY3RDb250cm9sL2NvbXBvbmVudHMvT3B0aW9uLnRzeA==) | `54.54% <54.54%> (ø)` | |
   | [...frontend/src/explore/components/OptionControls.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9PcHRpb25Db250cm9scy50c3g=) | `66.66% <55.55%> (-5.63%)` | :arrow_down: |
   | [...et-frontend/src/components/Pagination/Ellipsis.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9FbGxpcHNpcy50c3g=) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Item.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9JdGVtLnRzeA==) | `100.00% <100.00%> (ø)` | |
   | [...perset-frontend/src/components/Pagination/Next.tsx](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvUGFnaW5hdGlvbi9OZXh0LnRzeA==) | `100.00% <100.00%> (ø)` | |
   | ... and [30 more](https://codecov.io/gh/apache/superset/pull/13210/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=footer). Last update [cd3f521...1854cd7](https://codecov.io/gh/apache/superset/pull/13210?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] zhaoyongjie commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
zhaoyongjie commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581077986



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,114 @@
+/**
+ * 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, useTheme } 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+}
+
+export default function DndColumnSelectLabel(props: LabelProps) {

Review comment:
       This is a good question! 
   Code reuse can refined the logic, but it may make the logic difficult to understand. We should iterate it in the future. We have to consider all kinds of component. 
   eg: 
   - various Filter(datetime filter, numeric filter, text filter)
   - various dimension selection(simple dimension dimension set, dimension hierarchy)
   
   The current DND should be just a prototype. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] ktmud commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
ktmud commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582352812



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts
##########
@@ -0,0 +1,86 @@
+/**
+ * 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 };
+
+  isScalar: boolean;
+
+  constructor(
+    options: { string: ColumnMeta },
+    values: string[] | string | null,
+  ) {
+    this.options = options;
+    let groupByValues: string[];
+    if (Array.isArray(values)) {
+      groupByValues = values;
+      this.isScalar = false;
+    } else {
+      groupByValues = values ? [values] : [];
+      this.isScalar = true;
+    }

Review comment:
       +1 on change this to `isArray` check since we may want to other more complex `option` in the future (e.g. `AdhocFilter` and `AdhocMetric`).




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] villebro commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
villebro commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r582125785



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelectLabel.tsx
##########
@@ -0,0 +1,118 @@
+/**
+ * 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,
+  DatasourcePanelDndItem,
+} from 'src/explore/components/DatasourcePanel/types';
+import Icon from 'src/components/Icon';
+import OptionWrapper from './components/OptionWrapper';
+import { OptionSelector } from './utils';
+
+interface LabelProps extends BaseControlConfig {
+  name: string;
+  value: string[] | string | null;
+  onChange: (value: string[] | string | null) => void;
+  options: { string: ColumnMeta };
+  theme: SupersetTheme;
+}
+
+function DndColumnSelectLabel(props: LabelProps) {
+  const { value, options } = props;
+  const optionSelector = new OptionSelector(options, value);
+  const [groupByOptions, setGroupByOptions] = useState<ColumnMeta[]>(
+    optionSelector.groupByOptions,
+  );
+
+  const [, datasourcePanelDrop] = useDrop({
+    accept: DatasourcePanelDndType.COLUMN,
+
+    drop: (item: DatasourcePanelDndItem) => {
+      optionSelector.add(item.metricOrColumnName);
+      setGroupByOptions(optionSelector.groupByOptions);
+      props.onChange(optionSelector.getValues());
+    },
+
+    canDrop: (item: DatasourcePanelDndItem) =>
+      !optionSelector.has(item.metricOrColumnName),
+
+    collect: monitor => ({
+      isOver: monitor.isOver(),
+      canDrop: monitor.canDrop(),
+    }),
+  });
+
+  function onClickClose(index: number) {
+    optionSelector.del(index);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function onShiftOptions(dragIndex: number, hoverIndex: number) {
+    optionSelector.swap(dragIndex, hoverIndex);
+    setGroupByOptions(optionSelector.groupByOptions);
+    props.onChange(optionSelector.getValues());
+  }
+
+  function placeHolderRenderer() {
+    return (
+      <AddControlLabel cancelHover>

Review comment:
       I understand this, and as long as this is behind a FF, I agree we can live with some temporary glitches in the feature. Some thoughts that might be relevant for Mihir when considering options:
   - We currently only support max 50 columns in the column list. While it's possible to filter the list, it is currently not possible to browse the full list like it is in the current select control.
   - If the filter and metric DND controls will support both DND and the click, it would make sense to also support select on the column control (alternatively it might make sense to disable non-DND interaction with the filter and metric controls).
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


[GitHub] [superset] kgabryje commented on a change in pull request #13210: feat(explore): ColumnSelectControl with drag-and-drop

Posted by GitBox <gi...@apache.org>.
kgabryje commented on a change in pull request #13210:
URL: https://github.com/apache/superset/pull/13210#discussion_r581010736



##########
File path: superset-frontend/src/explore/components/DatasourcePanel.tsx
##########
@@ -204,7 +206,12 @@ export default function DataSourcePanel({
             </div>
             {metricSlice.map(m => (
               <LabelContainer key={m.metric_name} className="column">
-                <MetricOption metric={m} showType />
+                <DatasourcePanelDragWrapper
+                  metricOrColumnName={m.metric_name}
+                  type={DatasourcePanelDndType.METRIC}
+                >
+                  <MetricOption metric={m} showType />

Review comment:
       I mean that here we could use `cursor: move` to indicate that the label is draggable 
   ![image](https://user-images.githubusercontent.com/15073128/108846169-8d5ffe00-75de-11eb-9b73-b3991316634c.png)
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org