feat: entity link view and api#36190
Conversation
|
Thanks for the pull request, @navinkarkera! 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. DetailsWhere 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. |
1423fe2 to
55e68a9
Compare
pomegranited
left a comment
There was a problem hiding this comment.
👍 Working beautifully.
- I tested this using the test instructions from openedx/frontend-app-authoring#1641
Also had to run migrations,recreate_upstream_linksandreindex_studioto get the data ready to test. - I read through the code that's changed since #36111 (ref compare)
-
I checked for accessibility issuesN/A - Includes documentation - code comments
-
User-facing strings are extracted for translationN/A
bec771b to
41d2b3a
Compare
ChrisChV
left a comment
There was a problem hiding this comment.
Looks good! I will merge it tomorrow morning
|
@navinkarkera I have two question before to merge this:
|
@ChrisChV Nice catch! Added. Also, gated this page behind
We have a discussion going on in the issue here: openedx/frontend-app-authoring#1565. Since it depends on UX designs, I'll handle it in a separate task. |
|
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. |
| @view_auth_classes() | ||
| class UpstreamListView(DeveloperErrorViewMixin, APIView): | ||
| """ | ||
| Serves course->library publishable entity links | ||
| """ | ||
| def get(self, request: _AuthenticatedRequest, course_key_string: str): | ||
| """ | ||
| Fetches publishable entity links for given course key | ||
| """ | ||
| try: | ||
| course_key = CourseKey.from_string(course_key_string) | ||
| except InvalidKeyError as exc: | ||
| raise ValidationError(detail=f"Malformed course key: {course_key_string}") from exc | ||
| links = PublishableEntityLink.get_by_downstream_context(downstream_context_key=course_key) | ||
| serializer = PublishableEntityLinksSerializer(links, many=True) | ||
| return Response(serializer.data) |
There was a problem hiding this comment.
@navinkarkera @ChrisChV @pomegranited The name of this is UpstreamListView, but in reality is a list of Downstreams. Consider the case where one upstream library block is linked to two downstream course blocks. How many times would it be represented in this API's response? Twice--one for each downstream.
That is why there is a commented-out class above this class called DownstreamListView... it was meant to be un-commented for this very API endpoint :) That's also why the docstring mentions some NOT YET IMPLEMENTED routes around /downstreams/, and why downstreams/ is a Potential Future Path in the urls.py.
Could you please make a follow-up PR to fix this, and follow the API schema that the comments had recommended? (Otherwise, in terms of actual functionality, the API looks great :)
There was a problem hiding this comment.
@kdmccormick Makes sense, I'll update it soon.
Adds api for listing upstream entity links for a given course.
Adds api for listing upstream entity links for a given course.
Adds api for listing upstream entity links for a given course.

Description:
Adds api for listing upstream entity links for a given course.
Test instructions: See openedx/frontend-app-authoring#1641
Part of: openedx/frontend-app-authoring#1565
Private-ref: FAL-4006