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(DatePicker): convert properties to camel case and deprecate those with snake case #4273

Merged
merged 20 commits into from
Nov 15, 2024

Conversation

joakbjerk
Copy link
Contributor

@joakbjerk joakbjerk commented Nov 12, 2024

  • Fix tests related to Fields using DatePicker

Copy link

vercel bot commented Nov 12, 2024

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

Copy link

codesandbox-ci bot commented Nov 12, 2024

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.

@joakbjerk joakbjerk marked this pull request as ready for review November 12, 2024 20:40
@joakbjerk joakbjerk changed the title feat(DatePicker) covnvert properties to camel case feat(DatePicker): covnvert properties to camel case Nov 12, 2024
@langz langz changed the title feat(DatePicker): covnvert properties to camel case feat(DatePicker): convert properties to camel case Nov 13, 2024
…n.tsx

Co-authored-by: Anders <anderslangseth@gmail.com>
day: 'd',
month: 'm',
year: 'å',
},
// TODO: add firstDay
Copy link
Contributor

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?

Copy link
Contributor Author

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 🙏

@langz
Copy link
Contributor

langz commented Nov 13, 2024

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

@joakbjerk
Copy link
Contributor Author

joakbjerk commented Nov 13, 2024

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
Copy link
Contributor

langz commented Nov 13, 2024

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
Copy link
Contributor

langz commented Nov 13, 2024

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
Copy link
Contributor

langz commented Nov 13, 2024

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

@joakbjerk
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor

langz commented Nov 13, 2024

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

@joakbjerk
Copy link
Contributor Author

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 🤷

@tujoworker tujoworker changed the title feat(DatePicker): convert properties to camel case refactor(DatePicker): convert properties to camel case and deprecate those with snake case Nov 14, 2024
Copy link
Member

@tujoworker tujoworker left a 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.

@langz
Copy link
Contributor

langz commented Nov 15, 2024

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 👍

Copy link
Contributor

@langz langz left a 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

@joakbjerk
Copy link
Contributor Author

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

Sweet, thank you! 🎁

@joakbjerk joakbjerk merged commit a69a8aa into main Nov 15, 2024
10 checks passed
@joakbjerk joakbjerk deleted the feat/date-picker-camel-case-props branch November 15, 2024 07:41
tujoworker pushed a commit that referenced this pull request Nov 18, 2024
## [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))
@tujoworker
Copy link
Member

🎉 This PR is included in version 10.56.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants