Skip to content

feat: allow pasting units from a course into a library - #1812

Merged
bradenmacdonald merged 3 commits into
openedx:masterfrom
open-craft:braden/paste-unit-from-course
Apr 15, 2025
Merged

feat: allow pasting units from a course into a library#1812
bradenmacdonald merged 3 commits into
openedx:masterfrom
open-craft:braden/paste-unit-from-course

Conversation

@bradenmacdonald

@bradenmacdonald bradenmacdonald commented Apr 11, 2025

Copy link
Copy Markdown
Contributor

Description

This PR allows pasting units from a course into a content library. The child XBlocks and the unit will be pasted into the library.

Depends on openedx/openedx-platform#36516

Note that if #1800 is not merged, you may see fake errors when copying.

Supporting information

Implemented as part of #1647 which turned out to be too complex so I started with the reverse.

Testing instructions

Go to a course, copy a unit, then test pasting that unit into both courses and libraries.

Copied Unit Pasted Unit
Screenshot Screenshot

Also verify that the pasted things now have nice slugs (URL IDs / usage key block_ids) when pasted into a library.

Other information

It is a known issue that when copying a unit, all the static files referenced by any XBlock in the unit will be imported into the library separately for each XBlock. There is no good way to tell which static files are used by which XBlock (or maybe there is but it will have to come later as a fix; this PR is complicated enough already).

Private ref: Part of FAL-4067

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 11, 2025
@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @bradenmacdonald!

This repository is currently maintained by @openedx/2u-tnl.

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.

@codecov

codecov Bot commented Apr 12, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.56%. Comparing base (87695ae) to head (1b32be2).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1812      +/-   ##
==========================================
+ Coverage   93.55%   93.56%   +0.01%     
==========================================
  Files        1136     1136              
  Lines       23247    23252       +5     
  Branches     5029     5015      -14     
==========================================
+ Hits        21748    21756       +8     
+ Misses       1423     1420       -3     
  Partials       76       76              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bradenmacdonald
bradenmacdonald force-pushed the braden/paste-unit-from-course branch 2 times, most recently from 0d26803 to 27b91a0 Compare April 12, 2025 02:04

@rpenido rpenido left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍
Thank you for your work, @bradenmacdonald!

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

Comment thread src/library-authoring/data/api.ts Outdated
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 14, 2025
@bradenmacdonald
bradenmacdonald force-pushed the braden/paste-unit-from-course branch from 27b91a0 to 70deca9 Compare April 15, 2025 00:26
@bradenmacdonald
bradenmacdonald force-pushed the braden/paste-unit-from-course branch from a0cd8bc to 1b32be2 Compare April 15, 2025 16:25
@bradenmacdonald
bradenmacdonald merged commit f24b89c into openedx:master Apr 15, 2025
@github-project-automation github-project-automation Bot moved this from Waiting on Author to Done in Contributions Apr 15, 2025
@bradenmacdonald
bradenmacdonald deleted the braden/paste-unit-from-course branch April 15, 2025 22:26
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