Skip to content

refactor: downstream entity links api [FC-0076]#36311

Merged
ChrisChV merged 13 commits intoopenedx:masterfrom
open-craft:navin/fal-4007/review-page
Mar 12, 2025
Merged

refactor: downstream entity links api [FC-0076]#36311
ChrisChV merged 13 commits intoopenedx:masterfrom
open-craft:navin/fal-4007/review-page

Conversation

@navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Feb 27, 2025

Description

Refactors downstream links API to handle multiple filters using a single API. Also adds a new route to return summary of library links for a given course.

Useful information to include:

  • Which edX user roles will this change impact? Common user roles are "Course Author" and "Developer".

Supporting information

Also addresses following comments

Testing instructions

See openedx/frontend-app-authoring#1699 for instructions

Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.
  • If your database migration can't be rolled back easily.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 27, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @navinkarkera!

This repository is currently maintained by @openedx/wg-maintenance-edx-platform.

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.

Details
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.

@navinkarkera navinkarkera force-pushed the navin/fal-4007/review-page branch from fcd903e to 901c1d0 Compare February 27, 2025 15:02
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Ready for Review in Contributions Feb 28, 2025
@mphilbrick211 mphilbrick211 added the needs reviewer assigned PR needs to be (re-)assigned a new reviewer label Feb 28, 2025
@navinkarkera navinkarkera force-pushed the navin/fal-4007/review-page branch 3 times, most recently from 3dcc942 to 7c2f62f Compare March 6, 2025 04:28
Copy link
Contributor

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

Works great @navinkarkera , and the renaming makes sense :) One optional nit, but 👍

  • I tested this using the test instructions from openedx/frontend-app-authoring#1699
  • I read through the code
  • I checked for accessibility issues by using my keyboard to navigate
  • Includes documentation
  • User-facing strings are extracted for translation

Comment on lines 135 to 155
return Response({
'next': self.page.next_page_number() if self.page.has_next() else None,
'previous': self.page.previous_page_number() if self.page.has_previous() else None,
'count': self.page.paginator.count,
'num_pages': self.page.paginator.num_pages,
'current_page': self.page.number,
'results': data
})
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can't you just do this?

Suggested change
return Response({
'next': self.page.next_page_number() if self.page.has_next() else None,
'previous': self.page.previous_page_number() if self.page.has_previous() else None,
'count': self.page.paginator.count,
'num_pages': self.page.paginator.num_pages,
'current_page': self.page.number,
'results': data
})
return super().get_paginated_response(data, *args, **kwargs)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pomegranited I wanted to replace next and previous links by page number, but I understand that it was not clear. Updated here: 77cac91

Copy link
Contributor

Choose a reason for hiding this comment

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

Huh ok.. that makes the returned data non-standard for a paginated DRF view, but your update at least makes this clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to make it work in useInfiniteQuery which expects next or previous page number instead of links.

Copy link
Contributor

Choose a reason for hiding this comment

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

To keep the standard, maybe instead of replacing next and previous, you can add the page numbers as new values: next_num_page and previous_num_page. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ChrisChV Makes sense, updated.

@navinkarkera navinkarkera force-pushed the navin/fal-4007/review-page branch from 7c2f62f to 77cac91 Compare March 10, 2025 05:31
@ChrisChV ChrisChV changed the title refactor: downstream entity links api refactor: downstream entity links api [FC-0076] Mar 10, 2025
Copy link
Contributor

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

Looks good! With some nits

@navinkarkera navinkarkera force-pushed the navin/fal-4007/review-page branch from 77cac91 to b99e1dc Compare March 11, 2025 04:42
@navinkarkera navinkarkera force-pushed the navin/fal-4007/review-page branch from b99e1dc to a4af946 Compare March 12, 2025 11:50
@mphilbrick211 mphilbrick211 added FC Relates to an Axim Funded Contribution project and removed needs reviewer assigned PR needs to be (re-)assigned a new reviewer labels Mar 12, 2025
@ChrisChV ChrisChV enabled auto-merge (squash) March 12, 2025 17:36
@ChrisChV ChrisChV merged commit 711d6aa into openedx:master Mar 12, 2025
48 checks passed
@ChrisChV ChrisChV deleted the navin/fal-4007/review-page branch March 12, 2025 17:56
@github-project-automation github-project-automation bot moved this from Ready for Review to Done in Contributions Mar 12, 2025
@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production.

@edx-pipeline-bot
Copy link
Contributor

2U Release Notice: This PR has been deployed to the edX production environment.

@kdmccormick
Copy link
Member

Thanks!

jciasenza pushed a commit to jciasenza/edx-platform that referenced this pull request Mar 20, 2025
Refactors downstream links API to handle multiple filters using a single API. Also adds a new route to return summary of library links for a given course.
jciasenza pushed a commit to jciasenza/edx-platform that referenced this pull request Mar 20, 2025
Refactors downstream links API to handle multiple filters using a single API. Also adds a new route to return summary of library links for a given course.
tonybusa pushed a commit to tonybusa/edx-platform that referenced this pull request Apr 23, 2025
Refactors downstream links API to handle multiple filters using a single API. Also adds a new route to return summary of library links for a given course.
UsamaSadiq pushed a commit that referenced this pull request May 14, 2025
Refactors downstream links API to handle multiple filters using a single API. Also adds a new route to return summary of library links for a given course.
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

Archived in project

Development

Successfully merging this pull request may close these issues.

7 participants