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

[TimelineRow]: Replace defaultProps with destructuring #2622

Merged
merged 7 commits into from
Feb 13, 2025

Conversation

its-me-abhishek
Copy link
Contributor

@its-me-abhishek its-me-abhishek commented Jan 24, 2025

Which problem is this PR solving?

Description of the changes

  • Remove defaultProps from the TimelineRow component, replace with destructuring

How was this change tested?

  • Run npm run test npm run update-snapshots

Checklist

Partially Resolves jaegertracing#2596
- Remove defaultProps from the TimelineRow component, replace with destructuring

Signed-off-by: Abhishek <[email protected]>
@its-me-abhishek its-me-abhishek requested a review from a team as a code owner January 24, 2025 11:02
@its-me-abhishek its-me-abhishek requested review from pavolloffay and removed request for a team January 24, 2025 11:02
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.62%. Comparing base (25eca2a) to head (8ca7c96).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2622   +/-   ##
=======================================
  Coverage   96.62%   96.62%           
=======================================
  Files         256      256           
  Lines        7731     7734    +3     
  Branches     1942     1945    +3     
=======================================
+ Hits         7470     7473    +3     
  Misses        261      261           

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

Partially Resolves jaegertracing#2596

Signed-off-by: Abhishek <[email protected]>
width,
style = {},
onClick,
...rest
Copy link
Member

@yurishkuro yurishkuro Jan 25, 2025

Choose a reason for hiding this comment

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

I don't follow this. What can be possibly provided via ...rest if all the fields from the type are already mentioned as arguments? E.g. <TimelineRowCell data-testid="x"> should be an error because data-testid is not part of the type declaration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

data-testid does not give error as of now, but does give an error when ...rest is removed. shall I replace ...rest with data-testid?

Copy link
Member

Choose a reason for hiding this comment

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

@its-me-abhishek
Copy link
Contributor Author

I have removed the ...rest from both components now, the issue has been fixed too

yurishkuro
yurishkuro previously approved these changes Feb 13, 2025
@yurishkuro yurishkuro added the changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements label Feb 13, 2025
interface ITimelineRowCellProps extends React.HTMLAttributes<HTMLDivElement> {
function TimelineRowCell({
children,
className = '',
Copy link
Member

Choose a reason for hiding this comment

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

I see code coverage complaining about this line. Maybe since it's already declared optional it doesn't need to have a default, and in the code use ${className || ''}?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense. I have updated it now

@yurishkuro yurishkuro added this pull request to the merge queue Feb 13, 2025
Merged via the queue into jaegertracing:main with commit 694074d Feb 13, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:bugfix-or-minor-feature 🐞 Bug fixes, Minor Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants