-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Generic Dropdowns #17603
base: main
Are you sure you want to change the base?
Generic Dropdowns #17603
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.
I wanted to test this one as well but as we (once again) are late on review, I thikg it's not up to date with the last evolution of generic routes for dropdown (#17454), no?
4ed32cd
to
9135996
Compare
I think it needs a new route. Custom Asset types and models aren't handled by the new controller either. |
They are mapped with the generic dropdown controllers here: glpi/src/Glpi/Http/LegacyDropdownRouteListener.php Lines 87 to 93 in 22df3fd
|
01da0c5
to
20cd3e1
Compare
- Mutualize some code - Extends CommonTreeDropdown everytime - Put back `getAssetClassName()` to reduce diff - Add default SO - ...
20cd3e1
to
c3ecd67
Compare
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.
I made some changes. Most important is that all custom dropdown are tree dropdowns, as it permits to simplify the code. I validated this change with @orthagh.
I did not had time to pass the whole test suite. If tests fails, I will fix them.
Disagree with that change but not willing to argue. Will wait and see if any users provide feedback about that forced behavior. |
Intended to be integrated with custom fields for generic assets in a future PR.
PR also generalizes the generic asset code to de-duplicate the work between generic assets and generic dropdowns.
Generic dropdowns may optionally be "tree" dropdowns instead of flat ones. This can be changed at any time. When not in tree mode, the items are added at level 0 with the complete name set properly as if they were root items. The base class switches between
CommonDropdown
andCommonTreeDropdown
depending on the value ofis_tree
in the definition.Being based on the standard dropdown classes, these custom ones are obviously translatable in the same way.