Skip to content

Conversation

@rpenido
Copy link
Contributor

@rpenido rpenido commented Oct 28, 2025

Description

This PR adds the Library Import Home, which lists course migrations to the library

image
  • Which user roles will this change impact?
    "Course Author" and "Developer"

Supporting information

Testing instructions

  • Open the Library Import Home (Tools > Import from inside the library) for a library that has not received any migrated courses
  • Check the empty state
  • Migrate some courses to the library, selecting a target collection
  • Open the Library Import Home and check the migration
    • Clicking on the title should navigate to the course
    • Clicking on the collection name should navigate to the collection

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'

Private ref: FAL-4265

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

openedx-webhooks commented Oct 28, 2025

Thanks for the pull request, @rpenido!

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.

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 97.22222% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.83%. Comparing base (436ac31) to head (6b3827b).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
src/library-authoring/data/api.ts 50.00% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2580    +/-   ##
========================================
  Coverage   94.82%   94.83%            
========================================
  Files        1226     1231     +5     
  Lines       27557    27627    +70     
  Branches     6043     6221   +178     
========================================
+ Hits        26131    26199    +68     
- Misses       1368     1370     +2     
  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 moved this from Needs Triage to Waiting on Author in Contributions Oct 29, 2025
@rpenido rpenido force-pushed the rpenido/FAL-4265/import-home branch 7 times, most recently from bb4eff0 to 9230c0e Compare November 4, 2025 22:06
@rpenido rpenido force-pushed the rpenido/FAL-4265/import-home branch from 9230c0e to ca3c068 Compare November 4, 2025 22:38
@rpenido rpenido changed the title feat: add course import page feat: add course import page [FC-0112] Nov 4, 2025
@rpenido rpenido marked this pull request as ready for review November 5, 2025 17:56
@navinkarkera
Copy link
Contributor

navinkarkera commented Nov 6, 2025

@rpenido The right chevron is missing here.

image

Also, the collection link color and underline is not matching with designs.

Copy link
Contributor

@navinkarkera navinkarkera left a comment

Choose a reason for hiding this comment

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

@rpenido Nice work! This looks good. Left some suggestions.

await getAuthenticatedHttpClient().post(getLibraryContainerPublishApiUrl(containerId));
}

export interface CourseMigration {
Copy link
Contributor

Choose a reason for hiding this comment

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

NIT: rename to indicate import instead of migration

Comment on lines 92 to 94
migrations: (libraryId: string) => [
...libraryAuthoringQueryKeys.contentLibrary(libraryId),
'migrations',
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here. Rename to import.

title={libraryData.title}
org={libraryData.org}
contextId={libraryId}
isLibrary
Copy link
Contributor

Choose a reason for hiding this comment

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

Pass readOnly from library context here.

Suggested change
isLibrary
isLibrary
readOnly={readOnly}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks! Fixed here: f17820b

Comment on lines 1 to 13
.course-migration-help {
z-index: 1000; // same as header
flex: 350px 0 0;
position: sticky;
top: 0;
right: 0;
height: 100vh;
overflow-y: auto;

hr {
width: 100%;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

We can remove this completely. It unnecessarily adds vertical scroll

Copy link
Contributor Author

@rpenido rpenido Nov 6, 2025

Choose a reason for hiding this comment

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

I was trying to avoid the same issue from here: #2200 (comment)

Removed: cab000a

import messages from './messages';

export const HelpSidebar = () => (
<div className="course-migration-help pt-3 border-left">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<div className="course-migration-help pt-3 border-left">
<div className="pt-3 border-left">

Copy link
Contributor Author

@rpenido rpenido Nov 6, 2025

Choose a reason for hiding this comment

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

Fixed cab000a

/>
</span>
</Stack>
<hr />
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<hr />
<hr className="w-100" />

Copy link
Contributor Author

@rpenido rpenido Nov 6, 2025

Choose a reason for hiding this comment

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

Fixed: cab000a

size: undefined,
}}
/>
<Container className="px-0 mt-4 mb-5 library-authoring-page">
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<Container className="px-0 mt-4 mb-5 library-authoring-page">
<Container className="mt-4 mb-5">

px-0 adds unnecessary horizontal scroll and library-authoring-page has no effect

Copy link
Contributor Author

@rpenido rpenido Nov 6, 2025

Choose a reason for hiding this comment

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

Thanks! Fixed: ab24e7c

@rpenido rpenido force-pushed the rpenido/FAL-4265/import-home branch from e11f76f to ab24e7c Compare November 6, 2025 16:54
@rpenido
Copy link
Contributor Author

rpenido commented Nov 6, 2025

@rpenido The right chevron is missing here.

I missed that! Thanks!

Also, the collection link color and underline is not matching with designs.

I was trying to stick to our default Paragon design (https://paragon-openedx.netlify.app/components/button/#when-to-use-the-inline-size) and prevent custom styles.

Both fixed here: 73948ab

Copy link
Contributor

@ChrisChV ChrisChV left a comment

Choose a reason for hiding this comment

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

The code looks good! @rpenido Thanks! 👍 I will merge it after fixing the broken lint and after the review of @navinkarkera

@rpenido rpenido force-pushed the rpenido/FAL-4265/import-home branch from fb1eded to fc79cb1 Compare November 6, 2025 21:16
Copy link
Contributor

@navinkarkera navinkarkera left a comment

Choose a reason for hiding this comment

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

@rpenido Great work 👍

  • I tested this: (Played around with import home page)
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

Comment on lines +89 to +95
<Link
to={`/course/${courseImport.source.key}`}
aria-label={intl.formatMessage(messages.courseImportNavigateAlt)}
className="text-primary-500"
>
<Icon src={ArrowForwardIos} />
</Link>
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be updated as part of #2526. The link should take user to import details page and I think the whole card should be clickable.

Co-authored-by: Navin Karkera <[email protected]>
@ChrisChV
Copy link
Contributor

ChrisChV commented Nov 7, 2025

@rpenido is it ready to be merged?

@rpenido
Copy link
Contributor Author

rpenido commented Nov 7, 2025

@rpenido is it ready to be merged?

Yeah!

@ChrisChV ChrisChV merged commit 6d619b9 into openedx:master Nov 7, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions Nov 7, 2025
@ChrisChV ChrisChV deleted the rpenido/FAL-4265/import-home branch November 7, 2025 21:32
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

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants