move MeteredConnectionNotificationModal to Library Page & conditionally render "Other Libraries" #11602
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.
This PR is based off of
release-v0.16.x
and is intended for the planned patch 1 releaseSummary
This PR relocates the
MeteredConnectionNotificationModal
that was previously added to the codebase and adjusts the logic for rendering the "Other Libraries" component inLearn > Library
.With these changes, "Other Libraries" will not render for a user on a metered connection unless they choose "Allow download on metered connection" on the
MeteredConnectionNotificationModal
that now appears on theLearn > Library
page. If the user chooses "Do not allow download..." theOtherLibraries
component should not render unless & until the user on a metered connection later changes this choice in their device settings. After dismissing the modal, it should not pop up for users again.This PR represents a departure from the initial issue spec, as it was determined that prior plans to have the
MeteredConnectionNotificationModal
appear at point of download would not actually save users any data, as the content had already been loaded on their device for viewing. The solution presented here appeared to be the swiftest way to avoid unnecessarily expending a user's data without their explicit agreement.References
Reviewer guidance
There are several conditions to explore once the testing setup steps are followed:
MeteredConnectionNotificationModal
:"Allow download on metered connection"
:OtherLibraries
component renders & is navigable"Do not allow download on metered connection"
:OtherLibraries
component does not renderMeteredConnectionNotificationModal
:OtherLibraries
only visible if"Allow download on metered connection"
previously selectedMeteredConnectionNotificationModal
does not renderOtherLibraries
renders (when applicable/available to user)Testing as a dev -- instructions borrowed from #10624
Run
yarn app-devserver
to run Kolibri in the app mode. Be sure to click theinitialize/
url that will come up in your console. If you want to test with the connection not being metered, update therun_kolibri_app_mode.py
file'scheck_is_metered
function to returnFalse
and restart theyarn app-devserver
.Log in as a superuser and you should see the modal the first time and never again after. The key is stored in session storage, clear it and you'll see it again if you selected to not allow connections. As is, if you click "Allow..." then you'll never see the modal again no matter what per the expected logic of the modal not showing whenever they've already said it was allowed. Until the Device Settings page is updated you won't be able to change this directly without going into the Kolibri shell and running:
Testing checklist
If there are any front-end changes, before/after screenshots are includedCritical user journeys are covered by Gherkin storiesCritical and brittle code paths are covered by unit testsPR process
If this is an important user-facing change, PR or related issue has a 'changelog' labelIf this includes an internal dependency change, a link to the diff is providedReviewer checklist
yarn
andpip
)