mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-04 16:11:11 -04:00
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:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user