Skip to content

Conversation

holaontiveros
Copy link

@holaontiveros holaontiveros commented Oct 9, 2025

Description

This PR adds a new view for the v2 libraries which will allow the user to export a backup of the library for later import.

Useful information to include:

  • This change should add new features for the course authors

Before new dropdown was added:
image

New dropdown on v2 libraries for tools:
image

Backup page:
image

Supporting information

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

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#37419)

  • Change to this branch
  • Go to a v2 library and verify the Tools dropdown is present
  • Access the backup option
  • While at the new scren try to do a backup of your library

Other information

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

  • This depends on changes on edx-platform to add the new endpoints required for the backup process, those changes were added in -> feat: Libraries v2 backup endpoint edx-platform#37419
  • This only covers the backup part the restorewill be handled in a different PR for clearness

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 9, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 9, 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 9, 2025
@holaontiveros holaontiveros force-pushed the feat/librariesv2-backup-page branch from 5d2d2b7 to e6ef987 Compare October 14, 2025 15:26
@holaontiveros holaontiveros force-pushed the feat/librariesv2-backup-page branch from e6ef987 to 70aefaa Compare October 14, 2025 16:25
Copy link

codecov bot commented Oct 14, 2025

Codecov Report

❌ Patch coverage is 93.23308% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.74%. Comparing base (c4a439d) to head (26ea500).
⚠️ Report is 14 commits behind head on master.

Files with missing lines Patch % Lines
...ary-authoring/backup-restore/LibraryBackupPage.tsx 89.88% 9 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2532      +/-   ##
==========================================
+ Coverage   94.70%   94.74%   +0.03%     
==========================================
  Files        1202     1212      +10     
  Lines       26842    27101     +259     
  Branches     6041     6092      +51     
==========================================
+ Hits        25422    25677     +255     
- Misses       1350     1354       +4     
  Partials       70       70              

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

@mphilbrick211 mphilbrick211 added the mao-onboarding Reviewing this will help onboard devs from an Axim mission-aligned organization (MAO). label Oct 15, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 15, 2025
@holaontiveros holaontiveros marked this pull request as ready for review October 16, 2025 16:48
render(<LibraryBackupPage />);
const initialButton = screen.getByRole('button', { name: messages.downloadAriaLabel.defaultMessage });
expect(initialButton).toBeEnabled();
await userEvent.click(initialButton);
Copy link
Contributor

@diana-villalvazo-wgu diana-villalvazo-wgu Oct 16, 2025

Choose a reason for hiding this comment

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

you need to initialize it first, something like:

const user = userEvent.setup();
const initialButton...
await user.click(initialButton);

Copy link
Author

Choose a reason for hiding this comment

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

theres a lot of debate on the userEvent.setup() isn't it? testing-library/user-event#1036

are we looking to have it for a specific reason?

Copy link
Author

Choose a reason for hiding this comment

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

I would say that we should use it when required to avoid extra boiler plate, for example there's a different test here were I need to setup the details like it should use jest for fake timers in that case we need a new instance create to setup to ensure all the interactions are the same, but in this case it's a one off, so the same instance with defaults it's more than enough

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: Waiting on Author

Development

Successfully merging this pull request may close these issues.

5 participants