mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-26 09:13:58 -04:00
Fix broken links
There were still a few links pointing to `/features/using-notify`
This commit is contained in:
@@ -442,15 +442,13 @@ def format_notification_status_as_field_status(status, notification_type):
|
|||||||
).get(status, 'error')
|
).get(status, 'error')
|
||||||
|
|
||||||
|
|
||||||
def format_notification_status_as_url(status, notification_type):
|
def format_notification_status_as_url(notification_type):
|
||||||
if notification_type == 'letter':
|
url = partial(url_for, "main.message_status")
|
||||||
return None
|
|
||||||
url = partial(url_for, "main.using_notify")
|
|
||||||
return {
|
return {
|
||||||
'technical-failure': url(_anchor='technical-failure'),
|
'email': url(_anchor='email-statuses'),
|
||||||
'temporary-failure': url(_anchor='not-accepting-messages'),
|
'sms': url(_anchor='sms-statuses')
|
||||||
'permanent-failure': url(_anchor='does-not-exist')
|
}.get(notification_type)
|
||||||
}.get(status)
|
|
||||||
|
|
||||||
|
|
||||||
def nl2br(value):
|
def nl2br(value):
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ def create_api_key(service_id):
|
|||||||
disabled_options = [KEY_TYPE_NORMAL]
|
disabled_options = [KEY_TYPE_NORMAL]
|
||||||
option_hints[KEY_TYPE_NORMAL] = Markup(
|
option_hints[KEY_TYPE_NORMAL] = Markup(
|
||||||
'Not available because your service is in '
|
'Not available because your service is in '
|
||||||
'<a href="{}#trial-mode">trial mode</a>'.format(url_for(".using_notify"))
|
'<a href="/features/trial-mode">trial mode</a>'
|
||||||
)
|
)
|
||||||
if current_service.has_permission('letter'):
|
if current_service.has_permission('letter'):
|
||||||
option_hints[KEY_TYPE_TEAM] = 'Can’t be used to send letters'
|
option_hints[KEY_TYPE_TEAM] = 'Can’t be used to send letters'
|
||||||
|
|||||||
@@ -154,11 +154,11 @@
|
|||||||
align='right'
|
align='right'
|
||||||
) %}
|
) %}
|
||||||
{% if displayed_on_single_line %}<span class="align-with-message-body">{% endif %}
|
{% if displayed_on_single_line %}<span class="align-with-message-body">{% endif %}
|
||||||
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
|
{% if notification.notification_type|format_notification_status_as_url %}
|
||||||
<a href="{{ notification.status|format_notification_status_as_url(notification.notification_type) }}">
|
<a href="{{ notification.notification_type|format_notification_status_as_url }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ notification.status|format_notification_status(notification.template.template_type) }}
|
{{ notification.status|format_notification_status(notification.template.template_type) }}
|
||||||
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
|
{% if notification.notification_type|format_notification_status_as_url %}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span class="status-hint">
|
<span class="status-hint">
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<div class="ajax-block-container">
|
<div class="ajax-block-container">
|
||||||
<p class="notification-status {{ notification.status|format_notification_status_as_field_status(notification.notification_type) }}">
|
<p class="notification-status {{ notification.status|format_notification_status_as_field_status(notification.notification_type) }}">
|
||||||
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
|
{% if notification.notification_type|format_notification_status_as_url %}
|
||||||
<a href="{{ notification.status|format_notification_status_as_url(notification.notification_type) }}">
|
<a href="{{ notification.notification_type|format_notification_status_as_url }}">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{ notification.status|format_notification_status(
|
{{ notification.status|format_notification_status(
|
||||||
notification.template.template_type
|
notification.template.template_type
|
||||||
) }}
|
) }}
|
||||||
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
|
{% if notification.notification_type|format_notification_status_as_url %}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if sent_with_test_key %}
|
{% if sent_with_test_key %}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
<p>These are the types of message status you’ll see when you’re signed in to Notify.</p>
|
<p>These are the types of message status you’ll see when you’re signed in to Notify.</p>
|
||||||
<p>If you’re using our API, some of the statuses you’ll see will be different. Read our <a href="{{ url_for('.documentation') }}">documentation</a> for a detailed list of API message statuses.</p>
|
<p>If you’re using our API, some of the statuses you’ll see will be different. Read our <a href="{{ url_for('.documentation') }}">documentation</a> for a detailed list of API message statuses.</p>
|
||||||
|
|
||||||
<h3 class="heading-small">Emails</h3>
|
<h3 id="email-statuses" class="heading-small">Emails</h3>
|
||||||
<div class="bottom-gutter-3-2">
|
<div class="bottom-gutter-3-2">
|
||||||
{% call mapping_table(
|
{% call mapping_table(
|
||||||
caption='Message statuses – emails',
|
caption='Message statuses – emails',
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
{% endcall %}
|
{% endcall %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="heading-small">Text messages</h3>
|
<h3 id="sms-statuses" class="heading-small">Text messages</h3>
|
||||||
<div class="bottom-gutter-3-2">
|
<div class="bottom-gutter-3-2">
|
||||||
{% call mapping_table(
|
{% call mapping_table(
|
||||||
caption='Message statuses – text messages',
|
caption='Message statuses – text messages',
|
||||||
@@ -77,7 +77,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h3 class="heading-small">Letters</h3>
|
<h3 class="heading-small">Letters</h3>
|
||||||
<div class="bottom-gutter-3-2">
|
<div class="bottom-gutter-3-2">
|
||||||
{% call mapping_table(
|
{% call mapping_table(
|
||||||
|
|||||||
@@ -521,7 +521,10 @@ def test_html_contains_links_for_failed_notifications(
|
|||||||
mock_get_service_data_retention,
|
mock_get_service_data_retention,
|
||||||
mocker,
|
mocker,
|
||||||
):
|
):
|
||||||
mock_get_notifications(mocker, active_user_with_permissions, noti_status='technical-failure')
|
mock_get_notifications(mocker,
|
||||||
|
active_user_with_permissions,
|
||||||
|
diff_template_type="sms",
|
||||||
|
noti_status='technical-failure')
|
||||||
response = client_request.get(
|
response = client_request.get(
|
||||||
'main.view_notifications',
|
'main.view_notifications',
|
||||||
service_id=SERVICE_ONE_ID,
|
service_id=SERVICE_ONE_ID,
|
||||||
|
|||||||
@@ -114,6 +114,15 @@ def test_old_static_pages_redirect(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_message_status_page_contains_message_status_ids(client_request):
|
||||||
|
# The 'email-statuses' and 'sms-statuses' id are linked to when we display a message status,
|
||||||
|
# so this test ensures we don't accidentally remove them
|
||||||
|
page = client_request.get('main.message_status')
|
||||||
|
|
||||||
|
assert page.find(id='email-statuses')
|
||||||
|
assert page.find(id='sms-statuses')
|
||||||
|
|
||||||
|
|
||||||
def test_old_using_notify_page(client_request):
|
def test_old_using_notify_page(client_request):
|
||||||
client_request.get('main.using_notify', _expected_status=410)
|
client_request.get('main.using_notify', _expected_status=410)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user