-
Notifications
You must be signed in to change notification settings - Fork 172
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
Move and remove elements from JSON arrays in form #4347
Draft
dafeder
wants to merge
16
commits into
2.x
Choose a base branch
from
json-form-arrays
base: 2.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dafeder
force-pushed
the
json-form-arrays
branch
from
December 2, 2024 21:43
e2c28ba
to
d8e7b69
Compare
dafeder
force-pushed
the
json-form-arrays
branch
from
December 2, 2024 22:04
0caaff7
to
f01cc3a
Compare
dafeder
force-pushed
the
json-form-arrays
branch
from
December 2, 2024 22:41
23a4352
to
37a6637
Compare
This reverts commit 37a6637.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4335
Describe your changes
Fairly extensive changes to how array properties are handled in JSON Form Widget. Arrays, whether "simple" (an array of strings or numbers) or "complex" (arrays of objects) will contain one more level of nested fieldsets. This is because each array item now has its own action buttons, so that array items can be removed or moved in the order. Previously we only had action buttons at the end of the array, allowing us to "add one" or "remove one".
Because the autoselect widgets expect a built array fieldset and then rewrite it, there are also a number of changes to that logic. A risk - we do not really have full functional test coverage for these elements. Also, now that I understand the code flow a bit better, it does make me wonder if there's a better approach that avoids building all these nested fieldsets on the first pass only to flatten and replace them on the second pass with WidgetRouter.
QA Steps
You may want to remove some fields from the distribution schema to make that form element shorter - Keep it to just title, description and downloadURL for instance.
Note on codeclimate failure - ArrayHelper is pretty big now but I don't see an obvious way to split it up that would make the code much more readable. Open to suggestions but IMO let's just let it slide for now and revisit if the method count gets any higher.
Checklist before requesting review
If any of these are left unchecked, please provide an explanation