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
PLATUI-2897 enable passing of attributes to input form group wrappers #288
Conversation
@@ -27,5 +26,5 @@ import play.api.http.HttpErrorHandler | |||
* [RuntimeException: java.lang.NoSuchMethodError: controllers.ReverseAssets.versioned(Ljava/lang/String;)Lplay/api/mvc/Call;] | |||
* when using Assets. | |||
*/ | |||
@Singleton | |||
@Singleton // TODO migrate off deprecated AssetsBuilder once we drop Play 2.8 support |
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.
just to remind people (like me 😅) who see the deprecation warning that we can't do this just yet 🙃
idPrefix <- Gen.option(genAlphaStr()) | ||
name <- genNonEmptyAlphaStr | ||
nItems <- Gen.chooseNum(0, 5) | ||
items <- Gen.listOfN(nItems, arbCheckboxItem.arbitrary) | ||
classes <- genClasses() | ||
attributes <- genAttributes() | ||
} yield Checkboxes( | ||
values <- Gen.listOfN(nItems, genAlphaStr()) |
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.
noticed values
was missing here 🙃
...-30/src/main/twirl/uk/gov/hmrc/govukfrontend/views/snippets/GovukFormGroupSnippet.scala.html
Outdated
Show resolved
Hide resolved
...rc-play-30/src/main/scala/uk/gov/hmrc/govukfrontend/views/viewmodels/CommonJsonFormats.scala
Show resolved
Hide resolved
...ntend-hmrc-play-30/src/main/scala/uk/gov/hmrc/govukfrontend/views/viewmodels/FormGroup.scala
Show resolved
Hide resolved
...play-30/src/main/twirl/uk/gov/hmrc/govukfrontend/views/components/GovukCheckboxes.scala.html
Outdated
Show resolved
Hide resolved
Out of interest, I notice a pattern of using |
Also, one more comment from me - as a thought on using snippets to compose HTML templates, one thing to consider is that manually syncing with |
TBH I just went with what was already there, but could change to |
…tributes to govuk-form-group
… back-fill missing docstrings
…y checkbox values
…m-group; fix up some earlier docstrings
…-group; document tech debt around `spellcheck` parameter
d71dce9
to
92cf552
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.
some of the composition of stuff in twirl components is so hard to follow 😵
this isn't me saying do this, just me taking a moment to think if I could imagine the a flavour I might like, this kind of structure was my first thought
@(checkboxes: Checkbox)
@govukFormGroup(checkboxes.formGroup) {
@govukFieldset(checkboxes.fieldset) {
@govukHint(checkboxes.hint)
@govukErrorMessage(checkboxes.errorMessage)
... inputs
}
})
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.
Agreed - the issue seems to be accumulating the right aria-describedby
when there's maybe a supplied one, maybe one related to the hint, and maybe one related to the error message... But perhaps there's a nicer way to do it, like using cats State
or something 😅
cb3d046
to
bd0d7b6
Compare
** GovukCharacterCount
** GovukCheckboxes
** GovukDateInput
** GovukFileUpload
** GovukInput
** GovukRadios
** GovukSelect
** GovukTextarea
** HmrcCharacterCount