Skip to content

feat: [FC-0044] Course unit page - Display sidebar component - #832

Merged
arbrandes merged 10 commits into
openedx:masterfrom
raccoongang:Peter_Kulko/sidebar-display
Mar 8, 2024
Merged

feat: [FC-0044] Course unit page - Display sidebar component#832
arbrandes merged 10 commits into
openedx:masterfrom
raccoongang:Peter_Kulko/sidebar-display

Conversation

@peterkulko

@peterkulko peterkulko commented Feb 13, 2024

Copy link
Copy Markdown
Contributor

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

openedx-webhooks commented Feb 13, 2024

Copy link
Copy Markdown

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.

@peterkulko peterkulko changed the title Peter kulko/sidebar display feat: [FC-0044] Course unit page - Display sidebar component Feb 13, 2024
@codecov

codecov Bot commented Feb 13, 2024

Copy link
Copy Markdown

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.

@peterkulko
peterkulko marked this pull request as draft February 13, 2024 13:31
@ChrisChV ChrisChV mentioned this pull request Feb 22, 2024
@peterkulko
peterkulko force-pushed the Peter_Kulko/sidebar-display branch from 89db038 to 38f42b6 Compare February 27, 2024 17:31
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
@peterkulko
peterkulko force-pushed the Peter_Kulko/sidebar-display branch from 38f42b6 to 55a9888 Compare February 29, 2024 09:33
peterkulko and others added 7 commits February 29, 2024 11:51
@peterkulko peterkulko self-assigned this Feb 29, 2024
@peterkulko
peterkulko marked this pull request as ready for review February 29, 2024 14:43
@peterkulko
peterkulko requested a review from a team 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
Copy Markdown

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

@arbrandes

Copy link
Copy Markdown
Contributor

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

image

@peterkulko peterkulko 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
Copy Markdown

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

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

@arbrandes arbrandes left a comment

Copy link
Copy Markdown
Contributor

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!

Comment thread src/course-unit/CourseUnit.test.jsx Outdated
Comment thread src/course-unit/CourseUnit.test.jsx Outdated
Comment thread src/course-unit/__mocks__/courseVerticalChildren.js Outdated
Comment thread src/course-unit/__mocks__/courseVerticalChildren.js Outdated
Comment thread src/course-unit/constants.js Outdated
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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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.

Comment thread src/course-unit/sidebar/components/SidebarBody.jsx Outdated
Comment thread src/course-unit/sidebar/components/SidebarHeader.jsx Outdated
Comment thread src/course-unit/sidebar/index.jsx Outdated
Comment thread src/course-unit/sidebar/index.jsx Outdated
@open-craft-grove

Copy link
Copy Markdown

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

Comment thread src/course-unit/sidebar/index.jsx Outdated
import useCourseUnitData from './hooks';
import messages from './messages';

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

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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

@peterkulko
peterkulko requested review from ChrisChV and arbrandes March 6, 2024 11:02

@arbrandes arbrandes left a comment

Copy link
Copy Markdown
Contributor

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
@openedx-webhooks

Copy link
Copy Markdown

@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