Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PLATUI-2942: Upgrade library to govuk-frontend v5.3.0 (#292)
* PLATUI-2942: Release new version of play-frontend-hmrc that has govuk-frontend 5.3.0 --------- Co-authored-by: david.ellam <ellamdav@users.noreply.github.com>
- Loading branch information
1 parent
072fcda
commit 4eee1ee
Showing
248 changed files
with
847 additions
and
438 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docs/maintainers/adr/0021-defer-inclusion-of-password-field.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Defer Inclusion of Password Field from govuk-frontend v5.3.0 | ||
|
||
* Status: accepted | ||
* Date: 2024-08-04 | ||
|
||
## Context and Problem Statement | ||
|
||
With the release of govuk-frontend v5.3.0, which includes a password field, we are considering whether to integrate this feature into our frontend library. Given that authentication for most services is handled by a central service (e.g., GG or the upcoming OLFG), the need for a library component for password fields may not be widespread. There are also considerations around the engineering cost of creating and maintaining such a component. | ||
|
||
## Decision Drivers | ||
|
||
* Centralized authentication services reducing the need for a password field component | ||
* Engineering cost of maintenance and development | ||
* Potential future demand for this component | ||
|
||
## Considered Options | ||
|
||
* Immediately include the password field feature from govuk-frontend v5.3.0 | ||
* Defer the inclusion of the password field feature until there is a demonstrated need | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "Defer the inclusion of the password field feature until there is a demonstrated need", because it allows us to focus on components with a clear demand and reduces the maintenance burden. This decision is reversible, and we remain open to revisiting it should a significant need for this component arise from our services. | ||
|
||
### Positive Consequences | ||
|
||
* Keeps the library focused on widely used components | ||
* Reduces unnecessary maintenance and development work | ||
* Flexible approach that can adapt to future demands | ||
|
||
### Negative Consequences | ||
|
||
* Teams needing the password field immediately may have to implement their own solutions | ||
|
||
## Pros and Cons of the Options | ||
|
||
### Immediately include the password field feature | ||
|
||
* Good, because it provides immediate feature completeness. | ||
* Bad, because it likely adds an unused feature for most teams, increasing maintenance overhead. | ||
|
||
### Defer the inclusion of the password field feature | ||
|
||
* Good, because it aligns our resources with current needs and reduces overhead. | ||
* Good, because it leaves room to adapt based on future demand. | ||
* Bad, because teams with immediate needs must find alternative solutions. | ||
|
||
## Links | ||
|
||
* [govuk-frontend v5.3.0 Release Notes](https://github.com/alphagov/govuk-frontend/releases/tag/v5.3.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...lay-30/src/main/scala/uk/gov/hmrc/govukfrontend/views/viewmodels/input/InputWrapper.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright 2024 HM Revenue & Customs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package uk.gov.hmrc.govukfrontend.views.viewmodels.input | ||
|
||
import play.api.libs.functional.syntax._ | ||
import play.api.libs.json._ | ||
|
||
case class InputWrapper( | ||
classes: Option[String] = None, | ||
attributes: Map[String, String] = Map.empty | ||
) | ||
|
||
object InputWrapper { | ||
|
||
val empty: InputWrapper = InputWrapper() | ||
|
||
implicit def jsonReads: Reads[InputWrapper] = | ||
( | ||
(__ \ "classes").readNullable[String] and | ||
(__ \ "attributes").readWithDefault[Map[String, String]](Map.empty) | ||
)(InputWrapper.apply _) | ||
|
||
implicit def jsonWrites: OWrites[InputWrapper] = | ||
( | ||
(__ \ "classes").writeNullable[String] and | ||
(__ \ "attributes").write[Map[String, String]] | ||
)(unlift(InputWrapper.unapply)) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.