feat: lazy load dashboards into the navigation menu [DHIS2-10624]#3226
Draft
jenniferarnesen wants to merge 53 commits intomasterfrom
Draft
feat: lazy load dashboards into the navigation menu [DHIS2-10624]#3226jenniferarnesen wants to merge 53 commits intomasterfrom
jenniferarnesen wants to merge 53 commits intomasterfrom
Conversation
Contributor
|
🚀 Deployed on https://pr-3226.dashboard.netlify.dhis2.org |
…com:dhis2/dashboard-app into feat/limit-dashboard-preloading-DHIS2-10624
jenniferarnesen
commented
Mar 5, 2025
|
|
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.




Implements DHIS2-10624
Key features
To improve dashboard app performance for users with access to many dashboards, use paging to limit the number of dashboards loaded into the navigation menu
Description
The navigation menu now has "infinite" scrolling similar to the data item selector in DV and LL. Scrolling to the bottom triggers a fetch of the next page of results (page size set to 200 as suggested by Lars in the Jira ticket). Searching works the same way, sending a request with the filter text and get the results, paged. Searching is debounced to 300ms.
The CacheableViewDashboard code is primarily determining whether there is a dashboard the user can view: when the app initially loads, instead of fetching all the dashboards like before, it now fetches a single dashboard to answer the question of whether there are any dashboards.
The list of dashboards has been removed from redux and is now kept in the NavigationMenu state. Each time the user opens the menu, the first page of dashboards is fetched.
The "starred" status of the dashboard being displayed is now kept in the redux 'selected' property.
The component EndIntersectionDetector was adapted from the Data Item selector (transfer) component of the same name (from analytics).
TODO