* feat: add experimental redirect for Learner Home
As a request by Data, this system repeatably groups users into
experiment groups. Based on end of user ID, users that fall beneath a
threshold (LEARNER_HOME_MFE_REDIRECT_PERCENTAGE) will be redirected to
the Learner Home experience, if enabled. Otherwise, learners will see
the legacy dashboard.
* feat: add learner home redirect percentage setting
Adds LEARNER_HOME_MFE_REDIRECT_PERCENTAGE to common settings to avoid a
failed lookup. Can be overridden through config.
* refactor: change test to not leak implementation
* refactor: remove old profiling function
* refactor: move mocks into separate directory
* refactor: move recommendations code into a new dir
* docs: docstring consistency and branding updates
* docs: add ADR for core versus experimental code
If a user has a certificate in a deleted course, an issue with how the
course is loaded from the cache can cause an exception that breaks our
code. This adds a wrapper to fail gracefully and log the exception for
future tracking / investigation.
It is possible to have an entitlement with no available course runs. In
this case, the entitlement is filtered out by the view logic but the
residual, bad pesudo-session mapping can cause breaks if we don't handle
for this case.
* refactor: make _credit_status function public
This allows for reuse in the new learner home
* feat: add credit to learner home serializers
* feat: get credit statuses for learner home
* fix: add missing permission/auth classes to init
* fix: add missing permission class
Django was complaining about adding JWT auth without the
NotJwtRestrictedApplication class which it would add automatically. Add
the class to remove that warning.
* style: use black / isort to fix import ordering
* refactor: remove dev logging
* style: run black
* refactor: move masquerade check into utils
* style: remove unnecessary assignment
* style: update dependency orderings
* refactor: add function tracing for perf testing
* refactor: move grade data fetching out of serializer
This allows us to separately profile the collection of grade data
* fix: add missing requires_context metadata
* refactor: split out serialization for profiling
* refactor: remove resume url checks for performance
Existing "get resume urls" loads the course structure to verify the last
completed block actually exists. This is a potentially very expensive
operation, especially for users with many enrollments. This isn't a huge
issue since Learning MFE already has a fallback behavior for this case.
* refactor: remove now-unnecessary serializer check
Old behavior passed an empty string for missing resume URL and
serializer would cast to None. Instead, update simply passes through
None for missing resume url
* style: update dependency ordering
* style: run black on some more files
* feat: add social share settings
* docs: add social share settings to mock
* feat: add social brand
* test: added tests for social share settings
Co-authored-by: jansenk <jkantor@edx.org>
Had previously expected use_ecommerce_payment_flow which we forgot to
pass as part of context. Instead, simplify to infer from
ecommerce_payment_page (which will be None if the ecommerce flow is
disabled).
* feat: get course provider info
* feat: get grade data
* feat: get course provider for entitlements
* style: run black
Co-authored-by: nsprenkle <nsprenkle@2u.com>
* refactor: update enterprise dashboard data shape
* refactor: remove hasFinished
* refactor: allow enterprise dashboard to be null
* docs: update mock data
* feat: get if an enrollment has unmet prerequisites
* feat: get is staff for course
* feat: get is too early for course
Co-authored-by: nsprenkle <nsprenkle@2u.com>
* fix: update learner home api
* refactor: update learner home API pathing
* fix: remove unused logger
* fix: remove unused import
* style: make pylint happy
* style: remove extra space
* style: remove extra space
Co-authored-by: nsprenkle <nsprenkle@2u.com>
Co-authored-by: Nathan Sprenkle <nsprenkle@users.noreply.github.com>