Skip to content

Commit d7e81a8

Browse files
authored
Merge pull request #1390 from hmrc/BST-148972_Correct-various-page-H1-headings
BST-148972 Correct various page H1 headings
2 parents d380b08 + 2895484 commit d7e81a8

30 files changed

+129
-72
lines changed

.scalafix.conf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
rules = [
2+
DisableSyntax,
3+
LeakingImplicitClassVal,
4+
NoValInForComprehension,
5+
RedundantSyntax,
6+
NoAutoTupling
7+
]

app/controllers/aboutYourLeaseOrTenure/CheckYourAnswersAboutYourLeaseOrTenureController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ class CheckYourAnswersAboutYourLeaseOrTenureController @Inject() (
126126
case FOR6076 =>
127127
controllers.aboutYourLeaseOrTenure.routes.ProvideDetailsOfYourLeaseController.show().url
128128
case _ =>
129-
logger.warn(s"Navigation for CYA about lease without correct selection of conditions by controller")
129+
logger.warn("Navigation for CYA about lease without correct selection of conditions by controller")
130130
throw new RuntimeException("Invalid option exception for CYA about lease back link")
131131
}
132132
}

app/controllers/aboutYourLeaseOrTenure/PayACapitalSumController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class PayACapitalSumController @Inject() (
100100
controllers.aboutYourLeaseOrTenure.routes.BenefitsGivenDetailsController.show().url
101101
case Some(AnswerNo) => controllers.aboutYourLeaseOrTenure.routes.BenefitsGivenController.show().url
102102
case _ =>
103-
logger.warn(s"Back link for pay capital sum page reached with unknown benefits given value")
103+
logger.warn("Back link for pay capital sum page reached with unknown benefits given value")
104104
controllers.routes.TaskListController.show().url
105105
}
106106
case FOR6045 | FOR6046 =>

app/controllers/aboutYourLeaseOrTenure/RentIncludeFixtureAndFittingsController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class RentIncludeFixtureAndFittingsController @Inject() (
104104
controllers.aboutYourLeaseOrTenure.routes.ServicePaidSeparatelyListController.show(index).url
105105
case Some(AnswerNo) => controllers.aboutYourLeaseOrTenure.routes.PaymentForTradeServicesController.show().url
106106
case _ =>
107-
logger.warn(s"Back link for fixture and fittings page reached with unknown payment trade services value")
107+
logger.warn("Back link for fixture and fittings page reached with unknown payment trade services value")
108108
controllers.routes.TaskListController.show().url
109109
}
110110
case _ =>

app/controllers/connectiontoproperty/ConnectionToThePropertyController.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ class ConnectionToThePropertyController @Inject() (
9797
Right(controllers.connectiontoproperty.routes.EditAddressController.show().url)
9898
case Some(AddressConnectionTypeYes) =>
9999
Right(controllers.connectiontoproperty.routes.AreYouStillConnectedController.show().url)
100-
case _ => Left(s"Unknown connection to property back link")
100+
case _ => Left("Unknown connection to property back link")
101101
}
102102
}

app/controllers/connectiontoproperty/ProvideContactDetailsController.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,16 +94,15 @@ class ProvideContactDetailsController @Inject() (
9494
case _ =>
9595
request.sessionData.stillConnectedDetails.flatMap(_.isAnyRentReceived) match {
9696
case Some(AnswerYes) =>
97-
request.sessionData.stillConnectedDetails.get.lettingPartOfPropertyDetails.isEmpty match {
98-
case true =>
99-
controllers.connectiontoproperty.routes.AddAnotherLettingPartOfPropertyController.show(0).url
100-
case false =>
101-
controllers.connectiontoproperty.routes.AddAnotherLettingPartOfPropertyController
102-
.show(request.sessionData.stillConnectedDetails.get.lettingPartOfPropertyDetailsIndex)
103-
.url
97+
if (request.sessionData.stillConnectedDetails.get.lettingPartOfPropertyDetails.isEmpty) {
98+
controllers.connectiontoproperty.routes.AddAnotherLettingPartOfPropertyController.show(0).url
99+
} else {
100+
controllers.connectiontoproperty.routes.AddAnotherLettingPartOfPropertyController
101+
.show(request.sessionData.stillConnectedDetails.get.lettingPartOfPropertyDetailsIndex)
102+
.url
104103
}
105104
case Some(AnswerNo) => controllers.connectiontoproperty.routes.IsRentReceivedFromLettingController.show().url
106-
case _ => s"Unknown connection to property back link"
105+
case _ => "Unknown connection to property back link"
107106
}
108107
}
109108
}

app/form/MappingSupport.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,13 +247,13 @@ object MappingSupport:
247247

248248
def rallyAreasMapping(year: String)(using messages: Messages): Mapping[Option[BigDecimal]] = optional(
249249
text
250-
.verifying(messages(s"error.rallyAreas.areaInHectares.range", year), s => Try(BigDecimal(s)).isSuccess)
250+
.verifying(messages("error.rallyAreas.areaInHectares.range", year), s => Try(BigDecimal(s)).isSuccess)
251251
.transform[BigDecimal](
252252
s => BigDecimal(s),
253253
_.toString
254254
)
255-
.verifying(messages(s"error.rallyAreas.areaInHectares.range", year), _ >= 0)
256-
).verifying(messages(s"error.rallyAreas.areaInHectares.required", year), _.isDefined)
255+
.verifying(messages("error.rallyAreas.areaInHectares.range", year), _ >= 0)
256+
).verifying(messages("error.rallyAreas.areaInHectares.required", year), _.isDefined)
257257

258258
private val salesMax = BigDecimal(1000000000000L)
259259

app/form/MonthYearFormatter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class MonthYearFormatter(
5656

5757
val fieldCapitalized = fieldName.capitalize
5858
val prefix = messages("error.dateParts.prefix")
59-
val monthText = messages(s"error.dateParts.month")
59+
val monthText = messages("error.dateParts.month")
6060
val yearText = messages("error.dateParts.year")
6161
val monthKey = s"$key.month"
6262
val yearKey = s"$key.year"

app/repositories/SessionRepository.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class SessionRepository @Inject() (mongo: MongoComponent)(implicit
6161
.findOneAndUpdate(
6262
filter = Filters.equal("_id", sessionId),
6363
update = Updates.combine(
64-
Updates.set(s"data", Codecs.toBson(SensitiveSession(data))),
64+
Updates.set("data", Codecs.toBson(SensitiveSession(data))),
6565
Updates.set("createdAt", Instant.now)
6666
),
6767
options = FindOneAndUpdateOptions().upsert(true)

app/views/CheckYourAnswersHelpers.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ object CheckYourAnswersHelpers:
3333

3434
private def withFrom: String =
3535
// Append the "from" query string parameter with a "CYA" value
36-
call.url + (if call.url.contains("?") then "&" else "?") + s"from=CYA"
36+
call.url + (if call.url.contains("?") then "&" else "?") + "from=CYA"

0 commit comments

Comments
 (0)