Skip to content

Conversation

@holaontiveros
Copy link
Contributor

@holaontiveros holaontiveros commented Oct 22, 2025

Description

This PR adds a new section for the v2 libraries which will allow the user to use a backup file while creating a new library

Useful information to include:

  • Which user roles will this change impact? Common user roles are "Learner", "Course Author",
    "Developer", and "Operator".
  • Include screenshots for changes to the UI (ideally, both "before" and "after" screenshots, if applicable).

Supporting information

Covers the second part of #2448
Implements the second part of the views this figma design

Screenshots:

Before dropzone:
image

Dropzone displayed:
image

Loader while waiting for upload and task result:
Screenshot 2025-10-27 at 2 54 40 p m

Error state returned from the status endpoint:
image

Succesful upload:
image

Testing instructions

Assuming you have a working authoring dev environment and you have the right version of the edx-platform (latest master which includes: openedx/edx-platform#37439) and you have builded your dev image with that latest change, given that learning-core lives outsied of edx-platform

  • Change to this branch
  • Go to create a new v2 library
  • Click the action of "Create from archive"
  • Use the a backup previously generated from a v2 library
  • Fill the information and submit

Other information

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

  • This depends on the changes at: feat: add library restore endpoint edx-platform#37439
  • This assumes you have a backup from a v2 library generated with the part one of this PR series or manually dumped with the CLI tools for libraries
  • Apart from the main work for the restore part there's one change that it's to another part of the code in the videouploader component, it had a "too broad" class that was affecting how Paragon's DropZone looked in the one used for restore

Best Practices Checklist

We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:

  • Any new files are using TypeScript (.ts, .tsx).
  • Deprecated propTypes, defaultProps, and injectIntl patterns are not used in any new or modified code.
  • Tests should use the helpers in src/testUtils.tsx (specifically initializeMocks)
  • Do not add new fields to the Redux state/store. Use React Context to share state among multiple components.
  • Use React Query to load data from REST APIs. See any apiHooks.ts in this repo for examples.
  • All new i18n messages in messages.ts files have a description for translators to use.
  • Imports avoid using ../. To import from parent folders, use @src, e.g. import { initializeMocks } from '@src/testUtils'; instead of from '../../../../testUtils'

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

openedx-webhooks commented Oct 22, 2025

Thanks for the pull request, @holaontiveros!

This repository is currently maintained by @bradenmacdonald.

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.


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.

@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Oct 22, 2025
@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Oct 22, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 22, 2025
@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

❌ Patch coverage is 98.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 94.79%. Comparing base (0972b7e) to head (d4b697e).
⚠️ Report is 5 commits behind head on master.

Files with missing lines Patch % Lines
...library-authoring/create-library/CreateLibrary.tsx 98.38% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2558      +/-   ##
==========================================
+ Coverage   94.78%   94.79%   +0.01%     
==========================================
  Files        1225     1226       +1     
  Lines       27399    27480      +81     
  Branches     5992     6200     +208     
==========================================
+ Hits        25969    26049      +80     
+ Misses       1372     1360      -12     
- Partials       58       71      +13     

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

@holaontiveros holaontiveros force-pushed the feat/librariesv2-restore branch from 64cbbb6 to 33b5386 Compare October 27, 2025 16:04
@holaontiveros holaontiveros marked this pull request as ready for review October 27, 2025 19:09
Copy link
Contributor

@jacobo-dominguez-wgu jacobo-dominguez-wgu left a comment

Choose a reason for hiding this comment

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

I tested it on my local and it seems to be working well.

Grabacion.de.pantalla.2025-10-27.a.la.s.6.20.11.p.m.mov

Just one question and some minor comments:

  • Is it expected the zip file not to be required in the form? I mean the user can complete the library creation from archive without uploading a backup file.
  • Also to see the feedback when there is an error in the upload process, it is needed to download a log file to view the actual error, it would be more user friendly if the error is shown on the UI as in the figma design.


{/* Loading state - show spinner in DropZone-like container */}
{restoreMutation.isPending && (
<div
Copy link
Contributor

Choose a reason for hiding this comment

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

Why the spinner from paragon was not used here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just to make it match the design and align properly, the one from paragon was creating some jumpingness while being shown

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, can you please mention that in the code? e.g. TODO: replace this with Paragon spinner - didn't use for now because of ...

@holaontiveros
Copy link
Contributor Author

I tested it on my local and it seems to be working well.

Grabacion.de.pantalla.2025-10-27.a.la.s.6.20.11.p.m.mov
Just one question and some minor comments:

  • Is it expected the zip file not to be required in the form? I mean the user can complete the library creation from archive without uploading a backup file.
  • Also to see the feedback when there is an error in the upload process, it is needed to download a log file to view the actual error, it would be more user friendly if the error is shown on the UI as in the figma design.

Yes it's expected, you may add it or you may not there's no penalization for that (eve if you opened the drozone)

Yeah it could be user friendly but currently that error log it's a file stored that could contain a huge amount of info, so as that get's polished it can be improved, the designs didn't take in account the final shape of the APIs

Copy link

@wgu-jesse-stewart wgu-jesse-stewart left a comment

Choose a reason for hiding this comment

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

This works great. Nice work. I'm wondering if we can provide some feedback to the Paragon team for the alignment of the spinner component

Copy link
Contributor

@bradenmacdonald bradenmacdonald 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! Just have some minor suggestions for consistency with other parts of the codebase.


{/* Loading state - show spinner in DropZone-like container */}
{restoreMutation.isPending && (
<div
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, can you please mention that in the code? e.g. TODO: replace this with Paragon spinner - didn't use for now because of ...

Copy link
Contributor

@bradenmacdonald bradenmacdonald left a comment

Choose a reason for hiding this comment

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

Code looks good to me. @holaontiveros could you please get someone from your team to test it once more to make sure it's working correctly after the camelCase refactoring? Then ping me to merge it.

Copy link
Contributor

@jacobo-dominguez-wgu jacobo-dominguez-wgu left a comment

Choose a reason for hiding this comment

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

Everything seems to be working well after pr comments addressed! LGTM 👍🏻

@bradenmacdonald bradenmacdonald enabled auto-merge (squash) October 29, 2025 21:30
@bradenmacdonald bradenmacdonald merged commit 9b77a40 into openedx:master Oct 29, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Oct 29, 2025
@holaontiveros holaontiveros deleted the feat/librariesv2-restore branch October 30, 2025 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). open-source-contribution PR author is not from Axim or 2U

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

7 participants