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

@@ -37,6 +37,11 @@ class InviteApiClient(NotifyAdminAPIClient):
'/service/{}/invite'.format(service_id)
)['data']
def get_invited_user(self, service_id, invited_user_id):
return self.get(
f'/service/{service_id}/invite/{invited_user_id}'
)['data']
def get_count_of_invites_with_permission(self, service_id, permission):
if permission not in roles.keys():
raise TypeError('{} is not a valid permission'.format(permission))