Skip to content

Commit

Permalink
Merge pull request #860 from ministryofjustice/destructive-button-con…
Browse files Browse the repository at this point in the history
…firm

Ensure buttons marked cpanel-button--destructive have confirmation alerts
  • Loading branch information
Nicholas Tollervey authored Dec 9, 2020
2 parents abe7899 + a72a93b commit 8d0fc1e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/datasource-access-update.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2 class="govuk-error-summary__title" id="error-summary-title">
<section class="cpanel-section">
<form method="post" action="{{ revoke_url }}">
{{ csrf_input }}
<button class="govuk-button cpanel-button--destructive">Revoke access</button>
<button class="govuk-button cpanel-button--destructive js-confirm">Revoke access</button>
</form>
</section>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/includes/parameter-list.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<td class="govuk-table__cell">
<form method="POST" action="{{ url("delete-parameter", kwargs={ "pk": parameter.id }) }}">
{{ csrf_input }}
<button class="govuk-button cpanel-button--destructive">Delete parameter</button>
<button class="govuk-button cpanel-button--destructive js-confirm">Delete parameter</button>
</form>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion controlpanel/frontend/jinja2/policy-update.html
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@ <h1 class="govuk-heading-xl">{{ page_title }}</h1>

<form method="POST" action="{{ url("delete-policy", kwargs={ "pk": policy.id }) }}">
{{ csrf_input }}
<button class="govuk-button cpanel-button--destructive">Delete group</button>
<button class="govuk-button cpanel-button--destructive js-confirm">Delete group</button>
</form>
{% endblock %}
6 changes: 3 additions & 3 deletions controlpanel/frontend/jinja2/webapp-detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h2 class="govuk-heading-m">
{% if user.id %}
<form action="{{ url('revoke-app-admin', kwargs={ "pk": app.id, "user_id": user.id }) }}" method="post">
{{ csrf_input }}
<button class="confirm govuk-button govuk-button--secondary right">
<button class="js-confirm govuk-button govuk-button--secondary right">
Revoke admin
</button>
</form>
Expand Down Expand Up @@ -247,14 +247,14 @@ <h2 class="govuk-heading-m">App data sources</h2>
<form action="{{ url('update-app-access', kwargs={ "pk": bucket.id }) }}" method="post" class="form-control-prefix">
{{ csrf_input }}
<input type="hidden" name="access_level" value="{{ yes_no(bucket.access_level, 'readwrite', 'readonly', 'readwrite') }}">
<button class="confirm govuk-button govuk-button--secondary">
<button class="js-confirm govuk-button govuk-button--secondary">
Set {{ yes_no(bucket.access_level, 'readwrite', 'read only', 'read/write') }}
</button>
</form>
{% if request.user.has_perm('api.remove_app_bucket', app) %}
<form action="{{ url('revoke-app-access', kwargs={ "pk": bucket.id }) }}" method="post" class="form-control-prefix">
{{ csrf_input }}
<button class="confirm govuk-button govuk-button--secondary">
<button class="js-confirm govuk-button govuk-button--secondary">
Disconnect
</button>
</form>
Expand Down

0 comments on commit 8d0fc1e

Please sign in to comment.