Updated support views to represent new url structure

This commit is contained in:
chrisw
2017-11-28 12:00:12 +00:00
parent 6b98e62f4c
commit 90e18e04ee
12 changed files with 61 additions and 139 deletions

View File

@@ -67,6 +67,7 @@
}
// https://github.com/alphagov/product-page-example/blob/master/source/stylesheets/modules/_sub-navigation.scss
.sub-navigation {
@include media(tablet) {
margin-top: $gutter * 1.5;

View File

@@ -21,9 +21,7 @@ def api_integration(service_id):
@login_required
@user_has_permissions('manage_api_keys', admin_override=True)
def api_documentation(service_id):
return render_template(
'views/api/documentation.html'
)
return redirect(url_for('.documentation'), code=301)
@main.route("/services/<service_id>/api/whitelist", methods=['GET', 'POST'])

View File

@@ -1,24 +1,24 @@
{% macro sub_navigation(
item_set
) %}
<nav class="sub-navigation">
<ol itemscope itemtype="http://schema.org/ItemList">
{% for item in item_set %}
<li class="sub-navigation__item {% if item['link'] == request.endpoint %} sub-navigation__item--active {% endif %}"
itemprop="itemListElement"
itemscope
itemtype="http://schema.org/ListItem"
>
<a href="{% if item['external_link'] %}
{{ item['link'] }}
{% else %}
{{ url_for(item['link']) }}
{% endif %}"
itemprop="item">
<span itemprop="name">{{item['name']}}</span>
</a>
</li>
{% endfor %}
</ol>
</nav>
<nav class="sub-navigation">
<ol itemscope itemtype="http://schema.org/ItemList">
{% for item in item_set %}
<li class="sub-navigation__item {% if item['link'] == request.endpoint %} sub-navigation__item--active {% endif %}"
itemprop="itemListElement"
itemscope
itemtype="http://schema.org/ListItem"
>
<a href="{%- if item['external_link'] -%}
{{ item['link'] }}
{%- else -%}
{{ url_for(item['link']) }}
{%- endif -%}"
itemprop="item">
<span itemprop="name">{{item['name']}}</span>
</a>
</li>
{% endfor %}
</ol>
</nav>
{% endmacro %}

View File

@@ -1,37 +0,0 @@
{% extends "withnav_template.html" %}
{% from "components/table.html" import list_table, field, hidden_field_heading %}
{% from "components/api-key.html" import api_key %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Documentation
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
Documentation
</h1>
<ul class="list list-bullet">
{% for name, url in [
('Java client', 'https://github.com/alphagov/notifications-java-client'),
('.NET client', 'https://github.com/alphagov/notifications-net-client'),
('Node JS client', 'https://github.com/alphagov/notifications-node-client'),
('PHP client', 'https://github.com/alphagov/notifications-php-client'),
('Python client', 'https://github.com/alphagov/notifications-python-client'),
('Ruby client', 'https://github.com/alphagov/notifications-ruby-client')
] %}
<li>
<a href="{{ url }}" target="_blank" rel="noopener noreferrer">{{ name }}</a>
</li>
{% endfor %}
<li><a href="{{ url_for("main.integration_testing") }}">Integration testing</a></li>
</ul>
{{ page_footer(
secondary_link=url_for('.api_integration', service_id=current_service.id),
secondary_link_text='Back to API integration'
) }}
{% endblock %}

View File

@@ -19,7 +19,7 @@
<li><a href="https://github.com/alphagov/notifications-python-client">Python</a></li>
<li><a href="https://github.com/alphagov/notifications-ruby-client">Ruby</a></li>
</ul>
<p>You can also find out about integration testing and the different types of API keys that you can use.</p>
<p>You can also find out about <a href="{{ url_for('main.integration_testing')}}">integration testing</a> and the different types of API keys that you can use.</p>
</div>
</div>

View File

@@ -33,7 +33,7 @@
</p>
<h2 class="heading-medium">Any other problems</h2>
<p class="bottom-gutter-2">
<a href="{{ url_for('main.feedback', ticket_type='problem', severe='no') }}">Fill in this form</a>
<a href="{{ url_for('main.feedback', ticket_type='report-problem', severe='no') }}">Fill in this form</a>
and well get back to you by the next working day.
</p>
<p>

View File

@@ -8,76 +8,34 @@
{% block maincolumn_content %}
<h1 class="heading-large">
Support
</h1>
<div class="grid-row">
<div class="column-two-thirds">
<div class="grid-row">
<div class="column-two-thirds">
<h1 class="heading-large">Support</h1>
<form method="post" class="bottom-gutter-2">
{{ radios(form.support_type) }}
{{ page_footer('Continue') }}
</form>
<form method="post" class="bottom-gutter-2">
{{ radios(form.support_type) }}
{{ page_footer('Continue') }}
</form>
<p>If somethings wrong, you can <a href="https://status.notifications.service.gov.uk/"> check the GOV.UK Notify system status page</a> to see if were already aware of it.</p>
<h2 class="heading-medium">
Support process
</h2>
<p>
If you have a problem, first check for known issues on the
GOV.UK Notify <a href="https://status.notifications.service.gov.uk">system status page</a>.
Subscribe to get alerts on the progress of any listed issue.
</p>
<h2 class="heading-small">
During office hours
</h2>
<p>
Our office hours are 9.30am to 5.30pm, Monday to Friday.
</p>
<p>
Well reply within 30 minutes whether youre
reporting a problem or just asking a question.
</p>
<p>
The team are also available to answer questions on the
<a href="https://ukgovernmentdigital.slack.com/messages/govuk-notify">cross-government Slack channel</a>.
</p>
<h2 class="heading-small">
Out of hours support
</h2>
<p>
We offer 24 hour online support if you have a GOV.UK Notify
account and weve made your service live. We have different
response times depending on whether the problem you want to
report is an emergency.
</p>
<p>
Its only an emergency if:
</p>
<ul class="list list-bullet">
<li>
no one in your team can log in
</li>
<li>
a technical difficulties error appears when you try to
upload a file
</li>
<li>
a 500 response code appears when you try to send messages
using the API
</li>
</ul>
<p>
Well reply within 30 minutes and give you hourly updates
until the problems fixed.
</p>
<p>
Well reply by the next working day for any other problems.
</p>
</div>
</div>
<h2 class="heading-medium">24-hour support</h2>
<p>You can get 24-hour online support for Notify if you have a live account.</p>
<h3 class="heading-small">During office hours</h3>
<p>Our office hours are 9.30am to 5.30pm, Monday to Friday.</p>
<p>Contact us using one of the options on this page and youll get a reply within 30 minutes.</p>
<p>You can also <a href="https://ukgovernmentdigital.slack.com/messages/govuk-notify">get in touch with us on Slack.</a></p>
<h3 class="heading-small">Out-of-hours</h3>
<p>Outside office hours, response times depend on whether youre reporting an emergency or not.</p>
<p>If its an emergency, well reply within 30 minutes and update you every hour until the problems fixed.</p>
<p>A problem is only classed as an emergency if:</p>
<ul class="list list-bullet">
<li>nobody on your team can sign in</li>
<li>a technical difficulties error appears when you try to upload a file</li>
<li>a 500 response code appears when you try to send messages using the API</li>
</ul>
<p>Well reply during the next working day for any other problems.</p>
</div>
</div>
{% endblock %}

View File

@@ -76,7 +76,7 @@ def test_should_show_api_page_for_live_service(
assert 'Your service is in trial mode' not in page.find('main').text
def test_should_show_api_documentation_page(
def test_api_documentation_page_should_redirect(
logged_in_client,
mock_login,
api_user_active,
@@ -84,9 +84,11 @@ def test_should_show_api_documentation_page(
mock_has_permissions
):
response = logged_in_client.get(url_for('main.api_documentation', service_id=str(uuid.uuid4())))
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.h1.string.strip() == 'Documentation'
assert response.status_code == 301
assert response.location == url_for(
'main.documentation',
_external=True
)
def test_should_show_empty_api_keys_page(

View File

@@ -511,6 +511,7 @@ def test_thanks(
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert ' '.join(page.find('main').find('p').text.split()) == message
@pytest.mark.parametrize('view, old_ticket_type, expected_view, new_ticket_type', [
('old_submit_feedback', 'problem', 'feedback', 'report-problem'),
('old_submit_feedback', 'question', 'feedback', 'ask-question-give-feedback'),
@@ -534,4 +535,3 @@ def test_old_problem_and_question_urls_redirect(
ticket_type=new_ticket_type,
_external=True,
)

View File

@@ -68,10 +68,10 @@ def test_old_static_pages_redirect_to_using_notify_with_anchor(
('information_risk_management', 'security'),
('old_integration_testing', 'integration_testing'),
('old_roadmap', 'roadmap'),
('information_risk_management','security'),
('old_terms','terms'),
('information_security','using_notify'),
('old_using_notify','using_notify'),
('information_risk_management', 'security'),
('old_terms', 'terms'),
('information_security', 'using_notify'),
('old_using_notify', 'using_notify'),
])
def test_old_static_pages_redirect(
client,