Skip to content
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

[FC-0059] feat: Add order query param to lib v2 API #35005

Merged

Conversation

yusuf-musleh
Copy link
Member

@yusuf-musleh yusuf-musleh commented Jun 18, 2024

Description

This PR adds the order query param to the /api/libraries/v2/ endpoint to specify the ordering of the queried content libraries.

Supporting information

Related Tickets:

Testing instructions

Check that the tests cover the functionality and follow the testing instructions in openedx/frontend-app-authoring#1117


Private-ref: FAL-3752

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jun 18, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Jun 18, 2024

Thanks for the pull request, @yusuf-musleh! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/order-v2-libraries branch from b4baee6 to 2198608 Compare June 19, 2024 20:07
@yusuf-musleh yusuf-musleh marked this pull request as ready for review June 19, 2024 20:17
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/order-v2-libraries branch 2 times, most recently from 6e3c9a3 to e3ef443 Compare June 19, 2024 20:40
@mphilbrick211 mphilbrick211 added the needs reviewer assigned PR needs to be (re-)assigned a new reviewer label Jun 20, 2024
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.

@yusuf-musleh This PR is working great as-is, but I've replied to your commend about evaluating the query string, and added a couple nits of my own. Feel free to push back, or I'm happy to re-review with changes.

👍

openedx/core/djangoapps/content_libraries/api.py Outdated Show resolved Hide resolved
openedx/core/djangoapps/content_libraries/api.py Outdated Show resolved Hide resolved
openedx/core/djangoapps/content_libraries/views.py Outdated Show resolved Hide resolved
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/order-v2-libraries branch 2 times, most recently from 7e117e6 to cfb9f55 Compare June 23, 2024 18:41
@yusuf-musleh yusuf-musleh force-pushed the yusuf-musleh/order-v2-libraries branch from 9b56378 to f400aa5 Compare June 26, 2024 09:38
@yusuf-musleh yusuf-musleh changed the title feat: Add order query param to lib v2 API [FC-0059] feat: Add order query param to lib v2 API Jun 26, 2024
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.

Hi @yusuf-musleh!
LGTM 👍 Great work! (Now in the right PR!)

  • I tested this on my tutor dev stack using the testing instructions
  • I read through the code
  • I checked for accessibility issues N/A
  • Includes documentation

@@ -115,6 +115,7 @@ class BaseFilterSerializer(serializers.Serializer):
"""
text_search = serializers.CharField(default=None, required=False)
org = serializers.CharField(default=None, required=False)
order = serializers.CharField(default=None, required=False)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer a default here (in the serializer/rest api level) so we always return a sorted list, but is up to you.

Suggested change
order = serializers.CharField(default=None, required=False)
order = serializers.CharField(default='title', required=False)

@pomegranited pomegranited merged commit c625a8d into openedx:master Jul 2, 2024
49 checks passed
@openedx-webhooks
Copy link

@yusuf-musleh 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@pomegranited pomegranited deleted the yusuf-musleh/order-v2-libraries branch July 2, 2024 14:51
@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.

1 similar comment
@edx-pipeline-bot
Copy link
Contributor

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

@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 Jul 30, 2024
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