-
-
Notifications
You must be signed in to change notification settings - Fork 581
[5.x] Add user profile form tabs and sections #11836
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
[5.x] Add user profile form tabs and sections #11836
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add tests to cover your changes? You can add to UserTagsTest
.
Test added, not in the file you mentioned but in ProfileFormTest instead (though your link was useful to locate the correct file to add the tests to). To me, tests seemed relevant only for custom blueprints, since the default blueprint only has 1 tab, 1 section, therefore, I changed the custom blueprint to make it work with While I am here, quick reminder: |
@duncanmcclean : to follow up, will this PR ever be passed into 5.x? Or only 6.x? |
I'm not sure, sorry! It really depends when we get around to reviewing this PR. If you need to use this in your project, you could potentially use a composer patch. |
Going to be honest: your answer, or lack thereof, rubs me the wrong way. You are spending all of your time on Statamic v6; good for you and I understand the challenge.
It is not like I was pushing to have the PR merged urgently (though I'd very much like to see the thing be merged after 2 months), I was only asking for the plan. How is it possible nobody in the core team has discussed what to do with the growing backlog? Ultimately, it is unreasonable to ask people who go out of their way to develop themselves something they need short term (instead of submitting an idea and leaving its delivery to your schedule) to wait months without so much as a heads up and by happy with a makeshift solution. As to "use a composer patch", nah, I won't be using that sh*t and I feel you should not require your users, who are making contributions on their own time (and paid a Statamic license BTW), to use it. First of all, Statatamic can be used with just the commands provided in Your users are likely not, for the most part, expert in composer or git, let alone both. I for one made my first, and so far only, contribution ever on a PHP application with this very PR. Regarding the package, I've spent a few hours on it and all I have figured out is:
You seriously overestimate your users if you think they all can configure it without hours of trial and errors.... or at all really. |
This PR follows a discussion on Discord.
It adds/changes the following to
{{ user:profile_form }}
:{{ sections }}
inner tag.This aligns the profile form to other forms where it was possible to loop over sections.
{{ tabs }}
inner tag.Tabs do not exist in forms' blueprints.
Technically, the tags work by:
getProfileTabs()
method:password
,password_confirmation
,roles
,groups
as well as assets fields, on the same principle as the existinggetProfileFields
method.getProfileFields
method.getProfileTab() is then used to create the new
{{ tabs }}` inner tag.{{ sections }}
inner tag.{{ fields }}
inner tag (i.e. instead of usinggetProfileFields()
to create{{ fields }}
).This removes duplicate code (
getProfileFields()
is not called anymore, though I have not removed it) and is expected to have better performance.Note: flattening the Array from
tabs
tosections
and then toprofile
is done on the same way as it is done for regular forms:But it could have been done using:
One method might be superior in terms of performance.