Add entireFieldWrapperValue
configuration option, to wrap arrays.
#5753
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes regression introduced in: #3938, fixes feature requested in: #5227 and #4614 (issue can be discussed ether in these issues, or here).
The problem
The change made in issue #3938 changed how
fieldWrapper
worked, so that it is no longer possible to wrap an entire array usingFieldWrapper
, rather the values INSIDE the array are wrapped.@nebbles summed this up well in #5227:
When adding to config:
Then I'd expect this wrapper to be applied to the Type of the field
A type like this:
Should turn into:
However as mentioned, the above change (#3938) means that Arrays cannot be given a custom wrapper. The result of using the config returns
The fix
This adds two new configuration options:
wrapEntireFieldDefinitions
andentireFieldWrapperValue
that fixes this. So when adding to config:A type like this:
Turns into:
This can also be nested with
wrapFieldDefinitions
so thatWill make it so a type like this:
Turns into:
Type of change
How Has This Been Tested?
Added a new test case for these new configuration option(s).
Checklist:
Further comments
It can also be considered, that this should be added to
flow
generator also. But I'm not an expert there, so requires assistance.