-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
533-refactor: Widget courses #545
Conversation
Lighthouse Report:
|
Lighthouse Report:
|
Lighthouse Report:
|
Lighthouse Report:
|
π Walkthroughπ WalkthroughWalkthroughThe pull request introduces several changes across multiple files related to the Changes
Assessment against linked issues
Possibly related issues
Possibly related PRs
Suggested reviewers
π Recent review detailsConfiguration used: .coderabbit.yaml π Files selected for processing (1)
π§ Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? πͺ§ TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
π§Ή Outside diff range and nitpick comments (1)
src/widgets/courses/ui/courses.test.tsx (1)
49-81
: Test cases cover main scenarios, but could be more specific.The test cases effectively cover rendering, loading, and error states. Consider enhancing the rendering test to check for specific course details in the cards, such as start date or language.
Example addition to the rendering test:
courseCards.forEach((card, index) => { expect(card).toBeVisible(); expect(card).toHaveTextContent(mockCourses[index].title); expect(card).toHaveTextContent(mockCourses[index].startDate); expect(card).toHaveTextContent(mockCourses[index].language.join(', ')); });
π Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
π Files selected for processing (6)
- src/widgets/courses/constants.ts (1 hunks)
- src/widgets/courses/other-courses.test.tsx (0 hunks)
- src/widgets/courses/ui/courses.module.scss (1 hunks)
- src/widgets/courses/ui/courses.scss (0 hunks)
- src/widgets/courses/ui/courses.test.tsx (1 hunks)
- src/widgets/courses/ui/courses.tsx (2 hunks)
π€ Files not reviewed due to no reviewable changes (2)
- src/widgets/courses/other-courses.test.tsx
- src/widgets/courses/ui/courses.scss
π Additional comments (11)
src/widgets/courses/constants.ts (1)
1-1
: Approved: Good use of constants.Centralizing the path improves maintainability.
src/widgets/courses/ui/courses.module.scss (3)
1-9
: LGTM: .courses-content implementation.The flexbox layout with responsive adjustments is well-implemented.
11-24
: LGTM: .courses-list implementation.The grid layout with responsive adjustments is well-implemented, addressing previous grid-related comments.
1-24
: Verify padding implementation.The past comment from KristiBo about unified paddings for container and content isn't explicitly addressed in this file. Please confirm if this is handled elsewhere or if it still needs attention.
src/widgets/courses/ui/courses.tsx (5)
1-2
: Improved styling approach and imports.The changes to import statements and the setup for CSS modules align well with the refactoring objectives. Good job on using
classNames
for flexible class management.Also applies to: 10-12
15-15
: Improved data fetching with constant.Using the
path
constant inuseDataByName
enhances maintainability. Good refactoring choice.
36-36
: Refactored section element styling.The use of
cx
for class names and the removal of the unusedid
attribute improve the code. These changes align with the refactoring goals and past review discussions.
37-37
: Updated content div styling.The content div now correctly uses
cx
for multiple class names, following the CSS modules approach. This change addresses previous review comments effectively.
39-39
: Refined courses list structure.The courses list div now uses
cx
for styling, adhering to the CSS modules approach. The decision to keep it as adiv
instead of changing to aul-li
structure is noted and aligns with the previous discussion about the appropriateness of list elements in this context.src/widgets/courses/ui/courses.test.tsx (2)
1-37
: Imports and mock data are well-structured.The imports and mock data are appropriate for the testing setup.
39-47
: Mock setup for useDataByName is correct.The mock setup will provide consistent data for testing.
Lighthouse Report:
|
What type of PR is this? (select all that apply)
Description
Related Tickets & Documents
Screenshots, Recordings
Please replace this line with any relevant images for UI changes.
Added/updated tests?
[optional] Are there any post deployment tasks we need to perform?
[optional] What gif best describes this PR or how it makes you feel?
Summary by CodeRabbit
New Features
Bug Fixes
Refactor