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-0044] Unit page - add new component section #828

Conversation

ihor-romaniuk
Copy link
Contributor

@ihor-romaniuk ihor-romaniuk commented Feb 8, 2024

Settings

EDX_PLATFORM_REPOSITORY: https://github.com/openedx/edx-platform.git
EDX_PLATFORM_VERSION: master

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 pull request introduces a new section that allow adding the addition of various xblock components to the page. The main features of this update include a block with pre-prepared buttons for different types of components.

The primary features were implemented:

  • New component selection block: Included a dedicated block with pre-prepared buttons for different types of components, making it intuitive for users to choose and add components to their pages.
  • Components: Introduced the ability to add Discussion/Drag-and-Drop/Problem/Video components to the page.

Issue: openedx/platform-roadmap#321

Developer notes

The first three commits in this pull request are temporary. Once the #809 is merged, the fourth and next commits of this pull request will become the main commits.

Design

https://www.figma.com/file/YeKFwSpyLaJFDs3f3p3TSa/Studio-1%3A1-mock-ups?node-id=599%3A23595

add-component

Testing instructions

  1. Run master devstack.
  2. Start platform make dev.up.lms+cms+frontend-app-course-authoring and make checkout on this branch.
  3. Enable new Unit page by adding a waffle flad contentstore.new_studio_mfe.use_new_unit_page in CMS admin panel.
  4. Go to Course Unit page from the Course Outline page.

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

Thanks for the pull request, @ihor-romaniuk! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b234344) 89.02% compared to head (48001a4) 89.13%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #828      +/-   ##
==========================================
+ Coverage   89.02%   89.13%   +0.11%     
==========================================
  Files         545      548       +3     
  Lines        9585     9647      +62     
  Branches     2054     2067      +13     
==========================================
+ Hits         8533     8599      +66     
+ Misses       1005     1001       -4     
  Partials       47       47              

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

@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/feat/unit-page/add-new-component-section branch from 84be573 to a4959b2 Compare February 8, 2024 16:26
@arbrandes arbrandes added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Feb 8, 2024
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a test for when adding a component fails?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tests have been added for all uncovered places.

@ihor-romaniuk ihor-romaniuk force-pushed the romaniuk/feat/unit-page/add-new-component-section branch from a4959b2 to 48001a4 Compare February 9, 2024 14:31
Copy link
Contributor

@arbrandes arbrandes left a comment

Choose a reason for hiding this comment

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

One optional nit and a couple of questions, but otherwise approved.

Oh, and it Runs In Tutor ™️ ✅ . ;)

@@ -146,4 +158,57 @@ describe('<CourseUnit />', () => {
expect(titleEditField).not.toBeInTheDocument();
expect(await findByText(newDisplayName)).toBeInTheDocument();
});

it('doesn\'t handle creating xblock and displays an error message', async () => {
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
it('doesn\'t handle creating xblock and displays an error message', async () => {
it('doesn\'t handle creating video xblock and displays an error message', async () => {

Copy link
Contributor

@arbrandes arbrandes Feb 9, 2024

Choose a reason for hiding this comment

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

Maybe this was made to be generic intentionally. In which case, ignore the comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you are right. It might be as a generic and can be reverted in next MR.

navigate(`/course/${courseKey}/editor/${type}/${locator}`);
});
break;
default:
Copy link
Contributor

Choose a reason for hiding this comment

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

[Non-blocking] Do we have a plan to handle "advanced" (i.e, custom) XBlocks?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, these are just the xblocks that do not require a modal to specify the exact block. (see mock-up)
Screenshot 2024-02-09 at 12 49 54 PM

* @param {string} checkPath - the internal route path that is validated
* @returns {string} - the correct internal route path
*/
export const createCorrectInternalRoute = (checkPath) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

[Non-blocking] Thank you for handling PUBLIC_PATH and the trailing slash! 👍🏼

This came up a lot after the react-router-v6 upgrade, during Quince testing. It should be standardized in frontend-platform, eventually.

@KristinAoki KristinAoki merged commit 1555e9f into openedx:master Feb 9, 2024
6 checks passed
@openedx-webhooks
Copy link

@ihor-romaniuk 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

@ihor-romaniuk ihor-romaniuk deleted the romaniuk/feat/unit-page/add-new-component-section branch February 12, 2024 08:48
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 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