Skip to content

Commit

Permalink
Updating NCTS exit survey
Browse files Browse the repository at this point in the history
  • Loading branch information
lewishay committed Apr 2, 2024
1 parent 9904c99 commit c8f106a
Show file tree
Hide file tree
Showing 15 changed files with 185 additions and 152 deletions.
4 changes: 2 additions & 2 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
$govuk-assets-path: "/new-computerised-transit-system-service-availability/assets/lib/govuk-frontend/govuk/assets/";
$govuk-assets-path: "/new-computerised-transit-system-service-availability/assets/lib/govuk-frontend/dist/govuk/assets/";
$hmrc-assets-path: "/new-computerised-transit-system-service-availability/assets/lib/hmrc-frontend/hmrc/";
@import "lib/hmrc-frontend/hmrc/all";
@import "lib/govuk-frontend/govuk/all";
@import "lib/govuk-frontend/dist/govuk/all";

// Components
@import "components/_typography";
Expand Down
17 changes: 10 additions & 7 deletions app/views/DowntimeHistoryView.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ <h2 class="govuk-heading-m">@messages("service.downtime.history.h2")</h2>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-row govuk-!-margin-bottom-6">
<div class="govuk-grid-column-full">
<h2 class="govuk-heading-l">@messages("service.availability.related.links")</h2>

Expand All @@ -71,12 +71,15 @@ <h2 class="govuk-heading-l">@messages("service.availability.related.links")</h2>
</a>
</li>
</ul>

<p class="govuk-body">
<a class="govuk-link" href="@appConfig.feedbackFrontendUrl">@messages("exitSurvey.p1")</a>
@messages("exitSurvey.p2")
</p>

</div>
</div>

<div id="exit-survey" class="govuk-!-margin-bottom-8">
<h2 class="govuk-heading-m">@messages("exitSurvey.heading")</h2>
<p class="govuk-body">@messages("exitSurvey.p1")</p>
<p class="govuk-body">
<a class="govuk-link" href="@appConfig.feedbackFrontendUrl">@messages("exitSurvey.link")</a>
@messages("exitSurvey.p2")
</p>
</div>
}
17 changes: 10 additions & 7 deletions app/views/PlannedDowntime.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ <h2 class="govuk-heading-m">@messages("planned-downtime.temp.h2")</h2>
<p class="govuk-body">@messages("planned-downtime.temp.p3")</p>


<div class="govuk-grid-row">
<div class="govuk-grid-row govuk-!-margin-bottom-6">
<div class="govuk-grid-column-full">
<h2 class="govuk-heading-l">@messages("service.availability.related.links")</h2>

Expand All @@ -60,12 +60,15 @@ <h2 class="govuk-heading-l">@messages("service.availability.related.links")</h2>
</a>
</li>
</ul>

<p class="govuk-body">
<a class="govuk-link" href="@appConfig.feedbackFrontendUrl">@messages("exitSurvey.p1")</a>
@messages("exitSurvey.p2")
</p>

</div>
</div>

<div id="exit-survey" class="govuk-!-margin-bottom-8">
<h2 class="govuk-heading-m">@messages("exitSurvey.heading")</h2>
<p class="govuk-body">@messages("exitSurvey.p1")</p>
<p class="govuk-body">
<a class="govuk-link" href="@appConfig.feedbackFrontendUrl">@messages("exitSurvey.link")</a>
@messages("exitSurvey.p2")
</p>
</div>
}
17 changes: 10 additions & 7 deletions app/views/ServiceAvailability.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ <h1 class="govuk-heading-l">@messages("service.availability.heading")</h1>
)
</div>
</div>
<div class="govuk-grid-row">
<div class="govuk-grid-row govuk-!-margin-bottom-6">
<div class="govuk-grid-column-full">
<h2 class="govuk-heading-l">@messages("service.availability.related.links")</h2>

Expand All @@ -333,12 +333,15 @@ <h2 class="govuk-heading-l">@messages("service.availability.related.links")</h2>
</a>
</li>
</ul>

<p class="govuk-body">
<a class="govuk-link" href="@appConfig.feedbackFrontendUrl">@messages("exitSurvey.p1")</a>
@messages("exitSurvey.p2")
</p>

</div>
</div>

<div id="exit-survey" class="govuk-!-margin-bottom-8">
<h2 class="govuk-heading-m">@messages("exitSurvey.heading")</h2>
<p class="govuk-body">@messages("exitSurvey.p1")</p>
<p class="govuk-body">
<a class="govuk-link" href="@appConfig.feedbackFrontendUrl">@messages("exitSurvey.link")</a>
@messages("exitSurvey.p2")
</p>
</div>
}
24 changes: 20 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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.
*/

import play.sbt.routes.RoutesKeys
import sbt.Def
import scoverage.ScoverageKeys
Expand All @@ -12,9 +28,9 @@ ThisBuild / majorVersion := 0
lazy val root = (project in file("."))
.enablePlugins(PlayScala, SbtDistributablesPlugin)
.disablePlugins(JUnitXmlReportPlugin) // Required to prevent https://github.com/scalatest/scalatest/issues/1427
.settings(DefaultBuildSettings.scalaSettings: _*)
.settings(DefaultBuildSettings.defaultSettings(): _*)
.settings(inConfig(Test)(testSettings): _*)
.settings(DefaultBuildSettings.scalaSettings *)
.settings(DefaultBuildSettings.defaultSettings() *)
.settings(inConfig(Test)(testSettings) *)
.settings(ThisBuild / useSuperShell := false)
.settings(
name := appName,
Expand Down Expand Up @@ -55,7 +71,7 @@ lazy val root = (project in file("."))
scalacOptions += "-Wconf:cat=unused-imports&src=html/.*:s"
)

lazy val testSettings: Seq[Def.Setting[_]] = Seq(
lazy val testSettings: Seq[Def.Setting[?]] = Seq(
fork := true,
javaOptions ++= Seq(
"-Dconfig.resource=test.application.conf"
Expand Down
1 change: 0 additions & 1 deletion conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ play.http.errorHandler = "handlers.ErrorHandler"
play.modules.enabled += "uk.gov.hmrc.play.bootstrap.HttpClientModule"
play.modules.enabled += "config.Module"

play.filters.enabled += "uk.gov.hmrc.play.bootstrap.frontend.filters.SessionIdFilter"
play.filters.enabled += play.filters.csp.CSPFilter

play.i18n.langs = ["en"]
Expand Down
81 changes: 10 additions & 71 deletions conf/logback-test.xml
Original file line number Diff line number Diff line change
@@ -1,81 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/ncts-frontend.log</file>
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n</pattern>
</encoder>
</appender>
<statusListener class="ch.qos.logback.core.status.NopStatusListener" />

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] rid=[%X{X-Request-ID}] user=[%X{Authorization}] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n</pattern>
</encoder>
</appender>

<appender name="STDOUT_IGNORE_NETTY" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>%date{ISO8601} level=[%level] logger=[%logger] thread=[%thread] rid=[not-available] user=[not-available] message=[%message] %replace(exception=[%xException]){'^exception=\[\]$',''}%n</pattern>
</encoder>
</appender>

<appender name="ACCESS_LOG_FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/access.log</file>
<encoder>
<pattern>%message%n</pattern>
</encoder>
</appender>

<appender name="CONNECTOR_LOG_FILE" class="ch.qos.logback.core.FileAppender">
<file>logs/connector.log</file>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%message%n</pattern>
<pattern>%d{HH:mm:ss.SSS} [%-5level] %logger{15} - %msg%n%rEx</pattern>
<immediateFlush>false</immediateFlush>
</encoder>
</appender>

<logger name="accesslog" level="INFO" additivity="false">
<appender-ref ref="ACCESS_LOG_FILE" />
</logger>

<logger name="com.ning.http.client.providers.netty" additivity="false">
<appender-ref ref="STDOUT_IGNORE_NETTY" />
</logger>
<logger name="uk.gov.hmrc.play.bootstrap.audit.DisabledDatastreamMetricsProvider" level="OFF"/>
<logger name="uk.gov.hmrc.play.audit.DefaultAuditConnector" level="OFF"/>

<logger name="com.google.inject" level="INFO"/>

<logger name="uk.gov" level="INFO"/>

<logger name="application" level="DEBUG"/>

<logger name="org.asynchttpclient.netty" level="INFO"/>
<logger name="io.netty.buffer" level="INFO"/>
<logger name="play.core.netty" level="INFO"/>

<logger name="uk.gov" level="INFO"/>

<logger name="reactivemongo.core" level="INFO"/>
<logger name="akka" level="INFO"/>
<logger name="play" level="INFO"/>
<logger name="org.jose4j" level="INFO"/>
<logger name="class org.jose4j" level="INFO"/>

<logger name="javax.management" level="INFO"/>

<logger name="org.eclipse.jetty" level="INFO"/>

<logger name="org.apache.http" level="INFO"/>

<logger name="org.jboss" level="INFO"/>
<logger name="io.netty" level="INFO"/>
<logger name="sun.net.www.protocol.http" level="INFO"/>

<logger name="connector" level="TRACE">
<appender-ref ref="STDOUT"/>
</logger>

<root level="INFO">
<appender-ref ref="FILE"/>
<appender-ref ref="STDOUT"/>
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>

</configuration>
6 changes: 4 additions & 2 deletions conf/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -178,5 +178,7 @@ service.downtime.history.related.links.service.availability=Service availability
service.downtime.history.related.links.planned.downtime=Planned downtime


exitSurvey.p1 = What do you think of this service?
exitSurvey.p2 = (takes 30 seconds)
exitSurvey.heading = Before you go
exitSurvey.p1 = Your feedback helps us make our service better.
exitSurvey.link = Take a short survey
exitSurvey.p2 = to share your feedback on this service.
4 changes: 2 additions & 2 deletions it/test/controllers/PlannedDowntimeControllerISpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package test.controllers

import com.typesafe.config.ConfigFactory
import org.scalatest.time.SpanSugar.convertIntToGrainOfTime
import play.api.Configuration
import play.api.{Application, Configuration}
import play.api.http.Status.OK
import play.api.inject.guice.GuiceApplicationBuilder
import test.utils.SpecCommonHelper
Expand All @@ -28,7 +28,7 @@ import scala.concurrent.Await

class PlannedDowntimeControllerISpec extends SpecCommonHelper {

override implicit lazy val app = {
override implicit lazy val app: Application = {

val downtimeConfig = ConfigFactory.parseFile(new File("it/config/planned-downtime.conf"))

Expand Down
28 changes: 22 additions & 6 deletions project/AppDependencies.scala
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
import sbt._
/*
* 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.
*/

import sbt.*

object AppDependencies {

val bootstrapVersion = "8.4.0"
val bootstrapVersion = "8.5.0"

val compile: Seq[ModuleID] = Seq(
play.sbt.PlayImport.ws,
"uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "8.4.0",
"uk.gov.hmrc" %% "play-frontend-hmrc-play-30" % "9.4.0",
"uk.gov.hmrc" %% "bootstrap-frontend-play-30" % bootstrapVersion
)

val test: Seq[ModuleID] = Seq(
"org.jsoup" % "jsoup" % "1.15.4",
"uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion
"org.jsoup" % "jsoup" % "1.15.4",
"uk.gov.hmrc" %% "bootstrap-test-play-30" % bootstrapVersion

).map(_ % "test")
).map(_ % Test)

val it: Seq[ModuleID] = Seq()

Expand Down
18 changes: 17 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* 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.
*/

resolvers += "HMRC-open-artefacts-maven" 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"))(
Expand All @@ -17,7 +33,7 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")

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

addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.1")
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.2")

addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")

Expand Down
2 changes: 1 addition & 1 deletion scalastyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<check level="warning" class="org.scalastyle.file.HeaderMatchesChecker" enabled="true">
<parameters>
<parameter name="header"><![CDATA[/*
* Copyright 2022 HM Revenue & Customs
* 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.
Expand Down
24 changes: 18 additions & 6 deletions test/views/DowntimeHistoryViewSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,24 @@ class DowntimeHistoryViewSpec extends SpecBase with Injecting {
document.select("h1").first().text() mustBe messages("service.downtime.history.heading")
}

"should have an exit survey link" in {
document
.body()
.select("#main-content > div:nth-child(3) > div > p > a")
.first()
.attr("href") mustBe feedbackFrontendUrl
"should have an exit survey" - {

"with the correct heading" in {
document.select("#exit-survey > h2").text() mustBe messages("exitSurvey.heading")
}

"with the correct first paragraph" in {
document.select("#exit-survey > p:nth-of-type(1)").text() mustBe messages("exitSurvey.p1")
}

"with the correct second paragraph" in {
document.select("#exit-survey > p:nth-of-type(2)").text() mustBe
messages("exitSurvey.link") + " " + messages("exitSurvey.p2")
}

"with the correct link" in {
document.select("#exit-survey > p > a").attr("href") mustBe feedbackFrontendUrl
}
}

"should have a get help link" in {
Expand Down
Loading

0 comments on commit c8f106a

Please sign in to comment.