[5.x] Support fieldsets in subdirectories
This pull request adds support for creating & managing fieldsets located in subdirectories. This was already kinda possible but there was a few rough edges, which this PR sorts out.
One of the rough edges was the fact you couldn't previously create a fieldset in a subdirectory in the Control Panel, you had to go in and manually create the file.
This PR fixes that so you can create fieldsets in subdirectories, using this syntax: components.team_members
Another change I've made is that fieldsets in subdirectories will be split out into separate groups on the Fieldsets Index page, like we do for namespaced fieldsets.
Here's an example of what that looks like (the "My Fieldsets" group will always be displayed first):
One last thing I had to fix was deleting fieldsets. Previously, the FieldsetRepository@delete method was manually constructing the file path and it wasn't replacing . with /. I've adjusted this to use the fieldset's path instead which takes this into account.
Closes #3178. Closes statamic/ideas#915.
Hey @duncanmcclean, this is a great PR! Curious if there are plans to merge this in the near-ish future?
We're using nested fieldsets in a project, and it actually seems to work for the most part, but CP access is broken (ie, throws a Undefined array key "type" in FieldTransformer::referenceFieldToVue() when trying to edit—or a create a new—fieldset. Thinking this PR might resolve that issue.
Sorry, we don't have an ETA for reviewing/merging this pull request. We'll get to it when we can.
In the meantime, you can pull this PR into your project with a composer patch.
No problem and no rush, just thought I'd check—thanks Duncan, appreciate the update!