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: [FC-0070] rendering library content in unit page #1475

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ihor-romaniuk
Copy link
Contributor

@ihor-romaniuk ihor-romaniuk commented Nov 6, 2024

🚨 Dependencies:

Settings

EDX_PLATFORM_REPOSITORY: https://github.com/raccoongang/edx-platform.git
EDX_PLATFORM_VERSION: romaniuk/children-container-for-rendering-library

TUTOR_GROVE_NEW_MFES:
  authoring:
    port: 18000
    repository: https://github.com/raccoongang/frontend-app-course-authoring.git
    version: romaniuk/children-container-for-rendering-library

TUTOR_GROVE_WAFFLE_FLAGS:
  - name: contentstore.new_studio_mfe.use_new_unit_page
    everyone: true

TUTOR_GROVE_MFE_LMS_COMMON_SETTINGS:
  MFE_CONFIG:
    ENABLE_UNIT_PAGE: true

Description

This PR introduces functionality to display Library Content within the new Unit page interface.

The feature enables opening a Library Content page within the Unit page’s new interface. This page displays the xBlocks from the specified library and provides basic configuration options for the library.

Unit_Library_Content.mov

Related Pull Requests

Testing instructions

  • Create a new course.
  • Create several units.
  • Open the course unit page.
  • Add a Library xBlock to the unit.
  • Click the β€œView” button on the Library xBlock.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Nov 6, 2024
@openedx-webhooks
Copy link

openedx-webhooks commented Nov 6, 2024

Thanks for the pull request, @ihor-romaniuk!

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.

@bradenmacdonald
Copy link
Contributor

Just to be clear: this is v1 library content, right? And the old "randomized content block"?

We have #1462 #1463 #1464 scheduled to implement V2 on the MFE unit page.

@ihor-romaniuk ihor-romaniuk added the FC Relates to an Axim Funded Contribution project label Nov 7, 2024
@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/children-container-for-rendering-library branch 2 times, most recently from 26c3235 to f836c6c Compare November 25, 2024 10:18
@ihor-romaniuk ihor-romaniuk marked this pull request as ready for review November 25, 2024 10:18
@ihor-romaniuk ihor-romaniuk requested a review from a team as a code owner November 25, 2024 10:18
@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/children-container-for-rendering-library branch from f836c6c to b53e28f Compare November 25, 2024 10:47
Copy link

codecov bot commented Nov 25, 2024

Codecov Report

Attention: Patch coverage is 97.50000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.92%. Comparing base (55fe87a) to head (f0c3e23).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
src/course-unit/breadcrumbs/Breadcrumbs.tsx 95.83% 1 Missing ⚠️
src/course-unit/hooks.jsx 94.11% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1475    +/-   ##
========================================
  Coverage   92.91%   92.92%            
========================================
  Files        1065     1072     +7     
  Lines       20979    21097   +118     
  Branches     4537     4580    +43     
========================================
+ Hits        19493    19604   +111     
- Misses       1419     1420     +1     
- Partials       67       73     +6     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/children-container-for-rendering-library branch 2 times, most recently from 09c33b0 to f45ad06 Compare November 25, 2024 13:24
@ihor-romaniuk ihor-romaniuk added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Nov 25, 2024
@open-craft-grove
Copy link

Sandbox deployment failed πŸ’₯
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
πŸ“œ Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@ihor-romaniuk
Copy link
Contributor Author

@bradenmacdonald Yes, you are right. This is v1 library content.

src/course-unit/CourseUnit.jsx Outdated Show resolved Hide resolved
src/course-unit/CourseUnit.jsx Outdated Show resolved Hide resolved
src/course-unit/CourseUnit.test.jsx Outdated Show resolved Hide resolved
src/course-unit/CourseUnit.test.jsx Outdated Show resolved Hide resolved
src/course-unit/breadcrumbs/Breadcrumbs.jsx Outdated Show resolved Hide resolved
src/course-unit/utils.test.ts Outdated Show resolved Hide resolved
src/course-unit/utils.ts Outdated Show resolved Hide resolved
src/course-unit/utils.ts Outdated Show resolved Hide resolved
src/course-unit/utils.ts Outdated Show resolved Hide resolved
src/course-unit/utils.ts Outdated Show resolved Hide resolved
@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/children-container-for-rendering-library branch from f45ad06 to 70f93f2 Compare November 26, 2024 17:07
@open-craft-grove
Copy link

Sandbox deployment failed πŸ’₯
Please check the settings and requirements.
Retry deployment by pushing a new commit or updating the requirements/settings in the pull request's description.
πŸ“œ Failure Logs
ℹ️ Grove Config, Tutor Config, Tutor Requirements

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.

I haven't had time to review this yet, sorry. Will try to take a look tomorrow.

{ancestorXblocks.map(({ children, title, isLast }, index) => (
<li
className="d-flex"
key={title}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is title unique? If not, then maybe use {index} as the key ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Replaced with key={`${title}-${index}`}

@open-craft-grove
Copy link

Sandbox deployment successful πŸš€
πŸŽ“ LMS
πŸ“ Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Nov 27, 2024

When the unit iframe is small, and I click "+ Legacy Library", the iframe doesn't fit the editor modal that opens:

Screenshot 2024-11-27 at 1 31 36β€―PM

It's actually impossible to use because the buttons aren't accessible.

@bradenmacdonald
Copy link
Contributor

Related Pull Requests
openedx/edx-platform#35785 - events to trigger click on View button and styles

^ This PR is actually a dependency and should be listed under "Dependencies" please :)

<Breadcrumbs />
<Breadcrumbs
courseId={courseId}
sequenceId={sequenceId}
Copy link
Contributor

Choose a reason for hiding this comment

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

What on earth is a "sequence ID"? I think the variable / URL parameter sequenceId is very unclear, and poorly documented. Can we rename it to something more clear? Is it "parent ID"? "Parent Unit ID"? Or something else?

I know it was already in the code here, but I think it's a problem and we can fix it now.

It's also very weird that it comes after the ID of the child containerΒ in the URL, but it may be too late to change that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Completely agree with you, and I tried to rename sequenceId to parentUnitId with minimal code impact.

variant="outline-primary"
onClick={handleEdit}
>
{intl.formatMessage(messages.editButton)}
Copy link
Contributor

Choose a reason for hiding this comment

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

This edit button is not working for me. Nothing happens when I click it.

Screenshot 2024-11-27 at 2 51 55β€―PM

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 edit functionality will be realized in pull request #1445 and then adopted to that page in pull request #1492 (if needed).

src/course-unit/header-navigations/messages.ts Outdated Show resolved Hide resolved
src/course-unit/CourseUnit.jsx Show resolved Hide resolved
src/course-unit/hooks.jsx Show resolved Hide resolved
src/course-unit/hooks.jsx Outdated Show resolved Hide resolved
src/generic/configure-modal/messages.js Outdated Show resolved Hide resolved
@open-craft-grove
Copy link

Sandbox deployment successful πŸš€
πŸŽ“ LMS
πŸ“ Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

@ihor-romaniuk
Copy link
Contributor Author

When the unit iframe is small, and I click "+ Legacy Library", the iframe doesn't fit the editor modal that opens:

Also related to edit functionality that will be realized in pull request #1445 and then adopted to that page in pull request #1492 (if needed).

@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/children-container-for-rendering-library branch 2 times, most recently from 2af7492 to c54f263 Compare November 28, 2024 08:54
@open-craft-grove
Copy link

Sandbox deployment successful πŸš€
πŸŽ“ LMS
πŸ“ Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

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.

LGTM. Thanks.

src/course-unit/utils.ts Outdated Show resolved Hide resolved
Comment on lines +42 to +45
ACCOUNT_PROFILE_URL: process.env.ACCOUNT_PROFILE_URL || null,
ACCOUNT_SETTINGS_URL: process.env.ACCOUNT_SETTINGS_URL || null,
IGNORED_ERROR_REGEX: process.env.IGNORED_ERROR_REGEX || null,
MFE_CONFIG_API_URL: process.env.MFE_CONFIG_API_URL || null,
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why these lines are included in this PR? Are they required for some of the new tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These configurations fix existing warnings in unit page tests.

@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/children-container-for-rendering-library branch from c54f263 to f0c3e23 Compare December 2, 2024 15:53
@open-craft-grove
Copy link

Sandbox deployment successful πŸš€
πŸŽ“ LMS
πŸ“ Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
create-sandbox open-craft-grove should create a sandbox environment from this PR 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