villebro opened a new pull request #15012:
URL: https://github.com/apache/superset/pull/15012
### SUMMARY
Currently select filters make two requests for data upon initialization.
This is due to the filter adding column type mappings to `ownState` on
initialization. Since these are only needed when "Search all options" is
enabled, the initial column type mappings are stored on initialization, and are
added to `ownState` only when needed.
### BEFORE
Currently the "Continent" filter generates two requests (the last two
requests to "data"); the first with `ownState: {}` and the second with
`ownState: { colTypeMap: region: 1 }`. Note that the request is the same, due
to `ownState` not changing the generated query in `buildQuery`:

### AFTER
Now loading the Filter Tab only causes one single request on initialization,
both when "Search all options" is enabled and disabled (`ownState` is added to
`dataMask` when the first update happens):

### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!--- Skip this if not applicable -->
### TESTING INSTRUCTIONS
Updated tests + added new test to ensure that `ownState` is populated
correctly when `searchAllOptions` is `true`.
### 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
--
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]