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
[4.x] Allowing adding a blueprint to user groups #6506
[4.x] Allowing adding a blueprint to user groups #6506
Conversation
Looks like a good addition to me. What more feedback were you looking for at the moment? |
That’s probably enough - just wanted to know if it was worth spending time on or if there was a reason it wasn’t there already. If there’s anything approach wise that looks wrong to you do let me know. |
I think you're looking good! We haven't added the feature because no one wanted it yet. 🤷 |
I think this is good to go, but the tests are failing due to a segmentation fault (something on Github's side?) |
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.
Nice. Some things I noticed:
- When you save the user group in the CP, the page title disappears.
- When you save the user group in the CP, no custom field data is added to the file.
- The blueprint should be added to the blueprint index. (/cp/fields/blueprints)
- UserGroup's augmentedArrayData will probably need to be updated in order for the custom fields to be used in templates, Add
user_groups
tag #6505, etc.
Thats really helpful thank you. Ive got them all fixed now. |
I'm not sure why the tests are failing like that. I pulled the suite down locally, used the same PHP version and composer deps, and it all passes. 🤔 |
Same! No idea what’s going on. |
I've got all the tests passing by specifying a min version of phpunit (8.5.23) on the PHP8 mockery action. Hope this is an acceptable solution. |
Yeah I'm fine with that. Looks like Orchestra requires 8.5.21 at a minimum, and 8.5.23 fixes a memory leak. Segfault seems like that's probably what it is. sebastianbergmann/phpunit#4799 |
# Conflicts: # .github/workflows/tests.yml # resources/js/components/user-groups/PublishForm.vue # resources/views/usergroups/edit.blade.php # routes/cp.php
This is in a good spot. I think there's just one more thing to sort out. The Now that handle becomes just a basic blueprint field, that feature is gone. I'm fine with putting that text just into the instructions, but then it's also possible to not include the handle field at all. In that case, the handle gets updated based on the title, which is awkward. I'm thinking this:
(Just putting these as notes to ourselves to sort out. You don't need to do anything, @ryanmitchell) |
Thanks for the work on this. Its genuinely appreciated. |
We can't inject the handle field directly after the title field (we can add it to the top or bottom of the form, but that's awkward), and adding a feature to do so would require a fair bit of work. So we're just going to remove the handle field. At least for now. So, by default, the handle will get snake_cased from the title on creation. |
Amazing. So good to see this merge, thank you! |
Ok be gentle as I've not worked with Vue a whole lot.
This PR adds the ability to modify the blueprint associated with a user group by adding some new routes, controllers and borrowing from the existing user blueprint approach for this. This would allow developers to add new fields to the groups, such as images, descriptions or whatever they want.
The only 'breaking' change I can see is adding
data()
to user groups and how that would affect eloquent - would love to hear your thoughts on this.I will definitely have missed some things here, so marking as a draft for now. But I would value feedback at this stage.
Closes: statamic/ideas#798