Skip to content

fix: use Library search results to populate container card preview [FC-0083] #1820

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

Merged

Conversation

pomegranited
Copy link
Contributor

@pomegranited pomegranited commented Apr 16, 2025

Description

Use the content.childUsageKey list from the content search metadata when displaying a Unit card, or content.published.childUsageKey when displaying only a Unit's published content.

This change fixes a performance bug for Library Authors, but does not otherwise alter their user experience.

Supporting information

Part of: #1778
Blocked by: openedx/edx-platform#36528
Private-ref: FAL-4139

Testing instructions

  1. Using the branch from feat: store content.child_usage_keys in Container search document [FC-0083] edx-platform#36528, reindex any existing Units:
    tutor dev run cms ./manage.py cms reindex_studio --experimental
    
  2. In the Authoring MFE, create/view a library.
  3. Add a Unit.
    Unit card preview should show no blocks.
  4. Open the Unit, and add components to it.
    Unit card preview should update automatically and to show an icon for each component type added (up to 5).
    Once >5 components have been added, the Unit card preview should show the first 4 component type icons, then +N for each subsequent component.
  5. Publish the Unit.
  6. Add one more component to the Unit, but do not publish. Note the number of draft / published components in the unit.
  7. Create/view a course Section > Subsection.
  8. Click "Use unit from library", and navigate to your library unit from the above steps.
    The Unit preview should only show icons from the published Unit children, not the draft.

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

openedx-webhooks commented Apr 16, 2025

Thanks for the pull request, @pomegranited!

This repository is currently maintained by @openedx/2u-tnl.

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.

Copy link

codecov bot commented Apr 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.79%. Comparing base (0fdc460) to head (83b075a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1820      +/-   ##
==========================================
+ Coverage   93.78%   93.79%   +0.01%     
==========================================
  Files        1147     1147              
  Lines       23894    23896       +2     
  Branches     5145     5043     -102     
==========================================
+ Hits        22409    22414       +5     
- Misses       1408     1414       +6     
+ Partials       77       68       -9     

☔ 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 Apr 23, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions Apr 23, 2025
@pomegranited pomegranited force-pushed the jill/container-data-from-search branch from f91c9ef to 90c6f9b Compare April 29, 2025 07:07
@pomegranited pomegranited marked this pull request as ready for review April 29, 2025 07:08
@pomegranited pomegranited marked this pull request as draft April 29, 2025 07:15
@pomegranited pomegranited force-pushed the jill/container-data-from-search branch from 90c6f9b to abc3b5d Compare April 29, 2025 07:16
@pomegranited pomegranited marked this pull request as ready for review April 29, 2025 07:44
@pomegranited pomegranited requested a review from rpenido April 30, 2025 04:48
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, @pomegranited!

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

I left only some nits

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.

@pomegranited Looks good, thank you! 👍

  • I tested this: (Verified card preview counts)
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

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 and is working nicely, but there's a conflict. Can you please fix it and then I'll merge?

@bradenmacdonald bradenmacdonald merged commit 24e4695 into openedx:master May 2, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Waiting on Author to Done in Contributions May 2, 2025
@bradenmacdonald bradenmacdonald deleted the jill/container-data-from-search branch May 2, 2025 02:13
pomegranited added a commit to open-craft/frontend-app-authoring that referenced this pull request May 2, 2025
…penedx#1820)

* fix: use Library search results to populate container card preview

* feat: show published children when showing only published Unit content

* fix: nits

(cherry picked from commit 24e4695)
pomegranited added a commit to open-craft/frontend-app-authoring that referenced this pull request May 2, 2025
…penedx#1820)

* fix: use Library search results to populate container card preview

* feat: show published children when showing only published Unit content

* fix: nits

(cherry picked from commit 24e4695)
bradenmacdonald pushed a commit that referenced this pull request May 2, 2025
…FC-0083] [TEAK] (#1889)

* fix: several library unit page UX bugs (#1868)

* fix: rename "Organize" tab to "Manage"

* fix: duplicate key warnings

* fix: uniform messages while adding to collection

* fix: do not allow units be added to a unit

(cherry picked from commit 0fdc460)

* perf: use Library search results to populate container card preview (#1820)

* fix: use Library search results to populate container card preview

* feat: show published children when showing only published Unit content

* fix: nits

(cherry picked from commit 24e4695)

---------

Co-authored-by: Rômulo Penido <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FC Relates to an Axim Funded Contribution project open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants