Skip to content

fix(gooddata-sdk): support tabbed dashboard layouts in translation methods#1525

Merged
hkad98 merged 1 commit intogooddata:masterfrom
vondravl:fix/tabbed-dashboard-layout-support
Apr 10, 2026
Merged

fix(gooddata-sdk): support tabbed dashboard layouts in translation methods#1525
hkad98 merged 1 commit intogooddata:masterfrom
vondravl:fix/tabbed-dashboard-layout-support

Conversation

@vondravl
Copy link
Copy Markdown
Contributor

@vondravl vondravl commented Apr 10, 2026

https://gooddata.atlassian.net/browse/PSDK-230

Summary

  • Dashboards can now use a tabbed layout where sections live under content.tabs[*].layout.sections instead of the legacy content.layout.sections
  • get_texts_to_translate and set_translated_texts crashed with KeyError: 'layout' on dashboards that only use tabs (no top-level layout key)
  • Adds _iter_dashboard_sections() helper that yields sections from both structures (legacy, tabbed, or both)
  • Extracts date filter titles and tab titles from tab-level configs
  • Includes 16 unit tests covering all layout variants (legacy-only, tabs-only, both, empty, malformed tabs)

Background

GoodData introduced a tabs array 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

  • 16 unit tests added covering:
    • _iter_dashboard_sections: legacy-only, tabs-only, both, empty, tabs-without-layout
    • get_texts_to_translate: tabs-only, legacy, rich text in tabs, viz switcher in tabs, already-translated exclusion
    • set_translated_texts: tab title translation, widget translation in tabs, legacy still works
    • _extract_dashboard_date_filter_titles: top-level, tab-level, both
  • Tested end-to-end against GoodData production workspace with 34 dashboards (3 tab-only)

🤖 Generated with Claude Code

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.26%. Comparing base (0ddff14) to head (a2f761d).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…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>
@vondravl vondravl force-pushed the fix/tabbed-dashboard-layout-support branch from e085250 to a2f761d Compare April 10, 2026 09:03
@vondravl vondravl marked this pull request as ready for review April 10, 2026 09:09
@hkad98 hkad98 merged commit 1649b1f into gooddata:master Apr 10, 2026
13 checks passed
@vondravl vondravl deleted the fix/tabbed-dashboard-layout-support branch April 10, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants