-
Notifications
You must be signed in to change notification settings - Fork 4k
feat: REST API to publish the changes to a container [FC-0083] #36543
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: REST API to publish the changes to a container [FC-0083] #36543
Conversation
Thanks for the pull request, @bradenmacdonald! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
1 similar comment
Thanks for the pull request, @bradenmacdonald! This repository is currently maintained by 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 approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo 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:
🔘 Get a green buildIf 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:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
20fffa8
to
8ea7b0a
Compare
8ea7b0a
to
e82bbc6
Compare
2933f2f
to
d7fa581
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.
👍 Found one minor bug, but this is working great otherwise. Thank you @bradenmacdonald !
- I tested this using the test instructions on feat: button to publish a container [FC-0083] frontend-app-authoring#1827
- I read through the code
- I checked for accessibility issues by using my keyboard to navigate
- Includes documentation -- code comments
- User-facing strings are extracted for translation
) | ||
# The core publishing API is based on draft objects, so find the draft that corresponds to this component: | ||
drafts_to_publish = authoring_api.get_all_drafts(learning_package.id).filter(entity__key=component.key) | ||
# Publish the component and update anything that needs to be updated (e.g. search index): | ||
authoring_api.publish_from_drafts(learning_package.id, draft_qset=drafts_to_publish, published_by=user.id) | ||
LIBRARY_BLOCK_UPDATED.send_event( | ||
library_block=LibraryBlockData( |
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.
If we also raise LIBRARY_CONTAINER_UPDATED
for affected containers here like we do here, then it'll handle this case:
- Edit a Component in a Unit:
- Component + Unit show "unpublished changes" ✔️
- Publish the Component only.
- Component no longer shows "unpublished changes" ✔️
- Unit no longer shows "unpublished changes" ❌
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.
Fixed with c0972ef.
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.
Nice, thanks for identifying and fixing that!
for components in containers.
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. |
…enedx#36543) * feat: REST API to publish the changes to a container * fix: trigger LIBRARY_CONTAINER_UPDATED when component published for components in containers. --------- Co-authored-by: Jillian Vogel <[email protected]>
…6543) * feat: REST API to publish the changes to a container * fix: trigger LIBRARY_CONTAINER_UPDATED when component published for components in containers. --------- Co-authored-by: Jillian Vogel <[email protected]>
Description
Implements openedx/frontend-app-authoring#1710 . Adds new REST + python APIs into content libraries that can be used to publish a single container and its children, without publishing the whole library. Publishing "all changes in the library" is already possible.
Needed for openedx/frontend-app-authoring#1827 and can be tested using that UI.
Testing instructions
See other PR.
Deadline
ASAP - needed for Teak
Private ref FAL-4069