From baf826377dba4bbab433485d474708d6597d0091 Mon Sep 17 00:00:00 2001 From: Lee Powell Date: Wed, 18 Sep 2024 13:16:21 +0100 Subject: [PATCH 1/2] VEIOSS-679 | Make submit button disappear on submission of returns --- app/assets/javascripts/app.js | 14 +++++++ .../stylesheets/import-one-stop-shop.css | 39 ++++++++++++++++++- app/views/CheckYourAnswersView.scala.html | 13 ++++++- .../ButtonGroupProcessing.scala.html | 28 +++++++++++++ build.sbt | 2 +- conf/messages.en | 1 + 6 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 app/views/components/ButtonGroupProcessing.scala.html diff --git a/app/assets/javascripts/app.js b/app/assets/javascripts/app.js index f12ee4e5..42e37e0d 100644 --- a/app/assets/javascripts/app.js +++ b/app/assets/javascripts/app.js @@ -106,3 +106,17 @@ if (typeof HMRCAccessibleAutocomplete != 'undefined' && document.querySelector(' } } +function showTheSpinner() { + + const processingWheel = document.getElementById("processing-wheel"); + + //make the spinning wheel visible + processingWheel.removeAttribute("aria-hidden"); + processingWheel.hidden = false; + + //make the elements hidden + document.getElementById("processing-button-group").style.visibility = 'hidden'; + + return false; +} + diff --git a/app/assets/stylesheets/import-one-stop-shop.css b/app/assets/stylesheets/import-one-stop-shop.css index ec36c713..f3a4a9e7 100644 --- a/app/assets/stylesheets/import-one-stop-shop.css +++ b/app/assets/stylesheets/import-one-stop-shop.css @@ -85,4 +85,41 @@ html[data-useragent*='MSIE 10.0'] .flex-container .tile { .autocomplete__dropdown-arrow-down { z-index: 0; pointer-events: none; -} \ No newline at end of file +} + +/* Dynamic spinner for please-wait page within file upload journey */ +.processing-wheel-loader { + border: 12px solid #DEE0E2; + border-radius: 50%; + border-top-color: #005EA5; + width: 50px; + height: 50px; + -webkit-animation: spin 2s linear infinite; + animation: spin 2s linear infinite; +} + +#processing-wheel { + margin-top: -75px; +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + } +} + +@keyframes spin { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +} + +/* End of dynamic spinner */ \ No newline at end of file diff --git a/app/views/CheckYourAnswersView.scala.html b/app/views/CheckYourAnswersView.scala.html index 37ba5be9..4e6b9a28 100644 --- a/app/views/CheckYourAnswersView.scala.html +++ b/app/views/CheckYourAnswersView.scala.html @@ -14,14 +14,14 @@ * limitations under the License. *@ -@import components.ButtonGroup +@import components.ButtonGroupProcessing @import models.etmp.EtmpExclusion @this( layout: templates.Layout, formHelper: FormWithCSRF, govukSummaryList: GovukSummaryList, - button: ButtonGroup, + button: ButtonGroupProcessing, govukButton: GovukButton, govukWarningText: GovukWarningText ) @@ -144,4 +144,13 @@

@messages("error.missing_answers_header")< ) } } + + } \ No newline at end of file diff --git a/app/views/components/ButtonGroupProcessing.scala.html b/app/views/components/ButtonGroupProcessing.scala.html new file mode 100644 index 00000000..921a7394 --- /dev/null +++ b/app/views/components/ButtonGroupProcessing.scala.html @@ -0,0 +1,28 @@ +@* + * 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 uk.gov.hmrc.play.bootstrap.binders.RedirectUrl +@this(govukButton: GovukButton) +@(continueMessage: String, continueUrl: String, period: Period, waypoints: Waypoints)(implicit messages: Messages) +
+ @govukButton( + ButtonViewModel(messages(continueMessage)).withAttribute(("id", "continue")).withAttribute("onclick", "showTheSpinner()") + ) + + + @messages("saveProgress.button") + +
\ No newline at end of file diff --git a/build.sbt b/build.sbt index da4f3c84..0ce78226 100644 --- a/build.sbt +++ b/build.sbt @@ -65,7 +65,7 @@ lazy val root = (project in file(".")) // below line required to force asset pipeline to operate in dev rather than only prod Assets / pipelineStages := Seq(concat, uglify), // only compress files generated by concat - uglify / includeFilter := GlobFilter("application.js") + uglify / includeFilter := GlobFilter("application*.js") ) lazy val testSettings: Seq[Def.Setting[_]] = Seq( diff --git a/conf/messages.en b/conf/messages.en index 60f5c9c3..8fb51f73 100644 --- a/conf/messages.en +++ b/conf/messages.en @@ -13,6 +13,7 @@ site.govuk = GOV.UK site.to = to site.submit = Submit site.warning = Warning +site.processing = We are processing your registration. date.day = Day date.month = Month From 028c0616b442e1416890ec73bbacbb36615a54cc Mon Sep 17 00:00:00 2001 From: Lee Powell Date: Wed, 18 Sep 2024 13:52:32 +0100 Subject: [PATCH 2/2] VEIOSS-679 | Change message and removed play filters headers as deprecated --- conf/application.conf | 2 -- conf/messages.en | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/conf/application.conf b/conf/application.conf index 32eec68e..d6bf3857 100644 --- a/conf/application.conf +++ b/conf/application.conf @@ -22,8 +22,6 @@ play.http.router = prod.Routes play.http.errorHandler = "handlers.ErrorHandler" -play.filters.headers.contentSecurityPolicy = "default-src 'self' 'unsafe-inline' localhost:9000 localhost:9032 localhost:9250 localhost:12345 www.google-analytics.com www.googletagmanager.com" - play.filters.enabled += play.filters.csp.CSPFilter play.modules.enabled += "uk.gov.hmrc.play.bootstrap.HttpClientModule" diff --git a/conf/messages.en b/conf/messages.en index 8fb51f73..d93a3062 100644 --- a/conf/messages.en +++ b/conf/messages.en @@ -13,7 +13,7 @@ site.govuk = GOV.UK site.to = to site.submit = Submit site.warning = Warning -site.processing = We are processing your registration. +site.processing = We are processing your return. date.day = Day date.month = Month