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 - Unit creation button logic and refactoring #831

Merged

Conversation

PKulkoRaccoonGang
Copy link
Contributor

@PKulkoRaccoonGang PKulkoRaccoonGang commented Feb 13, 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 is a logical continuation of optimizing the CMS of the navigation widget for course units. The second refactoring stage was carried out which will end in the next pull request to transfer the navigation widget from the MFE Learning. In addition, the functionality of a button to create a new unit for the Course unit page was implemented.

The primary features were implemented:

  • Course unit switch widget refactoring: preparations have been made for the final changes to replace LMS endpoints.
  • Unit creation button logic: the functionality of a button to create a new unit for the Course unit page was implemented.

Issue: openedx/platform-roadmap#321

Developer notes

  • The code base for this pull request does not provide test coverage for the Course unit switch widget.
  • 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.

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. Click on the add new unit button.

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

openedx-webhooks commented Feb 13, 2024

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 marked this pull request as draft February 13, 2024 10:49
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: Patch coverage is 92.41379% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 90.39%. Comparing base (76bb8e8) to head (27adcc9).
Report is 2 commits behind head on master.

Files Patch % Lines
src/course-unit/data/thunk.js 76.47% 4 Missing ⚠️
src/course-unit/add-component/AddComponent.jsx 94.59% 2 Missing ⚠️
...nce/sequence-navigation/SequenceNavigationTabs.jsx 80.00% 2 Missing ⚠️
src/course-unit/data/slice.js 66.66% 2 Missing ⚠️
src/course-unit/hooks.jsx 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #831      +/-   ##
==========================================
+ Coverage   89.27%   90.39%   +1.11%     
==========================================
  Files         551      554       +3     
  Lines        9738     9826      +88     
  Branches     2099     2110      +11     
==========================================
+ Hits         8694     8882     +188     
+ Misses        996      910      -86     
+ Partials       48       34      -14     

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

@PKulkoRaccoonGang PKulkoRaccoonGang changed the title feat: New unit btn and refactoring feat: [FC-0044] Course unit page - Unit creation button logic and refactoring Feb 13, 2024
@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the Peter_Kulko/new-unit-btn-and-refactoring branch from 65db5ac to 3ac069d Compare February 13, 2024 11:25
@PKulkoRaccoonGang PKulkoRaccoonGang self-assigned this Feb 13, 2024
@PKulkoRaccoonGang PKulkoRaccoonGang marked this pull request as ready for review February 13, 2024 11:34
@arbrandes arbrandes added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Feb 14, 2024
@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the Peter_Kulko/new-unit-btn-and-refactoring branch from 79d5a2d to 5e9bc34 Compare February 15, 2024 09:48
@PKulkoRaccoonGang PKulkoRaccoonGang force-pushed the Peter_Kulko/new-unit-btn-and-refactoring branch from 5e9bc34 to 556001c Compare February 19, 2024 11:49
@open-craft-grove
Copy link

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

… page components (#118)

* feat: added modal windows for course unit page components

* refactor: code refactoring

* refactor: added translations

* refactor: refactoring after review

* refactor: after review
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.

It works, and I like the direction of the refactor. I have one nit about the renaming of TitleEditForm to EditTitleForm, though, but only because similar variables have not been similarly changed. (If you want to change that, totally fine, but we should probably commit to changing the other ones too.)

I don't mind the failure in coverage, at least for now.

@@ -73,6 +73,7 @@ const CourseAuthoringRoutes = () => {
/>
{DECODED_ROUTES.COURSE_UNIT.map((path) => (
<Route
key={path}
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, just a question. wondering how it was working before. We probably had warnings, right?

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, a warning about the need to add a key for the element that is being mapped

src/course-unit/CourseUnit.jsx Outdated Show resolved Hide resolved
@open-craft-grove
Copy link

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

@PKulkoRaccoonGang
Copy link
Contributor Author

PKulkoRaccoonGang commented Feb 26, 2024

@arbrandes Thank you! Your wishes were taken into account + test coverage increased after rolling back the renaming of variables and Sandbox deployment was successful 🚀

@arbrandes
Copy link
Contributor

Thank you for addressing my comments!

@arbrandes arbrandes merged commit 6b57ce3 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.

6 participants