Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MMCA-4882] Bugfix: Fixing double headings #146

Merged
merged 4 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions app/views/cash_account.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@
) {
@cash_account_balance(model)

@h2(msg = "cf.cash-account.detail.payments-heading", id = Some("payments-heading"))

@link("cf.cash-account.detail.csv", cashTransactionsViewModel.downloadUrl, linkId = Some("download-link"), pId = Some("download"))

@for((transaction, index) <- cashTransactionsViewModel.visibleItems.zipWithIndex) {
Expand All @@ -73,7 +71,7 @@
)

@link(
"cf.cash-account.transactions.request.link",
"cf.cash-account.transactions.request.link.previous",
controllers.routes.RequestTransactionsController.onPageLoad().url,
preLinkMessage = Some("cf.cash-account.transactions.request.link.pre"),
pClass = "govuk-body govuk-!-margin-bottom-9",
Expand Down
2 changes: 1 addition & 1 deletion app/views/cash_account_exceeded_threshold.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

@p(
"cf.cash-account-detail.exceeded-threshold",
classes = "govuk-body govuk-!-margin-bottom-0",
classes = "govuk-body govuk-!-margin-bottom-0 govuk-!-margin-top-7",
id = Some("exceeded-threshold")
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
@p(
"cf.cash-account.detail.no-transactions-with-balance.p1",
id = Some("transactions-not-available"),
classes = "govuk-body govuk-!-margin-top-7"
)

@h2(
Expand All @@ -47,7 +48,7 @@
)

@link(
"cf.cash-account.transactions.request.link",
"cf.cash-account.transactions.request.link.previous",
controllers.routes.RequestTransactionsController.onPageLoad().url,
preLinkMessage = Some("cf.cash-account.transactions.request.link.pre"),
pClass = "govuk-body govuk-!-margin-bottom-9",
Expand Down
10 changes: 7 additions & 3 deletions app/views/cash_account_transactions_not_available.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
@cash_account_balance(accountModel)

@if(transactionsTimeout) {
<div class="govuk-inset-text" id="no-transactions-available">
<div class="govuk-inset-text govuk-!-margin-top-7" id="no-transactions-available">
@messages("cf.cash-account.detail.transactions-not-available.first")
<br> <br>
@messages("cf.cash-account.detail.transactions-not-available.second")
Expand All @@ -54,14 +54,18 @@
@h2(msg = "cf.cash-account.transactions.request.link.heading", id = Some("missing-documents-guidance-heading"))

@link(
"cf.cash-account.transactions.request.link",
"cf.cash-account.transactions.request.link.previous",
controllers.routes.RequestTransactionsController.onPageLoad().url,
preLinkMessage = Some("cf.cash-account.transactions.request.link.pre"),
pClass = "govuk-body govuk-!-margin-bottom-9",
linkSentence = true
)
} else {
@p("cf.cash-account.detail.transactions-not-available", id = Some("no-transactions-available"))
@p(
"cf.cash-account.detail.transactions-not-available",
id = Some("no-transactions-available"),
classes = "govuk-body govuk-!-margin-top-7"
)
}

@h2(
Expand Down
6 changes: 3 additions & 3 deletions app/views/components/cash_account_balance.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
classes = "govuk-label govuk-label--l govuk-!-margin-bottom-7 govuk-!-margin-top-2",
id = Some("balance-available")
)
@p(
"cf.cash-account.detail.last-transactions",
classes="govuk-label govuk-label--m govuk-!-margin-bottom-7",
@h2(
msg = "cf.cash-account.detail.last-transactions",
classes="govuk-heading-m",
id = Some("last-transactions")
)
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/components/h2Inner.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

@(
msg: String,
innerMsg: String,
innerMsg: String = emptyString,
id: Option[String] = None,
classes: String = "govuk-heading-m"
)(implicit messages: Messages)
Expand Down
1 change: 1 addition & 0 deletions conf/messages.cy
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ cf.cash-account.transactions.request.support.link=cysylltwch â’r llinell gymo
cf.cash-account.transactions.request.link.pre=Gallwch
cf.cash-account.transactions.request.link.post=trwy chwilio o ystod dyddiad byrrach.
cf.cash-account.transactions.request.link=chwilio am a lawrlwytho’ch trafodion fel ffeil CSV
cf.cash-account.transactions.request.link.previous=chwilio am a lawrlwytho unrhyw drafodion blaenorol fel ffeil CSV
cf.cash-account.transactions.request.title=Pa drafodion cyfrif arian parod sydd eu hangen arnoch?
cf.cash-account.transactions.request.legend.hidden.start=pa ddyddiad dechrau sydd ei angen arnoch ar gyfer trafodion cyfrif arian parod?
cf.cash-account.transactions.request.legend.hidden.end=pa ddyddiad dod i ben sydd ei angen arnoch ar gyfer trafodion cyfrif arian parod?
Expand Down
1 change: 1 addition & 0 deletions conf/messages.en
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ cf.cash-account.transactions.request.support.link=contact the HMRC accounting ce
cf.cash-account.transactions.request.link.pre=You can
cf.cash-account.transactions.request.link.post=by searching from a shorter date range.
cf.cash-account.transactions.request.link=search and download your transactions as a CSV file
cf.cash-account.transactions.request.link.previous=search and download any previous transactions as a CSV file
cf.cash-account.transactions.request.title=Which cash account transactions do you need?
cf.cash-account.transactions.request.legend.hidden.start=what start date do you need cash account transactions?
cf.cash-account.transactions.request.legend.hidden.end=what end date do you need cash account transactions?
Expand Down
6 changes: 3 additions & 3 deletions test/controllers/CashAccountControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ class CashAccountControllerSpec extends SpecBase {
contentAsString(result) mustEqual view(CashAccountViewModel(
eori, newCashAccount))(request, messages, appConfig).toString()

contentAsString(result) must include regex "search and download your transactions as a CSV file"
contentAsString(result) must include regex "search and download any previous transactions as a CSV file"
}
}

Expand Down Expand Up @@ -235,7 +235,7 @@ class CashAccountControllerSpec extends SpecBase {
contentAsString(result) mustEqual view(CashAccountViewModel(
eori, cashAccount))(request, messages, appConfig).toString()

contentAsString(result) must include regex "search and download your transactions as a CSV file"
contentAsString(result) must include regex "search and download any previous transactions as a CSV file"
}
}

Expand Down Expand Up @@ -291,7 +291,7 @@ class CashAccountControllerSpec extends SpecBase {
val request = FakeRequest(GET, routes.CashAccountController.showAccountDetails(Some(1)).url)
val result = route(app, request).value

contentAsString(result) must include regex "search and download your transactions as a CSV file"
contentAsString(result) must include regex "search and download any previous transactions as a CSV file"
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/controllers/CashAccountV2ControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class CashAccountV2ControllerSpec extends SpecBase {
contentAsString(result) mustEqual view(CashAccountViewModel(
eori, newCashAccount))(request, messages, appConfig).toString()

contentAsString(result) must include regex "search and download your transactions as a CSV file"
contentAsString(result) must include regex "search and download any previous transactions as a CSV file"
}
}

Expand Down Expand Up @@ -236,7 +236,7 @@ class CashAccountV2ControllerSpec extends SpecBase {
contentAsString(result) mustEqual view(CashAccountViewModel(
eori, cashAccount))(request, messages, appConfig).toString()

contentAsString(result) must include regex "search and download your transactions as a CSV file"
contentAsString(result) must include regex "search and download any previous transactions as a CSV file"
}
}

Expand Down
13 changes: 12 additions & 1 deletion test/viewmodels/CashAccountV2ViewModelSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ package viewmodels
import play.api.Application
import play.api.i18n.Messages
import utils.SpecBase
import models.{AccountStatusOpen, CDSCashBalance, CashAccount, CashAccountViewModel, CashDailyStatement, CashTransactions, Declaration, Payment, Transaction, Withdrawal}
import models.{
AccountStatusOpen,
CDSCashBalance,
CashAccount,
CashAccountViewModel,
CashDailyStatement,
CashTransactions,
Declaration,
Payment,
Transaction,
Withdrawal
}
import config.AppConfig
import org.scalatest.Assertion
import play.twirl.api.HtmlFormat
Expand Down
2 changes: 1 addition & 1 deletion test/views/CashAccountNoTransactionsWithBalanceSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class CashAccountNoTransactionsWithBalanceSpec extends ViewTestHelper {
private def shouldContainRequestTransactionsLink(implicit view: Document): Assertion = {
val linkElement: String = view.getElementsByClass("govuk-!-margin-bottom-9").html()

linkElement.contains(messages("cf.cash-account.transactions.request.link")) mustBe true
linkElement.contains(messages("cf.cash-account.transactions.request.link.previous")) mustBe true

linkElement.contains(messages("cf.cash-account.transactions.request.link.pre")) mustBe true

Expand Down
4 changes: 2 additions & 2 deletions test/views/CashAccountTransactionsNotAvailableSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class CashAccountTransactionsNotAvailableSpec extends ViewTestHelper {
shouldContainPaymentSection

checkUnavailabilityOfTransactionTimeOutSection

shouldContainHelpAndSupportSection
}
}
Expand Down Expand Up @@ -117,7 +117,7 @@ class CashAccountTransactionsNotAvailableSpec extends ViewTestHelper {
private def shouldContainLinkElement(implicit view: Document): Assertion = {
val linkElement: String = view.getElementsByClass("govuk-!-margin-bottom-9").html()

linkElement.contains(messages("cf.cash-account.transactions.request.link")) mustBe true
linkElement.contains(messages("cf.cash-account.transactions.request.link.previous")) mustBe true

linkElement.contains(messages("cf.cash-account.transactions.request.link.pre")) mustBe true

Expand Down