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

RAS-1085 Survey Respondent Help Journey #993

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ name: Build
on:
push:
branches:
- main
- survey-respondent-help-journey
paths-ignore:
- _infra/spinnaker/**
pull_request:
branches:
- main
- survey-respondent-help-journey
paths-ignore:
- _infra/spinnaker/**

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ gpg --armor --export ED1B7A3EADF95687
```
current saved exported public private keys are dev-public-key.asc dev-private-key.asc
The private key is only supplied for testing decryption
passphase if needed is PASSWORD1
passphase if needed is PASSWORD1
19 changes: 1 addition & 18 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
Front Stage Server
============================

Author: Andrew Millar
Version: 0.2.0

Changes For ras-front-stage Server
============================================

* Updated logging content and format
* Fixed HTTP redirect errors
* survey_id and ru_id no longer hardcoded for secure messages
* Improved error handling from external services
* Fixed bug where draft was still saved after sending


Known Issues For Front Stage Server
============================================
* Sign in with 10 bad passwords does not show you a different error message
* HTTP 500 errors are displayed on the screen when coming from other micro services
* Error when logging in with unverified user
RAS-1085 Survey Respondent Help Journey
6 changes: 4 additions & 2 deletions _infra/helm/frontstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 2.5.29
# This will be set to an appropriate branch version prior to the final merge to main
version: 0.0.100

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 2.5.29
# This will be set to an appropriate branch version prior to the final merge to main
appVersion: 0.0.100
37 changes: 28 additions & 9 deletions frontstage/templates/contact-us.html
Original file line number Diff line number Diff line change
@@ -1,23 +1,42 @@

{% extends "layouts/_block_content.html" %}
{% from "components/address-output/_macro.njk" import onsAddressOutput %}
{% from "components/breadcrumbs/_macro.njk" import onsBreadcrumbs %}

{% set page_title = "Contact us" %}

{% set breadcrumbsData = [
{
"text": "Back",
"url": "/sign-in/",
"id": "b-item"
}
] %}
{% block breadcrumbs %}
{{
onsBreadcrumbs({
"ariaLabel": "Breadcrumbs",
"id": "breadcrumbs",
"itemsList": breadcrumbsData
})
}}
{% endblock breadcrumbs %}

{% block main %}
<h1 class="ons-u-fs-xxl">Contact us</h1>

<h1 class="ons-u-fs-xl">Contact us</h1>
<h2>
Email
</h2>
<p><a href="mailto:[email protected]">[email protected]</a></p>

<h2>
Telephone
Phone
</h2>
<div class="ons-u-fs-r">
<p><a href="tel:+44-300-1234-931">0300 1234 931</a></p>
</div>
<div class="ons-u-fs-r">
<p class="ons-u-mb-l">Opening hours:<br />
Monday to Thursday 8:30am – 5pm<br/>
Friday 8:30am - 4:30pm</p>
<div class="ons-u-mb-xs">
<p> +44 300 1234 931<br/>
Monday to Thursday 8:30am to 5:00pm<br/>
Friday 8:30am to 4:00pm</p>
</div>
<h2>
Post
Expand Down
18 changes: 8 additions & 10 deletions frontstage/templates/sign-in/sign-in.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
) %}
{% endfor %}
{% endif %}

{% call
onsPanel({
"variant": "error",
Expand Down Expand Up @@ -116,11 +116,7 @@ <h1 class="ons-u-fs-xl">You've activated your account</h1>
<p>You are able to use the system and submit data during this period however your response status may not display as completed until after the maintenance has been completed.</p>
{% endcall %}
{% endif %}

<p>New to this service?
<a id="create-account" href="/register/create-account/">Create an account</a>
</p>
<h1 class="ons-u-fs-xl">Sign in</h1>
<h1 class="ons-u-fs-xxl">Sign in</h1>
{% endif %}

{% if errorType == 'failed' %}
Expand Down Expand Up @@ -162,17 +158,19 @@ <h1 class="ons-u-fs-xl">Sign in</h1>
}}

{% endcall %}
<div class="ons-u-fs-r"><p> Need
<a href="/passwords/forgot-password">help signing in?</a></p>
</div>
{{
onsButton({
"text": "Sign in",
"type": "submit",
"classes": "ons-u-mt-l",
"classes": "ons-u-mb-l",
"id": "sign_in_button",
"submitType": "timer"
})
}}
<div class="ons-u-mt-m">
<a href="/passwords/forgot-password">Forgot password?</a>
</div>
<h1 class="ons-u-fs-l">New to this service?</h1>
<a id="create-account" href="/register/create-account/">Create an account</a>
</form>
{% endblock main %}
12 changes: 10 additions & 2 deletions frontstage/views/sign_in/sign_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,21 @@ def login(): # noqa: C901
bound_logger.error("Unexpected error was returned from Auth service", auth_error=error_message)

bound_logger.unbind("email")
return render_template("sign-in/sign-in.html", form=form, data={"error": {"type": "failed"}})
return render_template(
"sign-in/sign-in.html",
form=form,
data={"error": {"type": "failed"}},
)

bound_logger.info("Successfully found user in auth service. Attempting to find user in party service")
party_json = party_controller.get_respondent_by_email(username)
if not party_json or "id" not in party_json:
bound_logger.error("Respondent has an account in auth but not in party")
return render_template("sign-in/sign-in.html", form=form, data={"error": {"type": "failed"}})
return render_template(
"sign-in/sign-in.html",
form=form,
data={"error": {"type": "failed"}},
)
party_id = party_json["id"]
bound_logger = bound_logger.bind(party_id=party_id)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/views/account/test_account_delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def test_account_delete_confirm(self, mock_request, get_respondent_party_by_id):
self.assertTrue("New to this service?".encode() in response.data)
self.assertTrue("Email Address".encode() in response.data)
self.assertTrue("Password".encode() in response.data)
self.assertTrue("Forgot password?".encode() in response.data)
self.assertTrue("Create an account".encode() in response.data)

@requests_mock.mock()
@patch("frontstage.controllers.party_controller.get_respondent_party_by_id")
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/views/test_cookies_and_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ def test_contact_success(self, mock_request):

self.assertEqual(response.status_code, 200)
self.assertTrue("Contact us".encode() in response.data)
self.assertTrue("Opening hours:".encode() in response.data)
self.assertIn(b'href="/sign-in/"', response.data)
Loading