From 397d1810bbc82179782c31414d975f2a7933abfb Mon Sep 17 00:00:00 2001 From: David Flynn <128475768+davidfes@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:12:32 +0000 Subject: [PATCH] ADR-1061 All css classes and business constant values to be put in Constants file (#205) * ADR-1061 constants refactor * ADR-1061 Various fixes * ADR-1227 Fix test data * ADR-1061 Fix link CSS --- app/config/Constants.scala | 152 ++++++++++++++++-- ...ustmentRepackagedTaxTypeFormProvider.scala | 4 +- ...llProducerReliefDutyRateFormProvider.scala | 11 +- .../AdjustmentTaxTypeFormProvider.scala | 4 +- .../OverDeclarationReasonFormProvider.scala | 8 +- .../UnderDeclarationReasonFormProvider.scala | 8 +- .../WhenDidYouPayDutyFormProvider.scala | 7 +- .../DutySuspendedBeerFormProvider.scala | 25 ++- .../DutySuspendedCiderFormProvider.scala | 25 ++- ...ySuspendedOtherFermentedFormProvider.scala | 22 ++- .../DutySuspendedSpiritsFormProvider.scala | 31 +++- .../DutySuspendedWineFormProvider.scala | 25 ++- .../AdjustmentVolumesAndRateFormatter.scala | 2 +- .../mappings/AdjustmentVolumesFormatter.scala | 2 +- .../SpoiltVolumesAndDutyFormatter.scala | 10 +- .../mappings/VolumesAndRateFormatter.scala | 2 +- app/forms/mappings/VolumesFormatter.scala | 2 +- .../AlcoholUsedFormProvider.scala | 27 ++-- .../DeclareQuarterlySpiritsFormProvider.scala | 1 - .../DeclareSpiritsTotalFormProvider.scala | 9 +- ...thyleneGasOrMolassesUsedFormProvider.scala | 24 +-- .../GrainsUsedFormProvider.scala | 47 +++--- .../OtherIngredientsUsedFormProvider.scala | 28 ++-- .../OtherMaltedGrainsFormProvider.scala | 31 ++-- .../OtherSpiritsProducedFormProvider.scala | 11 +- .../SpiritTypeFormProvider.scala | 1 - .../spiritsQuestions/WhiskyFormProvider.scala | 16 +- app/models/DutyCalculation.scala | 3 + app/viewmodels/InputWidth.scala | 28 ++-- app/viewmodels/LabelSize.scala | 10 +- app/viewmodels/LegendSize.scala | 10 +- .../AdjustmentListSummaryHelper.scala | 16 +- ...verUnderDeclarationCalculationHelper.scala | 3 +- .../DutyDueForThisReturnHelper.scala | 30 ++-- .../declareDuty/DutyCalculationHelper.scala | 15 +- .../HowMuchDoYouNeedToDeclareSummary.scala | 8 +- .../declareDuty/MultipleSPRListHelper.scala | 18 +-- .../declareDuty/MultipleSPRListSummary.scala | 6 +- .../TellUsAboutSingleSPRRateSummary.scala | 7 +- app/viewmodels/govuk/ButtonFluency.scala | 5 +- app/viewmodels/govuk/DateFluency.scala | 9 +- app/viewmodels/govuk/FieldsetFluency.scala | 5 +- app/viewmodels/govuk/LabelFluency.scala | 11 +- app/viewmodels/govuk/RadiosFluency.scala | 3 +- app/viewmodels/govuk/SummaryListFluency.scala | 3 +- app/viewmodels/govuk/TagFluency.scala | 22 +-- .../govuk/YearMonthDateFluency.scala | 7 +- .../payments/ViewPastPaymentsViewModel.scala | 19 ++- .../returns/ViewPastReturnsHelper.scala | 14 +- .../returns/ViewReturnViewModel.scala | 49 +++--- .../AlcholDutyTaskListItemStatus.scala | 7 +- .../tasklist/ReturnTaskListCreator.scala | 23 ++- app/views/BeforeStartReturnView.scala.html | 6 +- app/views/ErrorTemplate.scala.html | 6 +- .../JourneyRecoveryContinueView.scala.html | 10 +- .../JourneyRecoveryStartAgainView.scala.html | 10 +- app/views/TaskListView.scala.html | 5 +- .../adjustment/AdjustmentListView.scala.html | 3 +- .../AdjustmentVolumeView.scala.html | 13 +- .../AdjustmentVolumeWithSPRView.scala.html | 23 +-- .../CheckYourAnswersView.scala.html | 4 +- .../OverDeclarationReasonView.scala.html | 5 +- .../UnderDeclarationReasonView.scala.html | 5 +- app/views/auth/SignedOutView.scala.html | 8 +- .../DutyDueForThisReturnView.scala.html | 19 ++- app/views/components/BulletList.scala.html | 4 +- app/views/components/Link.scala.html | 4 +- app/views/components/NumberedList.scala.html | 4 +- app/views/components/PageHeading.scala.html | 4 +- app/views/components/Paragraph.scala.html | 4 +- app/views/components/PrintPage.scala.html | 4 +- app/views/components/SectionBreak.scala.html | 4 +- .../components/SectionHeading.scala.html | 6 +- app/views/components/SubHeading.scala.html | 4 +- .../components/TableRowAction.scala.html | 6 +- .../components/TableRowActionList.scala.html | 8 +- ...YouHaveMultipleSPRDutyRatesView.scala.html | 2 +- .../DutyCalculationView.scala.html | 7 +- .../HowMuchDoYouNeedToDeclareView.scala.html | 13 +- .../MultipleSPRListView.scala.html | 4 +- .../TellUsAboutMultipleSPRRateView.scala.html | 23 +-- .../TellUsAboutSingleSPRRateView.scala.html | 11 +- .../WhatDoYouNeedToDeclareView.scala.html | 11 +- ...wersDutySuspendedDeliveriesView.scala.html | 3 +- ...SuspendedDeliveriesQuestionView.scala.html | 3 +- .../payments/ViewPastPaymentsView.scala.html | 24 +-- .../returns/ViewPastReturnsView.scala.html | 6 +- app/views/returns/ViewReturnView.scala.html | 14 +- .../AlcoholUsedView.scala.html | 8 +- .../DeclareQuarterlySpiritsView.scala.html | 3 +- .../DeclareSpiritsTotalView.scala.html | 9 +- .../EthyleneGasOrMolassesUsedView.scala.html | 5 +- .../OtherSpiritsProducedView.scala.html | 5 +- .../templates/FullWidthMainContent.scala.html | 7 +- app/views/templates/Layout.scala.html | 13 +- .../ViewPastPaymentsViewModelSpec.scala | 11 +- .../returns/ViewPastReturnsHelperSpec.scala | 7 +- 97 files changed, 742 insertions(+), 482 deletions(-) diff --git a/app/config/Constants.scala b/app/config/Constants.scala index 8fd05c8a..5fc294ef 100644 --- a/app/config/Constants.scala +++ b/app/config/Constants.scala @@ -19,17 +19,42 @@ package config import java.time.Month._ object Constants { - val adrReturnCreatedDetails: String = "return-created-details" - val periodKeySessionKey: String = "period-key" - val maximumDecimalPlaces: Int = 2 - val volumeAndDutyMinimumValue: BigDecimal = BigDecimal(0.01) - val volumeMaximumValue: BigDecimal = BigDecimal(999999999.99) - val lpaMaximumDecimalPlaces: Int = 4 - val lpaMinimumValue: BigDecimal = BigDecimal(0.0001) - val lpaMaximumValue: BigDecimal = BigDecimal(999999999.9999) - val dutyMinimumValue: BigDecimal = BigDecimal(0.00) - val dutyMaximumValue: BigDecimal = BigDecimal(999999999.99) - val dutyDueMaximumValue: BigDecimal = BigDecimal(99999999999.99) + val adrReturnCreatedDetails: String = "return-created-details" + val periodKeySessionKey: String = "period-key" + val pastPaymentsSessionKey: String = "past-payment-amount" + + val maximumDecimalPlaces: Int = 2 + val volumeMinimumValueIncZero: BigDecimal = BigDecimal(0.00) + val volumeMinimumValue: BigDecimal = BigDecimal(0.01) + val volumeMaximumValue: BigDecimal = BigDecimal(999999999.99) + val quantityMinimumValueIncZero: BigDecimal = BigDecimal(0.00) + val quantityMinimumValue: BigDecimal = BigDecimal(0.01) + val quantityMaximumValue: BigDecimal = BigDecimal(999999999.99) + val dutySuspendedVolumeMinimumValue: BigDecimal = BigDecimal(-999999999.99) + val dutySuspendedVolumeMaximumValue: BigDecimal = BigDecimal(999999999.99) + val lpaMaximumDecimalPlaces: Int = 4 + val lpaMinimumValue: BigDecimal = BigDecimal(0.0001) + val lpaMaximumValue: BigDecimal = BigDecimal(999999999.9999) + val dutySuspendedLpaMinimumValue: BigDecimal = BigDecimal(-999999999.9999) + val dutySuspendedLpaMaximumValue: BigDecimal = BigDecimal(999999999.9999) + val dutyMaximumDecimalPlaces: Int = 2 + val dutyMinimumValue: BigDecimal = BigDecimal(0.00) + val dutyMaximumValue: BigDecimal = BigDecimal(999999999.99) + val spoiltDutyMinimumValue: BigDecimal = BigDecimal(0.01) + val spoiltDutyMaximumValue: BigDecimal = BigDecimal(99999999999.99) + + val overUnderDeclarationThreshold: BigDecimal = BigDecimal(1000) // When a reason is required + val overUnderDeclarationReasonLength: Int = 250 + + val adjustmentTooEarlyMonth: Int = 7 // Only dates afterward we allow to be adjusted via the service + val adjustmentTooEarlyYear: Int = 2023 + + val minTaxType = 100 // Although the boundaries will not be valid codes + val maxTaxType = 999 + + val otherIngredientsUsedMaxLength = 120 + val otherMaltedGrainsTypeMaxLength = 120 + val otherSpiritsProducedMaxLength = 150 val rowsPerPage = 15 @@ -62,5 +87,108 @@ object Constants { val quarterlySpiritsMonths = Set(JANUARY, APRIL, JULY, OCTOBER) - val pastPaymentsSessionKey: String = "past-payment-amount" + object Format { + val numeric = "numeric" + } + + object Css { + val bodyCssClass = "govuk-body" + + val hintCssClass = "govuk-hint" + + val linkNoVisitedStateCssClass = "govuk-link govuk-link--no-visited-state" + + val sectionBreakCssClass = "govuk-section-break" + val sectionBreakLCssClass = "govuk-section-break--l" + val sectionBreakVisibleCssClass = "govuk-section-break--visible" + + val fullWidthCssClass = "govuk-!-width-full" + val oneQuarterCssClass = "govuk-!-width-one-quarter" + val oneHalfCssClass = "govuk-!-width-one-half" + val threeQuartersCssClass = "govuk-!-width-three-quarters" + val oneThirdCssClass = "govuk-!-width-one-third" + val twoThirdsCssClass = "govuk-!-width-two-thirds" + + val textAlignRightCssClass = "text-align-right" + val textAlignRightWrapCssClass = "text-align-right-wrap" + + val boldFontCssClass = "govuk-!-font-weight-bold" + + val lightBlueTagCssClass = "govuk-tag--light-blue" + val blueTagCssClass = "govuk-tag--blue" + val greenTagCssClass = "govuk-tag--green" + val redTagCssClass = "govuk-tag--red" + val yellowTagCssClass = "govuk-tag--yellow" + val greyTagCssClass = "govuk-tag--grey" + val turquoiseCssClass = "govuk-tag--turquoise" + val purpleCssClass = "govuk-tag--purple" + val pinkCssClass = "govuk-tag--pink" + val orangeCssClass = "govuk-tag--orange" + + val headingXLCssClass = "govuk-heading-xl" + val headingLCssClass = "govuk-heading-l" + val headingMCssClass = "govuk-heading-m" + val headingSCssClass = "govuk-heading-s" + + val labelXLCssClass = "govuk-label--xl" + val labelLCssClass = "govuk-label--l" + val labelMCssClass = "govuk-label--m" + val labelSCssClass = "govuk-label--s" + + val hmrcCaptionXLCssClass = "hmrc-caption-xl" + val captionXLCssClass = "govuk-caption-xl" + + val fieldsetLegendXLCssClass = "govuk-fieldset__legend--xl" + val fieldsetLegendLCssClass = "govuk-fieldset__legend--l" + val fieldsetLegendMCssClass = "govuk-fieldset__legend--m" + val fieldsetLegendSCssClass = "govuk-fieldset__legend--s" + + val tableCaptionMCssClass = "govuk-table__caption--m" + val tableCaptionLCssClass = "govuk-table__caption--l" + + val gridRowCssClass = "govuk-grid-row" + val gridColumnOneThird = "govuk-grid-column-one-third" + val gridColumnTwoThirds = "govuk-grid-column-two-thirds" + val gridColumnFullCssClass = "govuk-grid-column-full" + + val numericCellClass = "govuk-table__cell--numeric" + + val summaryListNoBorderCssClass = "govuk-summary-list--no-border" + val summaryListRowNoBorderCssClass = "govuk-summary-list__row--no-border" + val summaryListKeyCssClass = "govuk-summary-list__key" + val summaryListValueCssClass = "govuk-summary-list__value" + val summaryListActionsCssClass = "govuk-summary-list__actions" + val summaryListActionsListCssClass = "govuk-summary-list__actions-list" + val summaryListActionsListItemCssClass = "govuk-summary-list__actions-list-item" + + val marginTop0CssClass = "govuk-!-margin-top-0" + val marginTop8CssClass = "govuk-!-margin-top-8" + val marginBottom0CssClass = "govuk-!-margin-bottom-0" + + val paddingBottomCssClass = "govuk-body govuk-!-padding-bottom-3" + + val inputWidth2CssClass = "govuk-input--width-2" + val inputWidth3CssClass = "govuk-input--width-3" + val inputWidth4CssClass = "govuk-input--width-4" + val inputWidth5CssClass = "govuk-input--width-5" + val inputWidth10CssClass = "govuk-input--width-10" + val inputWidth20CssClass = "govuk-input--width-20" + val inputWidth30CssClass = "govuk-input--width-30" + + val secondaryButtonCssClass = "govuk-button--secondary" + val warningButtonCssClass = "govuk-button--warning" + + val inlineRadiosCssClass = "govuk-radios--inline" + + val numberListCssClass = "govuk-list govuk-list--number" + val bulletListCssClass = "govuk-list govuk-list--bullet" + + val visuallyHiddenCssClass = "govuk-visually-hidden" + + val inputErrorCssClass = "govuk-input--error" + + val jsVisibleCssClass = "hmrc-!-js-visible" + + val displayNonePrintCssClass = "govuk-!-display-none-print" + } } diff --git a/app/forms/adjustment/AdjustmentRepackagedTaxTypeFormProvider.scala b/app/forms/adjustment/AdjustmentRepackagedTaxTypeFormProvider.scala index e01b947b..6c7bea13 100644 --- a/app/forms/adjustment/AdjustmentRepackagedTaxTypeFormProvider.scala +++ b/app/forms/adjustment/AdjustmentRepackagedTaxTypeFormProvider.scala @@ -16,7 +16,9 @@ package forms.adjustment +import config.Constants import forms.mappings.Mappings + import javax.inject.Inject import play.api.data.Form @@ -29,6 +31,6 @@ class AdjustmentRepackagedTaxTypeFormProvider @Inject() extends Mappings { "adjustmentRepackagedTaxType.error.invalid", "adjustmentRepackagedTaxType.error.invalid" ) - .verifying(inRange(100, 999, "adjustmentRepackagedTaxType.error.invalid")) + .verifying(inRange(Constants.minTaxType, Constants.maxTaxType, "adjustmentRepackagedTaxType.error.invalid")) ) } diff --git a/app/forms/adjustment/AdjustmentSmallProducerReliefDutyRateFormProvider.scala b/app/forms/adjustment/AdjustmentSmallProducerReliefDutyRateFormProvider.scala index f955b5f6..55893587 100644 --- a/app/forms/adjustment/AdjustmentSmallProducerReliefDutyRateFormProvider.scala +++ b/app/forms/adjustment/AdjustmentSmallProducerReliefDutyRateFormProvider.scala @@ -16,23 +16,26 @@ package forms.adjustment +import config.Constants import forms.mappings.Mappings + import javax.inject.Inject import play.api.data.Form class AdjustmentSmallProducerReliefDutyRateFormProvider @Inject() extends Mappings { - def apply(): Form[BigDecimal] = Form( "adjustment-small-producer-relief-duty-rate-input" -> bigDecimal( - 2, + Constants.dutyMaximumDecimalPlaces, "adjustmentSmallProducerReliefDutyRate.error.required", "adjustmentSmallProducerReliefDutyRate.error.nonNumeric", "adjustmentSmallProducerReliefDutyRate.error.decimalPlaces" ) - .verifying(minimumValue(BigDecimal(0.00), "adjustmentSmallProducerReliefDutyRate.error.minimumRequired")) .verifying( - maximumValue(BigDecimal(999999999.99), "adjustmentSmallProducerReliefDutyRate.error.maximumRequired") + minimumValue(Constants.dutyMinimumValue, "adjustmentSmallProducerReliefDutyRate.error.minimumRequired") + ) + .verifying( + maximumValue(Constants.dutyMaximumValue, "adjustmentSmallProducerReliefDutyRate.error.maximumRequired") ) ) } diff --git a/app/forms/adjustment/AdjustmentTaxTypeFormProvider.scala b/app/forms/adjustment/AdjustmentTaxTypeFormProvider.scala index 9692db5e..092c71df 100644 --- a/app/forms/adjustment/AdjustmentTaxTypeFormProvider.scala +++ b/app/forms/adjustment/AdjustmentTaxTypeFormProvider.scala @@ -16,7 +16,9 @@ package forms.adjustment +import config.Constants import forms.mappings.Mappings + import javax.inject.Inject import play.api.data.Form @@ -29,6 +31,6 @@ class AdjustmentTaxTypeFormProvider @Inject() extends Mappings { "adjustmentTaxType.error.invalid", "adjustmentTaxType.error.invalid" ) - .verifying(inRange(100, 999, "adjustmentTaxType.error.invalid")) + .verifying(inRange(Constants.minTaxType, Constants.maxTaxType, "adjustmentTaxType.error.invalid")) ) } diff --git a/app/forms/adjustment/OverDeclarationReasonFormProvider.scala b/app/forms/adjustment/OverDeclarationReasonFormProvider.scala index dda1925b..bcf24c9a 100644 --- a/app/forms/adjustment/OverDeclarationReasonFormProvider.scala +++ b/app/forms/adjustment/OverDeclarationReasonFormProvider.scala @@ -16,7 +16,7 @@ package forms.adjustment -import forms.adjustment.OverDeclarationReasonFormProvider.overDeclarationReasonLength +import config.Constants import javax.inject.Inject import forms.mappings.Mappings @@ -27,10 +27,6 @@ class OverDeclarationReasonFormProvider @Inject() extends Mappings { def apply(): Form[String] = Form( "over-declaration-reason-input" -> text("overDeclarationReason.error.required") - .verifying(maxLength(overDeclarationReasonLength, "overDeclarationReason.error.length")) + .verifying(maxLength(Constants.overUnderDeclarationReasonLength, "overDeclarationReason.error.length")) ) } - -object OverDeclarationReasonFormProvider { - val overDeclarationReasonLength = 250 -} diff --git a/app/forms/adjustment/UnderDeclarationReasonFormProvider.scala b/app/forms/adjustment/UnderDeclarationReasonFormProvider.scala index ebbb804c..5f7857dc 100644 --- a/app/forms/adjustment/UnderDeclarationReasonFormProvider.scala +++ b/app/forms/adjustment/UnderDeclarationReasonFormProvider.scala @@ -16,7 +16,7 @@ package forms.adjustment -import forms.adjustment.UnderDeclarationReasonFormProvider.underDeclarationReasonLength +import config.Constants import javax.inject.Inject import forms.mappings.Mappings @@ -27,10 +27,6 @@ class UnderDeclarationReasonFormProvider @Inject() extends Mappings { def apply(): Form[String] = Form( "under-declaration-reason-input" -> text("underDeclarationReason.error.required") - .verifying(maxLength(underDeclarationReasonLength, "underDeclarationReason.error.length")) + .verifying(maxLength(Constants.overUnderDeclarationReasonLength, "underDeclarationReason.error.length")) ) } - -object UnderDeclarationReasonFormProvider { - val underDeclarationReasonLength = 250 -} diff --git a/app/forms/adjustment/WhenDidYouPayDutyFormProvider.scala b/app/forms/adjustment/WhenDidYouPayDutyFormProvider.scala index bc7c1d8a..e84e5cae 100644 --- a/app/forms/adjustment/WhenDidYouPayDutyFormProvider.scala +++ b/app/forms/adjustment/WhenDidYouPayDutyFormProvider.scala @@ -16,6 +16,8 @@ package forms.adjustment +import config.Constants + import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form @@ -31,6 +33,9 @@ class WhenDidYouPayDutyFormProvider @Inject() extends Mappings { "whenDidYouPayDuty.date.error.invalidYear" ) .verifying("whenDidYouPayDuty.date.error.invalid.future", value => value.isBefore(YearMonth.now())) - .verifying("whenDidYouPayDuty.date.error.invalid.past", value => value.isAfter(YearMonth.of(2023, 7))) + .verifying( + "whenDidYouPayDuty.date.error.invalid.past", + value => value.isAfter(YearMonth.of(Constants.adjustmentTooEarlyYear, Constants.adjustmentTooEarlyMonth)) + ) ) } diff --git a/app/forms/dutySuspended/DutySuspendedBeerFormProvider.scala b/app/forms/dutySuspended/DutySuspendedBeerFormProvider.scala index 0dd2063c..a4305314 100644 --- a/app/forms/dutySuspended/DutySuspendedBeerFormProvider.scala +++ b/app/forms/dutySuspended/DutySuspendedBeerFormProvider.scala @@ -16,33 +16,42 @@ package forms.dutySuspended -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.dutySuspended.DutySuspendedBeer class DutySuspendedBeerFormProvider @Inject() extends Mappings { - def apply(): Form[DutySuspendedBeer] = Form( mapping( "totalBeer" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "dutySuspendedBeer.error.totalBeer.required", "dutySuspendedBeer.error.totalBeer.nonNumeric", "dutySuspendedBeer.error.totalBeer.decimalPlaces" - ).verifying(minimumValue(BigDecimal(-999999999.99), "dutySuspendedBeer.error.totalBeer.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "dutySuspendedBeer.error.totalBeer.maximumRequired")), + ).verifying( + minimumValue(Constants.dutySuspendedVolumeMinimumValue, "dutySuspendedBeer.error.totalBeer.minimumRequired") + ).verifying( + maximumValue(Constants.dutySuspendedVolumeMaximumValue, "dutySuspendedBeer.error.totalBeer.maximumRequired") + ), "pureAlcoholInBeer" -> bigDecimal( - 4, + Constants.lpaMaximumDecimalPlaces, "dutySuspendedBeer.error.pureAlcoholInBeer.required", "dutySuspendedBeer.error.pureAlcoholInBeer.nonNumeric", "dutySuspendedBeer.error.pureAlcoholInBeer.decimalPlaces" ).verifying( - minimumValue(BigDecimal(-999999999.9999), "dutySuspendedBeer.error.pureAlcoholInBeer.minimumRequired") + minimumValue( + Constants.dutySuspendedLpaMinimumValue, + "dutySuspendedBeer.error.pureAlcoholInBeer.minimumRequired" + ) ).verifying( - maximumValue(BigDecimal(999999999.9999), "dutySuspendedBeer.error.pureAlcoholInBeer.maximumRequired") + maximumValue( + Constants.dutySuspendedLpaMaximumValue, + "dutySuspendedBeer.error.pureAlcoholInBeer.maximumRequired" + ) ) )(DutySuspendedBeer.apply)(DutySuspendedBeer.unapply) ) diff --git a/app/forms/dutySuspended/DutySuspendedCiderFormProvider.scala b/app/forms/dutySuspended/DutySuspendedCiderFormProvider.scala index 3d77aa9f..5f0c5c1e 100644 --- a/app/forms/dutySuspended/DutySuspendedCiderFormProvider.scala +++ b/app/forms/dutySuspended/DutySuspendedCiderFormProvider.scala @@ -16,33 +16,42 @@ package forms.dutySuspended -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.dutySuspended.DutySuspendedCider class DutySuspendedCiderFormProvider @Inject() extends Mappings { - def apply(): Form[DutySuspendedCider] = Form( mapping( "totalCider" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "dutySuspendedCider.error.totalCider.required", "dutySuspendedCider.error.totalCider.nonNumeric", "dutySuspendedCider.error.totalCider.decimalPlaces" - ).verifying(minimumValue(BigDecimal(-999999999.99), "dutySuspendedCider.error.totalCider.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "dutySuspendedCider.error.totalCider.maximumRequired")), + ).verifying( + minimumValue(Constants.dutySuspendedVolumeMinimumValue, "dutySuspendedCider.error.totalCider.minimumRequired") + ).verifying( + maximumValue(Constants.dutySuspendedVolumeMaximumValue, "dutySuspendedCider.error.totalCider.maximumRequired") + ), "pureAlcoholInCider" -> bigDecimal( - 4, + Constants.lpaMaximumDecimalPlaces, "dutySuspendedCider.error.pureAlcoholInCider.required", "dutySuspendedCider.error.pureAlcoholInCider.nonNumeric", "dutySuspendedCider.error.pureAlcoholInCider.decimalPlaces" ).verifying( - minimumValue(BigDecimal(-999999999.9999), "dutySuspendedCider.error.pureAlcoholInCider.minimumRequired") + minimumValue( + Constants.dutySuspendedLpaMinimumValue, + "dutySuspendedCider.error.pureAlcoholInCider.minimumRequired" + ) ).verifying( - maximumValue(BigDecimal(999999999.9999), "dutySuspendedCider.error.pureAlcoholInCider.maximumRequired") + maximumValue( + Constants.dutySuspendedLpaMaximumValue, + "dutySuspendedCider.error.pureAlcoholInCider.maximumRequired" + ) ) )(DutySuspendedCider.apply)(DutySuspendedCider.unapply) ) diff --git a/app/forms/dutySuspended/DutySuspendedOtherFermentedFormProvider.scala b/app/forms/dutySuspended/DutySuspendedOtherFermentedFormProvider.scala index 8d8bf493..ce9f3cde 100644 --- a/app/forms/dutySuspended/DutySuspendedOtherFermentedFormProvider.scala +++ b/app/forms/dutySuspended/DutySuspendedOtherFermentedFormProvider.scala @@ -16,40 +16,46 @@ package forms.dutySuspended -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.dutySuspended.DutySuspendedOtherFermented class DutySuspendedOtherFermentedFormProvider @Inject() extends Mappings { - def apply(): Form[DutySuspendedOtherFermented] = Form( mapping( "totalOtherFermented" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "dutySuspendedOtherFermented.error.totalOtherFermented.required", "dutySuspendedOtherFermented.error.totalOtherFermented.nonNumeric", "dutySuspendedOtherFermented.error.totalOtherFermented.decimalPlaces" ).verifying( - minimumValue(BigDecimal(-999999999.99), "dutySuspendedOtherFermented.error.totalOtherFermented.minimumRequired") + minimumValue( + Constants.dutySuspendedVolumeMinimumValue, + "dutySuspendedOtherFermented.error.totalOtherFermented.minimumRequired" + ) ).verifying( - maximumValue(BigDecimal(999999999.99), "dutySuspendedOtherFermented.error.totalOtherFermented.maximumRequired") + maximumValue( + Constants.dutySuspendedVolumeMaximumValue, + "dutySuspendedOtherFermented.error.totalOtherFermented.maximumRequired" + ) ), "pureAlcoholInOtherFermented" -> bigDecimal( - 4, + Constants.lpaMaximumDecimalPlaces, "dutySuspendedOtherFermented.error.pureAlcoholInOtherFermented.required", "dutySuspendedOtherFermented.error.pureAlcoholInOtherFermented.nonNumeric", "dutySuspendedOtherFermented.error.pureAlcoholInOtherFermented.decimalPlaces" ).verifying( minimumValue( - BigDecimal(-999999999.9999), + Constants.dutySuspendedLpaMinimumValue, "dutySuspendedOtherFermented.error.pureAlcoholInOtherFermented.minimumRequired" ) ).verifying( maximumValue( - BigDecimal(999999999.9999), + Constants.dutySuspendedLpaMaximumValue, "dutySuspendedOtherFermented.error.pureAlcoholInOtherFermented.maximumRequired" ) ) diff --git a/app/forms/dutySuspended/DutySuspendedSpiritsFormProvider.scala b/app/forms/dutySuspended/DutySuspendedSpiritsFormProvider.scala index 4c30fc42..b5c45815 100644 --- a/app/forms/dutySuspended/DutySuspendedSpiritsFormProvider.scala +++ b/app/forms/dutySuspended/DutySuspendedSpiritsFormProvider.scala @@ -16,33 +16,48 @@ package forms.dutySuspended -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.dutySuspended.DutySuspendedSpirits class DutySuspendedSpiritsFormProvider @Inject() extends Mappings { - def apply(): Form[DutySuspendedSpirits] = Form( mapping( "totalSpirits" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "dutySuspendedSpirits.error.totalSpirits.required", "dutySuspendedSpirits.error.totalSpirits.nonNumeric", "dutySuspendedSpirits.error.totalSpirits.decimalPlaces" - ).verifying(minimumValue(BigDecimal(-999999999.99), "dutySuspendedSpirits.error.totalSpirits.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "dutySuspendedSpirits.error.totalSpirits.maximumRequired")), + ).verifying( + minimumValue( + Constants.dutySuspendedVolumeMinimumValue, + "dutySuspendedSpirits.error.totalSpirits.minimumRequired" + ) + ).verifying( + maximumValue( + Constants.dutySuspendedVolumeMaximumValue, + "dutySuspendedSpirits.error.totalSpirits.maximumRequired" + ) + ), "pureAlcoholInSpirits" -> bigDecimal( - 4, + Constants.lpaMaximumDecimalPlaces, "dutySuspendedSpirits.error.pureAlcoholInSpirits.required", "dutySuspendedSpirits.error.pureAlcoholInSpirits.nonNumeric", "dutySuspendedSpirits.error.pureAlcoholInSpirits.decimalPlaces" ).verifying( - minimumValue(BigDecimal(-999999999.9999), "dutySuspendedSpirits.error.pureAlcoholInSpirits.minimumRequired") + minimumValue( + Constants.dutySuspendedLpaMinimumValue, + "dutySuspendedSpirits.error.pureAlcoholInSpirits.minimumRequired" + ) ).verifying( - maximumValue(BigDecimal(999999999.9999), "dutySuspendedSpirits.error.pureAlcoholInSpirits.maximumRequired") + maximumValue( + Constants.dutySuspendedLpaMaximumValue, + "dutySuspendedSpirits.error.pureAlcoholInSpirits.maximumRequired" + ) ) )(DutySuspendedSpirits.apply)(DutySuspendedSpirits.unapply) ) diff --git a/app/forms/dutySuspended/DutySuspendedWineFormProvider.scala b/app/forms/dutySuspended/DutySuspendedWineFormProvider.scala index 3e0edcba..dd7a58c1 100644 --- a/app/forms/dutySuspended/DutySuspendedWineFormProvider.scala +++ b/app/forms/dutySuspended/DutySuspendedWineFormProvider.scala @@ -16,33 +16,42 @@ package forms.dutySuspended -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.dutySuspended.DutySuspendedWine class DutySuspendedWineFormProvider @Inject() extends Mappings { - def apply(): Form[DutySuspendedWine] = Form( mapping( "totalWine" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "dutySuspendedWine.error.totalWine.required", "dutySuspendedWine.error.totalWine.nonNumeric", "dutySuspendedWine.error.totalWine.decimalPlaces" - ).verifying(minimumValue(BigDecimal(-999999999.99), "dutySuspendedWine.error.totalWine.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "dutySuspendedWine.error.totalWine.maximumRequired")), + ).verifying( + minimumValue(Constants.dutySuspendedVolumeMinimumValue, "dutySuspendedWine.error.totalWine.minimumRequired") + ).verifying( + maximumValue(Constants.dutySuspendedVolumeMaximumValue, "dutySuspendedWine.error.totalWine.maximumRequired") + ), "pureAlcoholInWine" -> bigDecimal( - 4, + Constants.lpaMaximumDecimalPlaces, "dutySuspendedWine.error.pureAlcoholInWine.required", "dutySuspendedWine.error.pureAlcoholInWine.nonNumeric", "dutySuspendedWine.error.pureAlcoholInWine.decimalPlaces" ).verifying( - minimumValue(BigDecimal(-999999999.9999), "dutySuspendedWine.error.pureAlcoholInWine.minimumRequired") + minimumValue( + Constants.dutySuspendedLpaMinimumValue, + "dutySuspendedWine.error.pureAlcoholInWine.minimumRequired" + ) ).verifying( - maximumValue(BigDecimal(999999999.9999), "dutySuspendedWine.error.pureAlcoholInWine.maximumRequired") + maximumValue( + Constants.dutySuspendedLpaMaximumValue, + "dutySuspendedWine.error.pureAlcoholInWine.maximumRequired" + ) ) )(DutySuspendedWine.apply)(DutySuspendedWine.unapply) ) diff --git a/app/forms/mappings/AdjustmentVolumesAndRateFormatter.scala b/app/forms/mappings/AdjustmentVolumesAndRateFormatter.scala index 4ba9f932..dc918b01 100644 --- a/app/forms/mappings/AdjustmentVolumesAndRateFormatter.scala +++ b/app/forms/mappings/AdjustmentVolumesAndRateFormatter.scala @@ -40,7 +40,7 @@ class AdjustmentVolumesAndRateFormatter( maximumValueKey, fieldKey, maximumValue = Constants.volumeMaximumValue, - minimumValue = Constants.volumeAndDutyMinimumValue, + minimumValue = Constants.volumeMinimumValue, args = args ) diff --git a/app/forms/mappings/AdjustmentVolumesFormatter.scala b/app/forms/mappings/AdjustmentVolumesFormatter.scala index ca95d51b..a0f8c279 100644 --- a/app/forms/mappings/AdjustmentVolumesFormatter.scala +++ b/app/forms/mappings/AdjustmentVolumesFormatter.scala @@ -41,7 +41,7 @@ class AdjustmentVolumesFormatter( maximumValueKey, fieldKey, maximumValue = Constants.volumeMaximumValue, - minimumValue = Constants.volumeAndDutyMinimumValue, + minimumValue = Constants.volumeMinimumValue, args = args ) diff --git a/app/forms/mappings/SpoiltVolumesAndDutyFormatter.scala b/app/forms/mappings/SpoiltVolumesAndDutyFormatter.scala index 9dd4a748..3b060ae2 100644 --- a/app/forms/mappings/SpoiltVolumesAndDutyFormatter.scala +++ b/app/forms/mappings/SpoiltVolumesAndDutyFormatter.scala @@ -40,7 +40,7 @@ class SpoiltVolumesAndDutyFormatter( maximumValueKey, fieldKey, maximumValue = Constants.volumeMaximumValue, - minimumValue = Constants.volumeAndDutyMinimumValue, + minimumValue = Constants.volumeMinimumValue, args = args ) @@ -57,15 +57,15 @@ class SpoiltVolumesAndDutyFormatter( args = args ) - private def dutyRateFormatter(fieldKey: String) = new BigDecimalFieldFormatter( + private def dutyFormatter(fieldKey: String) = new BigDecimalFieldFormatter( requiredKey, invalidKey, decimalPlacesKey, minimumValueKey, maximumValueKey, fieldKey, - maximumValue = Constants.dutyDueMaximumValue, - minimumValue = Constants.volumeAndDutyMinimumValue, + maximumValue = Constants.spoiltDutyMaximumValue, + minimumValue = Constants.spoiltDutyMinimumValue, args = args ) @@ -78,7 +78,7 @@ class SpoiltVolumesAndDutyFormatter( private def formatVolume(key: String, data: Map[String, String]): Either[Seq[FormError], SpoiltVolumeWithDuty] = { val totalLitres = volumeFormatter("totalLitresVolume").bind(s"$key.totalLitresVolume", data) val pureAlcohol = pureAlcoholVolumeFormatter("pureAlcoholVolume").bind(s"$key.pureAlcoholVolume", data) - val duty = dutyRateFormatter("duty").bind(s"$key.duty", data) + val duty = dutyFormatter("duty").bind(s"$key.duty", data) (totalLitres, pureAlcohol, duty) match { case (Right(totalLitresValue), Right(pureAlcoholValue), Right(duty)) => diff --git a/app/forms/mappings/VolumesAndRateFormatter.scala b/app/forms/mappings/VolumesAndRateFormatter.scala index bd1f2c45..4f27da7b 100644 --- a/app/forms/mappings/VolumesAndRateFormatter.scala +++ b/app/forms/mappings/VolumesAndRateFormatter.scala @@ -41,7 +41,7 @@ class VolumesAndRateFormatter( maximumValueKey, fieldKey, maximumValue = Constants.volumeMaximumValue, - minimumValue = Constants.volumeAndDutyMinimumValue, + minimumValue = Constants.volumeMinimumValue, args = args ) diff --git a/app/forms/mappings/VolumesFormatter.scala b/app/forms/mappings/VolumesFormatter.scala index 89ad1868..68d3204b 100644 --- a/app/forms/mappings/VolumesFormatter.scala +++ b/app/forms/mappings/VolumesFormatter.scala @@ -42,7 +42,7 @@ class VolumesFormatter( maximumValueKey, fieldKey, maximumValue = Constants.volumeMaximumValue, - minimumValue = Constants.volumeAndDutyMinimumValue, + minimumValue = Constants.volumeMinimumValue, args = args ) diff --git a/app/forms/spiritsQuestions/AlcoholUsedFormProvider.scala b/app/forms/spiritsQuestions/AlcoholUsedFormProvider.scala index 7ae006dd..de8e6dfb 100644 --- a/app/forms/spiritsQuestions/AlcoholUsedFormProvider.scala +++ b/app/forms/spiritsQuestions/AlcoholUsedFormProvider.scala @@ -16,6 +16,8 @@ package forms.spiritsQuestions +import config.Constants + import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form @@ -23,47 +25,40 @@ import play.api.data.Forms._ import models.spiritsQuestions.AlcoholUsed class AlcoholUsedFormProvider @Inject() extends Mappings { - import AlcoholUsedFormProvider._ - def apply(): Form[AlcoholUsed] = Form( mapping( "beer" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "alcoholUsed.error.beer.required", "alcoholUsed.error.beer.nonNumeric", "alcoholUsed.error.beer.decimalPlaces" ) - .verifying(minimumValue(quantityMinValue, "alcoholUsed.error.beer.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "alcoholUsed.error.beer.maximumRequired")), + .verifying(minimumValue(Constants.volumeMinimumValueIncZero, "alcoholUsed.error.beer.minimumRequired")) + .verifying(maximumValue(Constants.volumeMaximumValue, "alcoholUsed.error.beer.maximumRequired")), "wine" -> bigDecimal( 2, "alcoholUsed.error.wine.required", "alcoholUsed.error.wine.nonNumeric", "alcoholUsed.error.wine.decimalPlaces" ) - .verifying(minimumValue(quantityMinValue, "alcoholUsed.error.wine.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "alcoholUsed.error.wine.maximumRequired")), + .verifying(minimumValue(Constants.volumeMinimumValueIncZero, "alcoholUsed.error.wine.minimumRequired")) + .verifying(maximumValue(Constants.volumeMaximumValue, "alcoholUsed.error.wine.maximumRequired")), "madeWine" -> bigDecimal( 2, "alcoholUsed.error.madeWine.required", "alcoholUsed.error.madeWine.nonNumeric", "alcoholUsed.error.madeWine.decimalPlaces" ) - .verifying(minimumValue(quantityMinValue, "alcoholUsed.error.madeWine.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "alcoholUsed.error.madeWine.maximumRequired")), + .verifying(minimumValue(Constants.volumeMinimumValueIncZero, "alcoholUsed.error.madeWine.minimumRequired")) + .verifying(maximumValue(Constants.volumeMaximumValue, "alcoholUsed.error.madeWine.maximumRequired")), "ciderOrPerry" -> bigDecimal( 2, "alcoholUsed.error.ciderOrPerry.required", "alcoholUsed.error.ciderOrPerry.nonNumeric", "alcoholUsed.error.ciderOrPerry.decimalPlaces" ) - .verifying(minimumValue(quantityMinValue, "alcoholUsed.error.ciderOrPerry.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "alcoholUsed.error.ciderOrPerry.maximumRequired")) + .verifying(minimumValue(Constants.volumeMinimumValueIncZero, "alcoholUsed.error.ciderOrPerry.minimumRequired")) + .verifying(maximumValue(Constants.volumeMaximumValue, "alcoholUsed.error.ciderOrPerry.maximumRequired")) )(AlcoholUsed.apply)(AlcoholUsed.unapply) ) } -object AlcoholUsedFormProvider { - val quantityMaxDecimalPlaces = 2 - val quantityMinValue = BigDecimal(0.00) - val quantityMaxValue = BigDecimal(999999999.99) -} diff --git a/app/forms/spiritsQuestions/DeclareQuarterlySpiritsFormProvider.scala b/app/forms/spiritsQuestions/DeclareQuarterlySpiritsFormProvider.scala index 2a4bee7a..7c79404d 100644 --- a/app/forms/spiritsQuestions/DeclareQuarterlySpiritsFormProvider.scala +++ b/app/forms/spiritsQuestions/DeclareQuarterlySpiritsFormProvider.scala @@ -22,7 +22,6 @@ import forms.mappings.Mappings import play.api.data.Form class DeclareQuarterlySpiritsFormProvider @Inject() extends Mappings { - def apply(): Form[Boolean] = Form( "declareQuarterlySpirits-yesNoValue" -> boolean("declareQuarterlySpirits.error.required") diff --git a/app/forms/spiritsQuestions/DeclareSpiritsTotalFormProvider.scala b/app/forms/spiritsQuestions/DeclareSpiritsTotalFormProvider.scala index 3b6b5943..4467381a 100644 --- a/app/forms/spiritsQuestions/DeclareSpiritsTotalFormProvider.scala +++ b/app/forms/spiritsQuestions/DeclareSpiritsTotalFormProvider.scala @@ -16,21 +16,22 @@ package forms.spiritsQuestions +import config.Constants import forms.mappings.Mappings + import javax.inject.Inject import play.api.data.Form class DeclareSpiritsTotalFormProvider @Inject() extends Mappings { - def apply(): Form[BigDecimal] = Form( "declare-spirits-total-input" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "declareSpiritsTotal.error.required", "declareSpiritsTotal.error.nonNumeric", "declareSpiritsTotal.error.decimalPlaces" ) - .verifying(minimumValue(BigDecimal(0.01), "declareSpiritsTotal.error.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "declareSpiritsTotal.error.maximumRequired")) + .verifying(minimumValue(Constants.volumeMinimumValue, "declareSpiritsTotal.error.minimumRequired")) + .verifying(maximumValue(Constants.volumeMaximumValue, "declareSpiritsTotal.error.maximumRequired")) ) } diff --git a/app/forms/spiritsQuestions/EthyleneGasOrMolassesUsedFormProvider.scala b/app/forms/spiritsQuestions/EthyleneGasOrMolassesUsedFormProvider.scala index 078f53e5..154788f5 100644 --- a/app/forms/spiritsQuestions/EthyleneGasOrMolassesUsedFormProvider.scala +++ b/app/forms/spiritsQuestions/EthyleneGasOrMolassesUsedFormProvider.scala @@ -16,33 +16,37 @@ package forms.spiritsQuestions -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.spiritsQuestions.EthyleneGasOrMolassesUsed class EthyleneGasOrMolassesUsedFormProvider @Inject() extends Mappings { - def apply(): Form[EthyleneGasOrMolassesUsed] = Form( mapping( "ethyleneGas" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "ethyleneGasOrMolassesUsed.error.ethyleneGas.required", "ethyleneGasOrMolassesUsed.error.ethyleneGas.nonNumeric", "ethyleneGasOrMolassesUsed.error.ethyleneGas.decimalPlaces" - ).verifying(minimumValue(BigDecimal(0.00), "ethyleneGasOrMolassesUsed.error.ethyleneGas.minimumRequired")) - .verifying( - maximumValue(BigDecimal(999999999.99), "ethyleneGasOrMolassesUsed.error.ethyleneGas.maximumRequired") - ), + ).verifying( + minimumValue(Constants.volumeMinimumValueIncZero, "ethyleneGasOrMolassesUsed.error.ethyleneGas.minimumRequired") + ).verifying( + maximumValue(Constants.volumeMaximumValue, "ethyleneGasOrMolassesUsed.error.ethyleneGas.maximumRequired") + ), "molasses" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "ethyleneGasOrMolassesUsed.error.molasses.required", "ethyleneGasOrMolassesUsed.error.molasses.nonNumeric", "ethyleneGasOrMolassesUsed.error.molasses.decimalPlaces" - ).verifying(minimumValue(BigDecimal(0.00), "ethyleneGasOrMolassesUsed.error.molasses.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "ethyleneGasOrMolassesUsed.error.molasses.maximumRequired")), + ).verifying( + minimumValue(Constants.volumeMinimumValueIncZero, "ethyleneGasOrMolassesUsed.error.molasses.minimumRequired") + ).verifying( + maximumValue(Constants.volumeMaximumValue, "ethyleneGasOrMolassesUsed.error.molasses.maximumRequired") + ), "otherIngredients" -> boolean("ethyleneGasOrMolassesUsed.error.required") )(EthyleneGasOrMolassesUsed.apply)(EthyleneGasOrMolassesUsed.unapply) ) diff --git a/app/forms/spiritsQuestions/GrainsUsedFormProvider.scala b/app/forms/spiritsQuestions/GrainsUsedFormProvider.scala index b4c3d668..70a30a74 100644 --- a/app/forms/spiritsQuestions/GrainsUsedFormProvider.scala +++ b/app/forms/spiritsQuestions/GrainsUsedFormProvider.scala @@ -16,60 +16,59 @@ package forms.spiritsQuestions -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.spiritsQuestions.GrainsUsed class GrainsUsedFormProvider @Inject() extends Mappings { - import GrainsUsedFormProvider._ - def apply(): Form[GrainsUsed] = Form( mapping( "maltedBarleyQuantity" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "grainsUsed.error.maltedBarleyQuantity.required", "grainsUsed.error.maltedBarleyQuantity.nonNumeric", "grainsUsed.error.maltedBarleyQuantity.decimalPlaces" - ).verifying(minimumValue(quantityMinValue, "grainsUsed.error.maltedBarleyQuantity.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "grainsUsed.error.maltedBarleyQuantity.maximumRequired")), + ).verifying( + minimumValue(Constants.quantityMinimumValueIncZero, "grainsUsed.error.maltedBarleyQuantity.minimumRequired") + ).verifying( + maximumValue(Constants.quantityMaximumValue, "grainsUsed.error.maltedBarleyQuantity.maximumRequired") + ), "wheatQuantity" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "grainsUsed.error.wheatQuantity.required", "grainsUsed.error.wheatQuantity.nonNumeric", "grainsUsed.error.wheatQuantity.decimalPlaces" - ).verifying(minimumValue(quantityMinValue, "grainsUsed.error.wheatQuantity.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "grainsUsed.error.wheatQuantity.maximumRequired")), + ).verifying(minimumValue(Constants.quantityMinimumValueIncZero, "grainsUsed.error.wheatQuantity.minimumRequired")) + .verifying(maximumValue(Constants.quantityMaximumValue, "grainsUsed.error.wheatQuantity.maximumRequired")), "maizeQuantity" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "grainsUsed.error.maizeQuantity.required", "grainsUsed.error.maizeQuantity.nonNumeric", "grainsUsed.error.maizeQuantity.decimalPlaces" - ).verifying(minimumValue(quantityMinValue, "grainsUsed.error.maizeQuantity.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "grainsUsed.error.maizeQuantity.maximumRequired")), + ).verifying(minimumValue(Constants.quantityMinimumValueIncZero, "grainsUsed.error.maizeQuantity.minimumRequired")) + .verifying(maximumValue(Constants.quantityMaximumValue, "grainsUsed.error.maizeQuantity.maximumRequired")), "ryeQuantity" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "grainsUsed.error.ryeQuantity.required", "grainsUsed.error.ryeQuantity.nonNumeric", "grainsUsed.error.ryeQuantity.decimalPlaces" - ).verifying(minimumValue(quantityMinValue, "grainsUsed.error.ryeQuantity.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "grainsUsed.error.ryeQuantity.maximumRequired")), + ).verifying(minimumValue(Constants.quantityMinimumValueIncZero, "grainsUsed.error.ryeQuantity.minimumRequired")) + .verifying(maximumValue(Constants.quantityMaximumValue, "grainsUsed.error.ryeQuantity.maximumRequired")), "unmaltedGrainQuantity" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "grainsUsed.error.unmaltedGrainQuantity.required", "grainsUsed.error.unmaltedGrainQuantity.nonNumeric", "grainsUsed.error.unmaltedGrainQuantity.decimalPlaces" - ).verifying(minimumValue(quantityMinValue, "grainsUsed.error.unmaltedGrainQuantity.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "grainsUsed.error.unmaltedGrainQuantity.maximumRequired")), + ).verifying( + minimumValue(Constants.quantityMinimumValueIncZero, "grainsUsed.error.unmaltedGrainQuantity.minimumRequired") + ).verifying( + maximumValue(Constants.quantityMaximumValue, "grainsUsed.error.unmaltedGrainQuantity.maximumRequired") + ), "usedMaltedGrainNotBarley" -> boolean("grainsUsed.error.usedMaltedGrainNotBarley.required") )(GrainsUsed.apply)(GrainsUsed.unapply) ) } - -object GrainsUsedFormProvider { - val quantityMaxDecimalPlaces = 2 - val quantityMinValue = BigDecimal(0.00) - val quantityMaxValue = BigDecimal(999999999.99) -} diff --git a/app/forms/spiritsQuestions/OtherIngredientsUsedFormProvider.scala b/app/forms/spiritsQuestions/OtherIngredientsUsedFormProvider.scala index 3a3af336..4abf5634 100644 --- a/app/forms/spiritsQuestions/OtherIngredientsUsedFormProvider.scala +++ b/app/forms/spiritsQuestions/OtherIngredientsUsedFormProvider.scala @@ -16,6 +16,8 @@ package forms.spiritsQuestions +import config.Constants + import javax.inject.Inject import forms.mappings.Mappings import models.UnitsOfMeasure @@ -24,32 +26,32 @@ import play.api.data.Forms._ import models.spiritsQuestions.OtherIngredientsUsed class OtherIngredientsUsedFormProvider @Inject() extends Mappings { - import OtherIngredientsUsedFormProvider._ - def apply(): Form[OtherIngredientsUsed] = Form( mapping( "otherIngredientsUsedTypes" -> text("otherIngredientsUsed.error.otherIngredientsUsedTypes.required") .verifying( - maxLength(otherIngredientTypesMaxLength, "otherIngredientsUsed.error.otherIngredientsUsedTypes.length") + maxLength( + Constants.otherIngredientsUsedMaxLength, + "otherIngredientsUsed.error.otherIngredientsUsedTypes.length" + ) ), "otherIngredientsUsedUnit" -> UnitsOfMeasure.formField, "otherIngredientsUsedQuantity" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "otherIngredientsUsed.error.otherIngredientsUsedQuantity.required", "otherIngredientsUsed.error.otherIngredientsUsedQuantity.nonNumeric", "otherIngredientsUsed.error.otherIngredientsUsedQuantity.decimalPlaces" ).verifying( - minimumValue(quantityMinValue, "otherIngredientsUsed.error.otherIngredientsUsedQuantity.minimumRequired") + minimumValue( + Constants.quantityMinimumValue, + "otherIngredientsUsed.error.otherIngredientsUsedQuantity.minimumRequired" + ) ).verifying( - maximumValue(quantityMaxValue, "otherIngredientsUsed.error.otherIngredientsUsedQuantity.maximumRequired") + maximumValue( + Constants.quantityMaximumValue, + "otherIngredientsUsed.error.otherIngredientsUsedQuantity.maximumRequired" + ) ) )(OtherIngredientsUsed.apply)(OtherIngredientsUsed.unapply) ) } - -object OtherIngredientsUsedFormProvider { - val otherIngredientTypesMaxLength = 120 - val quantityMaxDecimalPlaces = 2 - val quantityMinValue = BigDecimal(0.01) - val quantityMaxValue = BigDecimal(999999999.99) -} diff --git a/app/forms/spiritsQuestions/OtherMaltedGrainsFormProvider.scala b/app/forms/spiritsQuestions/OtherMaltedGrainsFormProvider.scala index 01e9ec3b..32b39bfc 100644 --- a/app/forms/spiritsQuestions/OtherMaltedGrainsFormProvider.scala +++ b/app/forms/spiritsQuestions/OtherMaltedGrainsFormProvider.scala @@ -16,34 +16,37 @@ package forms.spiritsQuestions -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.spiritsQuestions.OtherMaltedGrains class OtherMaltedGrainsFormProvider @Inject() extends Mappings { - import OtherMaltedGrainsFormProvider._ - def apply(): Form[OtherMaltedGrains] = Form( mapping( "otherMaltedGrainsTypes" -> text("otherMaltedGrains.error.otherMaltedGrainsTypes.required") - .verifying(maxLength(typesMaxLength, "otherMaltedGrains.error.otherMaltedGrainsTypes.length")), + .verifying( + maxLength(Constants.otherMaltedGrainsTypeMaxLength, "otherMaltedGrains.error.otherMaltedGrainsTypes.length") + ), "otherMaltedGrainsQuantity" -> bigDecimal( - quantityMaxDecimalPlaces, + Constants.maximumDecimalPlaces, "otherMaltedGrains.error.otherMaltedGrainsQuantity.required", "otherMaltedGrains.error.otherMaltedGrainsQuantity.nonNumeric", "otherMaltedGrains.error.otherMaltedGrainsQuantity.decimalPlaces" - ).verifying(minimumValue(quantityMinValue, "otherMaltedGrains.error.otherMaltedGrainsQuantity.minimumRequired")) - .verifying(maximumValue(quantityMaxValue, "otherMaltedGrains.error.otherMaltedGrainsQuantity.maximumRequired")) + ).verifying( + minimumValue( + Constants.quantityMinimumValue, + "otherMaltedGrains.error.otherMaltedGrainsQuantity.minimumRequired" + ) + ).verifying( + maximumValue( + Constants.quantityMaximumValue, + "otherMaltedGrains.error.otherMaltedGrainsQuantity.maximumRequired" + ) + ) )(OtherMaltedGrains.apply)(OtherMaltedGrains.unapply) ) } - -object OtherMaltedGrainsFormProvider { - val typesMaxLength = 120 - val quantityMaxDecimalPlaces = 2 - val quantityMinValue = BigDecimal(0.01) - val quantityMaxValue = BigDecimal(999999999.99) -} diff --git a/app/forms/spiritsQuestions/OtherSpiritsProducedFormProvider.scala b/app/forms/spiritsQuestions/OtherSpiritsProducedFormProvider.scala index 420334cd..a9d81212 100644 --- a/app/forms/spiritsQuestions/OtherSpiritsProducedFormProvider.scala +++ b/app/forms/spiritsQuestions/OtherSpiritsProducedFormProvider.scala @@ -16,21 +16,16 @@ package forms.spiritsQuestions -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form class OtherSpiritsProducedFormProvider @Inject() extends Mappings { - import OtherSpiritsProducedFormProvider._ - def apply(): Form[String] = Form( "otherSpiritsProduced" -> text("otherSpiritsProduced.error.required") - .verifying(maxLength(otherTypesLength, "otherSpiritsProduced.error.length")) + .verifying(maxLength(Constants.otherSpiritsProducedMaxLength, "otherSpiritsProduced.error.length")) ) } - -object OtherSpiritsProducedFormProvider { - val otherTypesLength = 150 -} diff --git a/app/forms/spiritsQuestions/SpiritTypeFormProvider.scala b/app/forms/spiritsQuestions/SpiritTypeFormProvider.scala index e4733289..63c90682 100644 --- a/app/forms/spiritsQuestions/SpiritTypeFormProvider.scala +++ b/app/forms/spiritsQuestions/SpiritTypeFormProvider.scala @@ -24,7 +24,6 @@ import play.api.data.Forms.set import models.SpiritType class SpiritTypeFormProvider @Inject() extends Mappings { - def apply(): Form[Set[SpiritType]] = Form( "value" -> set(enumerable[SpiritType]("spiritType.error.required")) diff --git a/app/forms/spiritsQuestions/WhiskyFormProvider.scala b/app/forms/spiritsQuestions/WhiskyFormProvider.scala index 5a95442d..8958d3c3 100644 --- a/app/forms/spiritsQuestions/WhiskyFormProvider.scala +++ b/app/forms/spiritsQuestions/WhiskyFormProvider.scala @@ -16,31 +16,31 @@ package forms.spiritsQuestions -import javax.inject.Inject +import config.Constants +import javax.inject.Inject import forms.mappings.Mappings import play.api.data.Form import play.api.data.Forms._ import models.spiritsQuestions.Whisky class WhiskyFormProvider @Inject() extends Mappings { - def apply(): Form[Whisky] = Form( mapping( "scotchWhisky" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "whisky.error.scotchWhisky.required", "whisky.error.scotchWhisky.nonNumeric", "whisky.error.scotchWhisky.decimalPlaces" - ).verifying(minimumValue(BigDecimal(0.00), "whisky.error.scotchWhisky.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "whisky.error.scotchWhisky.maximumRequired")), + ).verifying(minimumValue(Constants.volumeMinimumValueIncZero, "whisky.error.scotchWhisky.minimumRequired")) + .verifying(maximumValue(Constants.volumeMaximumValue, "whisky.error.scotchWhisky.maximumRequired")), "irishWhiskey" -> bigDecimal( - 2, + Constants.maximumDecimalPlaces, "whisky.error.irishWhiskey.required", "whisky.error.irishWhiskey.nonNumeric", "whisky.error.irishWhiskey.decimalPlaces" - ).verifying(minimumValue(BigDecimal(0.00), "whisky.error.irishWhiskey.minimumRequired")) - .verifying(maximumValue(BigDecimal(999999999.99), "whisky.error.irishWhiskey.maximumRequired")) + ).verifying(minimumValue(Constants.volumeMinimumValueIncZero, "whisky.error.irishWhiskey.minimumRequired")) + .verifying(maximumValue(Constants.volumeMaximumValue, "whisky.error.irishWhiskey.maximumRequired")) )(Whisky.apply)(Whisky.unapply) ) } diff --git a/app/models/DutyCalculation.scala b/app/models/DutyCalculation.scala index 49343900..fb233671 100644 --- a/app/models/DutyCalculation.scala +++ b/app/models/DutyCalculation.scala @@ -42,10 +42,13 @@ case class RepackagedDutyChangeRequest( newDuty: BigDecimal, oldDuty: BigDecimal ) + object RepackagedDutyChangeRequest { implicit val formats: OFormat[RepackagedDutyChangeRequest] = Json.format[RepackagedDutyChangeRequest] } + case class AdjustmentTotalCalculationRequest(dutyList: Seq[BigDecimal]) + object AdjustmentTotalCalculationRequest { implicit val formats: OFormat[AdjustmentTotalCalculationRequest] = Json.format[AdjustmentTotalCalculationRequest] } diff --git a/app/viewmodels/InputWidth.scala b/app/viewmodels/InputWidth.scala index 1a59af93..ebc0cdea 100644 --- a/app/viewmodels/InputWidth.scala +++ b/app/viewmodels/InputWidth.scala @@ -16,22 +16,24 @@ package viewmodels +import config.Constants.Css + sealed trait InputWidth object InputWidth { - case object Fixed2 extends WithCssClass("govuk-input--width-2") with InputWidth - case object Fixed3 extends WithCssClass("govuk-input--width-3") with InputWidth - case object Fixed4 extends WithCssClass("govuk-input--width-4") with InputWidth - case object Fixed5 extends WithCssClass("govuk-input--width-5") with InputWidth - case object Fixed10 extends WithCssClass("govuk-input--width-10") with InputWidth - case object Fixed20 extends WithCssClass("govuk-input--width-20") with InputWidth - case object Fixed30 extends WithCssClass("govuk-input--width-30") with InputWidth + case object Fixed2 extends WithCssClass(Css.inputWidth2CssClass) with InputWidth + case object Fixed3 extends WithCssClass(Css.inputWidth3CssClass) with InputWidth + case object Fixed4 extends WithCssClass(Css.inputWidth4CssClass) with InputWidth + case object Fixed5 extends WithCssClass(Css.inputWidth5CssClass) with InputWidth + case object Fixed10 extends WithCssClass(Css.inputWidth10CssClass) with InputWidth + case object Fixed20 extends WithCssClass(Css.inputWidth20CssClass) with InputWidth + case object Fixed30 extends WithCssClass(Css.inputWidth30CssClass) with InputWidth - case object Full extends WithCssClass("govuk-!-width-full") with InputWidth - case object ThreeQuarters extends WithCssClass("govuk-!-width-three-quarters") with InputWidth - case object TwoThirds extends WithCssClass("govuk-!-width-two-thirds") with InputWidth - case object OneHalf extends WithCssClass("govuk-!-width-one-half") with InputWidth - case object OneThird extends WithCssClass("govuk-!-width-one-third") with InputWidth - case object OneQuarter extends WithCssClass("govuk-!-width-one-quarter") with InputWidth + case object Full extends WithCssClass(Css.fullWidthCssClass) with InputWidth + case object ThreeQuarters extends WithCssClass(Css.threeQuartersCssClass) with InputWidth + case object TwoThirds extends WithCssClass(Css.twoThirdsCssClass) with InputWidth + case object OneHalf extends WithCssClass(Css.oneHalfCssClass) with InputWidth + case object OneThird extends WithCssClass(Css.oneThirdCssClass) with InputWidth + case object OneQuarter extends WithCssClass(Css.oneQuarterCssClass) with InputWidth } diff --git a/app/viewmodels/LabelSize.scala b/app/viewmodels/LabelSize.scala index 4e3167e1..1d89ed28 100644 --- a/app/viewmodels/LabelSize.scala +++ b/app/viewmodels/LabelSize.scala @@ -16,11 +16,13 @@ package viewmodels +import config.Constants.Css + sealed trait LabelSize object LabelSize { - case object ExtraLarge extends WithCssClass("govuk-label--xl") with LabelSize - case object Large extends WithCssClass("govuk-label--l") with LabelSize - case object Medium extends WithCssClass("govuk-label--m") with LabelSize - case object Small extends WithCssClass("govuk-label--s") with LabelSize + case object ExtraLarge extends WithCssClass(Css.labelXLCssClass) with LabelSize + case object Large extends WithCssClass(Css.labelLCssClass) with LabelSize + case object Medium extends WithCssClass(Css.labelMCssClass) with LabelSize + case object Small extends WithCssClass(Css.labelSCssClass) with LabelSize } diff --git a/app/viewmodels/LegendSize.scala b/app/viewmodels/LegendSize.scala index 820dd6dc..5c88264d 100644 --- a/app/viewmodels/LegendSize.scala +++ b/app/viewmodels/LegendSize.scala @@ -16,11 +16,13 @@ package viewmodels +import config.Constants.Css + sealed trait LegendSize object LegendSize { - case object ExtraLarge extends WithCssClass("govuk-fieldset__legend--xl") with LegendSize - case object Large extends WithCssClass("govuk-fieldset__legend--l") with LegendSize - case object Medium extends WithCssClass("govuk-fieldset__legend--m") with LegendSize - case object Small extends WithCssClass("govuk-fieldset__legend--s") with LegendSize + case object ExtraLarge extends WithCssClass(Css.fieldsetLegendXLCssClass) with LegendSize + case object Large extends WithCssClass(Css.fieldsetLegendLCssClass) with LegendSize + case object Medium extends WithCssClass(Css.fieldsetLegendMCssClass) with LegendSize + case object Small extends WithCssClass(Css.fieldsetLegendSCssClass) with LegendSize } diff --git a/app/viewmodels/checkAnswers/adjustment/AdjustmentListSummaryHelper.scala b/app/viewmodels/checkAnswers/adjustment/AdjustmentListSummaryHelper.scala index a8a38851..3713020b 100644 --- a/app/viewmodels/checkAnswers/adjustment/AdjustmentListSummaryHelper.scala +++ b/app/viewmodels/checkAnswers/adjustment/AdjustmentListSummaryHelper.scala @@ -16,7 +16,7 @@ package viewmodels.checkAnswers.adjustment -import config.Constants +import config.Constants.Css import config.Constants.rowsPerPage import models.UserAnswers import models.adjustment.AdjustmentEntry @@ -37,15 +37,15 @@ object AdjustmentListSummaryHelper { val adjustmentEntries: Seq[AdjustmentEntry] = getPaginatedAdjustmentEntries(userAnswers, pageNumber) TableViewModel( head = Seq( - HeadCell(content = Text(messages("adjustmentEntryList.type")), classes = Constants.oneQuarterCssClass), - HeadCell(content = Text(messages("adjustmentEntryList.description")), classes = Constants.oneQuarterCssClass), + HeadCell(content = Text(messages("adjustmentEntryList.type")), classes = Css.oneQuarterCssClass), + HeadCell(content = Text(messages("adjustmentEntryList.description")), classes = Css.oneQuarterCssClass), HeadCell( content = Text(messages("adjustmentEntryList.duty")), - classes = s"${Constants.oneQuarterCssClass} ${Constants.textAlignRightCssClass}" + classes = s"${Css.oneQuarterCssClass} ${Css.textAlignRightCssClass}" ), HeadCell( content = Text(messages("adjustmentEntryList.action")), - classes = Constants.oneQuarterCssClass + classes = Css.oneQuarterCssClass ) ), rows = getAdjustmentEntryRows(adjustmentEntries, pageNumber), @@ -93,7 +93,7 @@ object AdjustmentListSummaryHelper { TableRow(description), TableRow( content = Text(formattedDutyValue), - classes = Constants.textAlignRightCssClass + classes = Css.textAlignRightCssClass ) ), actions = Seq( @@ -125,11 +125,11 @@ object AdjustmentListSummaryHelper { TableTotalViewModel( HeadCell( content = Text(messages("adjustmentList.total")), - classes = Constants.threeQuartersCssClass + classes = Css.threeQuartersCssClass ), HeadCell( content = Text(Money.format(total)), - classes = s"${Constants.oneQuarterCssClass} ${Constants.textAlignRightCssClass}" + classes = s"${Css.oneQuarterCssClass} ${Css.textAlignRightCssClass}" ) ) diff --git a/app/viewmodels/checkAnswers/adjustment/AdjustmentOverUnderDeclarationCalculationHelper.scala b/app/viewmodels/checkAnswers/adjustment/AdjustmentOverUnderDeclarationCalculationHelper.scala index 8e2a9801..cfa72a18 100644 --- a/app/viewmodels/checkAnswers/adjustment/AdjustmentOverUnderDeclarationCalculationHelper.scala +++ b/app/viewmodels/checkAnswers/adjustment/AdjustmentOverUnderDeclarationCalculationHelper.scala @@ -16,6 +16,7 @@ package viewmodels.checkAnswers.adjustment +import config.Constants import connectors.AlcoholDutyCalculatorConnector import models.UserAnswers import models.adjustment.{AdjustmentDuty, AdjustmentType} @@ -90,5 +91,5 @@ class AdjustmentOverUnderDeclarationCalculationHelper @Inject() ( total: BigDecimal, userAnswers: UserAnswers ): Try[UserAnswers] = - if (total.abs < 1000) userAnswers.remove(reasonPage) else Try(userAnswers) + if (total.abs < Constants.overUnderDeclarationThreshold) userAnswers.remove(reasonPage) else Try(userAnswers) } diff --git a/app/viewmodels/checkAnswers/checkAndSubmit/DutyDueForThisReturnHelper.scala b/app/viewmodels/checkAnswers/checkAndSubmit/DutyDueForThisReturnHelper.scala index 2892033d..f010e9a3 100644 --- a/app/viewmodels/checkAnswers/checkAndSubmit/DutyDueForThisReturnHelper.scala +++ b/app/viewmodels/checkAnswers/checkAndSubmit/DutyDueForThisReturnHelper.scala @@ -17,7 +17,7 @@ package viewmodels.checkAnswers.checkAndSubmit import cats.data.EitherT -import config.Constants.{boldFontCssClass, summaryListKey, summaryListValue} +import config.Constants.Css import connectors.AlcoholDutyCalculatorConnector import models.AlcoholRegime.{Beer, Cider, OtherFermentedProduct, Spirits, Wine} import models.checkAndSubmit.AdrDutySuspended @@ -127,13 +127,13 @@ class DutyDueForThisReturnHelper @Inject() ( cells = Seq( TableRow( content = Text(messages("dutyDueForThisReturn.table.nil.label")), - classes = boldFontCssClass + classes = Css.boldFontCssClass ), TableRow(Text(messages("dutyDueForThisReturn.table.nil.value"))) ), actions = Seq( TableRowActionViewModel( - label = "Change", + label = messages("site.change"), href = controllers.declareDuty.routes.DeclareAlcoholDutyQuestionController.onPageLoad(NormalMode) ) ) @@ -145,13 +145,13 @@ class DutyDueForThisReturnHelper @Inject() ( cells = Seq( TableRow( content = Text(messages("dutyDueForThisReturn.table.dutyDue", messages(s"alcoholType.$alcoholRegime"))), - classes = boldFontCssClass + classes = Css.boldFontCssClass ), TableRow(Text(Money.format(alcoholDuty.totalDuty))) ), actions = Seq( TableRowActionViewModel( - label = "Change", + label = messages("site.change"), href = controllers.declareDuty.routes.CheckYourAnswersController.onPageLoad(alcoholRegime) ) ) @@ -168,11 +168,11 @@ class DutyDueForThisReturnHelper @Inject() ( cells = Seq( TableRow( content = Text(messages("dutyDueForThisReturn.dutySuspended.alcohol")), - classes = s"$boldFontCssClass $summaryListKey" + classes = s"${Css.boldFontCssClass} ${Css.summaryListKeyCssClass}" ), TableRow( Text(messages("dutyDueForThisReturn.dutySuspended.declared")), - classes = summaryListValue + classes = Css.summaryListValueCssClass ) ), actions = Seq( @@ -190,11 +190,11 @@ class DutyDueForThisReturnHelper @Inject() ( cells = Seq( TableRow( content = Text(messages("dutyDueForThisReturn.dutySuspended.alcohol")), - classes = s"$boldFontCssClass $summaryListKey" + classes = s"${Css.boldFontCssClass} ${Css.summaryListKeyCssClass}" ), TableRow( Text(messages("dutyDueForThisReturn.dutySuspended.nothingToDeclare")), - classes = summaryListValue + classes = Css.summaryListValueCssClass ) ), actions = Seq( @@ -214,16 +214,16 @@ class DutyDueForThisReturnHelper @Inject() ( cells = Seq( TableRow( content = Text(messages("dutyDueForThisReturn.table.adjustmentDue")), - classes = s"$boldFontCssClass $summaryListKey" + classes = s"${Css.boldFontCssClass} ${Css.summaryListKeyCssClass}" ), TableRow( content = Text(messages("dutyDueForThisReturn.table.nil.value")), - classes = summaryListValue + classes = Css.summaryListValueCssClass ) ), actions = Seq( TableRowActionViewModel( - label = "Change", + label = messages("site.change"), href = controllers.adjustment.routes.DeclareAdjustmentQuestionController.onPageLoad(NormalMode) ) ) @@ -233,16 +233,16 @@ class DutyDueForThisReturnHelper @Inject() ( cells = Seq( TableRow( content = Text(messages("dutyDueForThisReturn.table.adjustmentDue")), - classes = s"$boldFontCssClass $summaryListKey" + classes = s"${Css.boldFontCssClass} ${Css.summaryListKeyCssClass}" ), TableRow( Text(Money.format(totalAdjustment)), - classes = summaryListValue + classes = Css.summaryListValueCssClass ) ), actions = Seq( TableRowActionViewModel( - label = "Change", + label = messages("site.change"), href = controllers.adjustment.routes.AdjustmentListController.onPageLoad(1) ) ) diff --git a/app/viewmodels/declareDuty/DutyCalculationHelper.scala b/app/viewmodels/declareDuty/DutyCalculationHelper.scala index 0798c8f2..9b6be210 100644 --- a/app/viewmodels/declareDuty/DutyCalculationHelper.scala +++ b/app/viewmodels/declareDuty/DutyCalculationHelper.scala @@ -23,6 +23,7 @@ import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Text import uk.gov.hmrc.govukfrontend.views.viewmodels.table.{HeadCell, TableRow} import RateBandHelper.rateBandRecap +import config.Constants.Format import viewmodels.{TableRowActionViewModel, TableRowViewModel, TableViewModel} object DutyCalculationHelper { @@ -36,9 +37,9 @@ object DutyCalculationHelper { TableViewModel( head = Seq( HeadCell(Text(messages("dutyCalculation.table.description"))), - HeadCell(Text(messages("dutyCalculation.table.litresOfPureAlcohol")), format = Some("numeric")), - HeadCell(Text(messages("dutyCalculation.table.dutyRate")), format = Some("numeric")), - HeadCell(Text(messages("dutyCalculation.table.dutyDue")), format = Some("numeric")), + HeadCell(Text(messages("dutyCalculation.table.litresOfPureAlcohol")), format = Some(Format.numeric)), + HeadCell(Text(messages("dutyCalculation.table.dutyRate")), format = Some(Format.numeric)), + HeadCell(Text(messages("dutyCalculation.table.dutyDue")), format = Some(Format.numeric)), HeadCell(Text(messages("dutyCalculation.table.action"))) ), rows = rows @@ -79,13 +80,13 @@ object DutyCalculationHelper { TableRowViewModel( cells = Seq( TableRow(Text(rateBandRecap(rateBand))), - TableRow(Text(messages("site.4DP", totalByTaxType.pureAlcohol)), format = Some("numeric")), - TableRow(Text(messages("site.currency.2DP", totalByTaxType.dutyRate)), format = Some("numeric")), - TableRow(Text(messages("site.currency.2DP", totalByTaxType.dutyDue)), format = Some("numeric")) + TableRow(Text(messages("site.4DP", totalByTaxType.pureAlcohol)), format = Some(Format.numeric)), + TableRow(Text(messages("site.currency.2DP", totalByTaxType.dutyRate)), format = Some(Format.numeric)), + TableRow(Text(messages("site.currency.2DP", totalByTaxType.dutyDue)), format = Some(Format.numeric)) ), actions = Seq( TableRowActionViewModel( - label = "Change", + label = messages("site.change"), href = controllers.declareDuty.routes.CheckYourAnswersController.onPageLoad(regime), visuallyHiddenText = Some(rateBandRecap(rateBand)) ) diff --git a/app/viewmodels/declareDuty/HowMuchDoYouNeedToDeclareSummary.scala b/app/viewmodels/declareDuty/HowMuchDoYouNeedToDeclareSummary.scala index 2f6ade63..d5f86983 100644 --- a/app/viewmodels/declareDuty/HowMuchDoYouNeedToDeclareSummary.scala +++ b/app/viewmodels/declareDuty/HowMuchDoYouNeedToDeclareSummary.scala @@ -24,7 +24,7 @@ import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Text import uk.gov.hmrc.govukfrontend.views.viewmodels.summarylist.{Actions, Card, CardTitle, SummaryList, SummaryListRow, Value} import RateBandHelper.rateBandRecap -import config.Constants +import config.Constants.Css import viewmodels.govuk.summarylist._ import viewmodels.implicits._ @@ -100,7 +100,7 @@ object HowMuchDoYouNeedToDeclareSummary { val headRow = SummaryListRowViewModel( key = messages(s"howMuchDoYouNeedToDeclare.checkYourAnswersLabel.row.head.${rateType.toString}"), value = ValueViewModel("") - ).withCssClass(Constants.tableRowNoBorderCssClass) + ).withCssClass(Css.summaryListRowNoBorderCssClass) val dutyRows = rateBands.toSeq.sortBy(_.taxTypeCode).map { rateBand => dutyByTaxTypes.find(_.taxType == rateBand.taxTypeCode) match { @@ -109,13 +109,13 @@ object HowMuchDoYouNeedToDeclareSummary { SummaryListRowViewModel( key = KeyViewModel(rateBandRecap(rateBand)), value = Value() - ).withCssClass(Constants.tableRowNoBorderCssClass), + ).withCssClass(Css.summaryListRowNoBorderCssClass), SummaryListRowViewModel( key = messages("howMuchDoYouNeedToDeclare.checkYourAnswersLabel.row.totalLitres"), value = ValueViewModel( s"${messages("site.2DP", dutyByTaxType.totalLitres)} ${messages("site.unit.litres")}" ) - ).withCssClass(Constants.tableRowNoBorderCssClass), + ).withCssClass(Css.summaryListRowNoBorderCssClass), SummaryListRowViewModel( key = messages("howMuchDoYouNeedToDeclare.checkYourAnswersLabel.row.pureAlcohol"), value = ValueViewModel( diff --git a/app/viewmodels/declareDuty/MultipleSPRListHelper.scala b/app/viewmodels/declareDuty/MultipleSPRListHelper.scala index e2b44293..17930fd6 100644 --- a/app/viewmodels/declareDuty/MultipleSPRListHelper.scala +++ b/app/viewmodels/declareDuty/MultipleSPRListHelper.scala @@ -23,6 +23,7 @@ import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.Aliases.{HeadCell, Text} import uk.gov.hmrc.govukfrontend.views.viewmodels.table.TableRow import RateBandHelper.rateBandRecap +import config.Constants.{Css, Format} import viewmodels.{TableRowActionViewModel, TableRowViewModel, TableViewModel} object MultipleSPRListHelper { @@ -36,24 +37,23 @@ object MultipleSPRListHelper { TableViewModel( head = Seq( HeadCell( - content = Text(messages("multipleSPRList.description.label")), - classes = "govuk-!-width-half" + content = Text(messages("multipleSPRList.description.label")) ), HeadCell( - format = Some("numeric"), + format = Some(Format.numeric), content = Text(messages("multipleSPRList.totalLitres.label")) ), HeadCell( - format = Some("numeric"), + format = Some(Format.numeric), content = Text(messages("multipleSPRList.pureAlcohol.label")) ), HeadCell( - format = Some("numeric"), + format = Some(Format.numeric), content = Text(messages("multipleSPRList.dutyRate.label")) ), HeadCell( content = Text(messages("multipleSPRList.action.label")), - classes = "govuk-!-width-one-quarter" + classes = Css.oneQuarterCssClass ) ), rows = getSPREntryRows(sprList, regime) @@ -94,9 +94,9 @@ object MultipleSPRListHelper { TableRowViewModel( cells = Seq( TableRow(Text(rateBandRecap(sprEntry.rateBand))), - TableRow(Text(messages("site.2DP", sprEntry.dutyByTaxType.totalLitres)), format = Some("numeric")), - TableRow(Text(messages("site.4DP", sprEntry.dutyByTaxType.pureAlcohol)), format = Some("numeric")), - TableRow(Text(messages("site.currency.2DP", sprEntry.dutyByTaxType.dutyRate)), format = Some("numeric")) + TableRow(Text(messages("site.2DP", sprEntry.dutyByTaxType.totalLitres)), format = Some(Format.numeric)), + TableRow(Text(messages("site.4DP", sprEntry.dutyByTaxType.pureAlcohol)), format = Some(Format.numeric)), + TableRow(Text(messages("site.currency.2DP", sprEntry.dutyByTaxType.dutyRate)), format = Some(Format.numeric)) ), actions = Seq( TableRowActionViewModel( diff --git a/app/viewmodels/declareDuty/MultipleSPRListSummary.scala b/app/viewmodels/declareDuty/MultipleSPRListSummary.scala index 0d3102e6..32bd01d4 100644 --- a/app/viewmodels/declareDuty/MultipleSPRListSummary.scala +++ b/app/viewmodels/declareDuty/MultipleSPRListSummary.scala @@ -21,7 +21,7 @@ import pages.declareDuty.{MultipleSPRListPage, WhatDoYouNeedToDeclarePage} import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.summarylist.{SummaryListRow, Value} import RateBandHelper.rateBandRecap -import config.Constants +import config.Constants.Css import viewmodels.govuk.summarylist._ import viewmodels.implicits._ @@ -55,11 +55,11 @@ object MultipleSPRListSummary { SummaryListRowViewModel( key = KeyViewModel(rateBandRecap(rateBand)), value = Value() - ).withCssClass(Constants.tableRowNoBorderCssClass), + ).withCssClass(Css.summaryListRowNoBorderCssClass), SummaryListRowViewModel( key = messages("checkYourAnswersLabel.row.totalLitres"), value = ValueViewModel(s"${messages("site.2DP", totalLitres)} ${messages("site.unit.litres")}") - ).withCssClass(Constants.tableRowNoBorderCssClass), + ).withCssClass(Css.summaryListRowNoBorderCssClass), SummaryListRowViewModel( key = messages("checkYourAnswersLabel.row.pureAlcohol"), value = ValueViewModel(s"${messages("site.4DP", pureAlcohol)} ${messages("site.unit.litres")}") diff --git a/app/viewmodels/declareDuty/TellUsAboutSingleSPRRateSummary.scala b/app/viewmodels/declareDuty/TellUsAboutSingleSPRRateSummary.scala index 4621181c..80783037 100644 --- a/app/viewmodels/declareDuty/TellUsAboutSingleSPRRateSummary.scala +++ b/app/viewmodels/declareDuty/TellUsAboutSingleSPRRateSummary.scala @@ -21,6 +21,7 @@ import pages.declareDuty.{TellUsAboutSingleSPRRatePage, WhatDoYouNeedToDeclarePa import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.summarylist.{SummaryListRow, Value} import RateBandHelper.rateBandRecap +import config.Constants.Css import viewmodels.govuk.summarylist._ import viewmodels.implicits._ @@ -38,19 +39,19 @@ object TellUsAboutSingleSPRRateSummary { SummaryListRowViewModel( key = KeyViewModel(rateBandRecap(rateBand)), value = Value() - ).withCssClass("govuk-summary-list__row--no-border"), + ).withCssClass(Css.summaryListRowNoBorderCssClass), SummaryListRowViewModel( key = messages("checkYourAnswersLabel.row.totalLitres"), value = ValueViewModel( s"${messages("site.2DP", dutyByTaxType.totalLitres)} ${messages("site.unit.litres")}" ) - ).withCssClass("govuk-summary-list__row--no-border"), + ).withCssClass(Css.summaryListRowNoBorderCssClass), SummaryListRowViewModel( key = messages("checkYourAnswersLabel.row.pureAlcohol"), value = ValueViewModel( s"${messages("site.4DP", dutyByTaxType.pureAlcohol)} ${messages("site.unit.litres")}" ) - ).withCssClass("govuk-summary-list__row--no-border"), + ).withCssClass(Css.summaryListRowNoBorderCssClass), SummaryListRowViewModel( key = messages("checkYourAnswersLabel.row.dutyRate"), value = ValueViewModel(messages("site.currency.2DP", dutyByTaxType.dutyRate)) diff --git a/app/viewmodels/govuk/ButtonFluency.scala b/app/viewmodels/govuk/ButtonFluency.scala index a0311ef8..15e4a580 100644 --- a/app/viewmodels/govuk/ButtonFluency.scala +++ b/app/viewmodels/govuk/ButtonFluency.scala @@ -16,6 +16,7 @@ package viewmodels.govuk +import config.Constants.Css import uk.gov.hmrc.govukfrontend.views.viewmodels.button.Button import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Content @@ -66,9 +67,9 @@ trait ButtonFluency { button.copy(isStartButton = true) def asSecondaryButton(): Button = - withCssClass("govuk-button--secondary") + withCssClass(Css.secondaryButtonCssClass) def asWarningButton(): Button = - withCssClass("govuk-button--warning") + withCssClass(Css.warningButtonCssClass) } } diff --git a/app/viewmodels/govuk/DateFluency.scala b/app/viewmodels/govuk/DateFluency.scala index c1c7cf7c..a3d286f8 100644 --- a/app/viewmodels/govuk/DateFluency.scala +++ b/app/viewmodels/govuk/DateFluency.scala @@ -16,6 +16,7 @@ package viewmodels.govuk +import config.Constants.Css import play.api.data.Field import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.dateinput.{DateInput, InputItem} @@ -47,7 +48,7 @@ trait DateFluency { fieldset: Fieldset )(implicit messages: Messages): DateInput = { - val errorClass = if (errorMessage(field).isDefined) "govuk-input--error" else "" + val errorClass = if (errorMessage(field).isDefined) Css.inputErrorCssClass else "" val items = Seq( InputItem( @@ -55,21 +56,21 @@ trait DateFluency { name = s"${field.name}.day", value = field("day").value, label = Some(messages("date.day")), - classes = s"govuk-input--width-2 $errorClass".trim + classes = s"${Css.inputWidth2CssClass} $errorClass".trim ), InputItem( id = s"${field.id}.month", name = s"${field.name}.month", value = field("month").value, label = Some(messages("date.month")), - classes = s"govuk-input--width-2 $errorClass".trim + classes = s"${Css.inputWidth2CssClass} $errorClass".trim ), InputItem( id = s"${field.id}.year", name = s"${field.name}.year", value = field("year").value, label = Some(messages("date.year")), - classes = s"govuk-input--width-4 $errorClass".trim + classes = s"${Css.inputWidth4CssClass} $errorClass".trim ) ) diff --git a/app/viewmodels/govuk/FieldsetFluency.scala b/app/viewmodels/govuk/FieldsetFluency.scala index a16147ce..23218dcb 100644 --- a/app/viewmodels/govuk/FieldsetFluency.scala +++ b/app/viewmodels/govuk/FieldsetFluency.scala @@ -16,6 +16,7 @@ package viewmodels.govuk +import config.Constants.Css import play.twirl.api.Html import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Content import uk.gov.hmrc.govukfrontend.views.viewmodels.fieldset.{Fieldset, Legend} @@ -70,9 +71,9 @@ trait FieldsetFluency { legend.copy(classes = s"${legend.classes} $newClass") def asSubheading: Legend = - legend.withCssClass("govuk-fieldset__legend--m") + legend.withCssClass(Css.fieldsetLegendMCssClass) def asVisuallyHidden(): Legend = - withCssClass("govuk-visually-hidden") + withCssClass(Css.visuallyHiddenCssClass) } } diff --git a/app/viewmodels/govuk/LabelFluency.scala b/app/viewmodels/govuk/LabelFluency.scala index 9786e8a9..a5f5d0e9 100644 --- a/app/viewmodels/govuk/LabelFluency.scala +++ b/app/viewmodels/govuk/LabelFluency.scala @@ -16,7 +16,7 @@ package viewmodels.govuk -import config.Constants.visuallyHiddenCssClass +import config.Constants.Css import uk.gov.hmrc.govukfrontend.views.viewmodels.content.{Content, HtmlContent} import uk.gov.hmrc.govukfrontend.views.viewmodels.label.Label import viewmodels.LabelSize @@ -31,10 +31,9 @@ trait LabelFluency { Label(content = content) def apply(visibleText: String, hiddenText: String): Label = { - val content = HtmlContent(s"$visibleText $hiddenText") + val content = HtmlContent(s"$visibleText $hiddenText") Label(content = content) } - } implicit class FluentLabel(label: Label) { @@ -48,7 +47,7 @@ trait LabelFluency { label.copy(classes = s"${label.classes} $className") def asSubheading: Label = - label.withCssClass("govuk-label--m govuk-!-margin-bottom-0") + label.withCssClass(s"${Css.labelMCssClass} ${Css.marginBottom0CssClass}") def withAttribute(attribute: (String, String)): Label = label.copy(attributes = label.attributes + attribute) @@ -57,12 +56,12 @@ trait LabelFluency { label.copy(forAttr = Some(attr)) def asVisuallyHidden(): Label = - withCssClass("govuk-visually-hidden") + withCssClass(Css.visuallyHiddenCssClass) def withHiddenText(visibleText: String, hiddenText: String): Label = label.copy(content = HtmlContent( - s"$visibleText $hiddenText" + s"$visibleText $hiddenText" ) ) } diff --git a/app/viewmodels/govuk/RadiosFluency.scala b/app/viewmodels/govuk/RadiosFluency.scala index 0680e179..9921bf04 100644 --- a/app/viewmodels/govuk/RadiosFluency.scala +++ b/app/viewmodels/govuk/RadiosFluency.scala @@ -16,6 +16,7 @@ package viewmodels.govuk +import config.Constants.Css import play.api.data.Field import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Text @@ -110,6 +111,6 @@ trait RadiosFluency { radios.copy(attributes = radios.attributes + attribute) def inline(): Radios = - radios.withCssClass("govuk-radios--inline") + radios.withCssClass(Css.inlineRadiosCssClass) } } diff --git a/app/viewmodels/govuk/SummaryListFluency.scala b/app/viewmodels/govuk/SummaryListFluency.scala index 5271d873..8fdf668c 100644 --- a/app/viewmodels/govuk/SummaryListFluency.scala +++ b/app/viewmodels/govuk/SummaryListFluency.scala @@ -16,6 +16,7 @@ package viewmodels.govuk +import config.Constants.Css import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Content import uk.gov.hmrc.govukfrontend.views.viewmodels.summarylist._ @@ -32,7 +33,7 @@ trait SummaryListFluency { implicit class FluentSummaryList(list: SummaryList) { def withoutBorders(): SummaryList = - list.copy(classes = s"${list.classes} govuk-summary-list--no-border") + list.copy(classes = s"${list.classes} ${Css.summaryListNoBorderCssClass}") def withCssClass(className: String): SummaryList = list.copy(classes = s"${list.classes} $className") diff --git a/app/viewmodels/govuk/TagFluency.scala b/app/viewmodels/govuk/TagFluency.scala index 5506accc..b923dd35 100644 --- a/app/viewmodels/govuk/TagFluency.scala +++ b/app/viewmodels/govuk/TagFluency.scala @@ -16,6 +16,7 @@ package viewmodels.govuk +import config.Constants.Css import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Content import uk.gov.hmrc.govukfrontend.views.viewmodels.tag.Tag @@ -38,30 +39,33 @@ trait TagFluency { tag.copy(attributes = tag.attributes + attribute) def grey(): Tag = - withCssClass("govuk-tag--grey") + withCssClass(Css.greyTagCssClass) def green(): Tag = - withCssClass("govuk-tag--green") + withCssClass(Css.greenTagCssClass) def turquoise(): Tag = - withCssClass("govuk-tag--turquoise") + withCssClass(Css.turquoiseCssClass) + + def lightBlue(): Tag = + withCssClass(Css.lightBlueTagCssClass) def blue(): Tag = - withCssClass("govuk-tag--blue") + withCssClass(Css.blueTagCssClass) def purple(): Tag = - withCssClass("govuk-tag--purple") + withCssClass(Css.purpleCssClass) def pink(): Tag = - withCssClass("govuk-tag--pink") + withCssClass(Css.pinkCssClass) def red(): Tag = - withCssClass("govuk-tag--red") + withCssClass(Css.redTagCssClass) def orange(): Tag = - withCssClass("govuk-tag--orange") + withCssClass(Css.orangeCssClass) def yellow(): Tag = - withCssClass("govuk-tag--yellow") + withCssClass(Css.yellowTagCssClass) } } diff --git a/app/viewmodels/govuk/YearMonthDateFluency.scala b/app/viewmodels/govuk/YearMonthDateFluency.scala index c33d27f4..df96faea 100644 --- a/app/viewmodels/govuk/YearMonthDateFluency.scala +++ b/app/viewmodels/govuk/YearMonthDateFluency.scala @@ -16,6 +16,7 @@ package viewmodels.govuk +import config.Constants.Css import play.api.data.Form import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.dateinput.{DateInput, InputItem} @@ -48,7 +49,7 @@ trait YearMonthDateFluency { val field = form(id) def errorClass(id: String) = - if (errorMessage(field).isDefined || errorMessage(form(id)).isDefined) "govuk-input--error" else "" + if (errorMessage(field).isDefined || errorMessage(form(id)).isDefined) Css.inputErrorCssClass else "" val monthId = s"${field.id}.month" val yearId = s"${field.id}.year" @@ -62,14 +63,14 @@ trait YearMonthDateFluency { name = s"${field.name}.month", value = field("month").value, label = Some(messages("date.month")), - classes = s"govuk-input--width-2 ${errorClass(monthId)}".trim + classes = s"${Css.inputWidth2CssClass} ${errorClass(monthId)}".trim ), InputItem( id = yearId, name = s"${field.name}.year", value = field("year").value, label = Some(messages("date.year")), - classes = s"govuk-input--width-4 ${errorClass(yearId)}".trim + classes = s"${Css.inputWidth4CssClass} ${errorClass(yearId)}".trim ) ) diff --git a/app/viewmodels/payments/ViewPastPaymentsViewModel.scala b/app/viewmodels/payments/ViewPastPaymentsViewModel.scala index 9b8f8df1..92fb0e2b 100644 --- a/app/viewmodels/payments/ViewPastPaymentsViewModel.scala +++ b/app/viewmodels/payments/ViewPastPaymentsViewModel.scala @@ -16,8 +16,7 @@ package viewmodels.payments -import config.Constants -import config.Constants.boldFontCssClass +import config.Constants.Css import models.OutstandingPaymentStatusToDisplay.{Due, NothingToPay, Overdue} import models.TransactionType.RPI import models.{HistoricPayment, OutstandingPayment, OutstandingPaymentStatusToDisplay, TransactionType, UnallocatedPayment} @@ -52,7 +51,7 @@ class ViewPastPaymentsViewModel @Inject() (dateTimeHelper: DateTimeHelper) exten HeadCell(content = Text(messages("viewPastPayments.description"))), HeadCell( content = Text(messages("viewPastPayments.outstandingPayments.remainingAmount")), - classes = Constants.textAlignRightCssClass + classes = Css.textAlignRightCssClass ), HeadCell(content = Text(messages("viewPastPayments.outstandingPayments.status"))), HeadCell(content = Text(messages("viewPastPayments.outstandingPayments.action"))) @@ -79,7 +78,7 @@ class ViewPastPaymentsViewModel @Inject() (dateTimeHelper: DateTimeHelper) exten ), TableRow( content = Text(Money.format(outstandingPaymentsData.remainingAmount)), - classes = s"$boldFontCssClass ${Constants.textAlignRightCssClass}" + classes = s"${Css.boldFontCssClass} ${Css.textAlignRightCssClass}" ), TableRow(content = HtmlContent(statusTag)) ), @@ -106,7 +105,7 @@ class ViewPastPaymentsViewModel @Inject() (dateTimeHelper: DateTimeHelper) exten Seq( HeadCell(content = Text(messages(s"viewPastPayments.$paymentType.payments.paymentDate"))), HeadCell(content = Text(messages("viewPastPayments.description"))), - HeadCell(content = Text(messages("viewPastPayments.totalAmount")), classes = Constants.textAlignRightCssClass) + HeadCell(content = Text(messages("viewPastPayments.totalAmount")), classes = Css.textAlignRightCssClass) ) private def getUnallocatedPaymentsDataTableRows( @@ -119,7 +118,7 @@ class ViewPastPaymentsViewModel @Inject() (dateTimeHelper: DateTimeHelper) exten TableRow(content = Text(messages("viewPastPayments.unallocatedPayments.description"))), TableRow( content = Text(Money.format(unallocatedPaymentData.unallocatedAmount)), - classes = s"$boldFontCssClass ${Constants.textAlignRightCssClass}" + classes = s"${Css.boldFontCssClass} ${Css.textAlignRightCssClass}" ) ) ) @@ -158,7 +157,7 @@ class ViewPastPaymentsViewModel @Inject() (dateTimeHelper: DateTimeHelper) exten ), TableRow( content = Text(Money.format(historicPaymentsData.amountPaid)), - classes = s"$boldFontCssClass ${Constants.textAlignRightCssClass}" + classes = s"${Css.boldFontCssClass} ${Css.textAlignRightCssClass}" ) ) ) @@ -236,11 +235,11 @@ class ViewPastPaymentsViewModel @Inject() (dateTimeHelper: DateTimeHelper) exten ): Html = { val tag = status match { case OutstandingPaymentStatusToDisplay.Due => - Tag(content = Text(messages("viewPastReturns.status.due")), classes = Constants.blueTagCssClass) + Tag(content = Text(messages("viewPastReturns.status.due")), classes = Css.blueTagCssClass) case OutstandingPaymentStatusToDisplay.Overdue => - Tag(content = Text(messages("viewPastReturns.status.overdue")), classes = Constants.redTagCssClass) + Tag(content = Text(messages("viewPastReturns.status.overdue")), classes = Css.redTagCssClass) case OutstandingPaymentStatusToDisplay.NothingToPay => - Tag(content = Text(messages("viewPastPayments.status.nothingToPay")), classes = Constants.greyTagCssClass) + Tag(content = Text(messages("viewPastPayments.status.nothingToPay")), classes = Css.greyTagCssClass) } new GovukTag()(tag) } diff --git a/app/viewmodels/returns/ViewPastReturnsHelper.scala b/app/viewmodels/returns/ViewPastReturnsHelper.scala index 5da69f82..bf0d1119 100644 --- a/app/viewmodels/returns/ViewPastReturnsHelper.scala +++ b/app/viewmodels/returns/ViewPastReturnsHelper.scala @@ -16,7 +16,7 @@ package viewmodels.returns -import config.Constants +import config.Constants.Css import models.ObligationStatus.Open import models.{ObligationData, ObligationStatusToDisplay, ReturnPeriod} import play.api.Logging @@ -48,9 +48,9 @@ class ViewPastReturnsHelper @Inject() () extends Logging { private def getTableHeader(messages: Messages): Seq[HeadCell] = Seq( - HeadCell(content = Text(messages("viewPastReturns.period")), classes = Constants.oneQuarterCssClass), - HeadCell(content = Text(messages("viewPastReturns.status")), classes = Constants.oneQuarterCssClass), - HeadCell(content = Text(messages("viewPastReturns.action")), classes = Constants.oneQuarterCssClass) + HeadCell(content = Text(messages("viewPastReturns.period")), classes = Css.oneQuarterCssClass), + HeadCell(content = Text(messages("viewPastReturns.status")), classes = Css.oneQuarterCssClass), + HeadCell(content = Text(messages("viewPastReturns.action")), classes = Css.oneQuarterCssClass) ) private def getObligationDataTableRows(obligationData: Seq[ObligationData])(implicit @@ -116,11 +116,11 @@ class ViewPastReturnsHelper @Inject() () extends Logging { ): Html = { val tag = status match { case ObligationStatusToDisplay.Due => - Tag(content = Text(messages("viewPastReturns.status.due")), classes = Constants.blueTagCssClass) + Tag(content = Text(messages("viewPastReturns.status.due")), classes = Css.blueTagCssClass) case ObligationStatusToDisplay.Overdue => - Tag(content = Text(messages("viewPastReturns.status.overdue")), classes = Constants.redTagCssClass) + Tag(content = Text(messages("viewPastReturns.status.overdue")), classes = Css.redTagCssClass) case ObligationStatusToDisplay.Completed => - Tag(content = Text(messages("viewPastReturns.status.completed")), classes = Constants.greenTagCssClass) + Tag(content = Text(messages("viewPastReturns.status.completed")), classes = Css.greenTagCssClass) } new GovukTag()(tag) } diff --git a/app/viewmodels/returns/ViewReturnViewModel.scala b/app/viewmodels/returns/ViewReturnViewModel.scala index 6369735d..69484f17 100644 --- a/app/viewmodels/returns/ViewReturnViewModel.scala +++ b/app/viewmodels/returns/ViewReturnViewModel.scala @@ -16,7 +16,8 @@ package viewmodels.returns -import config.{Constants, FrontendAppConfig} +import config.Constants.Css +import config.FrontendAppConfig import models.returns._ import models.{RateBand, ReturnPeriod} import play.api.i18n.Messages @@ -50,14 +51,14 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { private def alcoholDeclaredTableHeader()(implicit messages: Messages): Seq[HeadCell] = Seq( HeadCell(content = Text(messages("viewReturn.table.description.legend"))), - HeadCell(content = Text(messages("viewReturn.table.lpa.legend")), classes = Constants.textAlignRightWrapCssClass), + HeadCell(content = Text(messages("viewReturn.table.lpa.legend")), classes = Css.textAlignRightWrapCssClass), HeadCell( content = Text(messages("viewReturn.table.dutyRate.legend")), - classes = Constants.textAlignRightWrapCssClass + classes = Css.textAlignRightWrapCssClass ), HeadCell( content = Text(messages("viewReturn.table.dutyDue.legend")), - classes = Constants.textAlignRightWrapCssClass + classes = Css.textAlignRightWrapCssClass ) ) @@ -68,7 +69,7 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), HeadCell( content = Text(messages("viewReturn.table.dutyDue.legend")), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) @@ -87,15 +88,15 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), TableRow( content = Text(messages("site.4DP", alcoholDeclaredDetailsRow.litresOfPureAlcohol)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ), TableRow( content = Text(s"${Money.format(alcoholDeclaredDetailsRow.dutyRate)}"), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ), TableRow( content = Text(Money.format(alcoholDeclaredDetailsRow.dutyValue)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) ) @@ -119,7 +120,7 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { TableRow(content = Text(messages("viewReturn.alcoholDuty.noneDeclared"))), TableRow( content = Text(messages("site.nil")), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) ) @@ -134,7 +135,7 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), HeadCell( content = Text(Money.format(alcoholDeclared.total)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) @@ -159,14 +160,14 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { Seq( HeadCell(content = Text(messages("viewReturn.table.adjustmentType.legend"))), HeadCell(content = Text(messages("viewReturn.table.description.legend"))), - HeadCell(content = Text(messages("viewReturn.table.lpa.legend")), classes = Constants.textAlignRightWrapCssClass), + HeadCell(content = Text(messages("viewReturn.table.lpa.legend")), classes = Css.textAlignRightWrapCssClass), HeadCell( content = Text(messages("viewReturn.table.dutyRate.legend")), - classes = Constants.textAlignRightWrapCssClass + classes = Css.textAlignRightWrapCssClass ), HeadCell( content = Text(messages("viewReturn.table.dutyValue.legend")), - classes = Constants.textAlignRightWrapCssClass + classes = Css.textAlignRightWrapCssClass ) ) @@ -177,7 +178,7 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), HeadCell( content = Text(messages("viewReturn.table.dutyValue.legend")), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) @@ -206,15 +207,15 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), TableRow( content = Text(messages("site.4DP", returnAdjustmentsRow.litresOfPureAlcohol)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ), TableRow( content = Text(Money.format(returnAdjustmentsRow.dutyRate)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ), TableRow( content = Text(Money.format(returnAdjustmentsRow.dutyValue)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) ) @@ -225,7 +226,7 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { TableRowViewModel(cells = Seq( TableRow(content = Text(messages("viewReturn.adjustments.noneDeclared"))), - TableRow(content = Text(messages("site.nil")), classes = Constants.textAlignRightCssClass) + TableRow(content = Text(messages("site.nil")), classes = Css.textAlignRightCssClass) ) ) ) @@ -237,7 +238,7 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), HeadCell( content = Text(Money.format(adjustments.total)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) @@ -257,7 +258,7 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { HeadCell( content = Text(messages("viewReturn.dutyDue.total.legend")) ), - HeadCell(content = content, classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}") + HeadCell(content = content, classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}") ) } @@ -284,11 +285,11 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), HeadCell( content = Text(messages("viewReturn.table.totalVolume.legend")), - classes = Constants.textAlignRightWrapCssClass + classes = Css.textAlignRightWrapCssClass ), HeadCell( content = Text(messages("viewReturn.table.lpa.legend")), - classes = Constants.textAlignRightWrapCssClass + classes = Css.textAlignRightWrapCssClass ) ) @@ -338,11 +339,11 @@ class ViewReturnViewModel @Inject() (appConfig: FrontendAppConfig) { ), TableRow( content = Text(messages("site.2DP", total)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ), TableRow( content = Text(messages("site.4DP", lpa)), - classes = s"${Constants.textAlignRightCssClass} ${Constants.numericCellClass}" + classes = s"${Css.textAlignRightCssClass} ${Css.numericCellClass}" ) ) ) diff --git a/app/viewmodels/tasklist/AlcholDutyTaskListItemStatus.scala b/app/viewmodels/tasklist/AlcholDutyTaskListItemStatus.scala index 0d5eeaba..e79783e2 100644 --- a/app/viewmodels/tasklist/AlcholDutyTaskListItemStatus.scala +++ b/app/viewmodels/tasklist/AlcholDutyTaskListItemStatus.scala @@ -16,6 +16,7 @@ package viewmodels.tasklist +import config.Constants.Css import play.api.i18n.Messages import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Text import uk.gov.hmrc.govukfrontend.views.viewmodels.tag.Tag @@ -26,12 +27,12 @@ object AlcholDutyTaskListItemStatus { content = Text(messages("taskList.section.status.completed")) ) def notStarted(implicit messages: Messages): TaskListItemStatus = TaskListItemStatus( - tag = Some(Tag(content = Text(messages("taskList.section.status.notStarted")), classes = "govuk-tag--blue")) + tag = Some(Tag(content = Text(messages("taskList.section.status.notStarted")), classes = Css.blueTagCssClass)) ) def inProgress(implicit messages: Messages): TaskListItemStatus = TaskListItemStatus( - tag = Some(Tag(content = Text(messages("taskList.section.status.inProgress")), classes = "govuk-tag--light-blue")) + tag = Some(Tag(content = Text(messages("taskList.section.status.inProgress")), classes = Css.lightBlueTagCssClass)) ) def cannotStart(implicit messages: Messages): TaskListItemStatus = TaskListItemStatus( - tag = Some(Tag(content = Text(messages("taskList.section.status.cannotStart")), classes = "govuk-tag--grey")) + tag = Some(Tag(content = Text(messages("taskList.section.status.cannotStart")), classes = Css.greyTagCssClass)) ) } diff --git a/app/viewmodels/tasklist/ReturnTaskListCreator.scala b/app/viewmodels/tasklist/ReturnTaskListCreator.scala index c36eff4d..a78fd9f9 100644 --- a/app/viewmodels/tasklist/ReturnTaskListCreator.scala +++ b/app/viewmodels/tasklist/ReturnTaskListCreator.scala @@ -16,6 +16,7 @@ package viewmodels.tasklist +import config.Constants import models.adjustment.AdjustmentType import models.{AlcoholRegime, AlcoholRegimes, CheckMode, Mode, NormalMode, SpiritType, UserAnswers} import pages.QuestionPage @@ -33,6 +34,12 @@ import viewmodels.tasklist.DeclarationState.{Completed, InProgress, NotStarted} import javax.inject.Inject class ReturnTaskListCreator @Inject() () { + object SectionName { + val adjustment = "adjustment" + val dutySuspended = "dutySuspended" + val spirits = "spirits" + } + private def createSection( declareQuestionAnswer: Option[Boolean], createTaskListSection: () => Seq[TaskListItem], @@ -167,7 +174,7 @@ class ReturnTaskListCreator @Inject() () { createDeclarationTask( getDeclarationState, - "adjustment", + SectionName.adjustment, controllers.adjustment.routes.AdjustmentTypeController.onPageLoad(NormalMode).url, inProgressRoute, controllers.adjustment.routes.AdjustmentListController.onPageLoad(1).url @@ -239,7 +246,7 @@ class ReturnTaskListCreator @Inject() () { createDeclarationTask( getDeclarationState, - "dutySuspended", + SectionName.dutySuspended, controllers.dutySuspended.routes.DutySuspendedDeliveriesGuidanceController.onPageLoad().url, controllers.dutySuspended.routes.DutySuspendedDeliveriesGuidanceController.onPageLoad().url, controllers.dutySuspended.routes.CheckYourAnswersDutySuspendedDeliveriesController.onPageLoad().url @@ -280,7 +287,7 @@ class ReturnTaskListCreator @Inject() () { createDeclarationTask( getDeclarationState, - "spirits", + SectionName.spirits, controllers.spiritsQuestions.routes.DeclareSpiritsTotalController.onPageLoad(NormalMode).url, controllers.spiritsQuestions.routes.DeclareSpiritsTotalController.onPageLoad(NormalMode).url, controllers.spiritsQuestions.routes.CheckYourAnswersController.onPageLoad().url @@ -389,10 +396,10 @@ class ReturnTaskListCreator @Inject() () { val adjustmentListQuestion = userAnswers.get(AdjustmentListPage).getOrElse(true) val taskListItems = Seq( Some(returnAdjustmentJourneyTaskListItem(userAnswers)), - if (underDeclarationTotal >= 1000 && !adjustmentListQuestion) { + if (underDeclarationTotal >= Constants.overUnderDeclarationThreshold && !adjustmentListQuestion) { Some(returnAdjustmentJourneyUnderDeclarationTaskListItem(userAnswers)) } else { None }, - if (overDeclarationTotal.abs >= 1000 && !adjustmentListQuestion) { + if (overDeclarationTotal.abs >= Constants.overUnderDeclarationThreshold && !adjustmentListQuestion) { Some(returnAdjustmentJourneyOverDeclarationTaskListItem(userAnswers)) } else { None } ).flatten @@ -400,7 +407,7 @@ class ReturnTaskListCreator @Inject() () { userAnswers.get(DeclareAdjustmentQuestionPage), () => taskListItems, controllers.adjustment.routes.DeclareAdjustmentQuestionController.onPageLoad(_).url, - sectionName = "adjustment" + sectionName = SectionName.adjustment ) } @@ -409,7 +416,7 @@ class ReturnTaskListCreator @Inject() () { userAnswers.get(DeclareDutySuspendedDeliveriesQuestionPage), () => Seq(returnDSDJourneyTaskListItem(userAnswers)), controllers.dutySuspended.routes.DeclareDutySuspendedDeliveriesQuestionController.onPageLoad(_).url, - sectionName = "dutySuspended" + sectionName = SectionName.dutySuspended ) def returnQSSection(userAnswers: UserAnswers)(implicit messages: Messages): Section = @@ -417,6 +424,6 @@ class ReturnTaskListCreator @Inject() () { userAnswers.get(DeclareQuarterlySpiritsPage), () => Seq(returnQSJourneyTaskListItem(userAnswers)), controllers.spiritsQuestions.routes.DeclareQuarterlySpiritsController.onPageLoad(_).url, - sectionName = "spirits" + sectionName = SectionName.spirits ) } diff --git a/app/views/BeforeStartReturnView.scala.html b/app/views/BeforeStartReturnView.scala.html index d3aece61..667abb60 100644 --- a/app/views/BeforeStartReturnView.scala.html +++ b/app/views/BeforeStartReturnView.scala.html @@ -15,8 +15,10 @@ *@ @import components.{SectionHeading, PageHeading} -@import viewmodels.ReturnPeriodViewModel +@import config.Constants.Css @import viewmodels.BeforeStartReturnViewModel +@import viewmodels.ReturnPeriodViewModel + @import java.time.LocalDate @this( @@ -47,7 +49,7 @@ @paragraph(messages("beforeStartReturn.text.guidance3")) -
@messages(message)
+@messages(message)
} diff --git a/app/views/JourneyRecoveryContinueView.scala.html b/app/views/JourneyRecoveryContinueView.scala.html index 01d6c081..cab80197 100644 --- a/app/views/JourneyRecoveryContinueView.scala.html +++ b/app/views/JourneyRecoveryContinueView.scala.html @@ -14,6 +14,8 @@ * limitations under the License. *@ +@import config.Constants.Css + @this( layout: templates.Layout, govukButton: GovukButton @@ -23,12 +25,12 @@ @layout(pageTitle = titleNoForm(messages("journeyRecovery.continue.title"))) { -@messages("journeyRecovery.continue.guidance")
-@messages("journeyRecovery.continue.guidance.p2")
+@messages("journeyRecovery.continue.guidance")
+@messages("journeyRecovery.continue.guidance.p2")
-+
@govukButton( ButtonViewModel("continueButton", messages("site.continue")) .asLink(continueUrl) diff --git a/app/views/JourneyRecoveryStartAgainView.scala.html b/app/views/JourneyRecoveryStartAgainView.scala.html index 232c7188..a2f381b7 100644 --- a/app/views/JourneyRecoveryStartAgainView.scala.html +++ b/app/views/JourneyRecoveryStartAgainView.scala.html @@ -14,6 +14,8 @@ * limitations under the License. *@ +@import config.Constants.Css + @this( layout: templates.Layout, govukButton: GovukButton @@ -23,12 +25,12 @@ @layout(pageTitle = titleNoForm(messages("journeyRecovery.startAgain.title"))) { -
@messages("journeyRecovery.startAgain.guidance")
-@messages("journeyRecovery.startAgain.guidance.p2")
+@messages("journeyRecovery.startAgain.guidance")
+@messages("journeyRecovery.startAgain.guidance.p2")
-+
@govukButton( ButtonViewModel("startAgainButton", messages("site.startAgain")) .asLink(businessTaxAccountUrl) diff --git a/app/views/TaskListView.scala.html b/app/views/TaskListView.scala.html index 347aa0a0..048ed517 100644 --- a/app/views/TaskListView.scala.html +++ b/app/views/TaskListView.scala.html @@ -14,8 +14,9 @@ * limitations under the License. *@ -@import viewmodels.tasklist.AlcoholDutyTaskList @import components.Link +@import config.Constants.Css +@import viewmodels.tasklist.AlcoholDutyTaskList @this( layout: templates.Layout, @@ -37,7 +38,7 @@ @paragraph(messages("taskList.expiry.date", taskList.sessionExpiryDate)) @for(section <- taskList.sections) { - @subheading(section.title, classes = "govuk-heading-m") + @subheading(section.title, classes = Css.headingMCssClass) @govukTaskList(section.taskList) } diff --git a/app/views/adjustment/AdjustmentListView.scala.html b/app/views/adjustment/AdjustmentListView.scala.html index a6fef861..e335e141 100644 --- a/app/views/adjustment/AdjustmentListView.scala.html +++ b/app/views/adjustment/AdjustmentListView.scala.html @@ -15,6 +15,7 @@ *@ @import components.{SectionHeading, PageHeading} +@import config.Constants.Css @import viewmodels.{TableViewModel, PaginationViewModel} @this( @@ -85,7 +86,7 @@ @govukRadios( RadiosViewModel.yesNo( field = form("adjustment-list-yes-no-value"), - legend = LegendViewModel(messages("adjustmentList.question")).withCssClass("govuk-fieldset__legend--l") + legend = LegendViewModel(messages("adjustmentList.question")).withCssClass(Css.fieldsetLegendLCssClass) ) ) diff --git a/app/views/adjustment/AdjustmentVolumeView.scala.html b/app/views/adjustment/AdjustmentVolumeView.scala.html index 2a1c131a..cae9ef21 100644 --- a/app/views/adjustment/AdjustmentVolumeView.scala.html +++ b/app/views/adjustment/AdjustmentVolumeView.scala.html @@ -14,9 +14,10 @@ * limitations under the License. *@ -@import viewmodels.InputWidth._ @import components.{SectionHeading, PageHeading, Paragraph, SubHeading} +@import config.Constants.Css @import models.adjustment.AdjustmentType +@import viewmodels.InputWidth._ @this( layout: templates.Layout, @@ -47,15 +48,15 @@ @pageHeading(messages("adjustmentVolume.heading")) - @subHeading(rateBandContent, "govuk-heading-s") + @subHeading(rateBandContent, Css.headingSCssClass) @govukInput( InputViewModel( field = form("volumes"), key="totalLitresVolume", label = LabelViewModel(messages("adjustmentVolume.totalLitresVolume.heading", messages(s"return.regime.$regime"))), - errorMessageField = form(s"volumes_totalLitresVolume"), - value = form(s"volumes.totalLitresVolume").value + errorMessageField = form("volumes_totalLitresVolume"), + value = form("volumes.totalLitresVolume").value ) .asNumeric() .withWidth(Fixed10) @@ -68,8 +69,8 @@ field = form("volumes"), key="pureAlcoholVolume", label = LabelViewModel(messages("adjustmentVolume.pureAlcoholVolume.heading")), - errorMessageField = form(s"volumes_pureAlcoholVolume"), - value = form(s"volumes.pureAlcoholVolume").value + errorMessageField = form("volumes_pureAlcoholVolume"), + value = form("volumes.pureAlcoholVolume").value ) .asNumeric() .withWidth(Fixed10) diff --git a/app/views/adjustment/AdjustmentVolumeWithSPRView.scala.html b/app/views/adjustment/AdjustmentVolumeWithSPRView.scala.html index 6802400b..d9130313 100644 --- a/app/views/adjustment/AdjustmentVolumeWithSPRView.scala.html +++ b/app/views/adjustment/AdjustmentVolumeWithSPRView.scala.html @@ -14,9 +14,10 @@ * limitations under the License. *@ -@import viewmodels.InputWidth._ @import components.{SectionHeading, PageHeading, Paragraph, SubHeading} +@import config.Constants.Css @import models.adjustment.AdjustmentType +@import viewmodels.InputWidth._ @this( layout: templates.Layout, @@ -47,15 +48,15 @@ @pageHeading(messages("adjustmentVolume.heading")) - @subHeading(rateBandContent, "govuk-heading-s") + @subHeading(rateBandContent, Css.headingSCssClass) @govukInput( InputViewModel( field = form("volumes"), - key="totalLitresVolume", + key = "totalLitresVolume", label = LabelViewModel(messages("adjustmentVolume.totalLitresVolume.heading", messages(s"return.regime.$regime"))), - errorMessageField = form(s"volumes_totalLitresVolume"), - value = form(s"volumes.totalLitresVolume").value + errorMessageField = form("volumes_totalLitresVolume"), + value = form("volumes.totalLitresVolume").value ) .asNumeric() .withWidth(Fixed10) @@ -66,10 +67,10 @@ @govukInput( InputViewModel( field = form("volumes"), - key="pureAlcoholVolume", + key = "pureAlcoholVolume", label = LabelViewModel(messages("adjustmentVolume.pureAlcoholVolume.heading")), - errorMessageField = form(s"volumes_pureAlcoholVolume"), - value = form(s"volumes.pureAlcoholVolume").value + errorMessageField = form("volumes_pureAlcoholVolume"), + value = form("volumes.pureAlcoholVolume").value ) .asNumeric() .withWidth(Fixed10) @@ -81,10 +82,10 @@ @govukInput( InputViewModel( field = form("volumes"), - key="sprDutyRate", + key = "sprDutyRate", label = LabelViewModel(messages("adjustmentVolume.smallProducerReliefDutyRate.heading")), - errorMessageField = form(s"volumes_sprDutyRate"), - value = form(s"volumes.sprDutyRate").value + errorMessageField = form("volumes_sprDutyRate"), + value = form("volumes.sprDutyRate").value ) .asNumeric() .withWidth(Fixed10) diff --git a/app/views/adjustment/CheckYourAnswersView.scala.html b/app/views/adjustment/CheckYourAnswersView.scala.html index b155d7c3..4fd439b8 100644 --- a/app/views/adjustment/CheckYourAnswersView.scala.html +++ b/app/views/adjustment/CheckYourAnswersView.scala.html @@ -15,7 +15,9 @@ *@ @import components.{SectionHeading, PageHeading, SubHeading} +@import config.Constants.Css @import models.adjustment.AdjustmentType + @this( layout: templates.Layout, formHelper: FormWithCSRF, @@ -38,7 +40,7 @@ @pageHeading(messages("checkYourAnswers.heading")) - @subHeading(messages("checkYourAnswers.subHeading"),"govuk-heading-l") + @subHeading(messages("checkYourAnswers.subHeading"), Css.headingLCssClass) @govukSummaryList(list) diff --git a/app/views/adjustment/OverDeclarationReasonView.scala.html b/app/views/adjustment/OverDeclarationReasonView.scala.html index b1f8369b..8c0a6ae2 100644 --- a/app/views/adjustment/OverDeclarationReasonView.scala.html +++ b/app/views/adjustment/OverDeclarationReasonView.scala.html @@ -14,9 +14,10 @@ * limitations under the License. *@ -@import viewmodels.InputWidth._ @import components.{SectionHeading, PageHeading} +@import config.Constants @import forms.adjustment.OverDeclarationReasonFormProvider +@import viewmodels.InputWidth._ @this( layout: templates.Layout, @@ -49,7 +50,7 @@ label = LabelViewModel(messages("overDeclarationReason.heading")).asPageHeading() ) .withWidth(TwoThirds) - .withMaxLength(OverDeclarationReasonFormProvider.overDeclarationReasonLength) + .withMaxLength(Constants.overUnderDeclarationReasonLength) ) @govukButton( diff --git a/app/views/adjustment/UnderDeclarationReasonView.scala.html b/app/views/adjustment/UnderDeclarationReasonView.scala.html index 3a629017..83448ee6 100644 --- a/app/views/adjustment/UnderDeclarationReasonView.scala.html +++ b/app/views/adjustment/UnderDeclarationReasonView.scala.html @@ -14,9 +14,10 @@ * limitations under the License. *@ -@import viewmodels.InputWidth._ @import components.{SectionHeading, PageHeading} +@import config.Constants @import forms.adjustment.UnderDeclarationReasonFormProvider +@import viewmodels.InputWidth._ @this( layout: templates.Layout, @@ -49,7 +50,7 @@ label = LabelViewModel(messages("underDeclarationReason.heading")).asPageHeading() ) .withWidth(TwoThirds) - .withMaxLength(UnderDeclarationReasonFormProvider.underDeclarationReasonLength) + .withMaxLength(Constants.overUnderDeclarationReasonLength) ) @govukButton( diff --git a/app/views/auth/SignedOutView.scala.html b/app/views/auth/SignedOutView.scala.html index 07bf1a6b..06bd9310 100644 --- a/app/views/auth/SignedOutView.scala.html +++ b/app/views/auth/SignedOutView.scala.html @@ -14,6 +14,8 @@ * limitations under the License. *@ +@import config.Constants.Css + @this( layout: templates.Layout, govukButton: GovukButton @@ -28,11 +30,11 @@ showSignOut = false ) { -
@messages("signedOut.guidance")
+@messages("signedOut.guidance")
-+
@govukButton( ButtonViewModel("signInButton", messages("site.signIn")) .asLink(businessTaxAccountUrl) diff --git a/app/views/checkAndSubmit/DutyDueForThisReturnView.scala.html b/app/views/checkAndSubmit/DutyDueForThisReturnView.scala.html index 3acbfd47..d0c7dff1 100644 --- a/app/views/checkAndSubmit/DutyDueForThisReturnView.scala.html +++ b/app/views/checkAndSubmit/DutyDueForThisReturnView.scala.html @@ -15,9 +15,9 @@ *@ @import components.{SectionHeading, PageHeading, Paragraph, BulletList, SubHeading} +@import config.Constants.Css @import viewmodels.checkAnswers.checkAndSubmit.DutyDueForThisReturnViewModel @import viewmodels.Money -@import config.Constants.summaryListAction @this( layout: templates.Layout, @@ -35,7 +35,6 @@ @(dutyDueViewModel: DutyDueForThisReturnViewModel)(implicit request: Request[_], messages: Messages) -@import config.Constants.textAlignRightCssClass @titleMessage = @{ if (dutyDueViewModel.totalDue == 0) { messages("dutyDueForThisReturn.nil.title") @@ -56,7 +55,7 @@ @paragraph(messages("dutyDueForThisReturn.nil.p1")) - @subHeading(messages("dutyDueForThisReturn.h2"), classes = "govuk-heading-m") + @subHeading(messages("dutyDueForThisReturn.h2"), classes = Css.headingMCssClass) @bulletList(Seq(messages("dutyDueForThisReturn.bulletList.3"))) } @@ -66,7 +65,7 @@ @paragraph(messages("dutyDueForThisReturn.positive.p1")) - @subHeading(messages("dutyDueForThisReturn.h2"), classes = "govuk-heading-m") + @subHeading(messages("dutyDueForThisReturn.h2"), classes = Css.headingMCssClass) @bulletList(Seq( messages("dutyDueForThisReturn.bulletList.1") @@ -78,7 +77,7 @@ @paragraph(messages("dutyDueForThisReturn.negative.p1")) - @subHeading(messages("dutyDueForThisReturn.h2"), classes = "govuk-heading-m") + @subHeading(messages("dutyDueForThisReturn.h2"), classes = Css.headingMCssClass) @bulletList(Seq( messages("dutyDueForThisReturn.bulletList.1") @@ -89,11 +88,11 @@ @govukTable(Table( caption = Some(messages("dutyDueForThisReturn.h3")), - captionClasses = "govuk-table__caption--m", + captionClasses = Css.tableCaptionMCssClass, head = Some(dutyDueViewModel.dutiesBreakdownTable.head), rows = dutyDueViewModel.dutiesBreakdownTable.rows.map(row => { val actions = TableRow( - classes = s"$summaryListAction $textAlignRightCssClass", + classes = s"${Css.summaryListActionsCssClass} ${Css.textAlignRightCssClass}", content = HtmlContent(tableRowActionList( id = "productList", actions = row.actions.map(action => tableRowAction( @@ -107,7 +106,7 @@ )) ) - @subHeading(messages("dutyDueForThisReturn.youveAlsoAnswered"), classes = "govuk-heading-m") + @subHeading(messages("dutyDueForThisReturn.youveAlsoAnswered"), classes = Css.headingMCssClass) @paragraph(messages("dutyDueForThisReturn.youveAlsoAnswered.p")) @govukTable(Table( @@ -115,7 +114,7 @@ head = Some(dutyDueViewModel.dutiesBreakdownTable.head), rows = dutyDueViewModel.youveAlsoDeclaredTable.rows.map(row => { val actions = TableRow( - classes = s"$summaryListAction $textAlignRightCssClass", + classes = s"${Css.summaryListActionsCssClass} ${Css.textAlignRightCssClass}", content = HtmlContent(tableRowActionList( id = "declarationList", actions = row.actions.map(action => tableRowAction( @@ -129,7 +128,7 @@ )) ) - @subHeading(messages("dutyDueForThisReturn.h4"), classes = "govuk-heading-m") + @subHeading(messages("dutyDueForThisReturn.h4"), classes = Css.headingMCssClass) @paragraph(messages("dutyDueForThisReturn.p3")) @govukButton( diff --git a/app/views/components/BulletList.scala.html b/app/views/components/BulletList.scala.html index 4c211699..d672774b 100644 --- a/app/views/components/BulletList.scala.html +++ b/app/views/components/BulletList.scala.html @@ -14,9 +14,11 @@ * limitations under the License. *@ +@import config.Constants.Css + @this() -@(elements: Seq[Content], classes: String = "govuk-list govuk-list--bullet", id: Option[String] = None) +@(elements: Seq[Content], classes: String = Css.bulletListCssClass, id: Option[String] = None)
id="@id"}>@content.asHtml
\ No newline at end of file diff --git a/app/views/components/PrintPage.scala.html b/app/views/components/PrintPage.scala.html index 7b5c8146..dc534229 100644 --- a/app/views/components/PrintPage.scala.html +++ b/app/views/components/PrintPage.scala.html @@ -14,8 +14,10 @@ * limitations under the License. *@ +@import config.Constants.Css + @this() -@(id: String, text: String, classes: String = "govuk-link govuk-link--no-visited-state hmrc-!-js-visible govuk-!-display-none-print") +@(id: String, text: String, classes: String = s"${Css.linkNoVisitedStateCssClass} ${Css.jsVisibleCssClass} ${Css.displayNonePrintCssClass}") @text \ No newline at end of file diff --git a/app/views/components/SectionBreak.scala.html b/app/views/components/SectionBreak.scala.html index 4b50aa13..94e6d060 100644 --- a/app/views/components/SectionBreak.scala.html +++ b/app/views/components/SectionBreak.scala.html @@ -14,8 +14,10 @@ * limitations under the License. *@ +@import config.Constants.Css + @this() @(isVisible: Boolean = false) -+
@messages("declareDutySuspendedDeliveriesQuestion.p1")
diff --git a/app/views/payments/ViewPastPaymentsView.scala.html b/app/views/payments/ViewPastPaymentsView.scala.html index 28db6b76..c5017fa0 100644 --- a/app/views/payments/ViewPastPaymentsView.scala.html +++ b/app/views/payments/ViewPastPaymentsView.scala.html @@ -15,7 +15,7 @@ *@ @import components.{SectionHeading, PageHeading, Paragraph, SubHeading, Link} -@import config.Constants +@import config.Constants.Css @import viewmodels.TableViewModel @import viewmodels.Money @@ -42,17 +42,17 @@ @pageHeading(messages("viewPastPayments.heading")) @if(dutyBalance > 0) { -@messages("viewPastPayments.youOwe") +
@messages("viewPastPayments.youOwe")
- @messages("viewPastPayments.duty.value", Money.format(dutyBalance))
+ @messages("viewPastPayments.duty.value", Money.format(dutyBalance))
@messages("viewPastPayments.youAre") +
@messages("viewPastPayments.youAre")
- @messages("viewPastPayments.negative.duty.value", Money.format(dutyBalance.abs))
-
@messages("viewPastPayments.credit.para1") + @messages("viewPastPayments.negative.duty.value", Money.format(dutyBalance.abs)) +
@messages("viewPastPayments.credit.para1") @link( id = "view-past-payments-refund-link", text = messages("viewPastPayments.credit.link.content"), @@ -64,7 +64,7 @@ @paragraph(messages("viewPastPayments.outstandingPayments.paragraph")) } @if(dutyBalance == 0) { - @paragraph(messages("viewPastPayments.zeroBalance.paragraph"), Constants.headingLCssClass) + @paragraph(messages("viewPastPayments.zeroBalance.paragraph"), Css.headingLCssClass) } @@ -72,7 +72,7 @@ @if(outstandingPaymentsTable.rows.size > 0) { @govukTable(Table( caption = Some(messages("viewPastPayments.outstandingPayments.caption")), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(outstandingPaymentsTable.head), rows = outstandingPaymentsTable.rows.map(row => { val actions = TableRow(content = HtmlContent(tableRowActionList( @@ -94,18 +94,18 @@ @if(unallocatedPaymentsTable.rows.size > 0) { @govukTable(Table( caption = Some(messages("viewPastPayments.unallocatedPayments.caption")), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(unallocatedPaymentsTable.head), rows = unallocatedPaymentsTable.rows.map(_.cells), )) - @paragraph(messages("viewPastPayments.unallocatedPayments.paragraph"), Constants.paddingBottomCssClass) + @paragraph(messages("viewPastPayments.unallocatedPayments.paragraph"), Css.paddingBottomCssClass) } @if(historicPaymentsTable.rows.size > 0) { @govukTable(Table( caption = Some(messages("viewPastPayments.historic.caption", messages("site.year", year))), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(historicPaymentsTable.head), rows = historicPaymentsTable.rows.map(_.cells), )) @@ -113,7 +113,7 @@ } @if(historicPaymentsTable.rows.size == 0) { - @paragraph(messages("viewPastPayments.historic.caption", messages("site.year", year)), Constants.headingMCssClass) + @paragraph(messages("viewPastPayments.historic.caption", messages("site.year", year)), Css.headingMCssClass) @paragraph(messages("viewPastPayments.historic.noPayments")) } diff --git a/app/views/returns/ViewPastReturnsView.scala.html b/app/views/returns/ViewPastReturnsView.scala.html index 0fc1f90c..6e58ce45 100644 --- a/app/views/returns/ViewPastReturnsView.scala.html +++ b/app/views/returns/ViewPastReturnsView.scala.html @@ -15,7 +15,7 @@ *@ @import components.{SectionHeading, PageHeading, SubHeading} -@import config.Constants +@import config.Constants.Css @import viewmodels.TableViewModel @this( @@ -42,7 +42,7 @@ @if(outstandingReturns.rows.nonEmpty) { @govukTable(Table( caption = Some(messages("viewPastReturns.outstandingReturns.caption")), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(outstandingReturns.head), rows = outstandingReturns.rows.map(row => { val actions = TableRow(content = HtmlContent(tableRowActionList( @@ -63,7 +63,7 @@ @if(completedReturns.rows.nonEmpty) { @govukTable(Table( caption = Some(messages("viewPastReturns.completedReturns.caption")), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(completedReturns.head), rows = completedReturns.rows.map(row => { val actions = TableRow(content = HtmlContent(tableRowActionList( diff --git a/app/views/returns/ViewReturnView.scala.html b/app/views/returns/ViewReturnView.scala.html index 8acd5769..97a0020f 100644 --- a/app/views/returns/ViewReturnView.scala.html +++ b/app/views/returns/ViewReturnView.scala.html @@ -15,7 +15,7 @@ *@ @import components.{PageHeading, Paragraph, PrintPage} -@import config.Constants +@import config.Constants.Css @import viewmodels.{TableTotalViewModel, TableViewModel} @this( @@ -30,9 +30,9 @@ @(period: String, submittedAtDate: String, submittedAtTime: String, dutyToDeclare: TableViewModel, adjustments: TableViewModel, totalDue: TableTotalViewModel, netDutySuspension: TableViewModel)(implicit request: Request[_], messages: Messages) -@layout(pageTitle = titleNoForm(messages(s"viewReturn.title", period)), fullWidth = true, withPrintCss = true) { +@layout(pageTitle = titleNoForm(messages("viewReturn.title", period)), fullWidth = true, withPrintCss = true) { - @pageHeading(messages(s"viewReturn.heading", period)) + @pageHeading(messages("viewReturn.heading", period)) @paragraph(messages("viewReturn.submittedAt", submittedAtDate, submittedAtTime)) @@ -40,7 +40,7 @@ @govukTable(Table( caption = Some(messages("viewReturn.alcoholDuty.caption")), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(dutyToDeclare.head), rows = dutyToDeclare.rows.map(_.cells) )) @@ -55,7 +55,7 @@ @govukTable(Table( caption = Some(messages("viewReturn.adjustments.caption")), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(adjustments.head), rows = adjustments.rows.map(_.cells) )) @@ -70,7 +70,7 @@ @govukTable(Table( caption = Some(messages("viewReturn.dutyDue.caption")), - captionClasses = "govuk-table__caption--m", + captionClasses = Css.tableCaptionMCssClass, head = Some(totalDue.toHeadCells()) )) @@ -78,7 +78,7 @@ @govukTable(Table( caption = Some(messages("viewReturn.netDutySuspension.caption")), - captionClasses = Constants.tableCaptionMCssClass, + captionClasses = Css.tableCaptionMCssClass, head = Some(netDutySuspension.head), rows = netDutySuspension.rows.map(_.cells) )) diff --git a/app/views/spiritsQuestions/AlcoholUsedView.scala.html b/app/views/spiritsQuestions/AlcoholUsedView.scala.html index 7fd5ad23..72911e71 100644 --- a/app/views/spiritsQuestions/AlcoholUsedView.scala.html +++ b/app/views/spiritsQuestions/AlcoholUsedView.scala.html @@ -51,7 +51,7 @@ ) .asNumeric() .withWidth(Fixed10) - .withHint(Hint(content = messages("alcoholUsed.hint"))) + .withHint(Hint(content = messages("alcoholUsed.hint"))) .withSuffix(PrefixOrSuffix(content = messages("site.unit.litres"))) ) @@ -62,7 +62,7 @@ ) .asNumeric() .withWidth(Fixed10) - .withHint(Hint(content = messages("alcoholUsed.hint"))) + .withHint(Hint(content = messages("alcoholUsed.hint"))) .withSuffix(PrefixOrSuffix(content = messages("site.unit.litres"))) ) @@ -73,7 +73,7 @@ ) .asNumeric() .withWidth(Fixed10) - .withHint(Hint(content = messages("alcoholUsed.hint"))) + .withHint(Hint(content = messages("alcoholUsed.hint"))) .withSuffix(PrefixOrSuffix(content = messages("site.unit.litres"))) ) @@ -84,7 +84,7 @@ ) .asNumeric() .withWidth(Fixed10) - .withHint(Hint(content = messages("alcoholUsed.hint"))) + .withHint(Hint(content = messages("alcoholUsed.hint"))) .withSuffix(PrefixOrSuffix(content = messages("site.unit.litres"))) ) diff --git a/app/views/spiritsQuestions/DeclareQuarterlySpiritsView.scala.html b/app/views/spiritsQuestions/DeclareQuarterlySpiritsView.scala.html index bd56edd5..cd85cd69 100644 --- a/app/views/spiritsQuestions/DeclareQuarterlySpiritsView.scala.html +++ b/app/views/spiritsQuestions/DeclareQuarterlySpiritsView.scala.html @@ -15,6 +15,7 @@ *@ @import components.{SectionHeading, PageHeading, Paragraph, BulletList} +@import config.Constants.Css @this( layout: templates.Layout, @@ -83,7 +84,7 @@ @govukRadios( RadiosViewModel.yesNo( field = form("declareQuarterlySpirits-yesNoValue"), - legend = LegendViewModel(messages("declareQuarterlySpirits.question")).withCssClass("govuk-fieldset__legend--l") + legend = LegendViewModel(messages("declareQuarterlySpirits.question")).withCssClass(Css.fieldsetLegendLCssClass) ) ) diff --git a/app/views/spiritsQuestions/DeclareSpiritsTotalView.scala.html b/app/views/spiritsQuestions/DeclareSpiritsTotalView.scala.html index fbd48e5d..f6e439a6 100644 --- a/app/views/spiritsQuestions/DeclareSpiritsTotalView.scala.html +++ b/app/views/spiritsQuestions/DeclareSpiritsTotalView.scala.html @@ -14,9 +14,10 @@ * limitations under the License. *@ -@import viewmodels.InputWidth._ @import components.{Link, SectionHeading, PageHeading, BulletList} +@import config.Constants.Css @import uk.gov.hmrc.govukfrontend.views.viewmodels.content.Empty +@import viewmodels.InputWidth._ @this( layout: templates.Layout, @@ -49,8 +50,8 @@ @pageHeading(messages("declareSpiritsTotal.heading")) - @subheading(text = messages("declareSpiritsTotal.subheading1"), classes = "govuk-heading-m") -
+ @subheading(text = messages("declareSpiritsTotal.subheading1"), classes = Css.headingMCssClass) +
@messages("declareSpiritsTotal.p1") @link( id = "draught-relief-question-guidance-link", @@ -69,7 +70,7 @@ @govukInput( InputViewModel( field = form("declare-spirits-total-input"), - label = LabelViewModel(messages("declareSpiritsTotal.subheading2")).withCssClass("govuk-label--m"), + label = LabelViewModel(messages("declareSpiritsTotal.subheading2")).withCssClass(Css.labelMCssClass) ) .asNumeric() .withWidth(Fixed10) diff --git a/app/views/spiritsQuestions/EthyleneGasOrMolassesUsedView.scala.html b/app/views/spiritsQuestions/EthyleneGasOrMolassesUsedView.scala.html index 13ad1bd4..d718e3b3 100644 --- a/app/views/spiritsQuestions/EthyleneGasOrMolassesUsedView.scala.html +++ b/app/views/spiritsQuestions/EthyleneGasOrMolassesUsedView.scala.html @@ -14,8 +14,9 @@ * limitations under the License. *@ -@import viewmodels.InputWidth._ @import components.{SectionHeading, PageHeading} +@import config.Constants.Css +@import viewmodels.InputWidth._ @this( layout: templates.Layout, @@ -68,7 +69,7 @@ @govukRadios( RadiosViewModel.yesNo( field = form("otherIngredients"), - legend = LegendViewModel(messages("ethyleneGasOrMolassesUsed.question")).withCssClass("govuk-fieldset__legend--l") + legend = LegendViewModel(messages("ethyleneGasOrMolassesUsed.question")).withCssClass(Css.fieldsetLegendLCssClass) ) ) diff --git a/app/views/spiritsQuestions/OtherSpiritsProducedView.scala.html b/app/views/spiritsQuestions/OtherSpiritsProducedView.scala.html index d7fba093..ce4d425e 100644 --- a/app/views/spiritsQuestions/OtherSpiritsProducedView.scala.html +++ b/app/views/spiritsQuestions/OtherSpiritsProducedView.scala.html @@ -14,9 +14,10 @@ * limitations under the License. *@ +@import components.{SectionHeading, SubHeading} +@import config.Constants @import forms.spiritsQuestions.OtherSpiritsProducedFormProvider @import viewmodels.InputWidth._ -@import components.{SectionHeading, SubHeading} @this( layout: templates.Layout, @@ -49,7 +50,7 @@ label = LabelViewModel(messages("otherSpiritsProduced.heading")).asPageHeading() ) .withWidth(TwoThirds) - .withMaxLength(OtherSpiritsProducedFormProvider.otherTypesLength) + .withMaxLength(Constants.otherSpiritsProducedMaxLength) .withHint(Hint(content = HtmlContent(messages("otherSpiritsProduced.hint")))) ) diff --git a/app/views/templates/FullWidthMainContent.scala.html b/app/views/templates/FullWidthMainContent.scala.html index 2e7d48f8..ed08ff6d 100644 --- a/app/views/templates/FullWidthMainContent.scala.html +++ b/app/views/templates/FullWidthMainContent.scala.html @@ -14,12 +14,13 @@ * limitations under the License. *@ +@import config.Constants.Css + @this() @(contentBlock: Html) - -