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/09/01 09:42:27 UTC

[GitHub] [superset] zhaoyongjie commented on a change in pull request #16482: fix: can't drop column when name overlap

zhaoyongjie commented on a change in pull request #16482:
URL: https://github.com/apache/superset/pull/16482#discussion_r699408545



##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/DndColumnSelect.tsx
##########
@@ -59,8 +59,9 @@ export function DndColumnSelect(props: DndColumnSelectProps) {
     }
     if (
       typeof value === 'string' &&
-      typeof optionSelectorValues === 'string' &&
-      value !== optionSelectorValues
+      Array.isArray(optionSelectorValues) &&
+      optionSelectorValues.length === 1 &&
+      value !== optionSelectorValues[0]

Review comment:
       Done. thanks

##########
File path: superset-frontend/src/explore/components/controls/DndColumnSelectControl/utils/optionSelector.ts
##########
@@ -67,9 +67,10 @@ export class OptionSelector {
     return !!this.getValues()?.includes(value);
   }
 
-  getValues(): string[] | string | undefined {
+  getValues(): string[] | undefined {
+    // ensure an array type return value
     if (!this.multi) {
-      return this.values.length > 0 ? this.values[0].column_name : undefined;
+      return this.values.length > 0 ? [this.values[0].column_name] : undefined;

Review comment:
       Sorry, I overlooked that part of the logic. fixed




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

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