-
Notifications
You must be signed in to change notification settings - Fork 33
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(DatePicker): convert properties to camel case and deprecate those with snake case #4273
Conversation
joakbjerk
commented
Nov 12, 2024
•
edited
Loading
edited
- Fix tests related to Fields using DatePicker
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
bde67ea
to
4bb0b4a
Compare
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
a6afd54
to
31885fe
Compare
packages/dnb-eufemia/src/components/date-picker/DatePickerAddon.tsx
Outdated
Show resolved
Hide resolved
packages/dnb-eufemia/src/components/date-picker/DatePickerDocs.ts
Outdated
Show resolved
Hide resolved
…n.tsx Co-authored-by: Anders <anderslangseth@gmail.com>
day: 'd', | ||
month: 'm', | ||
year: 'å', | ||
}, | ||
// TODO: add firstDay |
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.
Is this to be done now, or at a later stage?
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.
Thinking later stage, as it also leads to rewriting the firstDay default prop 🙏
Unit tests is probably enough to test that this change works properly. Or should I test it manually as well? |
…erience/eufemia into feat/date-picker-camel-case-props
I think just double checking that the portal documentation looks correct should be enough? 🤔 Since the unit tests should over functionality as you said 😁 |
Is this still correct ? Or should it also be camelCased? |
When checking packages/dnb-design-system-portal/src/docs/uilib/components/date-picker/Examples.tsx, I see there's a good mix of props that's camelCased and other that's snake_cased, but that's probably just how it is in a transition face or so. I find both start_date and startDate there |
Not important, but we could also update |
Should be camel cased 😝 |
if it's snake casing in event objects, or shortcuts, then it's a symptom of the transition phase yeah, otherwise it's something that we forgot to convert 😁 |
Should these changes result in the need to update a screenshot test?🤔 |
Not the code changes, but it seems that changing the demo examples triggered a slight change in the height in the screenshot area itself 🤷 |
packages/dnb-eufemia/src/components/date-picker/__tests__/DatePicker.test.tsx
Show resolved
Hide resolved
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 nice work 🚀
We should test this PR manually.
In the example https://eufemia-git-feat-date-picker-camel-case-props-eufemia.vercel.app/uilib/components/date-picker/demos/#range-datepicker it's a bit annoying that we have both But I guess it's just something we need to have temporarily for now 👍 |
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 tested the Datepicker and Field.Date, and I could not find any anomalies
Sweet, thank you! 🎁 |
## [10.56.0](v10.55.1...v10.56.0) (2024-11-18) ### 🐛 Bug Fixes * **DatePicker:** ensure that `endMonth` does not fallback to `startMonth` when `endMonth` prop is defined ([#4254](#4254)) ([5281257](5281257)) * **Forms:** render given elements to `warning` and `info` properties ([#4261](#4261)) ([d60de25](d60de25)) ### ⚡ Refactoring * **DatePicker:** convert properties to camel case and deprecate those with snake case ([#4273](#4273)) ([a69a8aa](a69a8aa)) ### ✨ Features * **Field.Date:** add DatePickerProps ([#4160](#4160)) ([6a3765b](6a3765b)) * **Forms:** add `asyncFileHandler` to Field.Upload to support async file handling during upload ([#4281](#4281)) ([030a09c](030a09c)) * **Forms:** add inline HelpButton to all Field.* components as default (with option to open in Dialog) ([#4282](#4282)) ([e869a60](e869a60)) * **Forms:** add support for multiple info, warning and error messages given by an array ([#4284](#4284)) ([78f2fe8](78f2fe8)) * **ListFormat:** adds spacing properties ([#4255](#4255)) ([c72d999](c72d999)) * **Paragraph:** handle nested paragraphs (to be `span`'s) ([#4251](#4251)) ([ca3bbde](ca3bbde))
🎉 This PR is included in version 10.56.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |