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

fix(Forms): console log a warning when Value.SummaryList gets an invalid child #4249

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

tujoworker
Copy link
Member

@tujoworker tujoworker commented Nov 9, 2024

More info here.

It verifies that only allowed children are passed.

It does this by comparing the amount of given children components vs the amount of the actual wanted components (verified via a context call).
When there are more other children than the wanted ones, we show a warning ⚠️

I'm not sure if there are smarter ways to do that. But as of now, I think this may work.

Copy link

vercel bot commented Nov 9, 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 9, 2024 8:19pm

Copy link

codesandbox-ci bot commented Nov 9, 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.

} from 'react'
import { warn } from '../../../../shared/helpers'

export function useVerifyChildren({
Copy link
Contributor

@langz langz Nov 9, 2024

Choose a reason for hiding this comment

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

When reading verifyChildren.
I immediately think that it verifies children, but what does it mean to verify children?🤔

Some other potential names:

  • useVerifyChildrenNotEmpty
  • useVerifyChildrenHasElements
  • useChildrenNotEmpty
  • useVerifyChildrenHasItems
  • useVerifyChildrenHasChildren

Copy link
Contributor

Choose a reason for hiding this comment

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

It's more understandable now when we've added a PR description🥳🫡

@tujoworker tujoworker force-pushed the fix/summary-list-warning branch from aa6d2fc to f087e63 Compare November 9, 2024 20:12
@langz langz merged commit 011e9eb into main Nov 11, 2024
10 checks passed
@langz langz deleted the fix/summary-list-warning branch November 11, 2024 09:34
tujoworker pushed a commit that referenced this pull request Nov 11, 2024
## [10.55.1](v10.55.0...v10.55.1) (2024-11-11)

### 🐛 Bug Fixes

* **Forms:** console log a warning when Value.SummaryList gets an invalid child ([#4249](#4249)) ([011e9eb](011e9eb))
* **Forms:** ensure Field.Upload handles `required` logic between Wizard step changes ([#4248](#4248)) ([505dbc1](505dbc1))
@tujoworker
Copy link
Member Author

🎉 This PR is included in version 10.55.1 🎉

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.

2 participants