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 2019/10/07 16:58:40 UTC
[GitHub] [incubator-superset] mistercrunch commented on a change in pull
request #8291: (Fix ##8288): Select box now searchable by verbose tags
mistercrunch commented on a change in pull request #8291: (Fix ##8288): Select box now searchable by verbose tags
URL: https://github.com/apache/incubator-superset/pull/8291#discussion_r332129937
##########
File path: superset/assets/src/components/OnPasteSelect.jsx
##########
@@ -64,6 +64,23 @@ export default class OnPasteSelect extends React.Component {
}
}
}
+ customFilter(option, searchText) {
+ // customFilter is passed as a function to react-select library
+ // in the case that there is a column name and verbose name
+ if (!option.column_name) {
+ return false;
+ }
+ if (
+ option.column_name.toLowerCase().includes(searchText.toLowerCase()) ||
Review comment:
```js
const lowerSearchText = searchText.toLowerCase();
return (
option.column_name.toLowerCase().includes(lowerSearchText) || (
!!option.verbose_name &&
option.verbose_name.toLowerCase().includes(lowerSearchText)
)
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org