prathamesh04 opened a new pull request, #42440:
URL: https://github.com/apache/superset/pull/42440
## Summary
The `expose_in_sqllab` filter in `DatabaseSelector` was tied to
`sqlLabMode`, which controls the UI rendering (compact button vs full
dropdown). When the SQL Lab popover passed `sqlLabMode={false}` to render the
dropdown, the `expose_in_sqllab` filter was also disabled, allowing databases
with `expose_in_sqllab=false` to appear in SQL Lab.
## Before / After
**Before**: The popover's `DatabaseSelector` in SQL Lab passed
`sqlLabMode={false}` (to render the dropdown instead of a compact button). The
`loadDatabases` function checked `formMode || !sqlLabMode` -- since
`sqlLabMode=false`, this evaluated to `true`, skipping the `expose_in_sqllab`
filter.
**After**: Added a new `filterBySqlLab` prop that controls the
`expose_in_sqllab` filter independently from the UI rendering mode. The
popover's `DatabaseSelector` now passes `filterBySqlLab={true}` to apply the
filter while still rendering the dropdown.
## Testing Instructions
1. Create a database with `expose_in_sqllab = false`
2. Create another database with `expose_in_sqllab = true`
3. Open SQL Lab -- the database with `expose_in_sqllab = false` should NOT
appear in the dropdown
## Additional Information
- Fixes #40850
- Regression introduced in 6.1.0 when the SQL Lab left bar was refactored to
use a popover instead of inline dropdown
- Added unit test verifying the `expose_in_sqllab` filter is included in API
calls when `filterBySqlLab={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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]