-
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: Add REST endpoints to update Components in a Collections [FC-0062] #35384
feat: Add REST endpoints to update Components in a Collections [FC-0062] #35384
Conversation
Thanks for the pull request, @pomegranited! What's next?Please work through the following steps to get your changes 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. 🔘 Let us know that your PR is ready for review:Who will review my changes?This repository is currently maintained by 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. |
requirements/constraints.txt
Outdated
@@ -93,7 +93,7 @@ libsass==0.10.0 | |||
click==8.1.6 | |||
|
|||
# pinning this version to avoid updates while the library is being developed | |||
openedx-learning==0.11.1 | |||
openedx-learning @ git+https://github.com/openedx/openedx-learning/@jill/collection-components |
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.
FIXME: update when openedx/openedx-learning#216 merged & tagged.
Python API: * Converts UsageKeyV2 object keys into component keys for use with the oel_collections api. * Sends a CONTENT_OBJECT_TAGS_CHANGED for each component added/removed. REST API: * Calls the python API * Receives a collection PK + a list of UsageKeys to add to the collection.
eb91d5d
to
f4521b5
Compare
Addresses PR reviews. * Collection contents -> Collection components * Add warning about unstable REST APIs * Wrap update_components view in convert_exceptions * Raise api exceptions in api.update_collection_components * Use usage_key in CONTENT_OBJECT_TAGS_CHANGED event
openedx/core/djangoapps/content_libraries/collections/rest_api/v1/views.py
Outdated
Show resolved
Hide resolved
as oel_collections.get_learning_package_collections has been removed.
…-rest-api' into jill/collection-components-rest
so we can use the updated oel_collections.get_collections method.
…ction-components-rest.pre-rebase
Merged into #35321 for CC review. |
@pomegranited Even though your pull request wasn’t merged, please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
Adds a REST endpoint (patch, delete) for updating the Components in a v2 Content Library's Collection.
Adding/removing components raises a CONTENT_OBJECT_TAGS_CHANGED event, because we will index the ContentObject's collections as a type of "tag".
Note: We'll be renaming
CONTENT_OBJECT_TAGS_CHANGED
toCONTENT_OBJECT_ASSOCIATIONS_CHANGED
as part of openedx/modular-learning#230This PR adds to the features available to Course Authors of v2 Libraries, which aren't recommended for production use yet.
Supporting information
Part of : openedx/modular-learning#227
Based on: #35321
Depends on:
Private-ref: FAL-3784
Testing instructions
Please check that the unit tests added here cover most cases.
Manual testing:
lib:SampleTaxonomyOrg1:AL1
{"title":"Collection 1", "description": "First Collection"}
modified
dates.{"usage_keys": [ <list of usage keys from the library blocks> ]
{"count": <number of components in list>}
modified
timestamp should be updated.{"usage_keys": [ <list of usage keys from the library blocks> ]
{"count": <number of components in list>}
modified
timestamp should be updated.