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

feat(datepicker): added showSelectedCount for the component #5227

Closed
wants to merge 4 commits into from

Conversation

mertJF
Copy link
Contributor

@mertJF mertJF commented Nov 14, 2024

Description

This PR introduces a new feature to the component: the ability to customize how multiple selected dates are displayed in the input field. By adding the showSelectedCount prop, developers can choose between displaying a count of selected dates or a comma-separated list.

Problem

The existing behavior of displaying a date count in the input field can be less informative for users who need to see the exact dates that have been selected, especially when dealing with a large number of selected dates.

Changes

  • A new boolean prop, showSelectedCount, has been added to the component.

  • The component's rendering logic has been updated to conditionally render either the date count or a comma-separated list based on the value of the showSelectedCount prop.

  • The showSelectedCount prop defaults to true for backward compatibility.

  • I've added unit tests to cover the new functionality and ensure that existing functionality remains unaffected.

Screenshots

showSelectedCount: true

Screenshot 2024-11-14 at 13 10 13

showSelectedCount: false
Screenshot 2024-11-14 at 13 10 46

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.

@mertJF mertJF changed the title feat(datepicker): added showSelectedCount for the muı feat(datepicker): added showSelectedCount for the component Nov 14, 2024
Copy link

codecov bot commented Nov 14, 2024

Codecov Report

Attention: Patch coverage is 71.42857% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.86%. Comparing base (65bcb7e) to head (793e27b).
Report is 43 commits behind head on main.

Files with missing lines Patch % Lines
src/index.tsx 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5227      +/-   ##
==========================================
- Coverage   96.89%   96.86%   -0.03%     
==========================================
  Files          29       29              
  Lines        3381     3385       +4     
  Branches     1414     1403      -11     
==========================================
+ Hits         3276     3279       +3     
- Misses        103      106       +3     
+ Partials        2        0       -2     

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

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 for review. Expert reviewers are now being matched to your request based on the code's requirements. Stay tuned!

What to expect from this code review:
  • Comments posted to any areas of potential concern or improvement.
  • Detailed feedback or actions needed to resolve issues that are found.
  • Turnaround times vary, but we aim to be swift.

@mertJF 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

+ 49
- 3

54% TypeScript (tests)
23% TSX
21% TypeScript
2% TSX (tests)

Type of change

Feature - These changes are adding a new feature or improvement to existing code.

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.

The change looks good and matches the description

Image of Xiaoyong W Xiaoyong W


Reviewed with ❤️ by PullRequest

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.

Due to inactivity, PullRequest has cancelled this review job. You can reactivate the code review job from the PullRequest dashboard.

@mertJF mertJF closed this Dec 16, 2024
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.

1 participant