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

feat: [FC-0044] Unit page API as DRF #34036

Merged

Conversation

ruzniaievdm
Copy link
Contributor

@ruzniaievdm ruzniaievdm commented Jan 10, 2024

Description

This PR addresses a need in the development of the Course Unit Page feature within the frontend-app-course-authoring repository. The core objective is the implement of a DRF endpoint designed to render and deliver data within the unit.

The existing data structure can be explored in the edx-platform/cms/templates/container.html.

To promote code reusability and avoid duplications, the decision was made to centralize common logic within a utils.py. This approach simplifies code maintenance.

This PR includes additional modifications to various files to prevent errors on the api-docs page and resolving issues related to circular imports.

Testing instructions

  1. Run master devstack.
  2. Start platform make dev.up.lms+cms and make checkout on this branch.
  3. Go to http://localhost:18010/api-docs.
  4. Find the required API endpoint /api/contentstore/v1/container_handler/{usage_key_string}.
  5. Open needed unit page in cms http://localhost:18010/container/{usage_key_string} and make sure nothing has changed.
  6. Copy usage_key_string from previous step and paste it to required API endpoint to get data for unit.

@openedx-webhooks
Copy link

Thanks for the pull request, @ruzniaievdm! 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.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 10, 2024
@ruzniaievdm ruzniaievdm force-pushed the ruzniaievdm/feat/unit-page-drf branch from 736df64 to 26477c1 Compare January 10, 2024 09:39
@ruzniaievdm ruzniaievdm force-pushed the ruzniaievdm/feat/unit-page-drf branch from 26477c1 to ff8d3ea Compare January 10, 2024 09:53
@arbrandes
Copy link
Contributor

@ruzniaievdm, can you add a brief description of the motivation behind this PR, and a summary of the potential risks if this is merged? For example, what kind of impact surface area are we talking about? Are these views used everywhere in Studio, or is it a new thing?

It would also be good to have a brief set of instructions on how to test this manually.

@ruzniaievdm ruzniaievdm changed the title feat: Unit page API as DRF feat: [FC-0044] Unit page API as DRF Jan 17, 2024
Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

I've read the code: the logic seems solid. I've also tested this locally on a Tutor nightly dev enviroment running on latest master. Everything seems to work fine.

Can't object in principle, either: more DRF = more good. ;)

@arbrandes arbrandes merged commit cbe865a into openedx:master Jan 30, 2024
64 checks passed
@openedx-webhooks
Copy link

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

@arbrandes arbrandes self-assigned this Jan 30, 2024
@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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants