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 2022/04/08 10:48:37 UTC

[GitHub] [superset] villebro opened a new pull request, #19612: fix(select): render when empty multiselect

villebro opened a new pull request, #19612:
URL: https://github.com/apache/superset/pull/19612

   ### SUMMARY
   PR #19341 introduced a regression that caused the adhoc filter value selector to disappear if a multioperator (IN, NOT IN) was chosen and there were no options. It is typical for the options to be missing if the "populate autocomplete filters options" option has been disabled in the dataset properties. I believe the reason for the bug that #19341 attempted to address was due to only checking if a selected item was `typeof 'object'`. This is `true` for `null`, which caused the logic to assume the value was in fact a `LabeledValue` (=object with keys `value` and `label`). Here we introduce a typeguard to make the checking even more robust, and remove the logic that delays rendering of `SelectWithLabel`.
   
   I checked that the original issue that #19341 set out to fix still works after this change. However, *deselecting* a NULL value doesn't seem to work properly if there are other falsy values (for this we'll need to use `LabeledValue` and use a custom `key` as do make sure each entry is unique). However, I consider this a separate issue which should be addressed in the native filter, so will address that in a separate PR.
   
   ### AFTER
   Now the dropdown renders correctly:
   
   https://user-images.githubusercontent.com/33317356/162419361-9aa255f4-e5bb-41a9-8a5d-7a9032392e4c.mp4
   
   ### BEFORE
   Previously the dropdown disappeared if there were no options:
   
   https://user-images.githubusercontent.com/33317356/162419451-b1a03df2-7263-4ed4-84f4-6b55226681b9.mp4
   
   
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   1. Disable "populate autocomplete filters options" in a dataset
   2. Explore the dataset and add an adhoc filter
   3. choose any column and choose the "IN" operator
   4. see the dropdown disappear
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [x] Has associated issue: closes #19592
   - [ ] Required feature flags:
   - [ ] 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
   


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


[GitHub] [superset] villebro merged pull request #19612: fix(select): render when empty multiselect

Posted by GitBox <gi...@apache.org>.
villebro merged PR #19612:
URL: https://github.com/apache/superset/pull/19612


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


[GitHub] [superset] codecov[bot] commented on pull request #19612: fix(select): render when empty multiselect

Posted by GitBox <gi...@apache.org>.
codecov[bot] commented on PR #19612:
URL: https://github.com/apache/superset/pull/19612#issuecomment-1092824541

   # [Codecov](https://codecov.io/gh/apache/superset/pull/19612?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 [#19612](https://codecov.io/gh/apache/superset/pull/19612?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (0d8d080) into [master](https://codecov.io/gh/apache/superset/commit/761d5c4208632a1c186cf4c9fbcf2541a816fea8?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (761d5c4) will **decrease** coverage by `0.15%`.
   > The diff coverage is `87.50%`.
   
   > :exclamation: Current head 0d8d080 differs from pull request most recent head c16c534. Consider uploading reports for the commit c16c534 to get more accurate results
   
   ```diff
   @@            Coverage Diff             @@
   ##           master   #19612      +/-   ##
   ==========================================
   - Coverage   66.68%   66.53%   -0.16%     
   ==========================================
     Files        1681     1681              
     Lines       64316    64319       +3     
     Branches     6565     6564       -1     
   ==========================================
   - Hits        42888    42793      -95     
   - Misses      19733    19853     +120     
   + Partials     1695     1673      -22     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | javascript | `51.21% <87.50%> (-0.30%)` | :arrow_down: |
   
   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/19612?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...l/AdhocFilterEditPopoverSimpleTabContent/index.tsx](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2V4cGxvcmUvY29tcG9uZW50cy9jb250cm9scy9GaWx0ZXJDb250cm9sL0FkaG9jRmlsdGVyRWRpdFBvcG92ZXJTaW1wbGVUYWJDb250ZW50L2luZGV4LnRzeA==) | `65.60% <ø> (+0.52%)` | :arrow_up: |
   | [superset-frontend/src/components/Select/Select.tsx](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L1NlbGVjdC50c3g=) | `87.28% <83.33%> (+0.36%)` | :arrow_up: |
   | [superset-frontend/src/components/Select/utils.ts](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2NvbXBvbmVudHMvU2VsZWN0L3V0aWxzLnRz) | `65.00% <100.00%> (+1.84%)` | :arrow_up: |
   | [...ts/nativeFilters/FilterBar/FilterControls/state.ts](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlckNvbnRyb2xzL3N0YXRlLnRz) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | [...veFilters/FilterBar/FilterControls/FilterValue.tsx](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlckNvbnRyb2xzL0ZpbHRlclZhbHVlLnRzeA==) | `6.59% <0.00%> (-53.85%)` | :arrow_down: |
   | [...tend/src/filters/components/Time/transformProps.ts](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL3RyYW5zZm9ybVByb3BzLnRz) | `0.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...oard/components/nativeFilters/FilterCard/index.tsx](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQ2FyZC9pbmRleC50c3g=) | `10.00% <0.00%> (-50.00%)` | :arrow_down: |
   | [...d/src/filters/components/Time/TimeFilterPlugin.tsx](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL1RpbWVGaWx0ZXJQbHVnaW4udHN4) | `0.00% <0.00%> (-47.06%)` | :arrow_down: |
   | [...Filters/FilterBar/FilterControls/FilterControl.tsx](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2Rhc2hib2FyZC9jb21wb25lbnRzL25hdGl2ZUZpbHRlcnMvRmlsdGVyQmFyL0ZpbHRlckNvbnRyb2xzL0ZpbHRlckNvbnRyb2wudHN4) | `29.03% <0.00%> (-41.94%)` | :arrow_down: |
   | [...rset-frontend/src/filters/components/Time/index.ts](https://codecov.io/gh/apache/superset/pull/19612/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-c3VwZXJzZXQtZnJvbnRlbmQvc3JjL2ZpbHRlcnMvY29tcG9uZW50cy9UaW1lL2luZGV4LnRz) | `66.66% <0.00%> (-33.34%)` | :arrow_down: |
   | ... and [11 more](https://codecov.io/gh/apache/superset/pull/19612/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/superset/pull/19612?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/19612?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 [761d5c4...c16c534](https://codecov.io/gh/apache/superset/pull/19612?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.

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