mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 03:08:25 -04:00
Use the API key pattern for showing service ID
When we show an identifier, like an ID or a key, we have a pattern which adds a ‘copy to clipboard’ button. We weren’t using this pattern for service ID. This commit also moves it under the table, so hopefully people will be less likely to confuse the service ID for an API key when scanning down the page.
This commit is contained in:
@@ -33,6 +33,8 @@
|
|||||||
key = $component.data('key'),
|
key = $component.data('key'),
|
||||||
thing = $component.data('thing');
|
thing = $component.data('thing');
|
||||||
|
|
||||||
|
console.log(thing)
|
||||||
|
|
||||||
$component
|
$component
|
||||||
.html(states.keyVisible(key, thing))
|
.html(states.keyVisible(key, thing))
|
||||||
.attr('aria-live', 'polite')
|
.attr('aria-live', 'polite')
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{% extends "withnav_template.html" %}
|
{% extends "withnav_template.html" %}
|
||||||
{% from "components/table.html" import list_table, field, hidden_field_heading %}
|
{% from "components/table.html" import list_table, field, hidden_field_heading %}
|
||||||
|
{% from "components/api-key.html" import api_key %}
|
||||||
|
|
||||||
{% block page_title %}
|
{% block page_title %}
|
||||||
API keys – GOV.UK Notify
|
API keys – GOV.UK Notify
|
||||||
@@ -22,17 +23,11 @@
|
|||||||
developer documentation</a>.
|
developer documentation</a>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2 class="heading-medium">
|
|
||||||
Service ID
|
|
||||||
</h2>
|
|
||||||
<p class="api-key-key">
|
|
||||||
{{ current_service.id }}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{% call(item, row_number) list_table(
|
{% call(item, row_number) list_table(
|
||||||
keys,
|
keys,
|
||||||
empty_message="You haven’t created any API keys yet",
|
empty_message="You haven’t created any API keys yet",
|
||||||
caption="API keys",
|
caption="API keys",
|
||||||
|
caption_visible=False,
|
||||||
field_headings=['Key name', hidden_field_heading('Action')]
|
field_headings=['Key name', hidden_field_heading('Action')]
|
||||||
) %}
|
) %}
|
||||||
{% call field() %}
|
{% call field() %}
|
||||||
@@ -53,4 +48,6 @@
|
|||||||
<a href="{{ url_for('.create_api_key', service_id=current_service.id) }}">Create a new API key</a>
|
<a href="{{ url_for('.create_api_key', service_id=current_service.id) }}">Create a new API key</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
{{ api_key(current_service.id, "Service ID", thing="service ID") }}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Reference in New Issue
Block a user