mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Use confirmation banner for revoking API keys
Currently revoking an API key takes you to a separate page. It should work the same way as other destructive actions, ie staying on the same page but with a banner asking you to confirm the action.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/banner.html" import banner_wrapper %}
|
||||
{% from "components/table.html" import list_table, field, hidden_field_heading %}
|
||||
{% from "components/api-key.html" import api_key %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
@@ -9,6 +10,22 @@
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{% if revoke_key %}
|
||||
<div class="bottom-gutter">
|
||||
{% call banner_wrapper(type='dangerous', subhead='Are you sure you want to revoke this API key?') %}
|
||||
<p>
|
||||
‘{{ revoke_key }}’ will no longer let you connect to GOV.UK Notify.
|
||||
</p>
|
||||
<form method='post'>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<input type="submit" class="button" name="delete" value="Confirm" />
|
||||
</form>
|
||||
{% endcall %}
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-two-thirds">
|
||||
<h1 class="heading-large">
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/api-key.html" import api_key %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Revoke API key
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="heading-large">
|
||||
Revoke API key
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
‘{{ key_name }}’ will no longer let you connect to GOV.UK Notify.
|
||||
</p>
|
||||
<p>
|
||||
You can’t undo this.
|
||||
</p>
|
||||
|
||||
<form method="post">
|
||||
{{ page_footer(
|
||||
'Revoke this API key',
|
||||
back_link=url_for('.api_keys', service_id=current_service.id),
|
||||
back_link_text='Back to API keys',
|
||||
destructive=True
|
||||
) }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user