Skip to content

Conversation

@ChrisChV
Copy link
Contributor

@ChrisChV ChrisChV commented Oct 24, 2025

Description

  • Implemented the course import stepper described in Import from Course stepper UI #2524
  • Adds the new ENABLE_COURSE_IMPORT_IN_LIBRARY flag
  • Note: The Import Course is temporarily in the library home
  • Which user roles will this change impact? "Course Author".
image image

Supporting information

Testing instructions

  • Use this branch of edx-platform: feat: get migrations info REST-API added [FC-0112] edx-platform#37558
  • In this MFE, enable the ENABLE_COURSE_IMPORT_IN_LIBRARY (It is enabled by default in the .env.development)
  • Follow the instructions in feat!: modulestore_migrator edx-platform#36873 to migrate some courses to a v2 library
  • Go to the v2 library
  • In the Home page of the library, click on the temporary button Import Course.
  • Verify the new course import modal
  • Verify that the Previously Imported Chip is in the migrated courses.
  • Verify that you can select one course and click Next Step.
  • Verify the loading state of the Review Import Details.

Other information

TODO: Move the Import Course Button to the Import Home Page

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
Copy link

openedx-webhooks commented Oct 24, 2025

Thanks for the pull request, @ChrisChV!

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.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 24, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Contributions Oct 24, 2025
@ChrisChV ChrisChV marked this pull request as draft October 24, 2025 23:14
@codecov
Copy link

codecov bot commented Oct 24, 2025

Codecov Report

❌ Patch coverage is 95.56962% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.82%. Comparing base (bd82c1d) to head (3b32d20).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/studio-home/data/api.ts 16.66% 5 Missing ⚠️
src/library-authoring/LibraryAuthoringPage.tsx 83.33% 1 Missing ⚠️
src/studio-home/card-item/index.tsx 95.83% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2567    +/-   ##
========================================
  Coverage   94.81%   94.82%            
========================================
  Files        1225     1230     +5     
  Lines       27515    27672   +157     
  Branches     6036     6076    +40     
========================================
+ Hits        26089    26239   +150     
- Misses       1368     1375     +7     
  Partials       58       58            

☔ 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 FC Relates to an Axim Funded Contribution project label Oct 27, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Oct 27, 2025
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.

LGTM 👍
Thank you for your work, @ChrisChV!

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

Left some nits about disabling useQuery and the use of a Modal here.

const [selectedCourseId, setSelectedCourseId] = useState<string>();

return (
<ModalDialog
Copy link
Contributor

Choose a reason for hiding this comment

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

From the design, it seems that this is not a Modal. The import home route is library/:libraryId/import. Maybe you can create a route like ../import/courses for it?

Also, it would make it easier to reuse the sidebar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The modal is a requirement in the ticket #2524, but I asked to product: #2524 (comment)

extraFilter={extraFilter}
overrideTypesFilter={overrideTypesFilter}
>
{getConfig().ENABLE_COURSE_IMPORT_IN_LIBRARY === 'true' && (
Copy link
Contributor

Choose a reason for hiding this comment

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

If we go for the route, I think we don't need this flag, as we can test it directly using the url.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The env flag is a requirement in the ticket #2524

@rpenido
Copy link
Contributor

rpenido commented Nov 3, 2025

One product question (CC @edschema): we are using the Previously Imported chip if the course was already migrated to THIS library. If it was migrated to another library, we are not showing it.

Is this the expected behaviour?

@edschema
Copy link

edschema commented Nov 4, 2025

One product question (CC @edschema): we are using the Previously Imported chip if the course was already migrated to THIS library. If it was migrated to another library, we are not showing it.

Is this the expected behaviour?

This is a good question. I want to bring this to the product team; I'll get back to you soon.

Is the data structure/ permissions/ access handled in a way that we can potentially show to a user that a course has been imported into a different library? I think it makes sense to show only in the first case below, but there are some reasons why I want to talk this over: if we support converting course content to library references if a course was previously imported to a library/ whether we want to give this visibility in case a team is in process of importing all courses to libraries and are worried about unintentionally importing a course twice.

Three import cases:

  • imported to this library
  • imported to a library I have access to
  • imported to a library I do not have access to

@ChrisChV
Copy link
Contributor Author

ChrisChV commented Nov 4, 2025

Is the data structure/ permissions/ access handled in a way that we can potentially show to a user that a course has been imported into a different library?

@edschema Permissions are based on the user's permissions for each course. If a user has staff permissions for a course, they can view the libraries where the course has been imported, regardless of whether they have permission to those libraries. However, this permission only extends to the library title, not the content.

Three import cases:

  • imported to this library
  • imported to a library I have access to
  • imported to a library I do not have access to

So, the first and second cases would work without a problem. In the third case, the library title would still be displayed; if we don't want to display the library title, we would have to add extra validations, but it is possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Core Contributor assignee FC Relates to an Axim Funded Contribution project 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