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

646-fix: Stale courses date #647

Merged
merged 5 commits into from
Nov 15, 2024
Merged

646-fix: Stale courses date #647

merged 5 commits into from
Nov 15, 2024

Conversation

Quiddlee
Copy link
Member

@Quiddlee Quiddlee commented Nov 12, 2024

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

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

Description

Related Tickets & Documents

Screenshots, Recordings

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?

gif

Summary by CodeRabbit

Release Notes

  • New Features

    • Added registrationEndDate to course-related components, enhancing date management for course registrations.
    • Introduced the DateStart component for improved date rendering in the DateLang and SchoolItem components.
  • Bug Fixes

    • Updated tests to ensure accurate rendering of components with the new registrationEndDate prop.
  • Chores

    • Removed unused constants related to stale data handling from various components, streamlining data processing.
  • Style

    • Renamed CSS selectors for improved clarity without affecting layout or functionality.

@Quiddlee Quiddlee self-assigned this Nov 12, 2024
@Quiddlee Quiddlee added bug Something isn't working high priority labels Nov 12, 2024
@github-actions github-actions bot changed the title refactor: 646 - change dates to be calculated on the client 646-fix: Stale courses date Nov 12, 2024
@Quiddlee Quiddlee requested a review from SpaNb4 November 14, 2024 19:54
@Quiddlee
Copy link
Member Author

run visual now

@Quiddlee
Copy link
Member Author

run visual now

Copy link

Lighthouse Report:

  • Performance: 95 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

Copy link

Lighthouse Report:

  • Performance: 67 / 100
  • Accessibility: 99 / 100
  • Best Practices: 100 / 100
  • SEO: 100 / 100

View detailed report

@Quiddlee Quiddlee marked this pull request as ready for review November 15, 2024 08:10
@Quiddlee Quiddlee merged commit 15835e5 into main Nov 15, 2024
3 checks passed
@Quiddlee Quiddlee deleted the fix/646-stale-courses-date branch November 15, 2024 08:10
Copy link
Contributor

coderabbitai bot commented Nov 15, 2024

Caution

Review failed

The pull request is closed.

πŸ“ Walkthrough

Walkthrough

The pull request introduces several changes across various files, primarily adding a new environment variable API_URL for visual testing workflows and enhancing the CourseItemData type to include a registrationEndDate. Additionally, multiple components and their tests are updated to accommodate this new property, improving the handling of course registration dates. The changes also involve the introduction of a new DateStart component for better date management.

Changes

File Path Change Summary
.github/workflows/visual-testing-on-comment.yml Added API_URL environment variable for visual tests.
.github/workflows/visual-testing-on-push.yml Added API_URL environment variable for visual tests on push events.
src/entities/course/types.ts Updated CourseItemData type to include registrationEndDate.
src/entities/course/ui/course-card/course-card.test.tsx Updated test to use dayJS for startDate and added registrationEndDate in mockProps.
src/entities/course/ui/course-card/course-card.tsx Modified CourseCardProps to include registrationEndDate and updated DateLang usage.
src/entities/course/ui/course-item/course-item.test.tsx Updated mockedProps to use dayJS for startDate and added registrationEndDate.
src/entities/course/ui/course-item/course-item.tsx Modified CourseItem to accept registrationEndDate and updated date handling with DateStart.
src/shared/__tests__/constants.ts Updated registrationEndDate for specific courses in mockedCourses.
src/shared/helpers/getActualData.ts Made staleAfter optional in GetActualDataParams type and adjusted getActualData logic.
src/shared/ui/date-lang/date-lang.test.tsx Updated tests to include registrationEndDate in DateLang component rendering.
src/shared/ui/date-lang/date-lang.tsx Added registrationEndDate to DateLangProps and updated rendering logic to use DateStart.
src/shared/ui/date-start/index.ts Added export for DateStart component.
src/shared/ui/date-start/ui/date-start.tsx Introduced DateStart component to handle date rendering with courseStartDate and registrationEndDate.
src/widgets/courses/ui/courses.tsx Removed COURSE_STALE_AFTER_DAYS constant and adjusted course fetching logic.
src/widgets/hero-course/ui/hero-course.tsx Updated HeroCourse to include registrationEndDate in DateLang component.
src/widgets/school-menu/school-menu.test.tsx Modified test to retrieve descriptions using class name instead of tag name.
src/widgets/school-menu/ui/school-item/school-item.tsx Updated to use DateStart for date rendering and simplified date handling.
src/widgets/school-menu/ui/school-menu.scss Renamed small selector to .description in styles.
src/widgets/upcoming-courses/ui/upcoming-courses.tsx Removed COURSE_STALE_AFTER_DAYS and included registrationEndDate in course item mapping.

Assessment against linked issues

Objective Addressed Explanation
Change all components that contain dates to client components (#646) ❌ No components were converted to client components.
Extend courses stale date by registration end date (#649) βœ… Registration end date has been added to relevant components.

Possibly related PRs

Suggested labels

refactor

Suggested reviewers

  • dzmitry-varabei
  • andron13
  • ansivgit
  • 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.

src/entities/course/types.ts

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the plugin "eslint-plugin-boundaries".

(The package "eslint-plugin-boundaries" was not found when loaded as a Node module from the directory "".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

npm install eslint-plugin-boundaries@latest --save-dev

The plugin "eslint-plugin-boundaries" was referenced from the config file in " Β» @feature-sliced/eslint-config Β» /node_modules/@feature-sliced/eslint-config/rules/layers-slices".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.


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>, please review it.
    • 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 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 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working high priority preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend courses stale date by registration end date Fix course stale date
3 participants