Only show breaking change page to API users

We introduced the ‘breaking change’ page[1] partly to help teach people
about the relationship between the placeholders in their template and
the data they were providing. Data can be provided either by API or by
uploading a spreadsheet. The users who we struggled to communicate this
relationship to were the ones using the upload a spreadsheet feature.

We made two changes to the context of this feature:

1. Around the same time we introduced the interactive tour[2], which
   ultimately proved to be the thing that helped people understand the
   relationship between the data they were providing and the
   placeholders in the template.

2. We introduced a way for people to send one-off messages without
   using the API or uploading a spreadsheet[3]. So for this page to say
   that you’ll need to update a spreadsheet or change an API call if you
   change the placeholders in your template is no longer accurate.

Therefore I think it makes sense to only show this page to teams who are
using the API to send messages. The best proxy we have for that is to
look at whether they’ve created any API keys.

***

1. https://github.com/alphagov/notifications-admin/pull/631
2. https://github.com/alphagov/notifications-admin/pull/613
3. https://github.com/alphagov/notifications-admin/pull/1293
This commit is contained in:
Chris Hill-Scott
2019-11-12 16:57:01 +00:00
parent c51f6de1d6
commit dbc85fcc1f
2 changed files with 8 additions and 1 deletions

View File

@@ -603,7 +603,12 @@ def edit_service_template(service_id, template_id):
new_template = get_template(new_template_data, current_service)
template_change = get_template(template, current_service).compare_to(new_template)
if template_change.placeholders_added and not request.form.get('confirm'):
if (
template_change.placeholders_added and
not request.form.get('confirm') and
current_service.api_keys
):
example_column_headings = (
first_column_headings[new_template.template_type] + list(new_template.placeholders)
)

View File

@@ -1328,6 +1328,7 @@ def test_should_redirect_to_one_off_if_template_type_is_letter(
def test_should_redirect_when_saving_a_template(
client_request,
mock_get_service_template,
mock_get_api_keys,
mock_update_service_template,
fake_uuid,
):
@@ -1499,6 +1500,7 @@ def test_should_show_interstitial_when_making_breaking_change(
client_request,
mock_update_service_template,
mock_get_user_by_email,
mock_get_api_keys,
fake_uuid,
mocker,
template_mock,