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 2021/06/10 14:08:04 UTC
[GitHub] [superset] kgabryje opened a new pull request #15090: fix(native-filters): fix Select filter crashing when changing filter type
kgabryje opened a new pull request #15090:
URL: https://github.com/apache/superset/pull/15090
### SUMMARY
When user changed filter type from "Time range" to "Value", the filter crashed. The reason was that in Value filter we assumed that `filterState.value` is either an array or undefined. When we switched filter type from "Time range", `filterState.value` was actually a string, which caused a crash. This PR fixes it by using `ensureIsArray` function to ensure that `filterState.value` is an array (duh) and setting initial value to `defaultValue`, so that values from other filters don't propagate to Value filter.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before:
https://user-images.githubusercontent.com/15073128/121539232-c5f8db80-ca05-11eb-9c47-a35ace7124e8.mov
After:
https://user-images.githubusercontent.com/15073128/121539403-f17bc600-ca05-11eb-949d-a1787379db4a.mov
### TESTING INSTRUCTIONS
0. Set `DASHBOARD_NATIVE_FILTERS` feature flag to True
1. Add a time range filter
2. Change filter's type to Value
3. Verify that filter didn't crash and it's initial value equals to filter's default value (or empty if default value is not specified)
### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [ ] Runtime estimates and downtime expectations provided
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
CC: @junlincc @villebro
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] codecov[bot] commented on pull request #15090: fix(native-filters): fix Select filter crashing when changing filter type
Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on pull request #15090:
URL: https://github.com/apache/superset/pull/15090#issuecomment-858786063
# [Codecov](https://codecov.io/gh/apache/superset/pull/15090?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#15090](https://codecov.io/gh/apache/superset/pull/15090?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a64feb8) into [master](https://codecov.io/gh/apache/superset/commit/c0eff8faf6389ced142ad2e2f45768b0f5948544?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c0eff8f) will **increase** coverage by `0.00%`.
> The diff coverage is `100.00%`.
> :exclamation: Current head a64feb8 differs from pull request most recent head 730aa1d. Consider uploading reports for the commit 730aa1d to get more accurate results
[![Impacted file tree graph](https://codecov.io/gh/apache/superset/pull/15090/graphs/tree.svg?width=650&height=150&src=pr&token=KsB0fHcx6l&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/superset/pull/15090?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
```diff
@@ Coverage Diff @@
## master #15090 +/- ##
=======================================
Coverage 77.62% 77.62%
=======================================
Files 967 967
Lines 49702 49709 +7
Branches 6338 6339 +1
=======================================
+ Hits 38579 38586 +7
Misses 10920 10920
Partials 203 203
```
| Flag | Coverage Δ | |
|---|---|---|
| javascript | `72.50% <100.00%> (+<0.01%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
| [Impacted Files](https://codecov.io/gh/apache/superset/pull/15090?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...board/components/nativeFilters/FilterBar/index.tsx](https://codecov.io/gh/apache/superset/pull/15090/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL2luZGV4LnRzeA==) | `91.57% <100.00%> (+0.66%)` | :arrow_up: |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/15090?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/superset/pull/15090?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c0eff8f...730aa1d](https://codecov.io/gh/apache/superset/pull/15090?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas commented on pull request #15090: fix(native-filters): fix Select filter crashing when changing filter type
Posted by GitBox <gi...@apache.org>.
rusackas commented on pull request #15090:
URL: https://github.com/apache/superset/pull/15090#issuecomment-859162974
/testenv up FEATURE_DASHBOARD_NATIVE_FILTERS=True
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] rusackas merged pull request #15090: fix(native-filters): fix Select filter crashing when changing filter type
Posted by GitBox <gi...@apache.org>.
rusackas merged pull request #15090:
URL: https://github.com/apache/superset/pull/15090
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
[GitHub] [superset] github-actions[bot] commented on pull request #15090: fix(native-filters): fix Select filter crashing when changing filter type
Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #15090:
URL: https://github.com/apache/superset/pull/15090#issuecomment-859163812
--
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
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org