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

OOC-4407: Update declaration & submit button #201

Merged
merged 2 commits into from
Jun 28, 2024
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
2 changes: 1 addition & 1 deletion runner/src/server/forms/ReportAnOutbreak.json
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,7 @@
],
"version": 2,
"skipSummary": false,
"declaration": "<style>\n ul {\n list-style-type: none;\n }\n\n li {\n list-style-type: none;\n position: relative;\n }\n .bullet-item::before {\n content: \"– \";\n width: 10px;\n left: 0;\n }\n</style>\n<br class=\"govuk-prose-scope\">\n <p class=\"govuk-body\">In this section you can review and change your answers. The Submit button at the bottom of this page will result in your responses being submitted.<br/>\n Please be aware that your responses in this form may be shared with the Local Authority, Community Infection Control Team, Health Protection Team and/or NHS for the purposes of assisting you with the management of your situation.\n </br>\n <p class=\"govuk-body\">Once you press “submit”, you should receive at least two automatic emails from the Care OBRA Tool:</p>\n <ul>\n <li class=\"bullet-item\">One “acknowledgement email” which gives a summary of the information you entered onto the form</li>\n <li class=\"bullet-item\">One “advice email” which tells you what steps you should take to prevent spread of infection amongst your clients/residents and staff; and what to expect next from your Health Protection Team (HPT) or Community Infection Control (CIC) Team</li>\n <li class=\"bullet-item\">If you have reported an outbreak AND a single case of a different infection, you may receive an additional advice email</li>\n </ul>\n <p class=\"govuk-body govuk-!-font-weight-bold\">If:</p>\n <ul class=\"govuk-body govuk-!-font-weight-bold\">\n <li class=\"bullet-item\">You do not receive these emails within one hour OR</li>\n <li class=\"bullet-item\">You need very urgent outbreak management advice</li>\n </ul>\n <p class=\"govuk-body govuk-!-font-weight-bold\">You should call your local HPT or CIC Team.</p>\n <p class=\"govuk-body\">If you do not know the contact details of your HPT you can find them here - <a href=\"https://www.gov.uk/health-protection-team\" class=\"govuk-link\" rel=\"noreferrer noopener\" target=\"_blank\">Find your local health protection team in England - GOV.UK (www.gov.uk)</a></p>\n <p class=\"govuk-body\">Before submitting your answers, please ensure you have not included any person identifiable information in your responses (e.g. names or dates of birth).</p>\n <p class=\"govuk-body\">Please tick to confirm understanding of this.</p>\n</div>\n",
"declaration": "<br class=\"govuk-prose-scope\">\n <p class=\"govuk-body\">Your responses may be shared with your local UKHSA health protection team, your local authority community infection control team, and the NHS. They will use your information to help you to manage your situation.</br>\n <p class=\"govuk-body\">By submitting this report you confirm that the details you are providing are correct to the best of your knowledge. You confirm that you have not included any personally identifiable information, for example names or dates of birth</p>\n</div>\n",
"name": "Report an outbreak",
"feedback": {
"feedbackForm": true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,7 @@ export class SummaryPageController extends PageController {
return startPageRedirect;
}

/**
* If a form is configured with a declaration, a checkbox will be rendered with the configured declaration text.
* If the user does not agree to the declaration, the page will be rerendered with a warning.
*/
if (summaryViewModel.declaration && !summaryViewModel.skipSummary) {
const { declaration } = request.payload as {
declaration?: any;
};

if (!declaration) {
request.yar.flash(
"declarationError",
"You must declare to be able to submit this application"
);
const url = request.headers.referer ?? request.path;
return redirectTo(request, h, `${url}#declaration`);
}
summaryViewModel.addDeclarationAsQuestion();
}

Expand Down
31 changes: 4 additions & 27 deletions runner/src/server/views/summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h2 class="govuk-heading-m">Fees</h2>
<input type="hidden" name="crumb" value="{{ crumb }}" />

{%if declaration %}
<h2 class="govuk-heading-m" id="declaration">Declaration</h2>
<h2 class="govuk-heading-m" id="declaration">Now send your report</h2>
{{ declaration | safe }}
<div
class="govuk-grid-column-two-thirds {{ 'govuk-form-group--error' if declarationError }}"
Expand All @@ -96,29 +96,6 @@ <h2 class="govuk-heading-m" id="declaration">Declaration</h2>
{{ declarationError }}
</span>
{% endif %}
<div class="govuk-checkboxes">
<div class="govuk-checkboxes__item">
<input
class="govuk-checkboxes__input"
id="declaration-1"
name="declaration"
{%
if
result.error
%}disabled{%
endif
%}
type="checkbox"
value="true"
/>
<label
class="govuk-label govuk-checkboxes__label"
for="declaration-1"
>
Confirm
</label>
</div>
</div>
</div>
{% endif %}

Expand All @@ -139,15 +116,15 @@ <h2 class="govuk-heading-m" id="declaration">Declaration</h2>
data-module="govuk-button"
>
{% if fees and fees.details|length %} Submit and pay {% else %}
Submit {% endif %}
Confirm and send {% endif %}
</button>
</div>


{% if result.error %}
<label id="form-error" class="govuk-error-message">
<span class="govuk-visually-hidden">Error:</span> You must enter all
required questions before submitting.
<span class="govuk-visually-hidden">Error:</span>
Answer all required questions before sending your report.
</label>
{% endif %}
</div>
Expand Down