Merge pull request #859 from alphagov/point-documentation-at-clients

Link to client documentation, not API documentation
This commit is contained in:
Chris Hill-Scott
2016-08-11 16:44:14 +01:00
committed by GitHub
6 changed files with 27 additions and 26 deletions

View File

@@ -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
)

View File

@@ -92,16 +92,24 @@
<div class="column-one-third">
<h2>Help</h2>
<ul>
<li><a href="{{ url_for("main.terms") }}">Terms of use</a></li>
<li><a href="{{ url_for("main.trial_mode") }}">Trial mode</a></li>
<li><a href="{{ url_for("main.pricing") }}">Pricing</a></li>
<li><a href="{{ url_for("main.delivery_and_failure") }}">Delivery and failure</a></li>
</ul>
</div>
<div class="column-one-third">
<h2>Documentation</h2>
<h2>API documentation</h2>
<ul>
<li><a href="{{ url_for("main.terms") }}">Terms of use</a></li>
<li><a href="{{ url_for('main.documentation') }}">API documentation</a></li>
{% for language, url in [
('Java', 'https://github.com/alphagov/notifications-java-client'),
('Node JS', 'https://github.com/alphagov/notifications-node-client'),
('PHP', 'https://github.com/alphagov/notifications-php-client'),
('Python', 'https://github.com/alphagov/notifications-python-client'),
('Ruby', 'https://github.com/alphagov/notifications-ruby-client')
] %}
<li><a href="{{ url }}">{{ language }} client</a></li>
{% endfor %}
</ul>
</div>
</div>

View File

@@ -58,11 +58,19 @@
{{ api_key(current_service.id, "Service ID", thing="service ID") }}
</div>
<h2 class="heading-small">Documentation</h2>
<p>
See the
<a href="{{ url_for('.documentation') }}">
API documentation</a> for clients and specfications.
</p>
<h2 class="heading-small">API clients</h2>
<ul class="list list-bullet">
{% for name, url in [
('Java', 'https://github.com/alphagov/notifications-java-client'),
('Node JS', 'https://github.com/alphagov/notifications-node-client'),
('PHP', 'https://github.com/alphagov/notifications-php-client'),
('Python', 'https://github.com/alphagov/notifications-python-client'),
('Ruby', 'https://github.com/alphagov/notifications-ruby-client')
] %}
<li>
<a href="{{ url }}">{{ name }}</a>
</li>
{% endfor %}
</ul>
{% endblock %}

View File

@@ -32,13 +32,4 @@
{{ api_key(template.id, name="Template ID", thing='template ID') }}
</div>
{% if personalisation %}
<h2 class="heading-small">Personalisation (all fields are required)</h2>
{{ personalisation|syntax_highlight_json }}
{% endif %}
<p>
<br />See the <a href="{{ url_for(".documentation") }}">developer documentation</a> for full details.
</p>
{% endblock %}

View File

@@ -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

View File

@@ -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(