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

refactor(@clayui/time-picker): rewrites the timer to mimic browser time behavior #2175

Merged
merged 4 commits into from
Jul 22, 2019

Conversation

matuzalemsteles
Copy link
Member

Fixes #2106

I'm not quite sure about some behaviors mainly for the case of the AM/PM picker, it does not seem so intuitive. I think there is room for some internal improvements in the code, so leave your thoughts. I've tried at most to mimic the behaviors of the native time picker, so it ends up having lots of use cases.

I have not done the tests yet nor the documentation, as soon as we are well with it, I will do.

packages/clay-date-picker/src/TimePicker.tsx Outdated Show resolved Hide resolved
packages/clay-date-picker/src/TimePicker.tsx Show resolved Hide resolved
packages/clay-time-picker/src/index.tsx Show resolved Hide resolved
packages/clay-time-picker/src/index.tsx Show resolved Hide resolved
packages/clay-time-picker/src/index.tsx Outdated Show resolved Hide resolved
packages/clay-time-picker/src/index.tsx Outdated Show resolved Hide resolved
packages/clay-time-picker/src/index.tsx Outdated Show resolved Hide resolved
packages/clay-time-picker/src/index.tsx Outdated Show resolved Hide resolved
@matuzalemsteles
Copy link
Member Author

hey @bryceosterhaus I made some changes here. Ready for a next look.

Copy link
Member

@bryceosterhaus bryceosterhaus left a comment

Choose a reason for hiding this comment

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

Looks good to me. Only question would be tests, do we have any already for time-picker? It might be beneficial to add some in this PR to give a bit of safety.

@matuzalemsteles
Copy link
Member Author

Yeah, I'm going to add the tests still in that PR and documents.

@matuzalemsteles
Copy link
Member Author

hey @bryceosterhaus just a status on this. I needed to modify several rules in the Date Picker so it works fine with Time Picker, I'm having to remove the timeFormat API from the Date Picker for everything to work fine, but I still have to refactor some things. This is taking longer than I expected 🙂.

@matuzalemsteles
Copy link
Member Author

hey @bryceosterhaus, I think it's fine now to take a look, I made some modifications to DatePicker.

@coveralls
Copy link

coveralls commented Jul 15, 2019

Pull Request Test Coverage Report for Build 3024

  • 120 of 123 (97.56%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.5%) to 85.068%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/clay-date-picker/src/index.tsx 7 8 87.5%
packages/clay-time-picker/src/index.tsx 95 97 97.94%
Totals Coverage Status
Change from base Build 3022: 0.5%
Covered Lines: 1552
Relevant Lines: 1723

💛 - Coveralls

@matuzalemsteles
Copy link
Member Author

hey @pat270 we can have some class we can add as select in the input when they are focused, just to try to get closer to the behavior of the native time picker.

@matuzalemsteles matuzalemsteles marked this pull request as ready for review July 17, 2019 16:43
@matuzalemsteles
Copy link
Member Author

@bryceosterhaus I added here the useFocusManagement hook and I organized the commits. @pat270 will work on adding the focus class to the inputs with form-control-inset. So I guess we can go without that and add it later.

Copy link
Member

@bryceosterhaus bryceosterhaus left a comment

Choose a reason for hiding this comment

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

just one nitpick on the tests, otherwise it looks good to me.

Copy link
Member

@bryceosterhaus bryceosterhaus left a comment

Choose a reason for hiding this comment

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

LGTM, feel free to merge unless you have anything else you want to add.

@matuzalemsteles matuzalemsteles merged commit e3faffe into liferay:master Jul 22, 2019
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.

Rewrite ClayTimePicker with new markup
3 participants