Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

DDCNL-9229 | Update 'Your State Pension Summary' content for Scenario 2-8 #567

Merged
merged 17 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions app/assets/stylesheets/nisp.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* Cope page
*
* Survey form styling
*
* New bar chart
*
*/

$breadcrumb: "/check-your-state-pension/assets/images/icons/breadcrumb-separator.png";
Expand Down Expand Up @@ -341,6 +344,7 @@ div.panel-indent {
}
}


/*----------------------------------*\
# Cope Page
\*----------------------------------*/
Expand Down Expand Up @@ -477,3 +481,43 @@ h1 + details .govuk-details__text,
visibility: visible;
}
}

/*----------------------------------*\
# New bar chart
\*----------------------------------*/

#barChart .graph-green-bar {
border-bottom: 10px solid #28a197;
}

#barChart .graph-grey-bar {
border-top: 2px solid #b1b4b6;
}

#barChart .content, #tax-spent-header, #tax-spent-footer {
display: flex;
flex-flow: row nowrap;
margin: 0.5em 0 0.2em;
}

#barChart dd {
flex-grow: 1;
padding: 0;
margin: 0;
align-self: end
}

#barChart dt {
flex-grow: 3;
padding: 0;
margin: 0;
}

#barChart dd {
text-align: right;
}

.govuk-summary-list__row--no-actions:after {
width: 0;
}

14 changes: 14 additions & 0 deletions app/uk/gov/hmrc/nisp/config/ApplicationConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ class ApplicationConfig @Inject()(config: Configuration, servicesConfig: Service
val moneyAdviceLinkEn: String = getString("money-advice-link-en.url")
val moneyAdviceLinkCy: String = getString("money-advice-link-cy.url")
val pensionWiseLink: String = getString("pension-wise-link.url")
val pensionWiseLinkCy: String = getString("pension-wise-link-cy.url")

val futurePensionLink: String = getString("govUkLinks.future-pension-link.url")
val nationalInsuranceLink: String = getString("govUkLinks.national-insurance-link.url")
val niHowMuchYouPayLink: String = getString("govUkLinks.ni-how-much-you-pay-link.url")
val nationalInsuranceCreditLink: String = getString("govUkLinks.national-insurance-credits-link.url")
val additionalStatePensionLink: String = getString("govUkLinks.additional-state-pension-link.url")
val pensionDeferralLink: String = getString("govUkLinks.pension-deferral-link.url")
val newStatePensionLink: String = getString("govUkLinks.new-state-pension-link.url")
val copeLink: String = getString("govUkLinks.contracted-out-pension-link.url")
val homeResponsibilitiesLink: String = getString("govUkLinks.home-responsibilities-protection-link.url")
val pensionCreditLink: String = getString("govUkLinks.pension-credit-link.url")
val abroadLink: String = getString("govUkLinks.living-and-working-overseas-link.url")

private val frontendHost = getString("nisp-frontend.host")
private val accessibilityStatementHost: String = getString("accessibility-statement.url") + "/accessibility-statement"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright 2024 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package uk.gov.hmrc.nisp.controllers
import com.google.inject.Inject
import play.api.i18n.I18nSupport
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.nisp.views.html.statePension.SeekGuidanceOrFinancialAdvice

class SeekGuidanceOrFinancialAdviceController @Inject() (
mcc: MessagesControllerComponents,
view: SeekGuidanceOrFinancialAdvice
)
extends NispFrontendController(mcc)
with I18nSupport {

def showView: Action[AnyContent] = Action { implicit request =>
Ok(view())
}
}

40 changes: 40 additions & 0 deletions app/uk/gov/hmrc/nisp/views/includes/BarChart.scala.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
@*
* Copyright 2024 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@

@import uk.gov.hmrc.nisp.views.html.includes.newComponents.{P, H3}
@import uk.gov.hmrc.nisp.views.formatting.NispMoney

@this()

@(
chartKey: Html,
chartValue: Html,
width: Int,
specId: Option[String] = None
)(
implicit messages: Messages
)

<dl id="barChart" class="govuk-summary-list">
<div class="govuk-summary-list__row--no-actions content">
<dt @specId.map{ id => data-spec="@id-key" } class="govuk-summary-list__key">@chartKey</dt>
<dd @specId.map{ id => data-spec="@id-value" } class="govuk-summary-list__value">@chartValue</dd>
</div>
<div aria-hidden="true">
<dt class="graph-green-bar" style="width: @width%"></dt>
<dd class="graph-grey-bar"></dd>
</div>
</dl>
10 changes: 6 additions & 4 deletions app/uk/gov/hmrc/nisp/views/includes/NiLInks.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
*@

@import uk.gov.hmrc.nisp.views.html.includes.newComponents.{P, Link}
@import uk.gov.hmrc.nisp.config.ApplicationConfig

@this(
p: P,
link: Link
link: Link,
appConfig: ApplicationConfig
)

@()(
Expand All @@ -28,7 +30,7 @@
@p(
classes = Some("govuk-body govuk-!-margin-top-4"),
content = HtmlContent(link(
href = "https://www.gov.uk/national-insurance",
href = appConfig.nationalInsuranceLink,
messageKey = "nisp.mqp.findOutAboutNI",
specId = Some("state_pension__mqp__find_out_ni")
))
Expand All @@ -37,7 +39,7 @@
@p(
classes = Some("govuk-body govuk-!-margin-top-4"),
content = HtmlContent(link(
href = "https://www.gov.uk/national-insurance/how-much-you-pay",
href = appConfig.niHowMuchYouPayLink,
messageKey = "nisp.mqp.findOutAboutNIYouPay",
specId = Some("state_pension__mqp__find_out_ni_you_pay")
))
Expand All @@ -46,7 +48,7 @@
@p(
classes = Some("govuk-body govuk-!-margin-top-4"),
content = HtmlContent(link(
href = "https://www.gov.uk/national-insurance-credits",
href = appConfig.nationalInsuranceCreditLink,
messageKey = "nisp.mqp.findOutAboutNICredits",
specId = Some("state_pension__mqp__find_out_ni_credits")
))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
@*
* Copyright 2024 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@

@import uk.gov.hmrc.nisp.controllers.routes
@import uk.gov.hmrc.nisp.models.enums.Scenario
@import uk.gov.hmrc.nisp.models.{SPChartModel, StatePension}
@import uk.gov.hmrc.nisp.views.formatting.NispMoney
@import uk.gov.hmrc.play.language.LanguageUtils
@import uk.gov.hmrc.nisp.views.html.includes.{chart, BarChart}

@this(
chart: chart,
barChart: BarChart,
langUtils: LanguageUtils
)

@(
statePension: StatePension,
yearsToContributeUntilPensionAge: Int,
currentChart: SPChartModel,
forecastChart: SPChartModel,
personalMaximumChart: SPChartModel
)(
implicit messages: Messages
)

@if(statePension.mqpScenario.isDefined) {
@barChart(
chartKey = Html(messages(
"nisp.main.chart.forecast",
statePension.finalRelevantEndYear.toString
)),
chartValue = Html(s"${NispMoney.pounds(forecastChart.amountModel.weeklyAmount)} ${messages("nisp.main.chart.week")}"),
width = forecastChart.width,
specId = Some("continue_working__mqp_forecast__chart1")
)

@barChart(
chartKey = Html(messages(
"nisp.main.context.fillgaps.chart.maxamount"
)),
chartValue = Html(s"${NispMoney.pounds(personalMaximumChart.amountModel.weeklyAmount)} ${messages("nisp.main.chart.week")}"),
width = personalMaximumChart.width,
specId = Some("continue_working__mqp_personal_max__chart2")
)

} else {

@barChart(
chartKey = Html(messages(
"nisp.main.chart.current",
statePension.earningsIncludedUpTo.getYear.toString
)),
chartValue = Html(s"${NispMoney.pounds(currentChart.amountModel.weeklyAmount)} ${messages("nisp.main.chart.week")}"),
width = currentChart.width,
specId = Some("continue_working_current__chart1")
)

@barChart(
chartKey = Html(messages(
"nisp.main.chart.forecast",
statePension.finalRelevantEndYear.toString
)),
chartValue = Html(s"${NispMoney.pounds(forecastChart.amountModel.weeklyAmount)} ${messages("nisp.main.chart.week")}"),
width = forecastChart.width,
specId = Some("continue_working_forecast__chart2")
)

@barChart(
chartKey = Html(messages(
"nisp.main.context.fillgaps.chart.maxamount"
)),
chartValue = Html(s"${NispMoney.pounds(personalMaximumChart.amountModel.weeklyAmount)} ${messages("nisp.main.chart.week")}"),
width = personalMaximumChart.width,
specId = Some("continue_working_personal_max__chart3")
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@*
* Copyright 2024 HM Revenue & Customs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*@

@import uk.gov.hmrc.nisp.views.html.includes.newComponents.{H2, Link, P}
@import uk.gov.hmrc.nisp.config.ApplicationConfig

@this(
p: P,
h2: H2,
link: Link,
appConfig: ApplicationConfig
)
@()(
implicit messages: Messages
)

@h2(
elmId = Some("contractedOut"),
msg = "nisp.cope.title1",
specId = Some("state_pension__contracted_out__h2")
)

@p(
content = Text(messages("nisp.cope.contractedOut")),
specId = Some("state_pension__contracted_out__p1")
)

@p(
classes = Some("govuk-body govuk-!-margin-top-4"),
content = HtmlContent(link(
href = appConfig.copeLink,
messageKey = "nisp.cope.contractedOut.findOutMore",
specId = Some("state_pension__contracted_out__link_1")
))
)

@p(
classes = Some("govuk-body govuk-!-margin-top-4"),
content = HtmlContent(link(
href = appConfig.newStatePensionLink,
messageKey = "nisp.cope.contractedOut.findOutNewStatePension",
specId = Some("state_pension__contracted_out__link_2")
))
)
Loading