Skip to content

Commit

Permalink
Merge pull request #457 from hmrc/DL-14866
Browse files Browse the repository at this point in the history
feat(DL-14866): Enable autocomplete and inputmode attributes
  • Loading branch information
preetampotdar authored Nov 25, 2024
2 parents c2ec8d5 + 639fc69 commit 55de8b6
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/forms/PropertyDetailsForms.scala
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ object PropertyDetailsForms {

val propertyDetailsNewValuationForm: Form[PropertyDetailsNewValuation] = Form(
mapping(
"revaluedValue" -> valueValidation.verifying(revaluedValueConstraint)
"revaluedValue" -> valueValidation.verifying(revaluedValueConstraint())
)(PropertyDetailsNewValuation.apply)(PropertyDetailsNewValuation.unapply)
)

Expand Down
2 changes: 0 additions & 2 deletions app/models/PropertyDetailsModels.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import java.time.LocalDate
import play.api.libs.functional.syntax._
import play.api.libs.json._
import play.api.libs.json.Reads._
import play.api.libs.json.Writes._
import uk.gov.hmrc.play.bootstrap.config.ServicesConfig

sealed trait PeriodValidity

Expand Down
3 changes: 1 addition & 2 deletions app/utils/AtedUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
package utils

import config.ApplicationConfig
import models.{IsOwnedBefore2012, IsOwnedBefore2017, IsOwnedBefore2022, NotOwnedBeforePolicyYear, OwnedBeforePolicyYear, _}
import models.{IsOwnedBefore2012, IsOwnedBefore2017, IsOwnedBefore2022, NotOwnedBeforePolicyYear, _}

import java.time.LocalDate
import play.api.mvc.{AnyContent, Request}
import uk.gov.hmrc.play.bootstrap.config.ServicesConfig
import utils.AtedConstants._

import scala.language.postfixOps
Expand Down
6 changes: 4 additions & 2 deletions app/views/propertyDetails/addressLookup.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ <h1 class="govuk-heading-xl">
@govukInput(Input(
label = Label(
content = Text(messages("ated.address-lookup.house-name"))
)
),
autocomplete = Some("address-line1")
).withFormField(searchForm("houseName")
))

@govukInput(Input(
label = Label(
content = Text(messages("ated.address-lookup.postcode"))
),
classes = "govuk-input--width-10"
classes = "govuk-input--width-10",
autocomplete = Some("postal-code")
).withFormField(searchForm("postcode")
))

Expand Down
15 changes: 10 additions & 5 deletions app/views/propertyDetails/propertyDetailsAddress.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,34 +88,39 @@ <h1 class="govuk-heading-xl">
@govukInput(Input(
label = Label(
content = Text(messages("ated.addressProperty.line_1"))
)
),
autocomplete = Some("address-line1")
).withFormField(propertyDetailsForm("line_1")))

@govukInput(Input(
label = Label(
content = Text(messages("ated.addressProperty.line_2"))
)
),
autocomplete = Some("address-line2")
).withFormField(propertyDetailsForm("line_2")))

@govukInput(Input(
label = Label(
content = Text(messages("ated.addressProperty.line_3"))
),
classes = "govuk-!-width-two-thirds"
classes = "govuk-!-width-two-thirds",
autocomplete = Some("address-line3")
).withFormField(propertyDetailsForm("line_3")))

@govukInput(Input(
label = Label(
content = Text(messages("ated.addressProperty.line_4"))
),
classes = "govuk-!-width-two-thirds"
classes = "govuk-!-width-two-thirds",
autocomplete = Some("address-level2")
).withFormField(propertyDetailsForm("line_4")))

@govukInput(Input(
label = Label(
content = Text(messages("ated.addressProperty.postcode"))
),
classes = "govuk-input--width-10"
classes = "govuk-input--width-10",
autocomplete = Some("postal-code")
).withFormField(propertyDetailsForm("postcode")))

@if(!fromConfirmAddressPage) {
Expand Down
15 changes: 10 additions & 5 deletions app/views/subcriptionData/correspondenceAddress.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ <h1 class="govuk-heading-xl">
@formHelper(action = controllers.subscriptionData.routes.CorrespondenceAddressController.submit) {

@input(Input(inputType = "hidden").withFormField(correspondenceAddressForm("addressType")))
@input(Input(label = Label(content = Text(messages("ated.addressLine1")))).withFormField(correspondenceAddressForm("addressLine1")))
@input(Input(label = Label(content = Text(messages("ated.addressLine2")))).withFormField(correspondenceAddressForm("addressLine2")))
@input(Input(label = Label(content = Text(messages("ated.addressLine3"))), classes = "govuk-!-width-two-thirds").withFormField(correspondenceAddressForm("addressLine3")))
@input(Input(label = Label(content = Text(messages("ated.addressLine4"))), classes = "govuk-!-width-two-thirds").withFormField(correspondenceAddressForm("addressLine4")))
@input(Input(label = Label(content = Text(messages("ated.addressLine1"))),
autocomplete = Some("address-line1")).withFormField(correspondenceAddressForm("addressLine1")))
@input(Input(label = Label(content = Text(messages("ated.addressLine2"))),
autocomplete = Some("address-line2")).withFormField(correspondenceAddressForm("addressLine2")))
@input(Input(label = Label(content = Text(messages("ated.addressLine3"))),
autocomplete = Some("address-line3"), classes = "govuk-!-width-two-thirds").withFormField(correspondenceAddressForm("addressLine3")))
@input(Input(label = Label(content = Text(messages("ated.addressLine4"))),
autocomplete = Some("address-level2"), classes = "govuk-!-width-two-thirds").withFormField(correspondenceAddressForm("addressLine4")))
@select(Select(
label = Label(content = Text(messages("ated.country"))),
items = Seq(SelectItem(Some(""), "Select a country")) ++ listOfIsoCode.map {
Expand All @@ -82,7 +86,8 @@ <h1 class="govuk-heading-xl">
text = country)
}
).withFormField(correspondenceAddressForm("countryCode")))
@input(Input(label = Label(content = Text(messages("ated.postcode"))), classes = "govuk-input--width-10").withFormField(correspondenceAddressForm("postalCode")))
@input(Input(label = Label(content = Text(messages("ated.postcode"))),
autocomplete = Some("postal-code"), classes = "govuk-input--width-10").withFormField(correspondenceAddressForm("postalCode")))

@button(Button(content = Text(messages("ated.save-changes"))))

Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import uk.gov.hmrc.versioning.SbtGitVersioning.autoImport.majorVersion
val appName = "ated-frontend"

ThisBuild / majorVersion := 3
ThisBuild / scalaVersion := "2.13.14"
ThisBuild / scalaVersion := "2.13.15"

lazy val appDependencies: Seq[ModuleID] = AppDependencies()
lazy val plugins: Seq[Plugins] = Seq(play.sbt.PlayScala)
Expand Down
4 changes: 2 additions & 2 deletions project/AppDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import play.sbt.PlayImport.*

object AppDependencies {

val bootstrapVersion = "9.0.0"
val bootstrapVersion = "9.5.0"

val compile: Seq[ModuleID] = Seq(
ws,
"uk.gov.hmrc" %% "bootstrap-frontend-play-30" % bootstrapVersion,
"uk.gov.hmrc" %% "play-partials-play-30" % "10.0.0",
"uk.gov.hmrc" %% "domain-play-30" % "10.0.0",
"uk.gov.hmrc" %% "http-caching-client-play-30" % "12.1.0",
"uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "10.5.0"
"uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "11.6.0"
)

val test: Seq[ModuleID] = Seq(
Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
resolvers += "HMRC-open-artefacts-maven2" at "https://open.artefacts.tax.service.gov.uk/maven2"
resolvers += Resolver.url("HMRC-open-artefacts-ivy", url("https://open.artefacts.tax.service.gov.uk/ivy2"))(Resolver.ivyStylePatterns)

addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.22.0")
addSbtPlugin("uk.gov.hmrc" % "sbt-auto-build" % "3.24.0")

addSbtPlugin("uk.gov.hmrc" % "sbt-distributables" % "2.5.0")

addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.3")
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.5")

addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "2.0.12")
addSbtPlugin("org.scoverage" %% "sbt-scoverage" % "2.2.2")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0" exclude("org.scala-lang.modules", "scala-xml_2.12"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import config.ApplicationConfig
import forms.PropertyDetailsForms.{dateFirstOccupiedForm, propertyDetailsNewValuationForm}
import forms.PropertyDetailsForms.propertyDetailsNewValuationForm
import models.StandardAuthRetrievals
import org.jsoup.Jsoup
import org.scalatestplus.mockito.MockitoSugar
Expand Down

0 comments on commit 55de8b6

Please sign in to comment.