mirror of
https://github.com/apache/superset.git
synced 2026-04-21 09:04:38 +00:00
feat(explore): UX improvements for drag'n'dropping time column (#15740)
This commit is contained in:
committed by
GitHub
parent
e9383e6d00
commit
4234031cba
@@ -157,11 +157,11 @@ export const DndMetricSelect = (props: any) => {
|
||||
const canDrop = (item: DatasourcePanelDndItem) => {
|
||||
const isMetricAlreadyInValues =
|
||||
item.type === 'metric' ? value.includes(item.value.metric_name) : false;
|
||||
return (props.multi || value.length === 0) && !isMetricAlreadyInValues;
|
||||
return !isMetricAlreadyInValues;
|
||||
};
|
||||
|
||||
const onNewMetric = (newMetric: Metric) => {
|
||||
const newValue = [...value, newMetric];
|
||||
const newValue = props.isMulti ? [...value, newMetric] : [newMetric];
|
||||
setValue(newValue);
|
||||
handleChange(newValue);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user