Skip to content

869-refactor: Update angular mark #875

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

Merged
merged 7 commits into from
Jun 4, 2025
Merged

Conversation

YulikK
Copy link
Collaborator

@YulikK YulikK commented May 7, 2025

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

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

Description

Update Angular mark

Related Tickets & Documents

Screenshots, Recordings

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?

Our alumni are running to register for the course πŸ™ƒ
Alt Text

Summary by CodeRabbit

  • New Features
    • Added support for displaying course subtitles in the course card, specifically showing the subtitle for the Angular course when applicable.
  • Bug Fixes
    • Improved matching logic in tests to correctly handle course titles with subtitles, ensuring accurate test coverage for courses like Angular.
  • Documentation
    • Updated course eligibility descriptions to reflect that courses are now available to graduates of any RS School course, not just JS/FE Stage 2.
  • Chores
    • Introduced a new constant for "Alumni only" eligibility.

@github-actions github-actions bot changed the title Refactor/869 update angular mark 869-refactor: Update angular mark May 7, 2025
Copy link
Contributor

coderabbitai bot commented May 7, 2025

πŸ“ Walkthrough

Walkthrough

The changes broaden the Angular course eligibility from only "JS/FE Stage 2" graduates to any RS School course graduates, update related test data, and adjust the CourseCard component and tests to handle an optional subtitle for the Angular course. A new constant is added for "Alumni only" labeling.

Changes

File(s) Change Summary
dev-data/about-course.data.tsx, dev-data/training-program.data.tsx Updated eligibility description from "JS/FE Stage 2" graduates only to any RS School course graduates.
src/entities/course/ui/course-card/course-card.tsx, .../course-card.test.tsx Added subTitle prop to CourseCard; updated rendering and tests to show subtitle for Angular course as needed.
src/widgets/courses/ui/courses.test.tsx Adjusted test logic to match course titles with subtitles, specifically for Angular course.
src/widgets/training-program/ui/training-program.test.tsx Updated test data to reflect new eligibility description for Angular course.
src/shared/constants.ts Added RS_GRADUATED_ONLY constant with value "Alumni only".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CoursesWidget
    participant CourseCard

    User->>CoursesWidget: View courses
    CoursesWidget->>CourseCard: Render course (with title, subTitle if Angular)
    CourseCard-->>CoursesWidget: Course card with conditional subtitle
    CoursesWidget-->>User: Displayed course cards with updated eligibility info
Loading

Assessment against linked issues

Objective Addressed Explanation
Update text for Angular marks (#869) βœ…

Possibly related PRs

Suggested reviewers

  • andron13
  • dzmitry-varabei
  • natanchik
  • SpaNb4

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-04T06_31_20_863Z-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 a8b2ae2 and e57ac90.

πŸ“’ Files selected for processing (4)
  • dev-data/about-course.data.tsx (1 hunks)
  • dev-data/training-program.data.tsx (1 hunks)
  • src/entities/course/ui/course-card/course-card.tsx (5 hunks)
  • src/shared/constants.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/entities/course/ui/course-card/course-card.tsx
  • src/shared/constants.ts
  • dev-data/about-course.data.tsx
  • dev-data/training-program.data.tsx
✨ 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
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: 2

🧹 Nitpick comments (3)
src/shared/constants.ts (1)

7-7: Add missing Russian translation for the new subtitle constant.

We introduced RS_GRADUATED_ONLY = 'Alumni only' but did not add a corresponding Russian localization. Consider adding an RS_GRADUATED_ONLY_RU constant or integrating this into the i18n pipeline for consistency across locales.

src/widgets/training-program/ui/training-program.test.tsx (1)

12-12: Avoid regex pitfalls in test.

The test uses new RegExp(p, 'i') on a string with punctuation, which can introduce unintended regex behavior. Prefer screen.getByText(p) for exact matching or escape special characters before constructing the RegExp.

dev-data/training-program.data.tsx (1)

120-121: Centralize eligibility text.

Hardcoding the Angular eligibility description here duplicates the literal. For maintainability, import and render RS_GRADUATED_ONLY within the <Paragraph> instead of repeating the string.

πŸ“œ Review details

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

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between f0c0e63 and fed9ebb.

πŸ“’ Files selected for processing (8)
  • dev-data/about-course.data.tsx (1 hunks)
  • dev-data/courses.data.ts (2 hunks)
  • dev-data/training-program.data.tsx (1 hunks)
  • src/entities/course/ui/course-card/course-card.test.tsx (1 hunks)
  • src/entities/course/ui/course-card/course-card.tsx (6 hunks)
  • src/shared/constants.ts (1 hunks)
  • src/widgets/courses/ui/courses.test.tsx (2 hunks)
  • src/widgets/training-program/ui/training-program.test.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
src/widgets/courses/ui/courses.test.tsx (1)
Learnt from: Quiddlee
PR: rolling-scopes/site#572
File: src/pages/home.tsx:25-25
Timestamp: 2024-09-30T12:07:39.137Z
Learning: The `Courses` component in `src/widgets/courses/other-courses.test.tsx`, `src/pages/courses.tsx`, and `dev-data/courses-path.data.ts` is a different component from the one replaced in `src/pages/home.tsx`.
🧬 Code Graph Analysis (2)
dev-data/courses.data.ts (1)
src/shared/constants.ts (3)
  • RS_GRADUATED_ONLY (7-7)
  • COURSE_LINKS (34-44)
  • TO_BE_DETERMINED (6-6)
src/widgets/courses/ui/courses.test.tsx (1)
src/shared/__tests__/constants.ts (1)
  • mockedCourses (27-207)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: CI
πŸ”‡ Additional comments (11)
dev-data/courses.data.ts (3)

10-10: Good - Import standardization

Adding RS_GRADUATED_ONLY to imports helps maintain consistency with the new eligibility labeling across the application.


108-108: Good - Broadened eligibility criteria

Changed from hardcoded "JS/FE Stage 2 graduates only" to a more inclusive RS_GRADUATED_ONLY constant ('Alumni only'), opening the Angular course to all RS School graduates.


114-114: Good - Using constants for date values

Replacing hardcoded strings with the TO_BE_DETERMINED constant improves consistency and makes future updates easier.

src/widgets/courses/ui/courses.test.tsx (2)

6-6: Good - Using constants for course titles

Adding the COURSE_TITLES import allows for more robust title matching in tests.


28-32: Good - Updated test logic for Angular subtitle

The test now correctly handles the special case where Angular course titles include a subtitle suffix in parentheses, ensuring proper test coverage of the UI changes.

src/entities/course/ui/course-card/course-card.tsx (6)

11-11: Good - Using central course title constants

Importing COURSE_TITLES enables consistent title handling and specific logic for Angular courses.


20-20: Good - Added subTitle property type

Properly extended the type definition to include the subTitle property from Course.


38-38: Good - Destructured subTitle prop

Added subTitle to the destructured props to make it available in the component.


56-56: Good - Clean Angular course subtitle logic

The condition to display the Angular course subtitle is clearly defined and handles the special case appropriately.


71-73: Good - Proper subtitle display implementation

Updated the Subtitle component to include the title with optional subtitle suffix for Angular courses.


93-93: Good - Code consolidation

Consolidated the ShortInfoPanel component usage to a single line, improving code readability without changing functionality.

@YulikK YulikK self-assigned this May 7, 2025
@YulikK YulikK added this to RS Site May 7, 2025
@YulikK YulikK moved this to Review in RS Site May 7, 2025
Copy link

github-actions bot commented May 7, 2025

Lighthouse Report:

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

View detailed report

Copy link

github-actions bot commented May 7, 2025

Lighthouse Report:

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

View detailed report

Copy link

github-actions bot commented May 7, 2025

Lighthouse Report:

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

View detailed report

@KristiBo KristiBo removed this from RS Site May 19, 2025
Copy link

github-actions bot commented Jun 4, 2025

Lighthouse Report:

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

View detailed report

@YulikK YulikK merged commit fe6152c into main Jun 4, 2025
3 checks passed
@YulikK YulikK deleted the refactor/869-update-angular-mark branch June 4, 2025 06:35
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.

Update text for angular marks
4 participants