[REFERENCE] feat: incrementally adopt Dashboard BFF API #1205
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.
Description
[Context] Tech Spec
queryEnterpriseLearnerDashboardBFF
to thequeryKeyFactory
, integrating with the new Dashboard BFF exposed via [REFERENCE] feat: introduce Gateway Aggregation / Backend-for-Frontend abstraction via LearnerPortalBFFAPIView enterprise-access#572.dashboardLoader
, the existingensureQueryData(queryEnterpriseCourseEnrollments)
is now replaced withqueryEnterpriseLearnerDashboardBFF
, which returns the same enterprise course enrollments metadata in its API response.rootLoader
, only executes theensureQueryData(querySubscriptions)
when not a page route configured with a BFF API endpoint. That is, since only the Dashboard page route has a BFF configured, all other page routes continue to work as normal (retrieving data from specific micro-services vs the BFF).useEnterpriseCourseEnrollments
to compose a new hookuseBaseEnterpriseCourseEnrollments
. The new hook is responsible for determining which query config to to retrieve enterprise course enrollments. It does so via aresolveBFFQuery
helper function that determines which BFF query is configured for any given route pattern. In practice, when on the Dashboard page route,useBaseEnterpriseCourseEnrollments
will extractenterpriseCourseEnrollments
from the BFF query; when on non-Dashboard page routes,useBaseEnterpriseCourseEnrollments
will continue extracting enrollments fromqueryEnterpriseCourseEnrollments
(independent query toenterprise_course_enrollments
).useSubscriptions
with a similar treatment asuseBaseEnterpriseCourseEnrollments
, described above.useSubscriptions
will now extract subscriptions-related data from the BFF query for the current route, if configured; otherwise, falls back to current statequerySubscriptions
(independent query tolearner-licenses
).Jira
ENT-9427
For all changes
Only if submitting a visual change