-
-
Notifications
You must be signed in to change notification settings - Fork 576
[5.x] Feature/add user profile form tabs 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
base: 5.x
Are you sure you want to change the base?
[5.x] Feature/add user profile form tabs 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: |
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.