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

feat(Forms): add support for multiple info, warning and error messages given by an array #4284

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

tujoworker
Copy link
Member

@tujoworker tujoworker commented Nov 15, 2024

More info.

This code:

Screenshot 2024-11-14 at 21 56 45



Will now result in this:

Screenshot 2024-11-14 at 21 55 34

@tujoworker tujoworker requested a review from langz November 15, 2024 10:27
Copy link

vercel bot commented Nov 15, 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 15, 2024 10:29am

Copy link

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.

Copy link
Contributor

@joakbjerk joakbjerk left a comment

Choose a reason for hiding this comment

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

Nice, looks good to me 🔥

status={birthYear.error?.message}
on_drag_start={handleFocus}
on_drag_end={handleBlur}
status={hasError}
Copy link
Member Author

@tujoworker tujoworker Nov 15, 2024

Choose a reason for hiding this comment

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

birthYear.error?.message complains about the type (because error can be an array). That's why we use hasError instead.

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.

Should we document this anywhere in docs, or is it just expected behavior?

@tujoworker
Copy link
Member Author

Should we document this anywhere in docs, or is it just expected behavior?

We have at least one example.

And written about in in every field properties:

Screenshot 2024-11-15 at 13 45 23

Not sure where to write more about it.

@langz
Copy link
Contributor

langz commented Nov 15, 2024

Should we document this anywhere in docs, or is it just expected behavior?

We have at least one example.

And written about in in every field properties:

Screenshot 2024-11-15 at 13 45 23 Not sure where to write more about it.

Thanks Tobias, I believe that's sufficient ❤️

@tujoworker tujoworker merged commit 78f2fe8 into main Nov 15, 2024
15 checks passed
@tujoworker tujoworker deleted the feat/status-as-array branch November 15, 2024 13:22
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 Author

🎉 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