Skip to content

Commit

Permalink
PLATUI-2588: Updated hmrc-frontend and TimeoutDialog (#261)
Browse files Browse the repository at this point in the history
PLATUI-2588: Updated hmrc-frontend and TimeoutDialog
  • Loading branch information
JoPintoPaul committed Nov 3, 2023
1 parent 33bc604 commit 561c0e0
Show file tree
Hide file tree
Showing 17 changed files with 112 additions and 10 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
For compatibility information see `govukFrontendVersion` and `hmrcFrontendVersion` in
[LibDependencies](project/LibDependencies.scala)

## [7.25.0] - 2023-11-03

### Changed

- Uplifted version of `hmrc-frontend` to `5.53.0`
- Updated `TimeoutDialog` to reflect the new experimental feature of `timeout-dialog`

### Compatible with

- [hmrc/hmrc-frontend v5.53.0](https://github.com/hmrc/hmrc-frontend/releases/tag/v5.53.0)
- [alphagov/govuk-frontend v4.7.0](https://github.com/alphagov/govuk-frontend/releases/tag/v4.7.0)

## [7.24.0] - 2023-10-30

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Add timeout-dialog hideSignOutButton

* Status: accepted
* Date: 2023-11-01

Technical Story: PLATUI-2588

## Context and Problem Statement

In the hmrc-frontend Github repository, a PR was raised by the DWP Access to Work team. They wanted to use the
`timeout-dialog` from hmrc-frontend and be able to disable the sign out button or link, as their service doesn't have log
in functionality. More context for this request is on the original Github issue: https://github.com/hmrc/hmrc-frontend/issues/316

In discussion with the Design Resources team, it was agreed that:
1. The `hideSignOutButton` functionality be included in the `hmrc-frontend` library for cross-Government teams with a
specific use case
1. The `hideSignOutButton` would NOT be documented or encouraged to HMRC MDTP microservices, because there has not been
a demonstrated need for this change on HMRC. Further research would be required before publicising this a Production
feature for HMRC.

## Decision Drivers

* The desire to work collaboratively cross-Government, and make our libraries useful to other departments
* The need to not introduce functionality into the HMRC production libraries that has not been tested for HMRC users

## Considered Options

* Do not implement `hideSignOutButton` in `hmrc-frontend`
* Implement `hideSignOutButton` in `hmrc-frontend` via `timout-dialog`, but not in `play-frontend-hmrc` via `HmrcTimoutDialog.scala.html`
* Implement `hideSignOutButton` in both `hmrc-frontend` via `timout-dialog`, and `play-frontend-hmrc` via `HmrcTimoutDialog.scala.html`

## Decision Outcome

Chosen option: "Implement `hideSignOutButton` in both `hmrc-frontend` via `timout-dialog`, and `play-frontend-hmrc` via
`HmrcTimoutDialog.scala.html`". Chosen because we want to include the feature in `hmrc-frontend` to support other
Government departments with a proven use case and need, but our design principles and testing strategy begin to break
down when `hmrc-fronted` and `play-frontend-hmrc` diverge. Therefore, this will be added as an undocumented feature
so as not to encourage its use for HMRC production microservices

### Positive Consequences

* The `timeout-dialog` in `hmrc-frontend` will be more appropriate to cross-Government departments, reducing a need for
forks or other code duplication
* The `HmrcTimeoutDialog` component will remain aligned with `timeout-dialog` but we will not be publicising the new
feature as part of `play-frontend-hmrc`.

### Negative Consequences

* There will be an undocumented and untested feature in `play-frontend-hmrc`. This ADR is intended to document the
reasoning behind this design decision.

## Links

* Github issue: https://github.com/hmrc/hmrc-frontend/issues/316
* `hmrc-frontend` release implementing this change: https://github.com/hmrc/hmrc-frontend/releases/tag/v5.52.0
1 change: 1 addition & 0 deletions docs/maintainers/adr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* [ADR-0014](0014-keep-current-package-structure-and-naming-conventions.md) - Keep current package structure and naming conventions
* [ADR-0015](0015-introduction-of-implicit-conversions.md) - Introduction of implicit conversions
* [ADR-0016](0016-use-implicit-messages-to-drive-welsh-translations-in-govuk-twirl-components.md) - Use implicit messages to drive Welsh translations in GOVUK Twirl components
* [ADR-0017](0017-add-timeout-dialog-hide-sign-out-button.md) - Add timeout-dialog hideSignOutButton

<!-- adrlogstop -->

2 changes: 1 addition & 1 deletion project/LibDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import sbt.ModuleID

object LibDependencies {
val govukFrontendVersion: String = "4.7.0"
val hmrcFrontendVersion: String = "5.51.0"
val hmrcFrontendVersion: String = "5.53.0"
val playLanguageVersion: String = "6.2.0"

val compile: Seq[ModuleID] = dependencies(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ case class TimeoutDialog(
messageSuffix: Option[String] = None,
keepAliveButtonText: Option[String] = None,
signOutButtonText: Option[String] = None,
synchroniseTabs: Boolean = false
synchroniseTabs: Option[Boolean] = None,
hideSignOutButton: Option[Boolean] = None
)

object TimeoutDialog {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@
data-keep-alive-button-text="@keepAliveButtonText"
data-sign-out-button-text="@signOutButtonText"
data-synchronise-tabs="@synchroniseTabs"
data-hide-sign-out-button="@hideSignOutButton"
/>
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@
keepAliveButtonText = keepAliveButtonText,
signOutButtonText = signOutButtonText,
language = Some(messages.lang.code),
synchroniseTabs = synchroniseTabs.getOrElse(timeoutDialogConfig.enableSynchroniseTabs)
synchroniseTabs = synchroniseTabs.orElse(Some(timeoutDialogConfig.enableSynchroniseTabs))
))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.51.0
5.53.0
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"messageSuffix" : "there is a suffix for the message",
"keepAliveButtonText" : "keepAliveButtonText",
"signOutButtonText" : "signOutButtonText",
"synchroniseTabs" : false
"synchroniseTabs" : false,
"hideSignOutButton" : false
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
data-message-suffix="there is a suffix for the message"
data-keep-alive-button-text="keepAliveButtonText"
data-sign-out-button-text="signOutButtonText"
data-synchronise-tabs="false"/>
data-synchronise-tabs="false"
data-hide-sign-out-button="false"/>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
data-message-suffix=""
data-keep-alive-button-text=""
data-sign-out-button-text=""
data-synchronise-tabs="false"/>
data-synchronise-tabs="false"
data-hide-sign-out-button=""/>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name" : "hmrcTimeoutDialog"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"timeout" : 75,
"countdown" : 74,
"keepAliveUrl" : "?abc=def",
"signOutUrl" : "?ghi=jkl",
"hideSignOutButton" : true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

<meta name="hmrc-timeout-dialog"
content="hmrc-timeout-dialog"
data-language=""
data-timeout="75"
data-countdown="74"
data-keep-alive-url="?abc=def"
data-sign-out-url="?ghi=jkl"
data-timeout-url=""
data-title=""
data-message=""
data-message-suffix=""
data-keep-alive-button-text=""
data-sign-out-button-text=""
data-synchronise-tabs=""
data-hide-sign-out-button="true"/>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
data-message-suffix=""
data-keep-alive-button-text=""
data-sign-out-button-text=""
data-synchronise-tabs="false"/>
data-synchronise-tabs="false"
data-hide-sign-out-button=""/>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
data-message-suffix=""
data-keep-alive-button-text=""
data-sign-out-button-text=""
data-synchronise-tabs="true"/>
data-synchronise-tabs="true"
data-hide-sign-out-button=""/>
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
data-message-suffix=""
data-keep-alive-button-text=""
data-sign-out-button-text=""
data-synchronise-tabs="false"/>
data-synchronise-tabs="false"
data-hide-sign-out-button=""/>

0 comments on commit 561c0e0

Please sign in to comment.