mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-11 09:28:27 -04:00
Let people choose which agreement to download
If we don’t know whether people belong to a crown organisation we should give them the option of self-selecting, because they might themselves know. This commit adds a new version of the ‘agreement’ page which gives people exactly that choice. It doesn’t link to it yet.
This commit is contained in:
@@ -13,7 +13,12 @@ def agreement():
|
||||
|
||||
agreement_info = AgreementInfo.from_current_user()
|
||||
|
||||
agreement_info.crown_status_or_404
|
||||
if agreement_info.crown_status is None:
|
||||
return render_template(
|
||||
'views/agreement-choose.html',
|
||||
owner=agreement_info.owner,
|
||||
navigation_links=features_nav(),
|
||||
)
|
||||
|
||||
return render_template(
|
||||
'views/agreement.html',
|
||||
|
||||
59
app/templates/views/agreement-choose.html
Normal file
59
app/templates/views/agreement-choose.html
Normal file
@@ -0,0 +1,59 @@
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Download the 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">
|
||||
Download the 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>
|
||||
Unsure whether your organisation is a crown body? Contact
|
||||
<a href="{{ url_for('main.support') }}">support</a>
|
||||
and we’ll help you work it out.
|
||||
</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,3 +1,4 @@
|
||||
from functools import partial
|
||||
from io import BytesIO
|
||||
|
||||
import pytest
|
||||
@@ -15,25 +16,46 @@ class _MockS3Object():
|
||||
return {'Body': BytesIO(self.data)}
|
||||
|
||||
|
||||
@pytest.mark.parametrize('email_address, expected_status', [
|
||||
('test@cabinet-office.gov.uk', 200),
|
||||
('test@aylesburytowncouncil.gov.uk', 200),
|
||||
('test@unknown.gov.uk', 404),
|
||||
@pytest.mark.parametrize('email_address, expected_links', [
|
||||
(
|
||||
'test@cabinet-office.gov.uk',
|
||||
[
|
||||
partial(url_for, 'main.download_agreement'),
|
||||
lambda: 'mailto:notify-support@digital.cabinet-office.gov.uk',
|
||||
]
|
||||
),
|
||||
(
|
||||
'test@aylesburytowncouncil.gov.uk',
|
||||
[
|
||||
partial(url_for, 'main.download_agreement'),
|
||||
lambda: 'mailto:notify-support@digital.cabinet-office.gov.uk',
|
||||
]
|
||||
),
|
||||
(
|
||||
'test@unknown.gov.uk',
|
||||
[
|
||||
partial(url_for, 'main.public_download_agreement', variant='crown'),
|
||||
partial(url_for, 'main.public_download_agreement', variant='non-crown'),
|
||||
partial(url_for, 'main.support'),
|
||||
lambda: 'mailto:notify-support@digital.cabinet-office.gov.uk',
|
||||
]
|
||||
),
|
||||
])
|
||||
def test_show_agreement_page(
|
||||
client_request,
|
||||
mocker,
|
||||
fake_uuid,
|
||||
email_address,
|
||||
expected_status,
|
||||
expected_links,
|
||||
):
|
||||
user = active_user_with_permissions(fake_uuid)
|
||||
user.email_address = email_address
|
||||
mocker.patch('app.user_api_client.get_user', return_value=user)
|
||||
client_request.get(
|
||||
'main.agreement',
|
||||
_expected_status=expected_status,
|
||||
)
|
||||
page = client_request.get('main.agreement')
|
||||
links = page.select('main .column-two-thirds a')
|
||||
assert len(links) == len(expected_links)
|
||||
for index, link in enumerate(links):
|
||||
assert link['href'] == expected_links[index]()
|
||||
|
||||
|
||||
@pytest.mark.parametrize('email_address, expected_file_fetched, expected_file_served', [
|
||||
|
||||
Reference in New Issue
Block a user