You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "justinpark (via GitHub)" <gi...@apache.org> on 2023/06/13 16:34:34 UTC
[GitHub] [superset] justinpark commented on a diff in pull request #24388: feat: Allows new values for single value filters
justinpark commented on code in PR #24388:
URL: https://github.com/apache/superset/pull/24388#discussion_r1228414623
##########
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:
why not matching `option.label` instead of `option.value` ?
--
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