dnbexperience / eufemia

DNB Design System
https://eufemia.dnb.no
Other
53 stars 32 forks source link

refactor(DatePicker): convert properties to camel case and deprecate those with snake case #4273

Closed joakbjerk closed 1 week ago

joakbjerk commented 1 week ago
vercel[bot] commented 1 week ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 13, 2024 2:50pm
codesandbox-ci[bot] commented 1 week ago

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.

langz commented 1 week ago

Unit tests is probably enough to test that this change works properly. Or should I test it manually as well?

joakbjerk commented 1 week ago

Unit tests is probably enough to test that this change works properly. Or should I test it manually as well?

I think just double checking that the portal documentation looks correct should be enough? 🤔 Since the unit tests should over functionality as you said 😁

langz commented 1 week ago

Is this still correct ? https://eufemia-git-feat-date-picker-camel-case-props-eufemia.vercel.app/uilib/components/date-picker/events/

Or should it also be camelCased?

langz commented 1 week ago

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

langz commented 1 week ago

Not important, but we could also update packages/dnb-eufemia/src/components/date-picker/stories/DatePicker.stories.tsx

joakbjerk commented 1 week ago

Is this still correct ? https://eufemia-git-feat-date-picker-camel-case-props-eufemia.vercel.app/uilib/components/date-picker/events/

Or should it also be camelCased?

Should be camel cased 😝

joakbjerk commented 1 week ago

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

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 😁

langz commented 1 week ago

Should these changes result in the need to update a screenshot test?🤔

joakbjerk commented 1 week ago

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 🤷

langz commented 1 week ago

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 startDate and start_date, endDate and end_date,etc.

But I guess it's just something we need to have temporarily for now 👍

joakbjerk commented 1 week ago

I tested the Datepicker and Field.Date, and I could not find any anomalies

Sweet, thank you! 🎁

tujoworker commented 1 week ago

:tada: This PR is included in version 10.56.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: