Add confirmation banner when cancelling user invites

This shows the green banner with a tick when cancelling a user's
invitation to a service or organisation. The accessibility audit noted
that 'When cancelling an invite a new page loads, however, there is no
immediate indication that the invite has been cancelled.'

In order to display the invited user's email address as part of the
flash message, this adds new methods to the api clients for invites to get
a single invite.
This commit is contained in:
Katie Smith
2020-08-17 14:30:09 +01:00
parent ecc44d5d56
commit 895a9df55a
8 changed files with 82 additions and 7 deletions

View File

@@ -283,4 +283,7 @@ def confirm_edit_user_mobile_number(service_id, user_id):
def cancel_invited_user(service_id, invited_user_id):
current_service.cancel_invite(invited_user_id)
invited_user = InvitedUser.by_id_and_service_id(service_id, invited_user_id)
flash(f'Invitation cancelled for {invited_user.email_address}', 'default_with_tick')
return redirect(url_for('main.manage_users', service_id=service_id))