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

fix: #4489 Disable weekNumber highlighting when no click handler is assigned. #4608

Merged
merged 1 commit into from
Mar 18, 2024

Conversation

yuki0410-dev
Copy link
Contributor

Description

Linked issue: close #4489

Problem
See issue #4489

Changes
Disable weekNumber highlighting when no click handler is assigned.

Screenshots

To reviewers

Contribution checklist

  • I have followed the contributing guidelines.
  • I have added sufficient test coverage for my changes.
  • I have formatted my code with Prettier and checked for linting issues with ESLint for code readability.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

⚠️ This pull request was not sent to the PullRequest network because the pull request is a draft.

Copy link

codecov bot commented Mar 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.94%. Comparing base (87a9835) to head (740007b).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4608   +/-   ##
=======================================
  Coverage   96.94%   96.94%           
=======================================
  Files          28       28           
  Lines        2586     2587    +1     
  Branches     1088     1089    +1     
=======================================
+ Hits         2507     2508    +1     
  Misses         79       79           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yuki0410-dev yuki0410-dev marked this pull request as ready for review March 17, 2024 15:33
Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

✅ This pull request was sent to the PullRequest network.


@yuki0410-dev you can click here to see the review status or cancel the code review job.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

PullRequest Breakdown

Reviewable lines of change

+ 41
- 6

87% JavaScript (tests)
13% JavaScript

Type of change

Fix - These changes are likely to be fixing a bug or issue.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

This PR is addressing issue #4489, which reported an unintuitive UX around week numbers in certain circumstances.

Based on this PR, the core issue appears to be that a clicker handler must be set to enable week number highlighting. The fix is as simple as validating the onClick props for truthiness before adding the week number react-datepicker__week-number--selected class name.

It appears that the new behavior will only allow the week number to be rendered as selected if there is an onClick handler.

This adds several tests around this scenario, which is great. I think these changes look good.

Image of Ryan Ryan


Reviewed with ❤️ by PullRequest

@yuki0410-dev
Copy link
Contributor Author

Thank you for the review.

I implemented a policy of not highlighting if it is not clickable, because if it is highlighted, the user may think it is clickable.

Copy link

@pullrequest pullrequest bot left a comment

Choose a reason for hiding this comment

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

Change is simple enough, nice to see some testing for this change too!

Image of Jacques Jacques


Reviewed with ❤️ by PullRequest

test/week_number_test.test.js Outdated Show resolved Hide resolved
test/week_number_test.test.js Outdated Show resolved Hide resolved
test/week_number_test.test.js Outdated Show resolved Hide resolved
test/week_number_test.test.js Outdated Show resolved Hide resolved
@yuki0410-dev
Copy link
Contributor Author

Thanks for the review.
We have corrected the typo in the test case.

@martijnrusschen martijnrusschen merged commit 7c81a78 into Hacker0x01:main Mar 18, 2024
6 checks passed
@yuki0410-dev yuki0410-dev deleted the fix/4489 branch March 18, 2024 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Week number is highlighted when selecting the first day of the week
2 participants