Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #111 from communitiesuk/FPASF-100-download-confirm…
Browse files Browse the repository at this point in the history
…ation

Download/Email Confirmation Page
  • Loading branch information
israr-ulhaq authored Jun 4, 2024
2 parents 7aedad7 + 1d8a9b8 commit a8cbfeb
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/main/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@ def download():
)


@bp.route("/request-received", methods=["GET", "POST"])
@login_required(return_app=SupportedApp.POST_AWARD_FRONTEND)
def request_received():
context = {
"user_email": g.user.email,
}
return render_template("request-received.html", context=context)


@bp.route("/accessibility", methods=["GET"])
@login_required(return_app=SupportedApp.POST_AWARD_FRONTEND)
def accessibility():
Expand Down
31 changes: 31 additions & 0 deletions app/templates/main/request-received.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "base.html" %}

{% block content %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title">
Request received
</h1>
</div>
<h2 class="govuk-heading-m govuk-!-margin-top-7">
What happens next
</h2>
<p class="govuk-body">
We will email a link to <span class="govuk-!-font-weight-bold">{{ context["user_email"] }}</span>.
</p>
<p class="govuk-body">
This may take anything up to 5 minutes to come through to your inbox.</p>
<h2 class="govuk-heading-m">
If you’ve not recieved the email</h2>
<p class="govuk-body">
If you cannot see the email in your inbox, check your junk or spam folder.
If you’re still having problems,
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for ('.download') }}">
request a new link to download your data</a> or email us at
<a class="govuk-link govuk-link--no-visited-state" href="mailto:{{ config.CONTACT_EMAIL }}">{{ config['CONTACT_EMAIL'] }}</a>.
</p>
</div>
</div>

{% endblock %}
11 changes: 11 additions & 0 deletions tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,14 @@ def test_back_link(flask_test_client, url):
def test_pages_we_need_to_make_work(flask_test_client, url):
response = flask_test_client.get(url)
assert response.status_code == 200


def test_download_confirmation_page(flask_test_client):
response = flask_test_client.get("/request-received")
assert response.status_code == 200


def test_user_not_signed(unauthenticated_flask_test_client):
response = unauthenticated_flask_test_client.get("/request-received")
assert response.status_code == 302
assert response.location == "authenticator/sessions/sign-out?return_app=post-award-frontend"

0 comments on commit a8cbfeb

Please sign in to comment.