feat: use navigation sequence metadata to disable navigation components - #1273
Conversation
|
Thanks for the pull request, @mariajgrimaldi! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1273 +/- ##
==========================================
+ Coverage 88.38% 88.40% +0.01%
==========================================
Files 291 291
Lines 4951 4959 +8
Branches 1253 1262 +9
==========================================
+ Hits 4376 4384 +8
Misses 561 561
Partials 14 14 ☔ View full report in Codecov by Sentry. |
44071a4 to
d966fc6
Compare
|
Hi @mariajgrimaldi, thank you for this contribution! Like #1262, it seems to relate to openedx/platform-roadmap#301, so I'm flagging it for product review. |
|
Hi Tim, this has already gone through product review, it was discussed and approved in this post. greetings! |
d966fc6 to
7f173bb
Compare
7f173bb to
203a5e3
Compare
|
Hi @mariajgrimaldi, I tested this PR in my local and it works correctly! |
|
Hey @mariajgrimaldi, aside from fixing conflicts this still needs approval from a CC and/or maintainer, right? |
203a5e3 to
55e1b5f
Compare
|
Sorry for the delay, @itsjeyd, yes! We still need the maintainers' approval. |
|
I'll bite. Let's see if we can get this working in a PR sandbox, first. |
|
@arbrandes: this needs openedx/openedx-platform#34049 to work. Is there a way to configure it? If we can't configure it, I'll let you know the PR is merged. |
|
Yes, there is! I just did (see the Settings section at the top of the PR description). Let's see if it works. It'll take up to an hour for the sandbox to come up. |
|
Sandbox deployment successful 🚀 |
|
I've tested this in the sandbox, and it works! Now, to look at the code. |
arbrandes
left a comment
There was a problem hiding this comment.
Just a couple of changes, otherwise looks and works great!
Use navigation_disabled sequence metadata based on Hide From TOC block field, so the student cannot navigate to another sequences in the course outline. https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3853975595/Feature+Enhancement+Proposal+Hide+Sections+from+course+outline
694269d to
523ab85
Compare
|
@arbrandes: comments addressed. Thank you! |
|
Sandbox deployment successful 🚀 |
|
@mariajgrimaldi 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Settings
Description
This PR adds a flag check to navigation components (next/previous buttons & course sequence breadcrumbs) to disable them if
navigation_disabledis True.The
navigation_disabledfield comes from this edx-platform PR: openedx/openedx-platform#34049, which returns the new field as sequence metadata, based on whether the sequence was configured as Hide from TOC. This kind of flag could also be extended for other use cases, not just hidden from TOC.These changes are part of a series of PR(s) that implement the Feature Enhancement Proposal: Hide Sections from course outline:
https://github.com/openedx/edx-platform/pulls?q=is%3Apr+is%3Aopen+hide+from+toc
https://github.com/openedx/frontend-app-learning/pulls?q=is%3Apr+is%3Aopen+hide+from+toc
How to test
Test setup using tutor:
git clone https://github.com/openedx/frontend-app-learning.gitgit fetch origin pull/1273/head:hide-from-sequence-navtutor mounts add ./frontend-app-learningcd frontend-app-learning && npm install, ensure you're using node 18tutor dev launchIt's better to test this out along with this PR: openedx/openedx-platform#33952. So first, follow the instructions in that PR. Don't change branches; apply these commits on top of the branch.
For the Learning MFE changes, please follow the instructions listed here. Then, go to the LMS using the link to your hidden subsection, it should look something like this with > 1 and exactly 1:
Screencast.from.13-02-24.12.55.13.mp4
With 1 unit it doesn't show prev, next and sequence breadcrumbs. With more than one, it shows next and previous for units within the same sequence.
Other information
As I mentioned, this PR is part of a series of PRs implementing the feature enhancement of Hide From TOC. This initiative is an open-source contribution to the Open edX platform funded by a Unidigital project from the Spanish Government - 2023.