-
Notifications
You must be signed in to change notification settings - Fork 0
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
[WIP] Update fragments #522
base: main
Are you sure you want to change the base?
Conversation
<th:block th:replace="~{fragments/inputs/checkboxInSet :: | ||
checkboxInSet(inputName=${inputName}, | ||
value=${option.getValue()}, | ||
label=${#strings.isEmpty(option.getLabel()) ? null : #messages.msg(option.getLabel())}, |
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.
Should these be interpolated beforehand?
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 sort of think it should just based on how the other messages work - it seems like for Actions and Validations, we interpolate them before the template gets rendered.
I also think it's kind of nice that it isn't interpolated beforehand because the enums work pretty well here and it's not straightforward to use the messageSource through an enum
I want to try this out in IL-GCC first before integrating to FFL. There's probably a better way to do this and maybe get interpolation to work easily 🤔 Holding off on merging, but feedback is welcome! |
Description of change ✍️
Updated the checkbox and radio fieldset fragments to be able to take a collection of options.
The
options
param are values from classes that implementInputOption
. They must have a value and label/helpText are optional. This is to simplify rendering for static checkboxes and have a more centralized way of referencing these values in html rendering and PDF generation.*Backwards compatible.
Priority 🥇
Medium - we can override locally for now
Effect on other applications using FFB 🌊
No breaking changes - this will be backwards compatible
Testing
There's a unit test showing how to use this new param. Here's an example as well (GenderOptions will have to be implements)
✅ Checklist before requesting a review
style?