Skip to content

Commit

Permalink
Help journey sign in (#999)
Browse files Browse the repository at this point in the history
* sign in page format update

* update error messages and error banner

* linting | add password only error message

* update tests

* auto patch increment

* remove debug statement

* fix tests

* auto patch increment

* version bump

* version bump

* revert error message updates

* EOF

* testing version bump bot

* retry

* revert and manually bump version

---------

Co-authored-by: ras-rm-pr-bot <[email protected]>
Co-authored-by: Mark Price <[email protected]>
  • Loading branch information
3 people authored Oct 22, 2024
1 parent 3482ba3 commit f00b502
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
4 changes: 2 additions & 2 deletions _infra/helm/frontstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ 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.
# This will be set to an appropriate branch version prior to the final merge to main
version: 0.0.99
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.
# This will be set to an appropriate branch version prior to the final merge to main
appVersion: 0.0.99
appVersion: 0.0.100
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

0 comments on commit f00b502

Please sign in to comment.