-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Custom fields on user v7 rebased #15146
base: master
Are you sure you want to change the base?
Custom fields on user v7 rebased #15146
Conversation
PR Summary
Please note, updates to several PHP and blade files, and new additions have been done to ensure smoother and more sophisticated handling and representation of custom fields across the application. These changes cater to improving the functionality, readability and maintainability of the codebase. |
…the new HasCustomFields trait. This should allow us to add custom fields to just about anything we want to within Snipe-IT. Below are the commits that have been squashed together: Initial decoupling of custom field behavior from Assets for re-use Add new DB columns to Custom Fields and fieldsets for 'type' WIP: trying to figure out UI for custom fields for things other than Assets, find problematic places Real progress towards getting to where this stuff might actually work... Fix the table-name determining code for Custom Fields Getting it closer to where Assets at least work Rename the trait to it's new, even better name Solid progress on the new Trait! WIP: HasCustomFields, still working some stuff out Got some basics working; creating custom fields and stuff HasCustomFields now validates and saves Starting to yank the other boilerplate code as things start to work (!) Got the start of defaultValuesForCustomField() working More progress (squash me!) Add migrations for default_values_for_custom_fields table WIP: more towards hasCustomFields trait Progress cleaning up the PR, fixing FIXME's New, passing HasCustomFieldsTrait test! Fix date formatter helper for custom fields Fixed more FIXME's Got a chunk of Custom Fields for Users worked out, still needs cleanup Wiring up custom fields for users - still some big UI challenges tho Remove some code duplication Refactor out common code for 'custom fields view' partial Clean up this migration so it runs forwards and backwards OK Clean up the fieldset experience for custom fields for users Make tests pass, at least to start with. Still needs cleanup
d3ee857
to
5c77c9b
Compare
This is another stab at Custom Fields as a Trait, with that trait being used on Assets (which we already had) and Users (which we did not have). This should put us in a good position going forward to start adding custom fields to other things. This is rebased and squashed against latest Develop, so it should be easier to merge develop back into it, or to rebase it against develop, or whatever else we need to do to it.
There are definitely some elements here that need buttoning-up. One that bothers me a lot is that I renamed the "default values for custom fields" table - and that makes it brutally hard to switch back and forth between branches. Not fun. Maybe I should've just stuck with the old name, and just added the columns, maybe renaming it later, if ever? Or maybe we rip this band-aid off now.
There are FIXME's scattered throughout that we should address, deprioritize into TODO's, or remove (if they've already been handled, of course).
The UI probably is going to need some pretty close attention to get it looking and working well enough.
I think once we have everything looking kinda how we like, it's probably worth it to do another squash to make this one clean set of changes.
I definitely ran into some weird problems with the squash/merge where stuff got duplicated and messed up in a few spots. I tried to clean those up, but those spurious changes are probably worth squashing out because they're unnecessarily weird.