Skip to content

Commit 071172a

Browse files
Chore/prsd 1519 use complex question page fragment (#832)
1 parent 063f93d commit 071172a

File tree

65 files changed

+790
-746
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+790
-746
lines changed

src/main/kotlin/uk/gov/communities/prsdb/webapp/forms/journeys/LandlordRegistrationJourney.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,6 @@ class LandlordRegistrationJourney(
121121
content =
122122
mapOf(
123123
"title" to "registerAsALandlord.title",
124-
"fieldSetHeading" to "registerAsALandlord.privacyNotice.fieldSetHeading",
125124
"submitButtonText" to "forms.buttons.continue",
126125
"landlordPrivacyNoticeUrl" to LANDLORD_PRIVACY_NOTICE_ROUTE,
127126
"options" to
@@ -217,8 +216,6 @@ class LandlordRegistrationJourney(
217216
content =
218217
mapOf(
219218
"title" to "registerAsALandlord.title",
220-
"fieldSetHeading" to "forms.confirmDetails.heading",
221-
"fieldSetHint" to "forms.confirmDetails.summary",
222219
"submitButtonText" to "forms.buttons.confirmAndContinue",
223220
BACK_URL_ATTR_NAME to RegisterLandlordController.LANDLORD_REGISTRATION_PRIVACY_NOTICE_ROUTE,
224221
),

src/main/kotlin/uk/gov/communities/prsdb/webapp/forms/steps/factories/PropertyComplianceSharedStepFactory.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,6 @@ class PropertyComplianceSharedStepFactory(
791791
content =
792792
mapOf(
793793
"title" to "propertyCompliance.title",
794-
"fieldSetHeading" to "forms.epcExpiryCheck.fieldSetHeading",
795794
"expiryDate" to (getAcceptedEpcDetailsFromSession()?.expiryDateAsJavaLocalDate ?: ""),
796795
"radioOptions" to
797796
listOf(
@@ -1052,7 +1051,6 @@ class PropertyComplianceSharedStepFactory(
10521051
content =
10531052
mapOf(
10541053
"title" to "propertyCompliance.title",
1055-
"fieldSetHeading" to "forms.checkMatchedEpc.fieldSetHeading",
10561054
"epcDetails" to (epcDetails ?: ""),
10571055
"epcCertificateUrl" to epcCertificateUrlProvider.getEpcCertificateUrl(epcDetails?.certificateNumber ?: ""),
10581056
"radioOptions" to

src/main/kotlin/uk/gov/communities/prsdb/webapp/journeys/example/steps/CheckEpcStepConfig.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ class CheckEpcStepConfig(
2121
getReleventEpc(state)?.let { epcDetails ->
2222
mapOf(
2323
"title" to "propertyCompliance.title",
24-
"fieldSetHeading" to "forms.checkMatchedEpc.fieldSetHeading",
2524
"epcDetails" to epcDetails,
2625
"epcCertificateUrl" to epcDetails.certificateNumber.let { epcCertificateUrlProvider.getEpcCertificateUrl(it) },
2726
"radioOptions" to

src/main/kotlin/uk/gov/communities/prsdb/webapp/models/requestModels/formModels/DeclarationFormModel.kt

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/main/resources/messages.properties

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,8 @@ registerAsALandlord.confirmation.propertyRegistration.paragraph.three=You could
399399
registerAsALandlord.confirmation.propertyRegistration.bullet.one=repeatedly break the rules
400400
registerAsALandlord.confirmation.propertyRegistration.bullet.two=commit a serious offence, like providing false information to the database
401401

402-
403402
registerAsALandlord.privacyNotice.checkbox.error.missing=You must confirm you have read the privacy notice to continue
404-
registerAsALandlord.privacyNotice.fieldSetHeading=Read and agree to the privacy notice
403+
registerAsALandlord.privacyNotice.heading=Read and agree to the privacy notice
405404
registerAsALandlord.privacyNotice.paragraph.one.beforeLink=Read the
406405
registerAsALandlord.privacyNotice.paragraph.one.linkText=full Private Rented Sector Database privacy notice (opens in new tab)
407406
registerAsALandlord.privacyNotice.paragraph.one.afterLink=for this private beta to find out how it stores, processes, and shares your personal information.
@@ -629,7 +628,7 @@ registerLaUser.success.whatHappensNext.paragraph.two=Head to your dashboard to:
629628
registerLaUser.success.whatHappensNext.bullet.one=search and view property and landlord information
630629
registerLaUser.success.whatHappensNext.bullet.two=view compliance information for registered properties
631630

632-
registerLAUser.privacyNotice.fieldSetHeading=Read and agree to the privacy notice for local councils
631+
registerLAUser.privacyNotice.heading=Read and agree to the privacy notice for local councils
633632
registerLAUser.privacyNotice.paragraph.one.beforeLink=Read the
634633
registerLAUser.privacyNotice.paragraph.one.linkText=full Private Rented Sector Database privacy notice (opens in new tab)
635634
registerLAUser.privacyNotice.paragraph.one.afterLink= for this private beta to find out what data we collect and why.
@@ -1045,7 +1044,7 @@ forms.name.error.missing=You must enter your full name
10451044

10461045
forms.checkAnswers.heading=Check your answers
10471046

1048-
forms.identityNotVerified.fieldSetHeading=You have not proven your identity using GOV.UK One Login
1047+
forms.identityNotVerified.heading=You have not proven your identity using GOV.UK One Login
10491048
forms.identityNotVerified.paragraph.one=You can return to GOV.UK One Login at any time to prove your identity. You only need to do this once.
10501049
forms.identityNotVerified.paragraph.two=Proving your identity helps local councils understand who has registered on the database.
10511050
forms.identityNotVerified.paragraph.three=You can continue using the database as normal.
@@ -1521,7 +1520,7 @@ forms.epcExemptionConfirmation.paragraph.two=If they have any issues, they can c
15211520
forms.epcExemptionConfirmation.paragraph.three=If at any point your property requires an EPC, you should get one and add it to the database.
15221521

15231522
forms.checkMatchedEpc.error.missing=Select Yes or No to continue
1524-
forms.checkMatchedEpc.fieldSetHeading=Check if this is the correct EPC information for {0,,address}
1523+
forms.checkMatchedEpc.heading=Check if this is the correct EPC information for {0,,address}
15251524
forms.checkMatchedEpc.insetText.beforeLink=The EPC information is generated from the Energy Performance of Buildings Register.
15261525
forms.checkMatchedEpc.insetText.link=View the full EPC certificate (opens in new tab)
15271526
forms.checkMatchedEpc.summaryList.address.heading=Address
@@ -1562,7 +1561,7 @@ forms.epcSuperseded.paragraph.two=We\u2019ve found the latest EPC with the certi
15621561
forms.epcSuperseded.paragraph.three=You can check the newer certificate is correct on the next screen before you save.
15631562

15641563
forms.epcExpiryCheck.missing=Select Yes or No to continue
1565-
forms.epcExpiryCheck.fieldSetHeading=Your EPC expiry date
1564+
forms.epcExpiryCheck.heading=Your EPC expiry date
15661565
forms.epcExpiryCheck.paragraph.one=An EPC is valid for 10 years. After 10 years, you only need a new EPC for the property if new tenants move in after the EPC expires.
15671566
forms.epcExpiryCheck.paragraph.two=If the same tenants remain, the EPC is stays valid even after 10 years.
15681567
forms.epcExpiryCheck.paragraph.three=To check if you need a new EPC, did the current tenancy start before {0,,expiryDate}?
@@ -1614,7 +1613,7 @@ forms.epcExpiredLowRating.whatNext.two.link=MEES exemption (opens in new tab)
16141613
forms.epcExpiredLowRating.whatNext.two.afterLink=.
16151614

16161615
forms.meesExemptionCheck.error.missing=Select Yes or No to continue
1617-
forms.meesExemptionCheck.fieldSetHeading=This property is below the Minimum Energy Efficiency Standard (MEES)
1616+
forms.meesExemptionCheck.heading=This property is below the Minimum Energy Efficiency Standard (MEES)
16181617
forms.meesExemptionCheck.paragraph.one.beforeLink=You cannot let a property under
16191618
forms.meesExemptionCheck.paragraph.one.link=Minimum Energy Efficiency Standard (MEES) Regulations (opens in new tab)
16201619
forms.meesExemptionCheck.paragraph.one.afterLink=if the property has an EPC rating below E, unless you have a valid exemption.
@@ -1792,7 +1791,7 @@ generatePasscode.returnToDashboard=Return to dashboard
17921791
betaBannerFeedback.title=Beta feedback
17931792
betaBannerFeedback.heading=Give feedback on the PRS Database
17941793
betaBannerFeedback.intro=Use this form to let us know if you\u2019ve experienced any issues, or have ideas for how we can improve the service.
1795-
betaBannerFeedback.label=<strong>Tell us about your experience with the PRS Database</strong>
1794+
betaBannerFeedback.label=Tell us about your experience with the PRS Database
17961795
betaBannerFeedback.hint=Do not include any personal or financial information, for example your National Insurance number or credit card details.
17971796
betaBannerFeedback.emailLabel=If you\u2019re happy for us to contact you about your feedback, enter your email address (optional)
17981797
betaBannerFeedback.buttonText=Send feedback

src/main/resources/templates/betaBannerFeedback.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,24 @@
33
<!--/*@thymesVar id="feedbackUrl" type="java.lang.String"*/-->
44
<!--/*@thymesVar id="referrerHeader" type="java.lang.String"*/-->
55
<!DOCTYPE html>
6-
<html id="form-content" th:replace="~{fragments/forms/questionPage :: questionPage(#{betaBannerFeedback.heading}, ${formModel}, ~{::#form-content/content()}, null, null)}">
7-
<th:block th:replace="~{forms/betaBannerFeedbackForm :: betaBannerFeedbackForm}"></th:block>
6+
<html th:replace="~{fragments/forms/complexQuestionPage :: complexQuestionPage(#{betaBannerFeedback.heading}, ${formModel}, ~{::#form-content}, ~{::#question-content}, null, null)}">
7+
<th:block id="question-content">
8+
<h1 class="govuk-heading-l" th:text="#{betaBannerFeedback.heading}">
9+
betaBannerFeedback.heading
10+
</h1>
11+
<p class="govuk-body" th:text="#{betaBannerFeedback.intro}">betaBannerFeedback.intro</p>
12+
</th:block>
13+
<th:block id="form-content">
14+
<th:block id="fieldset-content" th:replace="~{fragments/forms/minorFieldSet :: minorFieldSet(~{::#fieldset-content/content()}, 'feedback', #{betaBannerFeedback.label}, null)}">
15+
<input type="hidden" name="referrerHeader" th:value="${referrerHeader}" />
16+
<div th:replace="~{fragments/forms/textArea :: textArea(label=null, fieldName='feedback',hint= #{betaBannerFeedback.hint}, limit=1200, ariaLabel=#{betaBannerFeedback.label})}"></div>
17+
<div th:replace="~{fragments/forms/emailInput :: emailInput(#{betaBannerFeedback.emailLabel}, 'email', null)}"></div>
18+
</th:block>
19+
<button th:replace="~{fragments/buttons/primaryButton :: primaryButton(#{betaBannerFeedback.buttonText})}"></button>
820
<section>
921
<h2 class="govuk-heading-m" th:text="#{betaBannerFeedback.heading.two}">betaBannerFeedback.heading.two</h2>
1022
<h3 class="govuk-heading-s" th:text="#{betaBannerFeedback.heading.three}">betaBannerFeedback.heading.three</h3>
1123
<p class="govuk-body" th:text="#{betaBannerFeedback.paragraph.one}">betaBannerFeedback.paragraph.one</p>
1224
</section>
25+
</th:block>
1326
</html>

src/main/resources/templates/forms/betaBannerFeedbackForm.html

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/main/resources/templates/forms/checkAnswersForm.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,20 @@
99
<!--/*@thymesVar id="submitButtonText" type="java.lang.String"*/-->
1010
<!--/*@thymesVar id="insetText" type="java.lang.String"*/-->
1111
<!DOCTYPE html>
12-
<html id="form-content" th:replace="~{fragments/forms/questionPage :: questionPage(#{${title}}, ${formModel}, ~{::#form-content/content()}, ${backUrl}, ${sectionHeaderInfo})}">
13-
<legend class="govuk-fieldset__legend govuk-fieldset__legend--l">
14-
<h1 class="govuk-fieldset__heading" th:text="#{forms.checkAnswers.heading}">forms.checkAnswers.heading</h1>
15-
</legend>
12+
<html th:replace="~{fragments/forms/complexQuestionPage :: complexQuestionPage(#{${title}}, ${formModel}, ~{::#form-content}, ~{::#question-content}, ${backUrl}, ${sectionHeaderInfo})}">
13+
<th:block id="question-content">
14+
<h1 class="govuk-heading-l" th:text="#{forms.checkAnswers.heading}">forms.checkAnswers.heading</h1>
1615
<th:block th:if="${insetText != null}">
1716
<p class="govuk-inset-text" th:text="#{${insetText}}">insetText</p>
1817
</th:block>
19-
<h2 class="govuk-heading-m" th:text="#{${summaryName}}"></h2>
18+
<h2 class="govuk-heading-m" th:text="#{${summaryName}}" id="summary-name"></h2>
2019
<dl th:replace="~{fragments/summaryList :: summaryList(${summaryListData})}"></dl>
2120
<th:block th:if="${showWarning}">
2221
<div th:replace="~{fragments/warningText :: warningText(#{forms.warning})}">forms.update.warning</div>
2322
</th:block>
24-
<input type="hidden" name="submittedFilteredJourneyData" th:value="${submittedFilteredJourneyData}"/>
25-
<button th:replace="~{fragments/buttons/primaryButton :: primaryButton(#{${submitButtonText}})}"></button>
23+
</th:block>
24+
<th:block id="form-content">
25+
<input type="hidden" name="submittedFilteredJourneyData" th:value="${submittedFilteredJourneyData}"/>
26+
<button th:replace="~{fragments/buttons/primaryButton :: primaryButton(#{${submitButtonText}})}"></button>
27+
</th:block>
2628
</html>

src/main/resources/templates/forms/checkMatchedEpcForm.html

Lines changed: 43 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,51 @@
22
<!--/*@thymesVar id="formModel" type="java.lang.Object"*/-->
33
<!--/*@thymesVar id="backUrl" type="java.lang.String"*/-->
44
<!--/*@thymesVar id="sectionHeaderInfo" type="uk.gov.communities.prsdb.webapp.models.viewModels.SectionHeaderViewModel"*/-->
5-
<!--/*@thymesVar id="fieldSetHeading" type="java.lang.String"*/-->
65
<!--/*@thymesVar id="epcCertificateUrl" type="java.lang.String"*/-->
76
<!--/*@thymesVar id="epcDetails" type="java.lang.Object"*/-->
87
<!--/*@thymesVar id="radioOptions" type="uk.gov.communities.prsdb.webapp.models.viewModels.formModels.RadiosViewModel"*/-->
98
<!DOCTYPE html>
10-
<html id="form-content" th:replace="~{fragments/forms/questionPage :: questionPage(#{${title}}, ${formModel}, ~{::#form-content/content()}, ${backUrl}, ${sectionHeaderInfo})}">
11-
<th:block id="fieldset-content" th:replace="~{fragments/forms/fieldSet :: fieldSet(~{::#fieldset-content/content()}, 'matchedEpcIsCorrect', #{forms.checkMatchedEpc.fieldSetHeading(${epcDetails.singleLineAddress})}, null)}">
12-
<p class="govuk-inset-text">
13-
<span th:remove="tag" class="govuk-body" th:text="#{forms.checkMatchedEpc.insetText.beforeLink}">forms.checkMatchedEpc.insetText.beforeLink</span>
14-
<a class="govuk-link" th:text="#{forms.checkMatchedEpc.insetText.link}" th:href="@{${epcCertificateUrl}}" rel="noreferrer noopener" target="_blank">
15-
forms.checkMatchedEpc.insetText.link
16-
</a>
17-
</p>
18-
<dl class="govuk-summary-list">
19-
<div class="govuk-summary-list__row">
20-
<dt class="govuk-summary-list__key" th:text="#{forms.checkMatchedEpc.summaryList.address.heading}">
21-
forms.checkMatchedEpc.summaryList.address.heading
22-
</dt>
23-
<dd class="govuk-summary-list__value" th:text="${epcDetails.singleLineAddress}">
24-
</dd>
25-
</div>
26-
<div class="govuk-summary-list__row">
27-
<dt class="govuk-summary-list__key" th:text="#{forms.checkMatchedEpc.summaryList.energyRating.heading}">
28-
forms.checkMatchedEpc.summaryList.address.heading
29-
</dt>
30-
<dd class="govuk-summary-list__value" th:text="${epcDetails.energyRatingUppercase}">
31-
</dd>
32-
</div>
33-
<div class="govuk-summary-list__row">
34-
<dt class="govuk-summary-list__key" th:text="#{forms.checkMatchedEpc.summaryList.expiryDate.heading}">
35-
forms.checkMatchedEpc.summaryList.address.heading
36-
</dt>
37-
<dd class="govuk-summary-list__value" th:text="${{epcDetails.expiryDateAsJavaLocalDate}}">
38-
</dd>
39-
</div>
40-
</dl>
41-
<h2 class="govuk-heading-m" th:text="#{forms.checkMatchedEpc.isThisTheCorrectEpc.heading}">forms.checkMatchedEpc.isThisTheCorrectEpc.heading</h2>
42-
<th:block th:replace="~{fragments/forms/radios :: radios(null, 'matchedEpcIsCorrect', null, ${radioOptions})}"></th:block>
43-
</th:block>
44-
<button th:replace="~{fragments/buttons/primaryButton :: primaryButton(#{forms.buttons.saveAndContinue})}"></button>
9+
<html th:replace="~{fragments/forms/complexQuestionPage :: complexQuestionPage(#{${title}}, ${formModel}, ~{::#form-content}, ~{::#question-content}, ${backUrl}, ${sectionHeaderInfo})}">
10+
<th:block id="question-content">
11+
<h1 class="govuk-heading-l" th:text="#{forms.checkMatchedEpc.heading(${epcDetails.singleLineAddress})}">
12+
#{forms.checkMatchedEpc.heading(${epcDetails.singleLineAddress})}
13+
</h1>
14+
<p class="govuk-inset-text">
15+
<span th:remove="tag" class="govuk-body" th:text="#{forms.checkMatchedEpc.insetText.beforeLink}">forms.checkMatchedEpc.insetText.beforeLink</span>
16+
<a class="govuk-link" th:text="#{forms.checkMatchedEpc.insetText.link}" th:href="@{${epcCertificateUrl}}" rel="noreferrer noopener" target="_blank">
17+
forms.checkMatchedEpc.insetText.link
18+
</a>
19+
</p>
20+
<dl class="govuk-summary-list">
21+
<div class="govuk-summary-list__row">
22+
<dt class="govuk-summary-list__key" th:text="#{forms.checkMatchedEpc.summaryList.address.heading}">
23+
forms.checkMatchedEpc.summaryList.address.heading
24+
</dt>
25+
<dd class="govuk-summary-list__value" th:text="${epcDetails.singleLineAddress}">
26+
</dd>
27+
</div>
28+
<div class="govuk-summary-list__row">
29+
<dt class="govuk-summary-list__key" th:text="#{forms.checkMatchedEpc.summaryList.energyRating.heading}">
30+
forms.checkMatchedEpc.summaryList.address.heading
31+
</dt>
32+
<dd class="govuk-summary-list__value" th:text="${epcDetails.energyRatingUppercase}">
33+
</dd>
34+
</div>
35+
<div class="govuk-summary-list__row">
36+
<dt class="govuk-summary-list__key" th:text="#{forms.checkMatchedEpc.summaryList.expiryDate.heading}">
37+
forms.checkMatchedEpc.summaryList.address.heading
38+
</dt>
39+
<dd class="govuk-summary-list__value" th:text="${{epcDetails.expiryDateAsJavaLocalDate}}">
40+
</dd>
41+
</div>
42+
</dl>
43+
</th:block>
44+
<th:block id="form-content">
45+
<th:block id="fieldset-content"
46+
th:replace="~{fragments/forms/minorFieldSet :: minorFieldSet(~{::#fieldset-content/content()}, 'matchedEpcIsCorrect', #{forms.checkMatchedEpc.isThisTheCorrectEpc.heading}, null)}">
47+
<th:block th:replace="~{fragments/forms/radios :: radios(null, 'matchedEpcIsCorrect', null, ${radioOptions})}"></th:block>
48+
</th:block>
49+
<button th:replace="~{fragments/buttons/primaryButton :: primaryButton(#{forms.buttons.saveAndContinue})}"></button>
50+
</th:block>
51+
4552
</html>

0 commit comments

Comments
 (0)