-
-
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
651-fix: Incorrect course date on course page #652
Conversation
Lighthouse Report:
|
π WalkthroughWalkthroughThe pull request introduces modifications to the Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
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 (1.23.1)
src/widgets/hero-course/helpers/get-course-status.tsOops! 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:
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. π Recent review detailsConfiguration used: .coderabbit.yaml π Files selected for processing (2)
π Additional comments (5)src/widgets/hero-course/helpers/get-course-status.ts (2)
The optional parameter with default value maintains backward compatibility while adding flexibility.
The symmetric date window calculation looks correct, but let's verify that this change fixes the reported issue with incorrect course dates. β Verification successfulDate window calculation is consistent across the codebase The date window calculation in
π Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for any other date-related calculations in the codebase that might need similar updates
# Look for similar date window calculations
rg -A 2 "subtract\(.*,\s*['\"](day|days)['\"]"
# Look for other usages of COURSE_STALE_AFTER_DAYS
rg "COURSE_STALE_AFTER_DAYS"
Length of output: 1319 src/widgets/hero-course/ui/hero-course.tsx (3)
The dayJS import follows the project's conventions and supports the new date calculation approach. Line range hint The direct usage of startDate improves code clarity by removing unnecessary intermediate variables.
The new approach using dynamic date difference calculation is more flexible, but we should ensure it's consistently implemented across the codebase. β Verification successfulThe dynamic calculation is correctly implemented The change is consistent with the π Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for other getCourseStatus usages to ensure consistent implementation
ast-grep --pattern 'getCourseStatus($_)'
Length of output: 280 Script: #!/bin/bash
# Let's check the implementation and usage context
ast-grep --pattern 'function getCourseStatus($_) { $$$ }'
# Also check the test file content
cat src/widgets/hero-course/helpers/get-course-status.test.ts
Length of output: 1131 Script: #!/bin/bash
# Let's check the implementation of getCourseStatus
cat src/widgets/hero-course/helpers/get-course-status.ts
Length of output: 1224 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
|
What type of PR is this? (select all that apply)
Description
Related Tickets & Documents
Screenshots, Recordings
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