Skip to content

887-refactor: Partners refactor #892

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

HelenaIsh
Copy link
Collaborator

@HelenaIsh HelenaIsh commented May 13, 2025

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

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

Description

Refactor partnered module

Related Tickets & Documents

Screenshots, Recordings

I changed a little bit styles for tablets and mobiles

Before After
Tablet image image
Mobile image image

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?

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

Summary by CodeRabbit

  • New Features

    • Introduced a redesigned "Partnered" section displaying partner logos with improved semantic HTML structure and updated styling.
    • Added a new array of partner data to streamline partner logo rendering.
  • Style

    • Updated and modularized styles for the "Partnered" section using CSS modules.
  • Bug Fixes

    • Improved accessibility and semantic structure in the alumni list by updating HTML elements.
  • Tests

    • Enhanced and relocated tests for the "Partnered" section to ensure correct rendering and accessibility of partner logos.
  • Chores

    • Added test identifiers to partner logo images for improved testability.

@github-actions github-actions bot changed the title refactor: 887 - refactor partnered module 887-refactor: Partners refactor May 13, 2025
Copy link

Lighthouse Report:

  • Performance: 80 / 100
  • Accessibility: 96 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

Copy link

Lighthouse Report:

  • Performance: 72 / 100
  • Accessibility: 96 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@HelenaIsh HelenaIsh self-assigned this May 13, 2025
Copy link
Collaborator

@YulikK YulikK left a comment

Choose a reason for hiding this comment

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

I see that the only test that is in the component does not check anything. Let's add unit tests that check the content output. Title, src and alt logos

Copy link

Lighthouse Report:

  • Performance: 85 / 100
  • Accessibility: 96 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@HelenaIsh HelenaIsh requested a review from YulikK May 15, 2025 09:29
<WidgetTitle size="small">Partnered with</WidgetTitle>
<div className="partners">
<div className="partner-logo-container">
<ul className={cx('partners')}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we use the structure like in Alumni widget?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I understand a point of keeping a similar HTML structure in all our widgets

Difference for now:

Alumni

<article>
  <section>
    <WidgetTitle />
    <Paragraph />
    <section>
      {alumni.map(() => (
        <figure>
          <Image />
        </figure>
      ))}
    </section>
  </section>
</article>

Partnered

<section>
  <div>
    <WidgetTitle />
    <ul>
      {partners.map(() => (
        <li>
          <Component />
        </li>
      ))}
    </ul>
  </div>
</section>
  • All containers in widgets have section tag.
  • I't strange to have article->section->section structure
  • lists usually use ul->li tags

Therefore, I suggest to keep partnered html structure in both partnered and alumni widgets

Copy link

Lighthouse Report:

  • Performance: 84 / 100
  • Accessibility: 96 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@HelenaIsh HelenaIsh requested review from YulikK and ansivgit May 16, 2025 11:01
@YulikK
Copy link
Collaborator

YulikK commented May 27, 2025

πŸ‘

@HelenaIsh HelenaIsh marked this pull request as ready for review May 28, 2025 07:47
Copy link
Contributor

coderabbitai bot commented May 28, 2025

πŸ“ Walkthrough

Walkthrough

The changes restructure the partnered widget by moving logic and styles into a new FSD-compliant folder structure, updating the HTML for semantic correctness, and introducing a constants file for partners. Test coverage and styling are migrated to new module-based files, and test IDs are added to logo components for improved testing.

Changes

Files/Groups Change Summary
src/shared/icons/aws.tsx, src/shared/icons/github.tsx, src/shared/icons/jetbrains.tsx Added data-testid attributes to logo components for testing.
src/widgets/alumni/ui/alumni.tsx Updated markup to use semantic HTML elements for alumni lists.
src/widgets/partnered/constants.ts New file: defines a partners array mapping partner IDs to logo components.
src/widgets/partnered/index.ts Changed export source for Partnered to new UI module location.
src/widgets/partnered/partnered.scss, src/widgets/partnered/partnered.tsx, src/widgets/partnered/partnered.test.tsx Deleted old partnered widget SCSS, component, and test files.
src/widgets/partnered/ui/partnered.module.scss New SCSS module: styles for the Partnered widget using CSS modules and FSD conventions.
src/widgets/partnered/ui/partnered.test.tsx New test suite: verifies rendering and logo attributes in the new Partnered component.
src/widgets/partnered/ui/partnered.tsx New React component: renders partner logos using new structure, constants, and CSS modules.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant PartneredComponent
    participant WidgetTitle
    participant PartnersConstants
    participant LogoComponent

    User->>PartneredComponent: Render
    PartneredComponent->>WidgetTitle: Render "Partnered with"
    PartneredComponent->>PartnersConstants: Retrieve partners array
    loop For each partner
        PartneredComponent->>LogoComponent: Render logo
    end
Loading

Assessment against linked issues

Objective Addressed Explanation
Refactor partners widget to FSD structure, move logic and styles, update selectors, etc. (#887) ❌ The changes apply to partnered widget, not partners. No evidence of changes to partners.

Suggested labels

refactor

Suggested reviewers

  • andron13
  • dzmitry-varabei
  • natanchik
  • ansivgit
  • YulikK
  • Quiddlee

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

πŸ”§ ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-03T15_52_56_961Z-debug-0.log


πŸ“œ Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between a0c154b and 775edd1.

πŸ“’ Files selected for processing (4)
  • src/shared/icons/jetbrains.tsx (1 hunks)
  • src/widgets/partnered/constants.ts (1 hunks)
  • src/widgets/partnered/ui/partnered.module.scss (1 hunks)
  • src/widgets/partnered/ui/partnered.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/shared/icons/jetbrains.tsx
  • src/widgets/partnered/constants.ts
  • src/widgets/partnered/ui/partnered.tsx
  • src/widgets/partnered/ui/partnered.module.scss
✨ Finishing Touches
  • πŸ“ Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ 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>, please review it.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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 Jun 3, 2025

Lighthouse Report:

  • Performance: 81 / 100
  • Accessibility: 96 / 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
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Partners fsd refactor
4 participants