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

473-fix: Fsd refactor trainers card #492

Merged
merged 8 commits into from
Sep 12, 2024

Conversation

thirdmadman
Copy link
Collaborator

@thirdmadman thirdmadman commented Sep 4, 2024

What type of PR is this? (select all that apply)

  • πŸ• Feature
  • πŸ› Bug Fix
  • 🚧 Breaking Change
  • πŸ§‘β€πŸ’» Code Refactor
  • πŸ“ Documentation Update

Description

Reafctored trainers-card according to the task in issue #473

Related Tickets & Documents

Screenshots, Recordings

no visual changes

Added/updated tests?

  • πŸ‘Œ Yes
  • πŸ™…β€β™‚οΈ No, because they aren't needed
  • πŸ™‹β€β™‚οΈ No, because I need help

[optional] Are there any post deployment tasks we need to perform?

no

[optional] What gif best describes this PR or how it makes you feel?

Whaaat

Summary by CodeRabbit

  • Improvements

    • Updated import paths for the Trainer type across multiple files to enhance clarity and maintainability.
    • Introduced a new TrainerCard component for displaying trainer information, improving the user interface.
    • Added new styles for the TrainerCard component to enhance visual presentation and responsiveness.
    • Renamed and restructured CSS classes for the trainers' UI component to improve organization and maintainability.
  • Tests

    • Updated mocked trainer data in tests to reflect a new character and background, enhancing relevance for testing scenarios.
    • Modified import statements in test files to align with the new module structure for the Trainer type.
    • Enhanced test cases for the Trainers component to increase flexibility and maintainability.

@github-actions github-actions bot changed the title Fix/473 fsd refactor trainers card 473-fix: Fsd refactor trainers card Sep 4, 2024
@thirdmadman thirdmadman self-assigned this Sep 4, 2024
Copy link

github-actions bot commented Sep 5, 2024

Lighthouse Report:

  • Performance: 91 / 100
  • Accessibility: 94 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

Copy link

github-actions bot commented Sep 5, 2024

Lighthouse Report:

  • Performance: 91 / 100
  • Accessibility: 94 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

Copy link

github-actions bot commented Sep 5, 2024

Lighthouse Report:

  • Performance: 82 / 100
  • Accessibility: 94 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@thirdmadman thirdmadman force-pushed the fix/473-fsd-refactor-trainers-card branch from 5412fad to 41e6b90 Compare September 5, 2024 23:16
Copy link
Contributor

coderabbitai bot commented Sep 6, 2024

Walkthrough

Walkthrough

The changes involve a comprehensive refactor of the Trainer entity within the codebase. This includes restructuring imports to improve organization, moving files to a new directory, creating a new TrainerCard component, and updating related tests. The modifications enhance clarity and maintainability while ensuring that the functionality of the components remains intact.

Changes

Files Changed Change Summary
dev-data/angular.data.ts, dev-data/aws-devops.data.ts, dev-data/awsDev.data.ts, dev-data/awsFundamentals.data.ts, dev-data/javascript-ru.data.ts, dev-data/nodejs.data.ts, dev-data/preSchool.data.ts, dev-data/react-en.data.ts, dev-data/react-ru.data.ts Updated import statements for Trainer from 'data' to '@/entities/trainer'.
dev-data/index.ts Removed export statement for Trainer.
src/shared/__tests__/constants.ts Updated MOCKED_TRAINER details and modified import path for Trainer.
src/entities/trainer/index.ts Introduced new file to export Trainer type and TrainerCard component.
src/entities/trainer/ui/trainers-card/trainer-card.module.scss Created new SCSS file for styling the TrainerCard component.
src/entities/trainer/ui/trainers-card/trainer-card.tsx Introduced TrainerCard component to display trainer information.
src/widgets/trainers/trainers.test.tsx Updated tests to utilize MOCKED_ONE_TRAINER for dynamic rendering checks.
src/widgets/trainers/ui/trainers.scss Renamed main class and restructured styles for trainers' UI component.
src/widgets/trainers/ui/trainers.tsx Updated import paths and JSX structure for the Trainers component.

Assessment against linked issues

Objective Addressed Explanation
Create trainer folder in src/entities (Issue #473) βœ…
Move src/widgets/trainers/ui/trainers-card to src/entities/trainer/ui/trainer-card (Issue #473) ❌ No evidence of this move in the changes.
Create trainer-card.module.scss file and move styles (Issue #473) βœ…
Refactor trainers.scss file (Issue #473) βœ…
Move Trainer type to src/entities/trainer/types.ts (Issue #473) ❌ No evidence of this move in the changes.
Create index.ts file and re-export Trainer type and TrainerCard component (Issue #473) βœ…
Refactor TrainerCard component to utilize HTML5 tags (Issue #473) ❓ No specific changes to HTML5 tags noted.
Write unit test for TrainerCard component (Issue #473) βœ…

Possibly related PRs

  • 465-refactor: Customize sliderΒ #466: The changes in this PR involve updating import statements for the Trainer type from a relative path to an absolute path, similar to the main PR's modifications in multiple files.

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 5f03927 and de514c8.

Files selected for processing (19)
  • dev-data/angular.data.ts (1 hunks)
  • dev-data/aws-devops.data.ts (1 hunks)
  • dev-data/awsDev.data.ts (1 hunks)
  • dev-data/awsFundamentals.data.ts (1 hunks)
  • dev-data/index.ts (0 hunks)
  • dev-data/javascript-ru.data.ts (1 hunks)
  • dev-data/nodejs.data.ts (1 hunks)
  • dev-data/preSchool.data.ts (1 hunks)
  • dev-data/react-en.data.ts (1 hunks)
  • dev-data/react-ru.data.ts (1 hunks)
  • src/entities/trainer/index.ts (1 hunks)
  • src/entities/trainer/ui/trainers-card/trainer-card.module.scss (1 hunks)
  • src/entities/trainer/ui/trainers-card/trainer-card.test.tsx (1 hunks)
  • src/entities/trainer/ui/trainers-card/trainer-card.tsx (1 hunks)
  • src/shared/tests/constants.ts (1 hunks)
  • src/widgets/trainers/trainers.test.tsx (2 hunks)
  • src/widgets/trainers/ui/trainers-card/trainer-card.tsx (0 hunks)
  • src/widgets/trainers/ui/trainers.scss (2 hunks)
  • src/widgets/trainers/ui/trainers.tsx (2 hunks)
Files not reviewed due to no reviewable changes (2)
  • dev-data/index.ts
  • src/widgets/trainers/ui/trainers-card/trainer-card.tsx
Files skipped from review due to trivial changes (1)
  • dev-data/angular.data.ts
Files skipped from review as they are similar to previous changes (14)
  • dev-data/aws-devops.data.ts
  • dev-data/awsDev.data.ts
  • dev-data/awsFundamentals.data.ts
  • dev-data/javascript-ru.data.ts
  • dev-data/nodejs.data.ts
  • dev-data/preSchool.data.ts
  • dev-data/react-en.data.ts
  • dev-data/react-ru.data.ts
  • src/entities/trainer/index.ts
  • src/entities/trainer/ui/trainers-card/trainer-card.module.scss
  • src/entities/trainer/ui/trainers-card/trainer-card.test.tsx
  • src/entities/trainer/ui/trainers-card/trainer-card.tsx
  • src/widgets/trainers/trainers.test.tsx
  • src/widgets/trainers/ui/trainers.tsx
Additional comments not posted (4)
src/widgets/trainers/ui/trainers.scss (2)

Line range hint 1-15: LGTM!

The changes enhance the CSS structure's clarity and maintainability. The renaming of the main class to .trainers broadens the scope of the styling, and the introduction of .trainers-content improves the organization of layout properties. The media queries ensure responsive design across various screen sizes.


17-25: Looks good!

The .trainers-list class has been retained with no changes to its properties, suggesting an organizational shift rather than a complete removal of functionality. The positioning of the class under the new .trainers class improves the structure's clarity, and the unchanged grid layout properties and media query ensure consistent display across screen sizes.

src/shared/__tests__/constants.ts (2)

2-2: LGTM!

The updated import path aligns with the module restructuring goals outlined in the PR objectives. Using a type-only import is also a good practice.


5-8: Great work on updating the mocked data!

The new MOCKED_TRAINER data enhances the relevance and clarity of the mocked data used in tests. This change also addresses the previous review comment requesting the use of really mocked data.


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

github-actions bot commented Sep 6, 2024

Lighthouse Report:

  • Performance: 83 / 100
  • Accessibility: 94 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Copy link

Lighthouse Report:

  • Performance: 89 / 100
  • Accessibility: 100 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FSD: Entity trainer
7 participants