From 26e905d579ffc3aa64a6b4b32c51ce24e39d9eff Mon Sep 17 00:00:00 2001 From: Sinimol Babu Date: Mon, 18 Nov 2024 10:07:11 +0000 Subject: [PATCH] ADR-1416: Removes radio button for single spr selection (#213) * ADR-1416 Removes radio button for single spr selection * ADR-1416 css constant added --- .../TellUsAboutMultipleSPRRateView.scala.html | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/app/views/declareDuty/TellUsAboutMultipleSPRRateView.scala.html b/app/views/declareDuty/TellUsAboutMultipleSPRRateView.scala.html index e9613e80..eef9f282 100644 --- a/app/views/declareDuty/TellUsAboutMultipleSPRRateView.scala.html +++ b/app/views/declareDuty/TellUsAboutMultipleSPRRateView.scala.html @@ -57,16 +57,31 @@ content = Text(messages("tellUsAboutMultipleSPRRate.warning", messages(s"return.regime.$regime"))) )) - @govukRadios( - RadiosViewModel( - field = form("volumesWithRate.taxType"), - fieldset = FieldsetViewModel(LegendViewModel(messages("tellUsAboutMultipleSPRRate.radioHeading", messages(s"return.regime.$regime"))).withSize(LegendSize.Medium)), - items = rateBandRadioItems, - errorMessageField = form("volumesWithRate_taxType") + @if(rateBandRadioItems.size > 1){ + @govukRadios( + RadiosViewModel( + field = form("volumesWithRate.taxType"), + fieldset = FieldsetViewModel(LegendViewModel(messages("tellUsAboutMultipleSPRRate.radioHeading", messages(s"return.regime.$regime"))).withSize(LegendSize.Medium)), + items = rateBandRadioItems, + errorMessageField = form("volumesWithRate_taxType") + ) ) - ) + @subHeading(messages(s"tellUsAboutMultipleSPRRate.h3.$regime"), classes = Css.headingMCssClass) + } - @subHeading(messages(s"tellUsAboutMultipleSPRRate.h3.$regime"), classes = Css.headingMCssClass) + @if(rateBandRadioItems.size == 1){ + @subHeading(rateBandRadioItems.head.content.asHtml.toString(), classes = Css.headingMCssClass) + + @govukInput( + InputViewModel( + field = form("volumesWithRate"), + key = "taxType", + label = LabelViewModel(Text("")), + errorMessageField = form("volumesWithRate_taxType"), + value = rateBandRadioItems.head.value + ).hidden + ) + } @govukInput( InputViewModel(