rusackas commented on code in PR #39068:
URL: https://github.com/apache/superset/pull/39068#discussion_r3591503119


##########
superset-frontend/packages/superset-ui-core/src/components/Select/AsyncSelect.tsx:
##########
@@ -270,6 +280,8 @@ const AsyncSelect = forwardRef(
           }
           return previousState;
         });
+        setInputValue('');
+        setSelectOptions(prev => prev.sort(sortComparatorForNoSearch));

Review Comment:
   Good catch, and @jesperct flagged the same thing earlier. Pushed a fix in 
efa6457 to sort a copy (`[...prev].sort(...)`) instead of mutating in place. 
Thanks!



##########
superset-frontend/packages/superset-ui-core/src/components/Select/utils.tsx:
##########
@@ -250,3 +260,57 @@ export const mapOptions = (values: SelectOptionsType): 
Record<string, any>[] =>
     key: opt.value,
     ...opt,
   }));
+
+// Splits text by separators, preserving commas inside double quotes.
+// TODO(antd): drop once https://github.com/ant-design/ant-design/issues/57820 
ships.
+export function splitWithQuoteEscaping(
+  text: string,
+  separators: string[],
+): string[] {
+  const separator = separators.find(sep => text.includes(sep));
+  if (!separator) {
+    return [text];
+  }
+
+  const results: string[] = [];
+  let current = '';
+  let inQuotes = false;
+
+  for (let i = 0; i < text.length; i += 1) {
+    const char = text[i];
+
+    if (char === '"') {
+      inQuotes = !inQuotes;
+    } else if (!inQuotes && text.startsWith(separator, i)) {
+      results.push(current.trim());
+      current = '';
+      i += separator.length - 1;
+    } else {
+      current += char;
+    }
+  }
+

Review Comment:
   This one actually preserves the existing behavior. The old paste path did 
`tokenSeparators.find(...)` and then split on that single separator too, so 
nothing's regressing here, and multi-separator tokenization was never 
supported. I'll resolve this, but happy to reopen if we ever want mixed 
delimiters as a separate enhancement.



##########
superset-frontend/src/components/AlteredSliceTag/utils/index.ts:
##########
@@ -52,7 +52,9 @@ export const formatValueHandler = (
           v.comparator && v.comparator.constructor === Array
             ? `[${v.comparator.join(', ')}]`
             : v.comparator;
-        return filterVal ? `${v.subject} ${v.operator} ${filterVal}` : 
`${v.subject} ${v.operator}`;
+        return filterVal

Review Comment:
   This file isn't part of the current PR (looks like it's from an earlier 
revision), so resolving this one out.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to