superset icon indicating copy to clipboard operation
superset copied to clipboard

feat: Dashboard tabs api endpoint

Open fisjac opened this issue 10 months ago • 1 comments

SUMMARY

This PR implements a new property on the Dashboard model granting access to the tabs associated with a dashboard. A new API endpoint for accessing the associated dashboard tabs has been created at /api/v1/dashboard/[id]/tabs.

The payload of the api endpoint contains two properties: all_tabs which contains an array of all associated tabs, and tab_tree which contains a nested object representing the nested structure of tabs within the dashboard. tab_tree follows the data structure necessary for consumption by the Antd Tree and TreeSelect components on the frontend.

The primary use case for this implementation is for enabling the functionalities described in SIP: https://github.com/apache/superset/issues/26183.

The provided proof of concept provides an alternative approach, centralizing the business logic on the backend to process prior to serving to the client.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

image

TESTING INSTRUCTIONS

ADDITIONAL INFORMATION

  • [ ] Has associated issue:
  • [ ] Required feature flags:
  • [ ] Changes UI
  • [ ] Includes DB Migration (follow approval process in SIP-59)
    • [ ] Migration is atomic, supports rollback & is backwards-compatible
    • [ ] Confirm DB migration upgrade and downgrade tested
    • [ ] Runtime estimates and downtime expectations provided
  • [x] Introduces new feature or API
  • [ ] Removes existing feature or API

fisjac avatar Apr 10 '24 03:04 fisjac

Codecov Report

Attention: Patch coverage is 30.00000% with 42 lines in your changes are missing coverage. Please review.

Project coverage is 64.37%. Comparing base (76d897e) to head (aa4be0f). Report is 109 commits behind head on master.

Files Patch % Lines
superset/models/dashboard.py 9.37% 29 Missing :warning:
superset/dashboards/api.py 41.17% 10 Missing :warning:
superset/daos/dashboard.py 50.00% 2 Missing :warning:
superset/dashboards/schemas.py 85.71% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27962      +/-   ##
==========================================
+ Coverage   60.48%   64.37%   +3.89%     
==========================================
  Files        1931      521    -1410     
  Lines       76236    37526   -38710     
  Branches     8568        0    -8568     
==========================================
- Hits        46114    24159   -21955     
+ Misses      28017    13367   -14650     
+ Partials     2105        0    -2105     
Flag Coverage Δ
hive 49.06% <30.00%> (-0.10%) :arrow_down:
javascript ?
presto 53.61% <30.00%> (-0.19%) :arrow_down:
python 64.37% <30.00%> (+0.89%) :arrow_up:
unit 58.77% <30.00%> (+1.14%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar May 14 '24 15:05 codecov[bot]