-
Notifications
You must be signed in to change notification settings - Fork 13.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Dashboard tabs api endpoint #27962
Conversation
253bdc9
to
e3fc409
Compare
253bdc9
to
4b34bd6
Compare
4b34bd6
to
5dcef2d
Compare
5dcef2d
to
21a56b6
Compare
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
db.session.delete(dashboard) | ||
db.session.commit() | ||
|
||
@pytest.mark.usefixtures("load_world_bank_dashboard_with_slices") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add other negative paths, such as testing for permissions or invalid schema?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently the only tests that explicitly check permissions for the dashboard api are for PUT and DELETE requests. My understanding is that the FlaskAppbuilder @Protect decorator is doing most of the work for ensuring permissions for GET requests. Presumably the @Protect decorator is being tested somewhere else within the codebase?
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, andtab_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: #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
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION