-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Week picker (2nd attempt) #4288
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did an initial quick pass over things!
- There are some linting failures too, please don't forget them too :)
- We have pull request enabled for this repository, when you undraft they should be triggered for a review.
margin-bottom: -8px; | ||
} | ||
|
||
.react-datepicker__week { | ||
white-space: nowrap; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you confirmed this works responsively?
@philipkocanda @iMartzen great initiative and excited to see this coming back. Once you mark the PR as ready for review it will be sent to the pullrequest network as well. |
Please check the CI output. The linter is failing because of unused imports. |
Codecov Report
@@ Coverage Diff @@
## main #4288 +/- ##
==========================================
- Coverage 96.67% 95.27% -1.40%
==========================================
Files 27 28 +1
Lines 2373 2478 +105
Branches 952 1003 +51
==========================================
+ Hits 2294 2361 +67
- Misses 79 117 +38
|
Overall the code coverage seems a bit low, and reduces the project coverage from 96% to 94%, it would be great to make sure we keep this stable and increase the coverage on this PR to the project levels. |
BTW: This MR would benefit from having I would also include @TiesWestendorp if some of their work is included in this MR. |
Co-authored-by: Ties Westendorp <[email protected]>
1e80817
to
12f192f
Compare
@Zarthus Great suggestion! I've added Ties Westendorp as the co-author on the first commit. |
There was a problem hiding this 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.
@philipkocanda you can click here to see the review status or cancel the code review job.
There was a problem hiding this 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
+ 762
- 53
60% JavaScript (tests)
35% JavaScript
4% SCSS
1% Markdown
Type of change
Feature - These changes are adding a new feature or improvement to existing code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR looks fantastic and is really well done. I am glad to see so much work put into unit testing. I only had a few comments about minor issues but that's all.
Reviewed with ❤️ by PullRequest
test/week_picker_test.js
Outdated
<DatePicker onChange={onChangeSpy} showWeekPicker />, | ||
); | ||
expect(onChangeSpy.called).to.be.false; | ||
const input = ReactDOM.findDOMNode(weekPicker.input); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ISSUE: react/no-find-dom-node (Severity: Medium)
Do not use findDOMNode. It doesn’t work with function components and is deprecated in StrictMode. See https://reactjs.org/docs/react-dom.html#finddomnode
Remediation:
this probably doesn't matter because we're inside a test, not a component, right?
🤖 powered by PullRequest Automation 👋 verified by Andy W
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is indeed deprecated behaviour and should not be used anymore.
Test coverage seems pretty decent, but |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good and add the week picker that was described. I don't see any issues, and the changes overall look reasonable including good tests and examples.
Reviewed with ❤️ by PullRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i see where you responded to my suggestion about a default in a switch statement but I have further comments on how you implemented my suggestion!
Reviewed with ❤️ by PullRequest
…factored week_number isSameDay() method and removed usage of findDOMNode in week_picker_test
…d year_picker_test
…_test and year_picker_test" This reverts commit f99f41a.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've taken a quick look, I'll approve this now since Martijn and Pull Request seems sufficient :) My only note is that in the future I'd encourage splitting up changes (such as CONTRIBUTING) into a separate MR to reduce review overhead and increase focus, but since it's such a small change it's honestly OK.
Martijn and PR have got it from here I'm sure :)
<WeekNumber weekNumber={1} onClick={onClick} />, | ||
it("should handle onClick function", () => { | ||
const onClickMock = jest.fn(); | ||
const shallowWeekNumber = shallow( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
event.preventDefault(); | ||
event.key = "Enter"; | ||
} | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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.
Hi @martijnrusschen. Thanks for taking this up. I'd like to know if the latest merge has been published to npm. I can see the the |
📯 Hey everyone, big news
@philipkocanda and @iMartzen have helped get this Merge Request from 2021 over the finish line, so most of the credit goes to @TiesWestendorp 👏
⚙️ Implementation
📖 Resources:
🤝 We used our HackerOne Community Service Day to finalize this feature, and we're thrilled to share it today.
🚀 Enjoy the new week picker, and let's make a positive impact together