mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-08 22:53:12 -04:00
Merge pull request #2327 from alphagov/add-mou-to-checklist
Add line about the data sharing and financial agreement to the checklist
This commit is contained in:
@@ -67,8 +67,7 @@ from app.notify_client.billing_api_client import BillingAPIClient
|
|||||||
from app.notify_client.complaint_api_client import ComplaintApiClient
|
from app.notify_client.complaint_api_client import ComplaintApiClient
|
||||||
from app.notify_client.platform_stats_api_client import PlatformStatsAPIClient
|
from app.notify_client.platform_stats_api_client import PlatformStatsAPIClient
|
||||||
from app.commands import setup_commands
|
from app.commands import setup_commands
|
||||||
from app.utils import get_cdn_domain
|
from app.utils import get_cdn_domain, gmt_timezones, id_safe
|
||||||
from app.utils import gmt_timezones
|
|
||||||
|
|
||||||
login_manager = LoginManager()
|
login_manager = LoginManager()
|
||||||
csrf = CSRFProtect()
|
csrf = CSRFProtect()
|
||||||
@@ -664,5 +663,6 @@ def add_template_filters(application):
|
|||||||
formatted_list,
|
formatted_list,
|
||||||
nl2br,
|
nl2br,
|
||||||
format_phone_number_human_readable,
|
format_phone_number_human_readable,
|
||||||
|
id_safe,
|
||||||
]:
|
]:
|
||||||
application.add_template_filter(fn)
|
application.add_template_filter(fn)
|
||||||
|
|||||||
@@ -179,8 +179,13 @@ def service_name_change_confirm(service_id):
|
|||||||
@login_required
|
@login_required
|
||||||
@user_has_permissions('manage_service')
|
@user_has_permissions('manage_service')
|
||||||
def request_to_go_live(service_id):
|
def request_to_go_live(service_id):
|
||||||
|
|
||||||
|
agreement_signed = AgreementInfo.from_current_user().agreement_signed
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
'views/service-settings/request-to-go-live.html'
|
'views/service-settings/request-to-go-live.html',
|
||||||
|
show_agreement=agreement_signed is not None,
|
||||||
|
agreement_signed=agreement_signed,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
{% macro task_list_item(completed, label) %}
|
{% macro task_list_item(completed, label, link) %}
|
||||||
<li class="task-list-item">
|
<li class="task-list-item">
|
||||||
{{ label }}
|
<span aria-describedby="{{ label|id_safe }}"><a href="{{ link }}">{{ label }}</a></span>
|
||||||
{% if completed %}
|
{% if completed %}
|
||||||
<span class="task-list-indicator-completed">Completed</span>
|
<strong class="task-list-indicator-completed" id="{{ label|id_safe }}">Completed</strong>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="task-list-indicator-not-completed">Not completed</span>
|
<strong class="task-list-indicator-not-completed" id="{{ label|id_safe }}">Not completed</strong>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</li>
|
</li>
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||||
|
|
||||||
{% block per_page_title %}
|
{% block per_page_title %}
|
||||||
Download the GOV.UK Notify data sharing and financial agreement
|
GOV.UK Notify data sharing and financial agreement
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
|
|
||||||
<h1 class="heading-large">
|
<h1 class="heading-large">
|
||||||
Download the GOV.UK Notify data sharing and financial agreement
|
GOV.UK Notify data sharing and financial agreement
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||||
|
|
||||||
{% block per_page_title %}
|
{% block per_page_title %}
|
||||||
Download the GOV.UK Notify data sharing and financial agreement
|
GOV.UK Notify data sharing and financial agreement
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
|
|
||||||
<h1 class="heading-large">
|
<h1 class="heading-large">
|
||||||
Download the GOV.UK Notify data sharing and financial agreement
|
GOV.UK Notify data sharing and financial agreement
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% from "components/sub-navigation.html" import sub_navigation %}
|
{% from "components/sub-navigation.html" import sub_navigation %}
|
||||||
|
|
||||||
{% block per_page_title %}
|
{% block per_page_title %}
|
||||||
Download the GOV.UK Notify data sharing and financial agreement
|
GOV.UK Notify data sharing and financial agreement
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block maincolumn_content %}
|
{% block maincolumn_content %}
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
<div class="column-two-thirds">
|
<div class="column-two-thirds">
|
||||||
|
|
||||||
<h1 class="heading-large">
|
<h1 class="heading-large">
|
||||||
Download the GOV.UK Notify data sharing and financial agreement
|
GOV.UK Notify data sharing and financial agreement
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
@@ -17,32 +17,33 @@
|
|||||||
{% call task_list_wrapper() %}
|
{% call task_list_wrapper() %}
|
||||||
{{ task_list_item(
|
{{ task_list_item(
|
||||||
current_service.has_team_members,
|
current_service.has_team_members,
|
||||||
'<a href="{}">Add a team member who can manage settings, team and usage</a>
|
'Add a team member who can manage settings, team and usage',
|
||||||
'.format(
|
url_for('main.manage_users', service_id=current_service.id),
|
||||||
url_for('main.manage_users', service_id=current_service.id)
|
|
||||||
)|safe,
|
|
||||||
) }}
|
) }}
|
||||||
{{ task_list_item(
|
{{ task_list_item(
|
||||||
current_service.has_templates,
|
current_service.has_templates,
|
||||||
'<a href="{}">Add templates with examples of the content you plan to send
|
'Add templates with examples of the content you plan to send',
|
||||||
</a>'.format(
|
url_for('main.choose_template', service_id=current_service.id),
|
||||||
url_for('main.choose_template', service_id=current_service.id)
|
|
||||||
)|safe,
|
|
||||||
) }}
|
) }}
|
||||||
{% if current_service.has_email_templates %}
|
{% if current_service.has_email_templates %}
|
||||||
{{ task_list_item(
|
{{ task_list_item(
|
||||||
current_service.has_email_reply_to_address,
|
current_service.has_email_reply_to_address,
|
||||||
'<a href="{}">Add an email reply-to address</a>'.format(
|
'Add an email reply-to address',
|
||||||
url_for('main.service_email_reply_to', service_id=current_service.id)
|
url_for('main.service_email_reply_to', service_id=current_service.id),
|
||||||
)|safe,
|
|
||||||
) }}
|
) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if current_service.has_sms_templates and current_service.shouldnt_use_govuk_as_sms_sender %}
|
{% if current_service.has_sms_templates and current_service.shouldnt_use_govuk_as_sms_sender %}
|
||||||
{{ task_list_item(
|
{{ task_list_item(
|
||||||
not current_service.sms_sender_is_govuk,
|
not current_service.sms_sender_is_govuk,
|
||||||
'<a href="{}">Change your text message sender name</a>'.format(
|
'Change your text message sender name',
|
||||||
url_for('main.service_sms_senders', service_id=current_service.id)
|
url_for('main.service_sms_senders', service_id=current_service.id),
|
||||||
)|safe
|
) }}
|
||||||
|
{% endif %}
|
||||||
|
{% if show_agreement %}
|
||||||
|
{{ task_list_item(
|
||||||
|
agreement_signed,
|
||||||
|
'Sign our data sharing and financial agreement',
|
||||||
|
url_for('main.agreement'),
|
||||||
) }}
|
) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|||||||
@@ -206,6 +206,10 @@ def email_safe(string, whitespace='.'):
|
|||||||
return string.strip('.')
|
return string.strip('.')
|
||||||
|
|
||||||
|
|
||||||
|
def id_safe(string):
|
||||||
|
return email_safe(string, whitespace='-')
|
||||||
|
|
||||||
|
|
||||||
class Spreadsheet():
|
class Spreadsheet():
|
||||||
|
|
||||||
allowed_file_extensions = ['csv', 'xlsx', 'xls', 'ods', 'xlsm', 'tsv']
|
allowed_file_extensions = ['csv', 'xlsx', 'xls', 'ods', 'xlsm', 'tsv']
|
||||||
|
|||||||
@@ -702,6 +702,58 @@ def test_should_check_for_sms_sender_on_go_live(
|
|||||||
mock_get_sms_senders.assert_called_once_with(SERVICE_ONE_ID)
|
mock_get_sms_senders.assert_called_once_with(SERVICE_ONE_ID)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('email_address, expected_item', (
|
||||||
|
pytest.param(
|
||||||
|
'test@unknown.gov.uk',
|
||||||
|
'',
|
||||||
|
marks=pytest.mark.xfail(raises=IndexError)
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'test@education.gov.uk',
|
||||||
|
'Sign our data sharing and financial agreement Completed',
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'test@aylesbury.gov.uk',
|
||||||
|
'Sign our data sharing and financial agreement Not completed',
|
||||||
|
),
|
||||||
|
))
|
||||||
|
def test_should_check_for_mou_on_request_to_go_live(
|
||||||
|
client_request,
|
||||||
|
service_one,
|
||||||
|
mocker,
|
||||||
|
email_address,
|
||||||
|
expected_item,
|
||||||
|
):
|
||||||
|
mocker.patch(
|
||||||
|
'app.main.views.service_settings.user_api_client.get_count_of_users_with_permission',
|
||||||
|
return_value=0,
|
||||||
|
)
|
||||||
|
mocker.patch(
|
||||||
|
'app.main.views.service_settings.service_api_client.count_service_templates',
|
||||||
|
return_value=0,
|
||||||
|
)
|
||||||
|
mocker.patch(
|
||||||
|
'app.main.views.service_settings.service_api_client.get_sms_senders',
|
||||||
|
return_value=[],
|
||||||
|
)
|
||||||
|
mocker.patch(
|
||||||
|
'app.main.views.service_settings.service_api_client.get_reply_to_email_addresses',
|
||||||
|
return_value=[],
|
||||||
|
)
|
||||||
|
|
||||||
|
user = active_user_with_permissions(fake_uuid())
|
||||||
|
user.email_address = email_address
|
||||||
|
client_request.login(user)
|
||||||
|
|
||||||
|
page = client_request.get(
|
||||||
|
'main.request_to_go_live', service_id=SERVICE_ONE_ID
|
||||||
|
)
|
||||||
|
assert page.h1.text == 'Before you request to go live'
|
||||||
|
|
||||||
|
checklist_items = page.select('.task-list .task-list-item')
|
||||||
|
assert normalize_spaces(checklist_items[2].text) == expected_item
|
||||||
|
|
||||||
|
|
||||||
def test_should_show_request_to_go_live(
|
def test_should_show_request_to_go_live(
|
||||||
client_request,
|
client_request,
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user