From 44a084588280cdf2aeb71f94901e495d57f0614f Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 10 Aug 2016 09:52:15 +0100 Subject: [PATCH 1/4] Replace documentation link with links to clients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In research we found that developers orientate themselves around the API clients rather than the documentation. We should get them to the client documentation as quickly as possible. We currently link to the API documentation in three places: - API integration page - global footer - template ‘API info’ page For the first two this commit: - removes the link to the documentation - adds links to each of the 5 clients For the last one it just removes the link entirely. --- app/templates/admin_template.html | 10 +++++++++- app/templates/views/api-keys.html | 20 ++++++++++++++------ app/templates/views/send-from-api.html | 4 ---- tests/app/main/views/test_dashboard.py | 2 -- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 02564240d..7789e26bb 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -101,7 +101,15 @@

Documentation

diff --git a/app/templates/views/api-keys.html b/app/templates/views/api-keys.html index 78ba560ed..22d3cc12d 100644 --- a/app/templates/views/api-keys.html +++ b/app/templates/views/api-keys.html @@ -58,11 +58,19 @@ {{ api_key(current_service.id, "Service ID", thing="service ID") }} -

Documentation

-

- See the - - API documentation for clients and specfications. -

+

API clients

+ {% endblock %} diff --git a/app/templates/views/send-from-api.html b/app/templates/views/send-from-api.html index 9add19598..4a0a91b6f 100644 --- a/app/templates/views/send-from-api.html +++ b/app/templates/views/send-from-api.html @@ -37,8 +37,4 @@ {{ personalisation|syntax_highlight_json }} {% endif %} -

-
See the developer documentation for full details. -

- {% endblock %} diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index b1cc51ccb..1be535cbd 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -277,7 +277,6 @@ def test_menu_send_messages(mocker, service_id=service_one['id'], template_type='sms')in page assert url_for('main.manage_users', service_id=service_one['id']) in page - assert url_for('main.documentation') in page assert url_for('main.service_settings', service_id=service_one['id']) not in page assert url_for('main.api_keys', service_id=service_one['id']) not in page @@ -312,7 +311,6 @@ def test_menu_manage_service(mocker, template_type='sms') in page assert url_for('main.manage_users', service_id=service_one['id']) in page assert url_for('main.service_settings', service_id=service_one['id']) in page - assert url_for('main.documentation') in page assert url_for('main.api_keys', service_id=service_one['id']) not in page assert url_for('main.show_all_services') not in page From 7010e35256118e83251e203cfc6e20426e5b424e Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 10 Aug 2016 10:09:04 +0100 Subject: [PATCH 2/4] Remove example personalisation from template page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This was of dubious value, and the syntax probably isn’t accurate for all languages. --- app/main/views/send.py | 6 +----- app/templates/views/send-from-api.html | 5 ----- tests/app/main/views/test_send.py | 2 +- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/app/main/views/send.py b/app/main/views/send.py index 07aa0eb52..82619ed8f 100644 --- a/app/main/views/send.py +++ b/app/main/views/send.py @@ -193,13 +193,9 @@ def send_from_api(service_id, template_id): service_api_client.get_service_template(service_id, template_id)['data'], prefix=current_service['name'] ) - personalisation = { - placeholder: "..." for placeholder in template.placeholders - } return render_template( 'views/send-from-api.html', - template=template, - personalisation=json.dumps(personalisation, indent=4) if personalisation else None + template=template ) diff --git a/app/templates/views/send-from-api.html b/app/templates/views/send-from-api.html index 4a0a91b6f..266bdb088 100644 --- a/app/templates/views/send-from-api.html +++ b/app/templates/views/send-from-api.html @@ -32,9 +32,4 @@ {{ api_key(template.id, name="Template ID", thing='template ID') }} - {% if personalisation %} -

Personalisation (all fields are required)

- {{ personalisation|syntax_highlight_json }} - {% endif %} - {% endblock %} diff --git a/tests/app/main/views/test_send.py b/tests/app/main/views/test_send.py index 026dc55cf..1cacaf109 100644 --- a/tests/app/main/views/test_send.py +++ b/tests/app/main/views/test_send.py @@ -251,7 +251,7 @@ def test_api_info_page( follow_redirects=True ) assert response.status_code == 200 - assert 'API integration' in response.get_data(as_text=True) + assert 'API info' in response.get_data(as_text=True) def test_download_example_csv( From bf6c3bfcc2158b44aafc3750cd1c2fca28b9216a Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 10 Aug 2016 10:33:50 +0100 Subject: [PATCH 3/4] Move terms of use into help Terms of use is non-technical, it should sit alongside the other non-technical things like pricing. --- app/templates/admin_template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 7789e26bb..6fce91870 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -92,6 +92,7 @@

Help

    +
  • Terms of use
  • Trial mode
  • Pricing
  • Delivery and failure
  • @@ -100,7 +101,6 @@

    Documentation

      -
    • Terms of use
    • {% for language, url in [ ('Java', 'https://github.com/alphagov/notifications-java-client'), ('Node JS', 'https://github.com/alphagov/notifications-node-client'), From 3b2406ba02a090f0be965b578373fb33f0094d19 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Wed, 10 Aug 2016 10:34:02 +0100 Subject: [PATCH 4/4] Rename documentation to API documentation Everything in this column of the footer is specifically to do with the API now. --- app/templates/admin_template.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/admin_template.html b/app/templates/admin_template.html index 6fce91870..aa57f52d5 100644 --- a/app/templates/admin_template.html +++ b/app/templates/admin_template.html @@ -99,7 +99,7 @@
    -

    Documentation

    +

    API documentation

      {% for language, url in [ ('Java', 'https://github.com/alphagov/notifications-java-client'),