kristw commented on a change in pull request #6231: [bugfix] cannot add options
to FilterBox
URL:
https://github.com/apache/incubator-superset/pull/6231#discussion_r229499474
##########
File path: superset/assets/src/visualizations/FilterBox/FilterBox.jsx
##########
@@ -178,8 +178,7 @@ class FilterBox extends React.Component {
// Add created options to filtersChoices, even though it doesn't exist,
// or these options will exist in query sql but invisible to end user.
Object.keys(selectedValues)
- .filter(key => !selectedValues.hasOwnProperty(key)
- || !(key in filtersChoices))
+ .filter(key => selectedValues.hasOwnProperty(key))
Review comment:
Add `&& (key in filtersChoices)`
Thanks for fixing this. This was due to my refactor (#5789) that reversed
the logic so the correct logic should be negation of
```js
!selectedValues.hasOwnProperty(key) || !(key in filtersChoices)
```
which is
```js
selectedValues.hasOwnProperty(key) && (key in filtersChoices)
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]