-
Notifications
You must be signed in to change notification settings - Fork 377
WIP feat(DatePicker): Add DatePicker component #226
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
Conversation
|
Part of contributing this component is to take a deeper look at how 3rd party components can be blended in to patternfly-react repo. This The 3rd party component being consumed is DateTimePicker in the react-widgets package. At this point, the PR is a work in progress. There are a few things to consider:
|
|
@jelkosz, @gregsheremeta, @vojtechszocs - FYI |
Pull Request Test Coverage Report for Build 729
💛 - Coveralls |
|
@sjd78 nice job! I haven't had much time to review the others, but re: i18n: We would like to avoid introducing i18n/react-intl into this library (and have it handled by the products). This means that all components here should accept any text attributes as messages props (see pagination example). You are 100% correct that we'll need to be extra careful with this on datepicker/timepicker. I would expect that these components should accept timezone and language attributes as props (and downstream can handle setting these accordingly). Here is an example of that in Foreman (full PR). |
Absolutely! I just patched ovirt-engine-dashboard to remove
A DatePicker and a TimePicker will always be tied to i18n. There is no way around that. The component does have properties for The |
|
@sjd78 this is looking great! I noticed that some of the visuals don't match what's currently in core PF https://rawgit.com/patternfly/patternfly/master-dist/dist/tests/bootstrap-datepicker.html, as far as highlight & selection colors, etc |
|
@serenamarie125 Excellent! I didn't tweak the visuals much from the underlying component, so it is a bit different then the bootstrap-datepicker spec. I'm expecting a similar way forward as the Time Picker issue (#180). Once there is some agreement around handling CSS tweaks from the underlying component, I can make the necessary adjustments. |
|
Hey @sjd78, I actually defer to @jeff-phillips-18 on this one, since he was more involved in getting sass set up. I'm also curious how we would convert the third-party sass to less. |
|
I'm OK with the changes to be able to import the react-widgets SASS. Better to move the includes into the importer as the list could continue to grow. For the |
| "jest": "^22.0.4", | ||
| "jest-cli": "^22.0.4", | ||
| "node-sass": "^4.7.2", | ||
| "node-sass-tilde-importer": "^1.0.1", |
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.
Consider using node-sass-package-importer
I used a different feature from node-sass-magic-importer and the experience was great.
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.
The tilde import part works the same way, but the other features are interesting.
| // Bootstrap Core variables and mixins | ||
| @import "bootstrap/variables"; | ||
| @import "bootstrap/mixins"; | ||
| @import "@bootstrap/variables"; |
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.
Creating a special syntax will make it difficult to import this file for consumers.
I have an open pr for foreman that handle it differently:
https://github.com/theforeman/foreman/pull/5212/files#diff-a58d55bdb5770c78ad512f8e91f8d051R109
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 don't expect consumers would import this file, rather they would import the patternfly-react partials. But if there is a better way to avoid the special syntax, that would be better.
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.
oh you right, it's a bit confusing since they use they same name
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.
Really the reason I put the "@" there was to indicate that the import is coming from somewhere non-standard. In this case, the bootstrap and fontawesome imports all come from the patternfly package. That was achieved by including those source sass directories directly on the command line.
I though about changing the import to something that webpack would understand natively like:
@import "~patternfly/node_modules/bootstrap-sass/assets/stylesheets/variables" ;
but that seemed worse.
serenamarie125
left a comment
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.
@sjd78 let me know if the CSS tweaks were handled, and I can come back and take a look when it's ready
|
@sjd78 Do you want to proceed with this PR or shall we close it out? |
|
Hi @jeff-phillips-18, I won't have time to work on it anytime soon. I'll close it out. Sorry about that. |
What: Add the DatePicker component from PF to PF-react.
The PatternFly design is at: http://www.patternfly.org/pattern-library/forms-and-controls/datepicker/
The PatternFly widget is defined at: http://www.patternfly.org/pattern-library/widgets/#bootstrap-datepicker
See issue #232.
Link to Storybook: https://sjd78.github.io/patternfly-react/?selectedKind=DatePicker&selectedStory=DatePicker
Additional issues: