Skip to content

[6.x] Misc dynamic form builder preparations #10976

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

Merged
merged 83 commits into from
Mar 27, 2025
Merged

Conversation

jesseleite
Copy link
Member

@jesseleite jesseleite commented Oct 18, 2024

This PR initially started out as an attempt to add group field support, but has grown to include a whole bunch of improvements, with the purpose of improving dynamic field rendering for users, and to prepare for our upcoming GUI based form builder stuff.

TODO:

  • Pass both handle and name into fields context
    • Because nested fields need to submit nested[field][format] input names
    • But we still need dotted nested.field.format handles for showField() JS driver logic
  • Add support for group field
    • Make group fieldtype available to frontend forms
    • Flesh out default group.antlers.html fieldtype template
    • Change individual fieldtype views to submit using new name[format] instead of handle.format
    • Add preProcessTagRenderable() to fieldtypes
    • Update trait to call preProcessTagRenderable() for group-specific recursion logic
    • Make sure error bag still works
    • Make sure old input still works
    • Make sure JS conditions work on nested fields
      • Updates alpine driver
      • Update abstract JS driver so that custom drivers can easily render attributes onto group fields
    • Make sure JS conditions work on parent group field itself
      • Hidden fields should hide all children
    • Make sure show_fields array still works at top level for hardcoded fields outside of fields loop
      • Update documentation to show recommended syntax for this (ie. show_field['nested.dotted.handle'])
    • Fix old value bug when submitting partial nested field payloads
  • Add {{ form:fields }} recursive tag helper
    • Make sure {{ form:fields }} works recursively using {{ fields }} array context at every level
    • Make sure {{ form:fields }} works recursively within {{ sections }} loop as well
    • Support scope param (ie. {{ form:fields scope="field" }})
  • Add support for recently added $parent conditions syntax, since we assume feature parity with CP
  • Fix checkbox null filtering recursively once and for all
  • Improve field html id rendering
  • Test coverage
  • Documentation

Closes statamic/ideas#1228

@jesseleite jesseleite changed the title [5.x] Add frontend support for Group fieldtype [5.x] Add frontend forms support for Group fieldtype Oct 21, 2024
@jesseleite jesseleite changed the title [5.x] Add frontend forms support for Group fieldtype [5.x] Add form:fields tag with support for group fieldtype Feb 6, 2025
@jesseleite jesseleite changed the title [5.x] Add form:fields tag with support for group fieldtype [5.x] Add recursive form:fields tag with support for group fieldtype Feb 6, 2025
@jesseleite jesseleite changed the title [5.x] Add recursive form:fields tag with support for group fieldtype [6.x] Misc dynamic form builder preparations Mar 6, 2025
@jesseleite jesseleite changed the base branch from 5.x to master March 6, 2025 19:59
@jesseleite jesseleite requested a review from jasonvarga March 13, 2025 02:10
@jesseleite jesseleite marked this pull request as ready for review March 13, 2025 02:10
@jesseleite
Copy link
Member Author

jesseleite commented Mar 13, 2025

Failing JS test related to the other UTC refactoring you guys are doing on master maybe?

Update: It passes this morning 😁 ...Unrelated to this PR obviously though.

@jasonvarga jasonvarga merged commit d04dee8 into master Mar 27, 2025
18 checks passed
@jasonvarga jasonvarga deleted the frontend-form-group branch March 27, 2025 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add frontend support for Group fieldtype
2 participants