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 - Display sidebar component #832

Merged
merged 10 commits into from
Mar 8, 2024

Conversation

PKulkoRaccoonGang
Copy link
Contributor

@PKulkoRaccoonGang PKulkoRaccoonGang commented Feb 13, 2024

Settings

EDX_PLATFORM_REPOSITORY: https://github.com/raccoongang/edx-platform.git
EDX_PLATFORM_VERSION: ruzniaievdm/feat/unit-children

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 added a sidebar for the Course unit page and an alert notifying about unpublished changes.

The primary features were implemented:

  • A new Sidebar component.
  • Alert notifying about unpublished changes.

Issue: openedx/platform-roadmap#321

Developer notes

  • An updated visual representation of the Copy Unit button will be added after adding the copy-paste logic for units and xblocks.
  • The initial 1 commit in this pull request is temporary. Once the feat: [FC-0044] Unit page - display xblock components #857 is merged, the third commit of this pull request will become the main commit.

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.
Screen.Recording.2024-02-29.at.17.01.00.mov

@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 changed the title Peter kulko/sidebar display feat: [FC-0044] Course unit page - Display sidebar component Feb 13, 2024
Copy link

codecov bot commented Feb 13, 2024

Codecov Report

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

Project coverage is 91.14%. Comparing base (3c661e1) to head (8a62e60).
Report is 3 commits behind head on master.

Files Patch % Lines
src/course-unit/course-xblock/CourseXBlock.jsx 87.50% 2 Missing ⚠️
src/course-unit/data/thunk.js 96.77% 2 Missing ⚠️
src/course-unit/sidebar/hooks.jsx 86.66% 1 Missing and 1 partial ⚠️
src/course-unit/sidebar/utils.js 91.66% 2 Missing ⚠️
...e-unit/sidebar/components/ReleaseInfoComponent.jsx 85.71% 1 Missing ⚠️
...idebar/components/sidebar-footer/ActionButtons.jsx 90.90% 1 Missing ⚠️
...r/components/sidebar-footer/UnitVisibilityInfo.jsx 93.75% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #832      +/-   ##
==========================================
+ Coverage   90.94%   91.14%   +0.20%     
==========================================
  Files         520      542      +22     
  Lines        9157     9479     +322     
  Branches     1920     1984      +64     
==========================================
+ Hits         8328     8640     +312     
- Misses        797      806       +9     
- Partials       32       33       +1     

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

ihor-romaniuk and others added 2 commits February 28, 2024 18:30
* feat: added Sidebar with unit info

* feat: added unit location

* refactor: added legacy behavior

* feat: added live variant

* refactor: code refactoring

* feat: added tests and translations

* feat: added new font size

* refactor: after review
@PKulkoRaccoonGang PKulkoRaccoonGang self-assigned this Feb 29, 2024
@PKulkoRaccoonGang PKulkoRaccoonGang marked this pull request as ready for review February 29, 2024 14:43
@PKulkoRaccoonGang PKulkoRaccoonGang requested a review from a team as a code owner February 29, 2024 14:43
@arbrandes arbrandes added the create-sandbox open-craft-grove should create a sandbox environment from this PR label Feb 29, 2024
@open-craft-grove
Copy link

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

@arbrandes
Copy link
Contributor

Getting an error in the sandbox. It's one we've seen before. Any idea what could be causing it?

image

@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 Mar 5, 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 Mar 5, 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.

The code looks good for the most part, but I do have some requests for changes. Thanks!

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/__mocks__/courseVerticalChildren.js Outdated Show resolved Hide resolved
src/course-unit/__mocks__/courseVerticalChildren.js Outdated Show resolved Hide resolved
src/course-unit/constants.js Outdated Show resolved Hide resolved
return (
<span className="course-unit-sidebar-date-and-with">
<h6 className="course-unit-sidebar-date-timestamp m-0 d-inline">
{releaseInfo.releaseDate}&nbsp;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we know if the dates get localized properly in the backend?

Copy link
Member

Choose a reason for hiding this comment

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

The date in the backend is always in UTC. If we want it to be in the users time zone we can use <FormattedDate /> and <FormattedTime /> from i18n

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 💯
I had internal communication on this issue, now we have repeated legacy behavior. Let's take these improvements related to internationalization out of scope.

src/course-unit/sidebar/components/SidebarBody.jsx Outdated Show resolved Hide resolved
src/course-unit/sidebar/components/SidebarHeader.jsx Outdated Show resolved Hide resolved
src/course-unit/sidebar/index.jsx Outdated Show resolved Hide resolved
src/course-unit/sidebar/index.jsx Outdated Show resolved Hide resolved
@open-craft-grove
Copy link

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

import useCourseUnitData from './hooks';
import messages from './messages';

const Sidebar = ({ blockId, isDisplayUnitLocation, ...props }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@PKulkoRaccoonGang I'm working on a sidebar for tags that uses your sidebar as a base. A discussion has arisen about how to make the sidebar styles reusable, perhaps that the sidebar component is a wrapper for its content (until now we would have three sidebars). What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is a good idea 👍
Do you plan to split the sidebar presented in this PR into a wrapper and sidebar content?

@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.

Looks good to me, provided we deal with internationalization separately.

@khudym khudym mentioned this pull request Mar 7, 2024
2 tasks
@arbrandes arbrandes merged commit 642b4e4 into openedx:master Mar 8, 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.

7 participants