From 80e6c1654b1f82857f12e8967246d3fd7d6d97c5 Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Mon, 3 Jun 2019 13:31:45 +0100 Subject: [PATCH] Make organisation settings one table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There’s no longer a difference between regular settings and platform admin settings – it’s all platform admin. --- .../organisation/settings/index.html | 178 ++++++++---------- .../views/organisations/test_organisation.py | 2 - 2 files changed, 82 insertions(+), 98 deletions(-) diff --git a/app/templates/views/organisations/organisation/settings/index.html b/app/templates/views/organisations/organisation/settings/index.html index aa440f700..6f2ae3d75 100644 --- a/app/templates/views/organisations/organisation/settings/index.html +++ b/app/templates/views/organisations/organisation/settings/index.html @@ -23,102 +23,88 @@ ) }} {% endcall %} + {% call row() %} + {{ text_field('Organisation type') }} + {{ optional_text_field({ + 'central': 'Central government', + 'local': 'Local government', + 'nhs': 'NHS', + }.get(current_org.organisation_type)) }} + {{ edit_field( + 'Change', + url_for('.edit_organisation_type', org_id=current_org.id) + ) + }} + {% endcall %} + {% call row() %} + {{ text_field('Crown organisation') }} + {{ optional_text_field( + { + True: 'Yes', + False: 'No', + }.get(current_org.crown), + default='Not sure' + ) }} + {{ edit_field( + 'Change', + url_for('.edit_organisation_crown_status', org_id=current_org.id) + ) + }} + {% endcall %} + {% call row() %} + {{ text_field('Data sharing and financial agreement') }} + {{ text_field( + { + True: 'Signed', + False: 'Not signed', + None: 'Not signed (but we have some service-specific agreements in place)' + }.get(current_org.agreement_signed) + ) }} + {{ edit_field( + 'Change', + url_for('.edit_organisation_agreement', org_id=current_org.id) + ) + }} + {% endcall %} + {% call row() %} + {{ text_field('Request to go live notes') }} + {{ optional_text_field(current_org.request_to_go_live_notes, default='None') }} + {{ edit_field( + 'Change', + url_for('.edit_organisation_go_live_notes', org_id=current_org.id) + ) + }} + {% endcall %} + {% call row() %} + {{ text_field('Default email branding') }} + {{ text_field(email_branding) }} + {{ edit_field( + 'Change', + url_for('.edit_organisation_email_branding', org_id=current_org.id) + ) + }} + {% endcall %} + {% call row() %} + {{ text_field('Default letter branding') }} + {{ optional_text_field( + letter_branding, + default='No branding' + ) }} + {{ edit_field( + 'Change', + url_for('.edit_organisation_letter_branding', org_id=current_org.id) + ) + }} + {% endcall %} + {% call row() %} + {{ text_field('Known email domains') }} + {{ optional_text_field(current_org.domains or None, default='None') }} + {{ edit_field( + 'Change', + url_for('.edit_organisation_domains', org_id=current_org.id) + ) + }} + {% endcall %} {% endcall %} - - - {% if current_user.platform_admin %} -

Platform admin settings

-
- {% call mapping_table( - caption='Platform admin settings', - field_headings=['Label', 'Value', 'Action'], - field_headings_visible=False, - caption_visible=False - ) %} - {% call row() %} - {{ text_field('Organisation type') }} - {{ optional_text_field({ - 'central': 'Central government', - 'local': 'Local government', - 'nhs': 'NHS', - }.get(current_org.organisation_type)) }} - {{ edit_field( - 'Change', - url_for('.edit_organisation_type', org_id=current_org.id) - ) - }} - {% endcall %} - {% call row() %} - {{ text_field('Crown organisation') }} - {{ optional_text_field( - { - True: 'Yes', - False: 'No', - }.get(current_org.crown), - default='Not sure' - ) }} - {{ edit_field( - 'Change', - url_for('.edit_organisation_crown_status', org_id=current_org.id) - ) - }} - {% endcall %} - {% call row() %} - {{ text_field('Data sharing and financial agreement') }} - {{ text_field( - { - True: 'Signed', - False: 'Not signed', - None: 'Not signed (but we have some service-specific agreements in place)' - }.get(current_org.agreement_signed) - ) }} - {{ edit_field( - 'Change', - url_for('.edit_organisation_agreement', org_id=current_org.id) - ) - }} - {% endcall %} - {% call row() %} - {{ text_field('Request to go live notes') }} - {{ optional_text_field(current_org.request_to_go_live_notes, default='None') }} - {{ edit_field( - 'Change', - url_for('.edit_organisation_go_live_notes', org_id=current_org.id) - ) - }} - {% endcall %} - {% call row() %} - {{ text_field('Default email branding') }} - {{ text_field(email_branding) }} - {{ edit_field( - 'Change', - url_for('.edit_organisation_email_branding', org_id=current_org.id) - ) - }} - {% endcall %} - {% call row() %} - {{ text_field('Default letter branding') }} - {{ optional_text_field( - letter_branding, - default='No branding' - ) }} - {{ edit_field( - 'Change', - url_for('.edit_organisation_letter_branding', org_id=current_org.id) - ) - }} - {% endcall %} - {% call row() %} - {{ text_field('Known email domains') }} - {{ optional_text_field(current_org.domains or None, default='None') }} - {{ edit_field( - 'Change', - url_for('.edit_organisation_domains', org_id=current_org.id) - ) - }} - {% endcall %} - {% endcall %} -
- {% endif %} {% endblock %} diff --git a/tests/app/main/views/organisations/test_organisation.py b/tests/app/main/views/organisations/test_organisation.py index 416ad52e2..eb8a7093f 100644 --- a/tests/app/main/views/organisations/test_organisation.py +++ b/tests/app/main/views/organisations/test_organisation.py @@ -182,8 +182,6 @@ def test_organisation_settings_for_platform_admin( expected_rows = [ 'Label Value Action', 'Organisation name Org 1 Change', - - 'Label Value Action', 'Organisation type Not set Change', 'Crown organisation Yes Change', 'Data sharing and financial agreement Not signed Change',