fix(gooddata-sdk): support tabbed dashboard layouts in translation methods#1525
Merged
hkad98 merged 1 commit intogooddata:masterfrom Apr 10, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1525 +/- ##
==========================================
+ Coverage 78.18% 78.26% +0.07%
==========================================
Files 228 228
Lines 14930 14950 +20
==========================================
+ Hits 11673 11700 +27
+ Misses 3257 3250 -7 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…thods Dashboards can now use a tabbed layout where sections live under content.tabs[*].layout.sections instead of content.layout.sections. get_texts_to_translate and set_translated_texts crashed with KeyError on dashboards that only use tabs (no top-level layout key). - Add _iter_dashboard_sections() to yield sections from both structures - Extract date filter titles from tab-level configs - Extract and translate tab titles - Add unit tests covering all layout variants Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e085250 to
a2f761d
Compare
hkad98
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://gooddata.atlassian.net/browse/PSDK-230
Summary
content.tabs[*].layout.sectionsinstead of the legacycontent.layout.sectionsget_texts_to_translateandset_translated_textscrashed withKeyError: 'layout'on dashboards that only use tabs (no top-levellayoutkey)_iter_dashboard_sections()helper that yields sections from both structures (legacy, tabbed, or both)Background
GoodData introduced a
tabsarray in dashboard content. Some dashboards now have:{ "tabs": [ { "title": "Clearing", "layout": { "sections": [...] }, "dateFilterConfig": { "filterName": "..." } }, { "title": "Authorization", "layout": { "sections": [...] } } ] }Instead of (or in addition to) the legacy:
{ "layout": { "sections": [...] } }The SDK assumed
content["layout"]always exists, which fails on tab-only dashboards.Test plan
_iter_dashboard_sections: legacy-only, tabs-only, both, empty, tabs-without-layoutget_texts_to_translate: tabs-only, legacy, rich text in tabs, viz switcher in tabs, already-translated exclusionset_translated_texts: tab title translation, widget translation in tabs, legacy still works_extract_dashboard_date_filter_titles: top-level, tab-level, both🤖 Generated with Claude Code