You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "michael-s-molina (via GitHub)" <gi...@apache.org> on 2023/06/13 16:47:29 UTC

[GitHub] [superset] michael-s-molina commented on a diff in pull request #24388: feat: Allows new values for single value filters

michael-s-molina commented on code in PR #24388:
URL: https://github.com/apache/superset/pull/24388#discussion_r1228428323


##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.tsx:
##########
@@ -239,16 +236,26 @@ export default function PluginFilterSelect(props: PluginFilterSelectProps) {
   const options = useMemo(() => {
     const allOptions = [...data];
     const uniqueOptions = uniqWith(allOptions, isEqual);
-    const selectOptions: { label: string; value: DataRecordValue }[] = [];
+    const selectOptions: SelectOptionsType = [];
     uniqueOptions.forEach(row => {
       const [value] = groupby.map(col => row[col]);
       selectOptions.push({
         label: labelFormatter(value, datatype),
         value,
       });
     });
+    if (!multiSelect && search) {
+      const found = selectOptions.find(option => option.label === search);

Review Comment:
   I'll match both



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