Skip to content

feat: Add support to get and save hide_from_learners and enable_discussion fields in Library Units [FC-0083] #312

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented Apr 29, 2025

Description

  • Add hide_from_learners and enable_discussion fields to Unit model.
  • get_unit_by_key function added.
  • Update _create_container_version with metadata param.
  • Which edX user roles will this change impact? "Developer".

Supporting information

Testing instructions

Follow the testing instructions in openedx/frontend-app-authoring#1912

Deadline

"None"

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 29, 2025
@ChrisChV ChrisChV marked this pull request as draft April 29, 2025 23:35
@openedx-webhooks
Copy link

openedx-webhooks commented Apr 29, 2025

Thanks for the pull request, @ChrisChV!

This repository is currently maintained by @axim-engineering.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Apr 29, 2025
@ChrisChV ChrisChV changed the title feat: Add New fields to Units & get_unit_by_key to units API feat: Add New fields to Units & get_unit_by_key to units API [FC-0083] Apr 29, 2025
@ChrisChV ChrisChV changed the title feat: Add New fields to Units & get_unit_by_key to units API [FC-0083] feat: Add New fields in Units & get_unit_by_key to units API [FC-0083] Apr 29, 2025
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label May 1, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions May 1, 2025
@ChrisChV ChrisChV changed the title feat: Add New fields in Units & get_unit_by_key to units API [FC-0083] feat: Add support to get and save hide_from_learners and enable_discussion fields in Library Units [FC-0083] May 6, 2025
@ChrisChV ChrisChV marked this pull request as ready for review May 6, 2025 01:30
Copy link
Contributor

@rpenido rpenido left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work, @ChrisChV!

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

@mphilbrick211 mphilbrick211 moved this from Waiting on Author to In Eng Review in Contributions May 12, 2025
@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented May 17, 2025

We've paused this to focus on bugfixes, but I'd like @ormsbee to take a look before we consider merging it because he'd previously expression concerns about including these settings in libraries and about JSONField instead of real DB columns. Edit: my bad, there is no JSONField here, just a dict in the dataclass. All good :)

See also https://openedx.slack.com/archives/C05NT2YN820/p1740607773149429

@ormsbee
Copy link
Contributor

ormsbee commented May 18, 2025

Yeah, I think that putting these fields in libraries will cause more harm than good. The enable_discussion flag involves a lot of course configuration complexity, and hide_from_learners is an inherited mixin field that applies to any layer of the hierarchy. So if we were doing it “right”, we’d actually default to None instead of False. Otherwise, if people mark a subsection as hidden from learners and then add a Unit to it from a library, that Unit will be visible if accessed directly.

These are course policy decisions anyway. The most common uses I’ve seen for hiding content like this is for when things are still under construction, or when there are templates/notes for course staff to roughly copy and use elsewhere in the course. One of the big goals of having useful libraries is so that they don’t need to do that sort of thing in the course any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Status: In Eng Review
Development

Successfully merging this pull request may close these issues.

6 participants