mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-22 08:58:46 -04:00
Merge pull request #2943 from alphagov/service-agreement
Add service-specific versions of agreement page
This commit is contained in:
@@ -10,12 +10,21 @@ from app.s3_client.s3_mou_client import get_mou
|
||||
@login_required
|
||||
def agreement():
|
||||
return render_template(
|
||||
'views/{}.html'.format(current_user.default_organisation.as_jinja_template),
|
||||
'views/agreement/{}.html'.format(current_user.default_organisation.as_jinja_template),
|
||||
owner=current_user.default_organisation.name,
|
||||
navigation_links=features_nav(),
|
||||
)
|
||||
|
||||
|
||||
@main.route('/services/<uuid:service_id>/agreement')
|
||||
@login_required
|
||||
def service_agreement(service_id):
|
||||
return render_template(
|
||||
'views/agreement/service-{}.html'.format(current_user.default_organisation.as_jinja_template),
|
||||
owner=current_user.default_organisation.name,
|
||||
)
|
||||
|
||||
|
||||
@main.route('/agreement.pdf')
|
||||
@login_required
|
||||
def download_agreement():
|
||||
@@ -37,7 +46,7 @@ def public_agreement(variant):
|
||||
))
|
||||
|
||||
return render_template(
|
||||
'views/agreement-public.html',
|
||||
'views/agreement/agreement-public.html',
|
||||
owner=current_user.default_organisation.name,
|
||||
download_link=url_for('.public_download_agreement', variant=variant),
|
||||
)
|
||||
|
||||
@@ -237,6 +237,7 @@ class HeaderNavigation(Navigation):
|
||||
'service_add_email_reply_to',
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_dashboard',
|
||||
@@ -368,6 +369,7 @@ class MainNavigation(Navigation):
|
||||
'service_add_email_reply_to',
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_edit_email_reply_to',
|
||||
@@ -744,6 +746,7 @@ class CaseworkNavigation(Navigation):
|
||||
'service_add_email_reply_to',
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_dashboard',
|
||||
@@ -1003,6 +1006,7 @@ class OrgNavigation(Navigation):
|
||||
'service_add_email_reply_to',
|
||||
'service_add_letter_contact',
|
||||
'service_add_sms_sender',
|
||||
'service_agreement',
|
||||
'service_confirm_delete_email_reply_to',
|
||||
'service_confirm_delete_sms_sender',
|
||||
'service_dashboard',
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||
|
||||
{% block per_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-one-third">
|
||||
{{ sub_navigation(navigation_links) }}
|
||||
</div>
|
||||
<div class="column-two-thirds">
|
||||
|
||||
<h1 class="heading-large">
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
Before you can go live on GOV.UK Notify, your organisation needs to agree to our data sharing and financial agreement.
|
||||
</p>
|
||||
<h2 class="heading-small">
|
||||
Crown bodies
|
||||
</h2>
|
||||
<p>
|
||||
Download the <a href="{{ url_for('main.public_download_agreement', variant='crown') }}">crown agreement</a>.
|
||||
</p>
|
||||
<h2 class="heading-small">
|
||||
Non-crown bodies
|
||||
</h2>
|
||||
<p>
|
||||
Download the <a href="{{ url_for('main.public_download_agreement', variant='non-crown') }}">non-crown agreement</a>.
|
||||
</p>
|
||||
<div class="panel panel-border-wide">
|
||||
<p>
|
||||
<a href="{{ url_for('main.support') }}">Contact us</a> if you’re
|
||||
not sure whether your organisation is a crown or non-crown body.
|
||||
</p>
|
||||
</div>
|
||||
<h2 class="heading-small">
|
||||
Next steps
|
||||
</h2>
|
||||
<ol class="list list-number">
|
||||
<li>
|
||||
Get the agreement signed by someone who has the authority to do so on behalf of {{ owner or 'your organisation' }}.
|
||||
</li>
|
||||
<li>
|
||||
Return the signed copy to <a href="mailto:notify-support@digital.cabinet-office.gov.uk">notify-support@digital.cabinet-office.gov.uk</a>.
|
||||
</li>
|
||||
</ol>
|
||||
<p>
|
||||
The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -1,41 +0,0 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||
|
||||
{% block per_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-one-third">
|
||||
{{ sub_navigation(navigation_links) }}
|
||||
</div>
|
||||
<div class="column-two-thirds">
|
||||
|
||||
<h1 class="heading-large">
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
Before you can go live on GOV.UK Notify, your organisation needs to agree to our data sharing and financial agreement.
|
||||
</p>
|
||||
<ol class="list list-number">
|
||||
<li>
|
||||
<a href="{{ url_for('main.download_agreement') }}">Download the agreement</a>.
|
||||
</li>
|
||||
<li>
|
||||
Get it signed by someone who has the authority to do so on behalf of {{ owner }}.
|
||||
</li>
|
||||
<li>
|
||||
Return the signed copy to <a href="mailto:notify-support@digital.cabinet-office.gov.uk">notify-support@digital.cabinet-office.gov.uk</a>.
|
||||
</li>
|
||||
</ol>
|
||||
<p>
|
||||
The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
35
app/templates/views/agreement/_agreement-choose.html
Normal file
35
app/templates/views/agreement/_agreement-choose.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<p>
|
||||
Before you can go live on GOV.UK Notify, your organisation needs to agree to our data sharing and financial agreement.
|
||||
</p>
|
||||
<h2 class="heading-small">
|
||||
Crown bodies
|
||||
</h2>
|
||||
<p>
|
||||
Download the <a href="{{ url_for('main.public_download_agreement', variant='crown') }}">crown agreement</a>.
|
||||
</p>
|
||||
<h2 class="heading-small">
|
||||
Non-crown bodies
|
||||
</h2>
|
||||
<p>
|
||||
Download the <a href="{{ url_for('main.public_download_agreement', variant='non-crown') }}">non-crown agreement</a>.
|
||||
</p>
|
||||
<div class="panel panel-border-wide">
|
||||
<p>
|
||||
<a href="{{ url_for('main.support') }}">Contact us</a> if you’re
|
||||
not sure whether your organisation is a crown or non-crown body.
|
||||
</p>
|
||||
</div>
|
||||
<h2 class="heading-small">
|
||||
Next steps
|
||||
</h2>
|
||||
<ol class="list list-number">
|
||||
<li>
|
||||
Get the agreement signed by someone who has the authority to do so on behalf of {{ owner or 'your organisation' }}.
|
||||
</li>
|
||||
<li>
|
||||
Return the signed copy to <a href="mailto:notify-support@digital.cabinet-office.gov.uk">notify-support@digital.cabinet-office.gov.uk</a>.
|
||||
</li>
|
||||
</ol>
|
||||
<p>
|
||||
The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
|
||||
</p>
|
||||
8
app/templates/views/agreement/_agreement-signed.html
Normal file
8
app/templates/views/agreement/_agreement-signed.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<p>
|
||||
Your organisation ({{ owner }}) has already accepted the GOV.UK
|
||||
Notify data sharing and financial agreement. You can
|
||||
<a href="{{ url_for('main.download_agreement') }}">download a copy</a>.
|
||||
</p>
|
||||
<p>
|
||||
The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
|
||||
</p>
|
||||
17
app/templates/views/agreement/_agreement.html
Normal file
17
app/templates/views/agreement/_agreement.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<p>
|
||||
Before you can go live on GOV.UK Notify, your organisation needs to agree to our data sharing and financial agreement.
|
||||
</p>
|
||||
<ol class="list list-number">
|
||||
<li>
|
||||
<a href="{{ url_for('main.download_agreement') }}">Download the agreement</a>.
|
||||
</li>
|
||||
<li>
|
||||
Get it signed by someone who has the authority to do so on behalf of {{ owner }}.
|
||||
</li>
|
||||
<li>
|
||||
Return the signed copy to <a href="mailto:notify-support@digital.cabinet-office.gov.uk">notify-support@digital.cabinet-office.gov.uk</a>.
|
||||
</li>
|
||||
</ol>
|
||||
<p>
|
||||
The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
|
||||
</p>
|
||||
25
app/templates/views/agreement/agreement-choose.html
Normal file
25
app/templates/views/agreement/agreement-choose.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||
|
||||
{% block per_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-one-third">
|
||||
{{ sub_navigation(navigation_links) }}
|
||||
</div>
|
||||
<div class="column-two-thirds">
|
||||
|
||||
<h1 class="heading-large">
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
</h1>
|
||||
|
||||
{% include 'views/agreement/_agreement-choose.html'%}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -17,14 +17,8 @@
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
</h1>
|
||||
|
||||
<p>
|
||||
Your organisation ({{ owner }}) has already accepted the GOV.UK
|
||||
Notify data sharing and financial agreement. You can
|
||||
<a href="{{ url_for('main.download_agreement') }}">download a copy</a>.
|
||||
</p>
|
||||
<p>
|
||||
The agreement contains commercially sensitive information, so don’t share it more widely than you need to.
|
||||
</p>
|
||||
{% include 'views/agreement/_agreement-signed.html' %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
25
app/templates/views/agreement/agreement.html
Normal file
25
app/templates/views/agreement/agreement.html
Normal file
@@ -0,0 +1,25 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||
|
||||
{% block per_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-one-third">
|
||||
{{ sub_navigation(navigation_links) }}
|
||||
</div>
|
||||
<div class="column-two-thirds">
|
||||
|
||||
<h1 class="heading-large">
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
</h1>
|
||||
|
||||
{% include 'views/agreement/_agreement.html'%}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
23
app/templates/views/agreement/service-agreement-choose.html
Normal file
23
app/templates/views/agreement/service-agreement-choose.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
|
||||
{% block service_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
|
||||
{{ page_header(
|
||||
'GOV.UK Notify data sharing and financial agreement',
|
||||
back_link=url_for('main.request_to_go_live', service_id=current_service.id)
|
||||
)}}
|
||||
|
||||
{% include 'views/agreement/_agreement-choose.html'%}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
23
app/templates/views/agreement/service-agreement-signed.html
Normal file
23
app/templates/views/agreement/service-agreement-signed.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
|
||||
{% block service_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
|
||||
{{ page_header(
|
||||
'GOV.UK Notify data sharing and financial agreement',
|
||||
back_link=url_for('main.request_to_go_live', service_id=current_service.id)
|
||||
)}}
|
||||
|
||||
{% include 'views/agreement/_agreement-signed.html' %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
23
app/templates/views/agreement/service-agreement.html
Normal file
23
app/templates/views/agreement/service-agreement.html
Normal file
@@ -0,0 +1,23 @@
|
||||
{% extends "withnav_template.html" %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
|
||||
{% block service_page_title %}
|
||||
GOV.UK Notify data sharing and financial agreement
|
||||
{% endblock %}
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<div class="grid-row">
|
||||
<div class="column-five-sixths">
|
||||
|
||||
{{ page_header(
|
||||
'GOV.UK Notify data sharing and financial agreement',
|
||||
back_link=url_for('main.request_to_go_live', service_id=current_service.id)
|
||||
)}}
|
||||
|
||||
{% include 'views/agreement/_agreement.html'%}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -52,7 +52,7 @@
|
||||
{{ task_list_item(
|
||||
agreement_signed,
|
||||
'Sign our data sharing and financial agreement',
|
||||
url_for('main.agreement'),
|
||||
url_for('main.service_agreement', service_id=current_service.id),
|
||||
) }}
|
||||
{% endif %}
|
||||
{% endcall %}
|
||||
|
||||
@@ -4,7 +4,7 @@ from io import BytesIO
|
||||
import pytest
|
||||
from flask import url_for
|
||||
|
||||
from tests.conftest import mock_get_organisation_by_domain
|
||||
from tests.conftest import SERVICE_ONE_ID, mock_get_organisation_by_domain
|
||||
|
||||
|
||||
class _MockS3Object():
|
||||
@@ -16,6 +16,22 @@ class _MockS3Object():
|
||||
return {'Body': BytesIO(self.data)}
|
||||
|
||||
|
||||
@pytest.mark.parametrize('endpoint, extra_args, link_selector, expected_back_links', [
|
||||
(
|
||||
'main.agreement',
|
||||
{},
|
||||
'main .column-two-thirds a',
|
||||
[]
|
||||
),
|
||||
(
|
||||
'main.service_agreement',
|
||||
{'service_id': SERVICE_ONE_ID},
|
||||
'main .column-five-sixths a',
|
||||
[
|
||||
partial(url_for, 'main.request_to_go_live', service_id=SERVICE_ONE_ID)
|
||||
]
|
||||
),
|
||||
])
|
||||
@pytest.mark.parametrize('agreement_signed, crown, expected_links', [
|
||||
(
|
||||
True, True,
|
||||
@@ -44,17 +60,23 @@ def test_show_agreement_page(
|
||||
client_request,
|
||||
mocker,
|
||||
fake_uuid,
|
||||
mock_has_jobs,
|
||||
agreement_signed,
|
||||
crown,
|
||||
expected_links,
|
||||
endpoint,
|
||||
extra_args,
|
||||
link_selector,
|
||||
expected_back_links,
|
||||
):
|
||||
mock_get_organisation_by_domain(
|
||||
mocker,
|
||||
crown=crown,
|
||||
agreement_signed=agreement_signed,
|
||||
)
|
||||
page = client_request.get('main.agreement')
|
||||
links = page.select('main .column-two-thirds a')
|
||||
expected_links = expected_back_links + expected_links
|
||||
page = client_request.get(endpoint, **extra_args)
|
||||
links = page.select(link_selector)
|
||||
assert len(links) == len(expected_links)
|
||||
for index, link in enumerate(links):
|
||||
assert link['href'] == expected_links[index]()
|
||||
|
||||
Reference in New Issue
Block a user