Skip to content

Commit

Permalink
MIPR-1276: Added initial views to appeals
Browse files Browse the repository at this point in the history
* MIPR-1276: Added initial views to appeals

* wip

* MIPR-1276: Added more views to service

* MIPR-1276: Added more views

* MIPR-1276: Added tests

* MIPR-1276: Added more views and tests

* MIPR-1276: added html components

* MIPR-1276: Changes to print functionality

---------

Co-authored-by: Richard Melvin <[email protected]>
  • Loading branch information
nadinJ and r-melvin authored Dec 24, 2024
1 parent efe4627 commit d06fe07
Show file tree
Hide file tree
Showing 47 changed files with 2,608 additions and 61 deletions.
9 changes: 9 additions & 0 deletions app/assets/javascripts/print.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const printlink = document.getElementById('print-button');

if(printlink != null && printlink != 'undefined' ) {

printlink.addEventListener("click", function (e) {
e.preventDefault();
window.print();
});
};
20 changes: 20 additions & 0 deletions app/assets/stylesheets/print.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@media print {

/* Hide unnecessary elements when printing */
.cbanner-govuk-cookie-banner,
.govuk-footer,
.govuk-link,
.govuk-button,
.govuk-back-link,
.govuk-summary-list__actions,
.govuk-footer__section,
.govuk-footer__inline-list,
.hmrc-report-technical-issue,
.hmrc-language-select,
.hmrc-account-menu__link,
.govuk-phase-banner,
.print-hidden {
display: none !important;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AppealStartController @Inject()(appealStartPage: AppealStartPage,


Future.successful(Ok(appealStartPage(
true
true, currentUser.isAgent
)))
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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.incometaxpenaltiesappealsfrontend.controllers

import play.api.i18n.I18nSupport
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.auth.core.AuthConnector
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.config.AppConfig
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.controllers.auth.AuthenticatedController
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.featureswitch.core.config.FeatureSwitching
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.utils.IncomeTaxSessionKeys
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.views.html._

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}


class CheckYourAnswersController @Inject()(checkYourAnswers: CheckYourAnswersPage,
val authConnector: AuthConnector
)(implicit mcc: MessagesControllerComponents,
ec: ExecutionContext,
val appConfig: AppConfig) extends AuthenticatedController(mcc) with I18nSupport with FeatureSwitching {
def onPageLoad(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>
val optReasonableExcuse = request.session.get(IncomeTaxSessionKeys.reasonableExcuse)

optReasonableExcuse match {
case Some(reasonableExcuse) =>
Future.successful(Ok(checkYourAnswers(
true, currentUser.isAgent, reasonableExcuse
)))
case _ =>
Future.successful(Redirect(routes.ReasonableExcuseController.onPageLoad()))
}
}


def submit(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>

Future.successful(Redirect(routes.ConfirmationController.onPageLoad()))
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
* 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.incometaxpenaltiesappealsfrontend.controllers

import play.api.i18n.I18nSupport
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.auth.core.AuthConnector
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.config.AppConfig
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.controllers.auth.AuthenticatedController
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.featureswitch.core.config.FeatureSwitching
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.utils.IncomeTaxSessionKeys
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.views.html._

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}


class ConfirmationController @Inject()(confirmationPage: ConfirmationPage,
val authConnector: AuthConnector
)(implicit mcc: MessagesControllerComponents,
ec: ExecutionContext,
val appConfig: AppConfig) extends AuthenticatedController(mcc) with I18nSupport with FeatureSwitching {
def onPageLoad(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>
val optReasonableExcuse = request.session.get(IncomeTaxSessionKeys.reasonableExcuse)

optReasonableExcuse match {
case Some(reasonableExcuse) =>
Future.successful(Ok(confirmationPage(
true, currentUser.isAgent, reasonableExcuse
)))
case _ =>
Future.successful(Redirect(routes.ReasonableExcuseController.onPageLoad()))
}
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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.incometaxpenaltiesappealsfrontend.controllers

import play.api.i18n.I18nSupport
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.auth.core.AuthConnector
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.config.AppConfig
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.controllers.auth.AuthenticatedController
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.featureswitch.core.config.FeatureSwitching
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.utils.IncomeTaxSessionKeys
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.views.html._

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}


class CrimeReportedController @Inject()(hasTheCrimeBeenReportedPage: HasTheCrimeBeenReportedPage,
val authConnector: AuthConnector
)(implicit mcc: MessagesControllerComponents,
ec: ExecutionContext,
val appConfig: AppConfig) extends AuthenticatedController(mcc) with I18nSupport with FeatureSwitching {
def onPageLoad(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>
val optReasonableExcuse = request.session.get(IncomeTaxSessionKeys.reasonableExcuse)

optReasonableExcuse match {
case Some(reasonableExcuse) =>
Future.successful(Ok(hasTheCrimeBeenReportedPage(
true, currentUser.isAgent, reasonableExcuse
)))
case _ =>
Future.successful(Redirect(routes.ReasonableExcuseController.onPageLoad()))
}
}


def submit(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>

Future.successful(Redirect(routes.LateAppealController.onPageLoad()))
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* 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.incometaxpenaltiesappealsfrontend.controllers

import play.api.i18n.I18nSupport
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.auth.core.AuthConnector
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.config.AppConfig
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.controllers.auth.AuthenticatedController
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.featureswitch.core.config.FeatureSwitching
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.utils.IncomeTaxSessionKeys
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.views.html.HonestyDeclarationPage

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}


class HonestyDeclarationController @Inject()(honestyDeclaration: HonestyDeclarationPage,
val authConnector: AuthConnector
)(implicit mcc: MessagesControllerComponents,
ec: ExecutionContext,
val appConfig: AppConfig) extends AuthenticatedController(mcc) with I18nSupport {

def onPageLoad(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>
val optReasonableExcuse = request.session.get(IncomeTaxSessionKeys.reasonableExcuse)

optReasonableExcuse match {
case Some(reasonableExcuse) =>
Future.successful(Ok(honestyDeclaration(
true, currentUser.isAgent, reasonableExcuse
)))
case _ =>
Future.successful(Redirect(routes.ReasonableExcuseController.onPageLoad()))
}
}


def submit(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>
Future.successful(Redirect(routes.WhenDidEventHappenController.onPageLoad()))
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* 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.incometaxpenaltiesappealsfrontend.controllers

import play.api.i18n.I18nSupport
import play.api.mvc.{Action, AnyContent, MessagesControllerComponents}
import uk.gov.hmrc.auth.core.AuthConnector
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.config.AppConfig
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.controllers.auth.AuthenticatedController
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.utils.IncomeTaxSessionKeys
import uk.gov.hmrc.incometaxpenaltiesappealsfrontend.views.html.LateAppealPage

import javax.inject.Inject
import scala.concurrent.{ExecutionContext, Future}


class LateAppealController @Inject()(lateAppeal: LateAppealPage,
val authConnector: AuthConnector
)(implicit mcc: MessagesControllerComponents,
ec: ExecutionContext,
val appConfig: AppConfig) extends AuthenticatedController(mcc) with I18nSupport {

def onPageLoad(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>
val optReasonableExcuse = request.session.get(IncomeTaxSessionKeys.reasonableExcuse)

optReasonableExcuse match {
case Some(reasonableExcuse) =>
Future.successful(Ok(lateAppeal(
true, currentUser.isAgent, reasonableExcuse
)))
case _ =>
Future.successful(Redirect(routes.ReasonableExcuseController.onPageLoad()))
}
}

def submit(): Action[AnyContent] = isAuthenticated {
implicit request =>
implicit currentUser =>
Future.successful(Redirect(routes.CheckYourAnswersController.onPageLoad()))
}

}
Loading

0 comments on commit d06fe07

Please sign in to comment.