Skip to content
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

Add form question types and categories from plugins #19191

Merged

Conversation

AdrienClairembault
Copy link
Contributor

@AdrienClairembault AdrienClairembault commented Mar 13, 2025

Checklist before requesting a review

  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.

Description

Allow a plugin to define its own questions types and categories.

This required very little code for the questions types as we already had a defined interface that the plugin could implement.

It required a bit more changes for the categories as we had a single enum that contained all the types without an interface.
I added an interface and changed the type hints in the code to this new interface as needed.

I also took the liberty to do some small general improvements to the QuestionTypeManager service as I was already changing most of its methods anyway.

Screenshots

image

image

@AdrienClairembault AdrienClairembault self-assigned this Mar 13, 2025
@AdrienClairembault AdrienClairembault force-pushed the form-questions-from-plugins branch 5 times, most recently from e25eefc to 18b9204 Compare March 17, 2025 15:20
@AdrienClairembault AdrienClairembault force-pushed the form-questions-from-plugins branch from 18b9204 to 5d39816 Compare March 17, 2025 15:26
@AdrienClairembault AdrienClairembault marked this pull request as ready for review March 18, 2025 08:36
@cedric-anne cedric-anne added this to the 11.0.0 milestone Mar 24, 2025
@trasher trasher merged commit 70eab50 into glpi-project:main Mar 24, 2025
7 checks passed
@AdrienClairembault AdrienClairembault deleted the form-questions-from-plugins branch March 24, 2025 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants