From 90e18e04eebac228a01fd7aab577ae12c84c4dc0 Mon Sep 17 00:00:00 2001 From: chrisw Date: Tue, 28 Nov 2017 12:00:12 +0000 Subject: [PATCH] Updated support views to represent new url structure --- .../stylesheets/components/navigation.scss | 1 + app/main/views/api_keys.py | 4 +- app/templates/components/sub-navigation.html | 40 ++++---- app/templates/views/api/documentation.html | 37 -------- app/templates/views/documentation.html | 2 +- ...n.html => ask-question-give-feedback.html} | 0 app/templates/views/support/bat-phone.html | 2 +- app/templates/views/support/index.html | 94 +++++-------------- .../{problem.html => report-problem.html} | 0 tests/app/main/views/test_api_keys.py | 10 +- tests/app/main/views/test_feedback.py | 2 +- tests/app/main/views/test_index.py | 8 +- 12 files changed, 61 insertions(+), 139 deletions(-) delete mode 100644 app/templates/views/api/documentation.html rename app/templates/views/support/{question.html => ask-question-give-feedback.html} (100%) rename app/templates/views/support/{problem.html => report-problem.html} (100%) diff --git a/app/assets/stylesheets/components/navigation.scss b/app/assets/stylesheets/components/navigation.scss index f70de9b47..0a059573f 100644 --- a/app/assets/stylesheets/components/navigation.scss +++ b/app/assets/stylesheets/components/navigation.scss @@ -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; diff --git a/app/main/views/api_keys.py b/app/main/views/api_keys.py index 151cfc98d..14d31bb65 100644 --- a/app/main/views/api_keys.py +++ b/app/main/views/api_keys.py @@ -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//api/whitelist", methods=['GET', 'POST']) diff --git a/app/templates/components/sub-navigation.html b/app/templates/components/sub-navigation.html index 95294c1d7..84080faf9 100644 --- a/app/templates/components/sub-navigation.html +++ b/app/templates/components/sub-navigation.html @@ -1,24 +1,24 @@ {% macro sub_navigation( item_set ) %} - + {% endmacro %} \ No newline at end of file diff --git a/app/templates/views/api/documentation.html b/app/templates/views/api/documentation.html deleted file mode 100644 index 156a5e0f6..000000000 --- a/app/templates/views/api/documentation.html +++ /dev/null @@ -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 %} - -

- Documentation -

- - - - {{ page_footer( - secondary_link=url_for('.api_integration', service_id=current_service.id), - secondary_link_text='Back to API integration' - ) }} - -{% endblock %} diff --git a/app/templates/views/documentation.html b/app/templates/views/documentation.html index 99425686b..c59df7059 100644 --- a/app/templates/views/documentation.html +++ b/app/templates/views/documentation.html @@ -19,7 +19,7 @@
  • Python
  • Ruby
  • -

    You can also find out about integration testing and the different types of API keys that you can use.

    +

    You can also find out about integration testing and the different types of API keys that you can use.

    diff --git a/app/templates/views/support/question.html b/app/templates/views/support/ask-question-give-feedback.html similarity index 100% rename from app/templates/views/support/question.html rename to app/templates/views/support/ask-question-give-feedback.html diff --git a/app/templates/views/support/bat-phone.html b/app/templates/views/support/bat-phone.html index 8e9ec3eef..c713cfb87 100644 --- a/app/templates/views/support/bat-phone.html +++ b/app/templates/views/support/bat-phone.html @@ -33,7 +33,7 @@

    Any other problems

    - Fill in this form + Fill in this form and we’ll get back to you by the next working day.

    diff --git a/app/templates/views/support/index.html b/app/templates/views/support/index.html index 61ebb05f3..38193daaf 100644 --- a/app/templates/views/support/index.html +++ b/app/templates/views/support/index.html @@ -8,76 +8,34 @@ {% block maincolumn_content %} -

    - Support -

    +
    +
    -
    -
    +

    Support

    -
    - {{ radios(form.support_type) }} - {{ page_footer('Continue') }} -
    +
    + {{ radios(form.support_type) }} + {{ page_footer('Continue') }} +
    +

    If something’s wrong, you can check the GOV.UK Notify system status page to see if we’re already aware of it.

    -

    - Support process -

    -

    - If you have a problem, first check for known issues on the - GOV.UK Notify system status page. - Subscribe to get alerts on the progress of any listed issue. - -

    - -

    - During office hours -

    -

    - Our office hours are 9.30am to 5.30pm, Monday to Friday. -

    -

    - We’ll reply within 30 minutes whether you’re - reporting a problem or just asking a question. -

    -

    - The team are also available to answer questions on the - cross-government Slack channel. -

    - -

    - Out of hours support -

    -

    - We offer 24 hour online support if you have a GOV.UK Notify - account and we’ve made your service live. We have different - response times depending on whether the problem you want to - report is an emergency. -

    -

    - It’s only an emergency if: -

    -
      -
    • - no one in your team can log in -
    • -
    • - a ‘technical difficulties’ error appears when you try to - upload a file -
    • -
    • - a 500 response code appears when you try to send messages - using the API -
    • -
    -

    - We’ll reply within 30 minutes and give you hourly updates - until the problem’s fixed. -

    -

    - We’ll reply by the next working day for any other problems. -

    -
    -
    +

    24-hour support

    +

    You can get 24-hour online support for Notify if you have a live account.

    +

    During office hours

    +

    Our office hours are 9.30am to 5.30pm, Monday to Friday.

    +

    Contact us using one of the options on this page and you’ll get a reply within 30 minutes.

    +

    You can also get in touch with us on Slack.

    +

    Out-of-hours

    +

    Outside office hours, response times depend on whether you’re reporting an emergency or not.

    +

    If it’s an emergency, we’ll reply within 30 minutes and update you every hour until the problem’s fixed.

    +

    A problem is only classed as an emergency if:

    +
      +
    • nobody on your team can sign in
    • +
    • a ‘technical difficulties’ error appears when you try to upload a file
    • +
    • a 500 response code appears when you try to send messages using the API
    • +
    +

    We’ll reply during the next working day for any other problems.

    +
    +
    {% endblock %} diff --git a/app/templates/views/support/problem.html b/app/templates/views/support/report-problem.html similarity index 100% rename from app/templates/views/support/problem.html rename to app/templates/views/support/report-problem.html diff --git a/tests/app/main/views/test_api_keys.py b/tests/app/main/views/test_api_keys.py index 3dc08d962..412e9cc69 100644 --- a/tests/app/main/views/test_api_keys.py +++ b/tests/app/main/views/test_api_keys.py @@ -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( diff --git a/tests/app/main/views/test_feedback.py b/tests/app/main/views/test_feedback.py index 7d4d7b422..af819470c 100644 --- a/tests/app/main/views/test_feedback.py +++ b/tests/app/main/views/test_feedback.py @@ -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, ) - diff --git a/tests/app/main/views/test_index.py b/tests/app/main/views/test_index.py index 67dd4be07..c4d2562f1 100644 --- a/tests/app/main/views/test_index.py +++ b/tests/app/main/views/test_index.py @@ -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,