Skip to content

Commit

Permalink
Merge pull request #302 from hmrc/DLS-10885
Browse files Browse the repository at this point in the history
DLS-10885: Implement play-frontend-hmrc v10.9.0 upcoming upgrade
  • Loading branch information
jchrisp95 authored Sep 12, 2024
2 parents 0644ca3 + a8a6f61 commit 865f102
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 13 deletions.
3 changes: 0 additions & 3 deletions app/viewmodels/govuk/DateFluency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@ trait DateFluency {
def withHint(hint: Hint): DateInput =
date copy (hint = Some(hint))

def withFormGroupClasses(classes: String): DateInput =
date copy (formGroupClasses = classes)

def withCssClass(newClass: String): DateInput =
date copy (classes = s"${date.classes} $newClass")

Expand Down
3 changes: 0 additions & 3 deletions app/viewmodels/govuk/InputFluency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,6 @@ trait InputFluency {
def withHint(hint: Hint): Input =
input copy (hint = Some(hint))

def withFormGroupClasses(classes: String): Input =
input copy (formGroupClasses = classes)

def withCssClass(newClass: String): Input =
input copy (classes = s"${input.classes} $newClass")

Expand Down
3 changes: 0 additions & 3 deletions app/viewmodels/govuk/RadiosFluency.scala
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,6 @@ trait RadiosFluency {
def withHint(hint: Hint): Radios =
radios copy (hint = Some(hint))

def withFormGroupClasses(classes: String): Radios =
radios copy (formGroupClasses = classes)

def withIdPrefix(prefix: String): Radios =
radios copy (idPrefix = Some(prefix))

Expand Down
5 changes: 4 additions & 1 deletion app/views/helpers/AssociatedCompaniesViewHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import play.api.i18n.Messages
import play.twirl.api.Html
import uk.gov.hmrc.govukfrontend.views.Aliases.Text
import uk.gov.hmrc.govukfrontend.views.html.components.{ GovukErrorMessage, GovukHint, GovukInput, GovukLabel }
import uk.gov.hmrc.govukfrontend.views.html.helpers.{ GovukFormGroup, GovukHintAndErrorMessage }
import uk.gov.hmrc.govukfrontend.views.viewmodels.label.Label
import viewmodels.govuk.All.FluentInput
import viewmodels.govuk.input.InputViewModel
Expand All @@ -31,8 +32,10 @@ object AssociatedCompaniesViewHelper extends ViewHelper {

private val govukErrorMessage = new GovukErrorMessage
private val govukHint = new GovukHint
private val govukHintAndErrorMessage = new GovukHintAndErrorMessage(govukHint, govukErrorMessage)
private val govukFormGroup = new GovukFormGroup
private val govukLabel = new GovukLabel
private val govukInput = new GovukInput(govukErrorMessage, govukHint, govukLabel)
private val govukInput = new GovukInput(govukLabel, govukFormGroup, govukHintAndErrorMessage)

def yesHtml(form: Form[_], a: AssociatedCompaniesParameter)(implicit messages: Messages): Option[Html] =
a match {
Expand Down
4 changes: 2 additions & 2 deletions project/AppDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ object AppDependencies {
val compile: Seq[ModuleID] = Seq(
play.sbt.PlayImport.ws,
"uk.gov.hmrc" %% s"bootstrap-frontend-$playVersion" % bootstrapVersion,
"uk.gov.hmrc" %% s"play-frontend-hmrc-$playVersion" % "9.0.0",
"uk.gov.hmrc" %% s"play-conditional-form-mapping-$playVersion" % "2.0.0",
"uk.gov.hmrc" %% s"play-frontend-hmrc-$playVersion" % "10.11.0",
"uk.gov.hmrc" %% s"play-conditional-form-mapping-$playVersion" % "3.2.0",
"uk.gov.hmrc.mongo" %% s"hmrc-mongo-$playVersion" % hmrcMongoVersion,
"com.openhtmltopdf" % "openhtmltopdf-pdfbox" % "1.0.10",
"org.julienrf" %% "play-json-derived-codecs" % "11.0.0",
Expand Down
5 changes: 4 additions & 1 deletion test/views/helpers/AssociatedCompaniesViewHelperSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import play.api.i18n.Messages
import play.api.test.Helpers
import uk.gov.hmrc.govukfrontend.views.Aliases.Text
import uk.gov.hmrc.govukfrontend.views.html.components.{ GovukErrorMessage, GovukHint, GovukInput, GovukLabel }
import uk.gov.hmrc.govukfrontend.views.html.helpers.{ GovukFormGroup, GovukHintAndErrorMessage }
import uk.gov.hmrc.govukfrontend.views.viewmodels.label.Label
import viewmodels.govuk.All.FluentInput
import viewmodels.govuk.input.InputViewModel
Expand Down Expand Up @@ -58,8 +59,10 @@ class AssociatedCompaniesViewHelperSpec extends AnyFreeSpec with Matchers with V

private val govukErrorMessage = new GovukErrorMessage
private val govukHint = new GovukHint
private val govukHintAndErrorMessage = new GovukHintAndErrorMessage(govukHint, govukErrorMessage)
private val govukFormGroup = new GovukFormGroup
private val govukLabel = new GovukLabel
private val govukInput = new GovukInput(govukErrorMessage, govukHint, govukLabel)
private val govukInput = new GovukInput(govukLabel, govukFormGroup, govukHintAndErrorMessage)

"yesHtml" - {
"should return input field when AskAssociatedCompaniesParameter is AskFull" in {
Expand Down

0 comments on commit 865f102

Please sign in to comment.