Skip to content
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: take into account enrollments in dashboard -> search route redirect for new users #1208

Merged
merged 1 commit into from
Oct 17, 2024

Conversation

adamstankiewicz
Copy link
Member

@adamstankiewicz adamstankiewicz commented Oct 16, 2024

Ticket

ENT-9583

CHANGELOG

  • Moves call to redirectToSearchPageForNewUser from rootLoader to dashboardLoader.
    • Requires bringing in queryClient.ensureQueryData(queryRedeemablePolicies(...)) alongside the query to fetch enrollments to determine whether the dashboard -> search redirect is applicable based on both the enrollments but also assignments from credits_available.
  • Refactors redirectToSearchPageForNewUser to accept enterpriseCourseEnrollments, and only trigger redirect from the dashboard route to search route for learners with no enrollments to display on their dashboard, in addition to the existing check on the displayed assignments.
    • Returns early if navigating from a different route (e.g., search) to the dashboard route, as this navigation was triggered by an explicit user action (e.g., clicking "Dashboard" in the header menu navigation). Otherwise, it's possible to click "Dashboard" from search route and have no change in the UI since the dashboardLoader redirects you right back to the search route you're already on).

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)
  • Ensure English strings are marked for translation. See documentation for more details.

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

@adamstankiewicz adamstankiewicz changed the title feat: take into account enrollments in dashboard -> search route redirects for new users feat: take into account enrollments in dashboard -> search route redirect for new users Oct 16, 2024
@adamstankiewicz adamstankiewicz force-pushed the ags/ent-9583 branch 3 times, most recently from d67d454 to 488a3e1 Compare October 16, 2024 20:16
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.41%. Comparing base (5a1e7a6) to head (868625e).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1208      +/-   ##
==========================================
- Coverage   88.41%   88.41%   -0.01%     
==========================================
  Files         399      399              
  Lines        8502     8501       -1     
  Branches     2094     2051      -43     
==========================================
- Hits         7517     7516       -1     
- Misses        942      943       +1     
+ Partials       43       42       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -31,8 +32,27 @@ const makeDashboardLoader: Types.MakeRouteLoaderFunctionWithQueryClient = functi
authenticatedUser,
enterpriseSlug,
});
await Promise.all([

const loadEnrollmentsPoliciesAndRedirectForNewUsers = Promise.all([
queryClient.ensureQueryData(queryEnterpriseCourseEnrollments(enterpriseCustomer.uuid)),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[inform] Once the Dashboard BFF endpoint is integrated into the dashboardLoader, it will replace this queryEnterpriseCourseEnrollments.

Copy link
Member

@brobro10000 brobro10000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job 👍🏽

@adamstankiewicz adamstankiewicz merged commit b3c1e56 into master Oct 17, 2024
6 checks passed
@adamstankiewicz adamstankiewicz deleted the ags/ent-9583 branch October 17, 2024 16:43
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