Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add existing content to a collection [FC-0062] #1416

Conversation

rpenido
Copy link
Contributor

@rpenido rpenido commented Oct 21, 2024

Description

This PR implements a feature that allows library components to be added to a collection using the add-content sidebar.

image

More information

Testing instruction

  1. Open the Library Authoring page
  2. Open a collection
  3. Click on the "New" button
  4. Click on the "Existing Library Content"
  5. Select some components and then click on the "Add to collection" button

Private ref: FAL-3901}

@rpenido rpenido requested a review from a team as a code owner October 21, 2024 18:44
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Oct 21, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Oct 21, 2024

Thanks for the pull request, @rpenido!

What's next?

Please work through the following steps to get your changes 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.

🔘 Let us know that your PR is ready for review:

Who will review my changes?

This repository is currently maintained by @openedx/2u-tnl. Tag them in a comment and let them know that your changes are ready for review.

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.

@rpenido rpenido force-pushed the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch from e71fd44 to 21423e3 Compare October 21, 2024 18:50
Copy link

codecov bot commented Oct 21, 2024

Codecov Report

Attention: Patch coverage is 98.03922% with 1 line in your changes missing coverage. Please review.

Project coverage is 93.15%. Comparing base (11470f2) to head (806f32f).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
...rary-authoring/add-content/AddContentContainer.tsx 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1416   +/-   ##
=======================================
  Coverage   93.15%   93.15%           
=======================================
  Files        1051     1053    +2     
  Lines       20328    20373   +45     
  Branches     4335     4342    +7     
=======================================
+ Hits        18936    18979   +43     
+ Misses       1332     1331    -1     
- Partials       60       63    +3     

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

@rpenido rpenido changed the title refactor: add onComponentSelected callback function wip Oct 21, 2024
@rpenido rpenido marked this pull request as draft October 21, 2024 19:32
@rpenido rpenido force-pushed the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch 4 times, most recently from 7f74d83 to d45916d Compare October 22, 2024 22:18
@rpenido rpenido changed the title wip feat: add existing content to a collection [FC-0062] Oct 22, 2024
@rpenido rpenido force-pushed the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch 2 times, most recently from bc45738 to d612bd6 Compare October 22, 2024 22:52
@rpenido rpenido force-pushed the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch from a7ce64b to 9d9f3a1 Compare October 22, 2024 23:53
@rpenido rpenido force-pushed the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch from 12f9fe6 to 94ccd93 Compare October 23, 2024 00:26
@rpenido rpenido marked this pull request as ready for review October 23, 2024 00:38
Copy link
Contributor

@pomegranited pomegranited left a comment

Choose a reason for hiding this comment

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

👍 Works beautifully @rpenido !

I'll see if I can help with the circular imports.

  • I tested this on my dev stack using the PR test instructions
  • I read through the code and tests
  • I checked for accessibility issues by using my keyboard to navigate
  • Includes documentation -- code comments
  • User-facing strings are extracted for translation

@rpenido rpenido force-pushed the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch from 6d5e25d to 3fe699f Compare October 23, 2024 12:39
@kdmccormick
Copy link
Member

@rpenido Feel free to ping me if you are looking for a reviewer/merger on this one

@rpenido
Copy link
Contributor Author

rpenido commented Oct 23, 2024

@rpenido Feel free to ping me if you are looking for a reviewer/merger on this one

That would be awesome @kdmccormick!
This is ready for review. I'm just waiting for the CD/CI to check if everything is fine.

@rpenido rpenido force-pushed the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch from 2f19728 to 806f32f Compare October 23, 2024 14:53
Comment on lines +33 to +36
/** The component picker modal to use. We need to pass it as a reference instead of
* directly importing it to avoid the import cycle:
* ComponentPickerModal > ComponentPicker > LibraryAuthoringPage/LibraryCollectionPage >
* Sidebar > AddContentContainer > ComponentPickerModal */
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/** The component picker modal to use. We need to pass it as a reference instead of
* directly importing it to avoid the import cycle:
* ComponentPickerModal > ComponentPicker > LibraryAuthoringPage/LibraryCollectionPage >
* Sidebar > AddContentContainer > ComponentPickerModal */
{/** The component picker modal to use. We need to pass it as a reference instead of
* directly importing it to avoid the import cycle:=
* ComponentPickerModal > ComponentPicker > LibraryAuthoringPage/LibraryCollectionPage >
* Sidebar > AddContentContainer > ComponentPickerModal */}

My jsx is rusty, but doesn't this need to be in curly braces?

Copy link
Contributor

Choose a reason for hiding this comment

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

Apparently it's not necessary.

Copy link
Member

@kdmccormick kdmccormick left a comment

Choose a reason for hiding this comment

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

Tested, works great!

@@ -51,6 +66,11 @@ const messages = defineMessages({
defaultMessage: 'There was an error creating the content.',
description: 'Message when creation of content in library is on error',
},
successAssociateComponentMessage: {
id: 'course-authoring.library-authoring.associate-collection-content.success.text',
defaultMessage: 'Content linked successfully.',
Copy link
Member

Choose a reason for hiding this comment

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

Not sure how I feel about using the term "linking" here, since it's very different than linking content to a course. No action needed now, just a potential place for refinement post-Sumac.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@kdmccormick kdmccormick merged commit a8aa495 into openedx:master Oct 23, 2024
8 checks passed
@bradenmacdonald bradenmacdonald deleted the rpenido/fal-3901-collections-page-add-existing-content-from-within-a-collection branch October 23, 2024 15:53
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