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] Course unit page - Modal windows for course unit page components #845

Merged

Conversation

PKulkoRaccoonGang
Copy link
Contributor

@PKulkoRaccoonGang PKulkoRaccoonGang commented Feb 19, 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 adds functionality to display modal windows for the Add component block.

The primary features were implemented:

  • Added modals for: Open Response, Advanced components and Text buttons.

Issue: openedx/platform-roadmap#321

Developer notes

  • Current changes to the module switching widget are in preparation for the final changes to replace the LMS endpoints.
  • In the upcoming pull request, the LMS endpoints of the MFE Learning will be substituted with distinct and independent endpoints from the CMS.
  • After the associated pull request is merged, the first two commits from that pull request will be deleted.

Design

Figma design

image

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 the new Unit page by adding a waffle flag contentstore.new_studio_mfe.use_new_unit_page in the CMS admin panel.
  4. Make sure that the MFE setting ENABLE_UNIT_PAGE=true is enabled.
  5. Go to the Course Unit page from the Course Outline page.
  6. Make sure the course you are viewing is not outdated.
  7. Publish all sections on the Course Outline page.
  8. Open the legacy page of the current unit.
  9. After click on each of the working buttons (Open Response, Advanced components and Text), a modal window opens with xblock template options.
  10. The added xblock is displayed on the legacy page of the current unit.

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

Thanks for the pull request, @PKulkoRaccoonGang! 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.

@PKulkoRaccoonGang PKulkoRaccoonGang changed the title feat: Modal windows for course unit page components feat: [FC-0044] Course unit page - Modal windows for course unit page components Feb 19, 2024
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.39%. Comparing base (6b57ce3) to head (5ba4a07).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #845   +/-   ##
=======================================
  Coverage   90.39%   90.39%           
=======================================
  Files         554      554           
  Lines        9826     9826           
  Branches     2110     2110           
=======================================
  Hits         8882     8882           
  Misses        910      910           
  Partials       34       34           

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

@PKulkoRaccoonGang PKulkoRaccoonGang self-assigned this Feb 19, 2024
@PKulkoRaccoonGang PKulkoRaccoonGang added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Feb 19, 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

@PKulkoRaccoonGang PKulkoRaccoonGang added create-sandbox open-craft-grove should create a sandbox environment from this PR and removed create-sandbox open-craft-grove should create a sandbox environment from this PR labels Feb 20, 2024
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.

Just a couple of minor nits in the code. But it works perfectly in a local Tutor environment, even though the sandbox failed to fire up.

src/course-unit/add-component/AddComponent.jsx Outdated Show resolved Hide resolved
src/course-unit/add-component/AddComponent.jsx Outdated Show resolved Hide resolved
src/course-unit/add-component/AddComponent.jsx Outdated Show resolved Hide resolved
src/course-unit/add-component/AddComponent.test.jsx Outdated Show resolved Hide resolved
src/course-unit/add-component/AddComponent.test.jsx Outdated Show resolved Hide resolved
src/course-unit/add-component/AddComponent.test.jsx Outdated Show resolved Hide resolved
Comment on lines 55 to 63
return (
<Form.Radio
key={componentTemplate.displayName}
className="add-component-modal-radio mb-2.5"
value={value}
>
{componentTemplate.displayName}
</Form.Radio>
);
Copy link
Member

Choose a reason for hiding this comment

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

This part also needs to include the support status (full, partial, not supported). This is dependent on if show_legend is true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This functionality will be added in one of the next pull requests. Can I somehow reproduce this behavior on legacy?

Copy link
Member

Choose a reason for hiding this comment

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

Ok! From my brief exploration, it is controlled in component.py. I am not sure how to change the value of XBlockStudioConfigurationFlag.

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! 👍

@open-craft-grove
Copy link

Sandbox deployment successful 🚀
🎓 LMS
📝 Studio
ℹ️ Grove Config, Tutor Config, Tutor Requirements

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.

Approved as far as I'm concerned, though still pending resolution of @KristinAoki's comment above.

@arbrandes
Copy link
Contributor

The base PR was merged, so this requires conflict resolution.

@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the Peter_Kulko/components-modal-windows branch from 7f586f7 to 5ba4a07 Compare February 27, 2024 15:21
@PKulkoRaccoonGang PKulkoRaccoonGang requested a review from a team as a code owner February 27, 2024 15:21
@PKulkoRaccoonGang
Copy link
Contributor Author

@arbrandes Most likely, during my force push, one commit from this PR was included in the previous PR. I cleared the history and left only the missing commit with refactoring. Please take a look

@KristinAoki
Copy link
Member

@PKulkoRaccoonGang I think the forced push overwrote some of the changes in this PR. The change log is now showing that you only made changes in the test file.

@PKulkoRaccoonGang
Copy link
Contributor Author

@KristinAoki I deleted commits that were already in the master

@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

@arbrandes
Copy link
Contributor

Oh, so the changes here got merged on the other PR? Should've taken a closer look. Anyway, good thing this is technically approved, then. :)

@arbrandes arbrandes merged commit 49fce46 into openedx:master Feb 27, 2024
6 checks passed
@openedx-webhooks
Copy link

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

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