fix(sqllab): add filterBySqlLab prop to decouple expose_in_sqllab filter from UI rendering mode#42440
Conversation
Remove @has_access from the /language_pack/<lang>/ endpoint to allow embedded dashboards to fetch translations without authentication. Embedded dashboards use a bare fetch() without the guest-token header, so the endpoint returned a 302 redirect to /login/ instead of the translation catalog. This silently broke i18n for all embedded dashboards using non-English locales. The language pack contains only non-sensitive translation strings and is safe to serve without authentication. Closes apache#42433
…ter from UI rendering mode
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.
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.
Fixes apache#40850
Code Review Agent Run #d7a11dActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #42440 +/- ##
==========================================
- Coverage 65.23% 56.60% -8.63%
==========================================
Files 2795 2795
Lines 157694 157694
Branches 36067 36068 +1
==========================================
- Hits 102871 89268 -13603
- Misses 52847 67601 +14754
+ Partials 1976 825 -1151
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
The
expose_in_sqllabfilter inDatabaseSelectorwas tied tosqlLabMode, which controls the UI rendering (compact button vs full dropdown). When the SQL Lab popover passedsqlLabMode={false}to render the dropdown, theexpose_in_sqllabfilter was also disabled, allowing databases withexpose_in_sqllab=falseto appear in SQL Lab.Before / After
Before: The popover's
DatabaseSelectorin SQL Lab passedsqlLabMode={false}(to render the dropdown instead of a compact button). TheloadDatabasesfunction checkedformMode || !sqlLabMode-- sincesqlLabMode=false, this evaluated totrue, skipping theexpose_in_sqllabfilter.After: Added a new
filterBySqlLabprop that controls theexpose_in_sqllabfilter independently from the UI rendering mode. The popover'sDatabaseSelectornow passesfilterBySqlLab={true}to apply the filter while still rendering the dropdown.Testing Instructions
expose_in_sqllab = falseexpose_in_sqllab = trueexpose_in_sqllab = falseshould NOT appear in the dropdownAdditional Information
expose_in_sqllabfilter is included in API calls whenfilterBySqlLab={true}