-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: make hide from TOC a visibility section setting #33952
feat: make hide from TOC a visibility section setting #33952
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. |
bc00ad1
to
243c75c
Compare
606d74b
to
664d959
Compare
664d959
to
8997e61
Compare
0f9367e
to
29c0612
Compare
elif is_unit_with_changes: | ||
# Note that a unit that has never been published will fall into this category, | ||
# as well as previously published units with draft content. | ||
return VisibilityState.needs_attention | ||
|
||
is_unscheduled = xblock.start == DEFAULT_START_DATE | ||
is_live = is_course_self_paced or datetime.now(UTC) > xblock.start | ||
if child_info and child_info.get("children", []): | ||
if child_info and child_info.get("children", []): # pylint: disable=too-many-nested-blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewer: there are better ways to resolve this warning than this, but this PR is complex enough. So, I'll open a new PR proposing a refactoring change so this quality failure is not raised anymore. I'll attach the PR in this thread when it's ready.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function and the file are already plenty complex. This feature is not making it better. However having a different PR that is a requirement for this I think is the wrong approach.
If you are planning to extract this for in a "private" helper function at the top of the file or something with a similar complexity I suggest to do it already in this PR as a new commit and leave it at that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, but I can't entirely agree. I don't think it is a good idea to introduce more changes to this PR, adding more tests and points of failure, so I'd prefer disabling the pylint rule. Maybe we should consider the refactor an enhancement instead of a requirement.
29c0612
to
3cc4cc9
Compare
22ac48e
to
0c68ab7
Compare
Hi there, @MaferMazu @felipemontoya @BryanttV: could you help me with a review here? Please feel free to add yourselves as reviewers if you have the time. Thanks! |
@johnvente, all comments addressed! Could you check again? Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, @mariajgrimaldi. The functionality works as expected, the code looks good to me, and I think it is sustained well by the proposal and all the discussion before the implementation.
@itsjeyd, don't the proposal and the previous discussion apply as a product review? If this needs a product review, can you help us tag the person who could help us with the product review? Thanks.
@MaferMazu I suppose you're asking because I recently applied the That's a permanent label for PRs whose review process includes getting approval from members of one or more product teams. (I.e., we don't remove it after product review is complete). The fact that it hadn't been added to this PR yet it was simply an oversight. In the context of managing OSPRs, we've been using feature tickets on the platform roadmap to track status of product discussions. The feature ticket for this PR (as well as all other PRs related to Feature Enhancement Proposal: Hide Sections from course outline) is openedx/platform-roadmap#301. Santiago confirmed product approval for the proposal there last week. |
Oh, I wasn't aware of that. Thank you for the explanation, @itsjeyd. |
@MaferMazu No problem! For future reference, the Pull Request Status Guide provides info on statuses and labels that you might see on OSPRs. -- @mphilbrick211 It might make sense to update the definition of the Also, we're no longer using the Scheduled for Eng Review status so it would be worth removing it from the list at some point. CC @sarina |
elif is_unit_with_changes: | ||
# Note that a unit that has never been published will fall into this category, | ||
# as well as previously published units with draft content. | ||
return VisibilityState.needs_attention | ||
|
||
is_unscheduled = xblock.start == DEFAULT_START_DATE | ||
is_live = is_course_self_paced or datetime.now(UTC) > xblock.start | ||
if child_info and child_info.get("children", []): | ||
if child_info and child_info.get("children", []): # pylint: disable=too-many-nested-blocks |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function and the file are already plenty complex. This feature is not making it better. However having a different PR that is a requirement for this I think is the wrong approach.
If you are planning to extract this for in a "private" helper function at the top of the file or something with a similar complexity I suggest to do it already in this PR as a new commit and leave it at that.
I should have added with my review that I tested the code and it works just as the description explains. It is in line with the product definition in confluence so the feature is good to continue. The inline comments are more an engineering review. |
1ec6b5c
to
697b58f
Compare
Exposes the hide_from_toc xblock attribute so course authors can configure it as a section visibility option in Studio. Before this change, the Hide from TOC functionality was mainly used by OLX components. Hence, it wasn't available for configuration through the Studio UI. Still, its implementation existed in the platform and could be used by setting the attribute: hide_from_toc=true as part of the OLX definition. Ref: https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3853975595/Feature+Enhancement+Proposal+Hide+Sections+from+course+outline
This reverts commit 0d402b714e085ef058672b8e57ed67418f29a684.
697b58f
to
5a2199f
Compare
ed99841
to
e552d66
Compare
155272f
to
b97b2ba
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes @mariajgrimaldi no more comments. I tested this again and all is working as it should.
@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. |
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
2U Release Notice: This PR has been deployed to the edX production environment. |
1 similar comment
2U Release Notice: This PR has been deployed to the edX production environment. |
Description
This PR exposes the
hide_from_toc
xblock attribute so course authors can configure it as a section visibility option in Studio. Before this change, the Hide from TOC functionality was mainly used by OLX components. Hence, it wasn't available for configuration through the Studio UI. Still, its implementation existed in the platform and could be used by setting the attribute:hide_from_toc=true
as part of the OLX definition.So we could use the
hide_from_toc
attribute in the Studio UI making it configurable for sections and their children, we did the following:hide_from_toc
to the CMS Xblock handlers, serializers, and data classes so it can be recognized when setting the new visibility state optionvisible_to_staff_only
Supporting information
These changes are part of the effort made to implement feature enhancement proposal: Hide sections from course outline
Testing instructions
tutor dev exec lms openedx-assets build --env=dev
FEATURES["ENABLE_HIDE_FROM_TOC_UI"] = True
in your CMS environment, this will allow course staff to configure the hide from toc option from the Studio UI.CELERY_ALWAYS_EAGER = True
in both of your environments (LMS/CMS).View Live
optionScreencast.from.15-02-24.15.27.32.mp4
Deadline
This effort is part of the Spanish consortium project, so it'd be ideal to merge this before the end of the project.
Other information
After deploying these changes to a tutor nightly remote installation, we found that the changes weren't reflected on the Course Outline after saving the new visibility changes for the 1st time. Now, the second time we save the changes are triggered. We don't have an explanation for it yet, but we're actively working on it. Here's a video of the behavior:
Screencast.from.19-12-23.12.08.56.mp4
Update: This was solved by #34020, which is already under review.