Make navigating organisations a bit easier

This commit is contained in:
Chris Hill-Scott
2019-03-21 11:22:53 +00:00
parent 936883bf7b
commit eaa7af8692
9 changed files with 30 additions and 26 deletions

View File

@@ -39,7 +39,8 @@ def organisations():
return render_template(
'views/organisations/index.html',
organisations=orgs
organisations=orgs,
search_form=SearchByNameForm(),
)

View File

@@ -1,6 +1,6 @@
<nav class="navigation">
<ul>
<li><a href="{{ url_for('.organisation_dashboard', org_id=current_org.id) }}" {{ org_navigation.is_selected('dashboard') }}>Dashboard</a></li>
<li><a href="{{ url_for('.organisation_dashboard', org_id=current_org.id) }}" {{ org_navigation.is_selected('dashboard') }}>Services</a></li>
<li><a href="{{ url_for('.manage_org_users', org_id=current_org.id) }}" {{ org_navigation.is_selected('team-members') }}>Team members</a></li>
<li><a href="{{ url_for('.organisation_settings', org_id=current_org.id) }}" {{ org_navigation.is_selected('settings') }}>Settings</a></li>
</ul>

View File

@@ -8,6 +8,10 @@
<div id="content">
<div class="navigation-service">
<div class="navigation-service-name">
{% if current_user.platform_admin %}
<a href="{{ url_for('.organisations') }}">Organisations</a>
&gt;
{% endif %}
{{ current_org.name }}
</div>
<a href="{{ url_for('main.choose_account') }}" class="navigation-service-switch">Switch service</a>

View File

@@ -13,7 +13,7 @@
{% block platform_admin_content %}
<h1 class="heading-large">Create an organisation</h1>
<h1 class="heading-large">New organisation</h1>
{% call form_wrapper() %}
{{textbox(form.name)}}
{{ page_footer(

View File

@@ -1,4 +1,5 @@
{% extends "views/platform-admin/_base_template.html" %}
{% from "components/live-search.html" import live_search %}
{% from "components/page-footer.html" import page_footer %}
{% block per_page_title %}
@@ -14,6 +15,7 @@
<h1 class="heading-large">
Organisations
</h1>
{{ live_search(target_selector='.browse-list-item', show=True, form=search_form, label='Search by name') }}
<nav class="browse-list">
<ul>
{% for org in organisations %}
@@ -26,8 +28,8 @@
{% endfor %}
</ul>
</nav>
<div>
<a href="{{ url_for('main.add_organisation') }}" class="browse-list-link">Create an organisation</a>
<div class="js-stick-at-bottom-when-scrolling">
<a href="{{ url_for('main.add_organisation') }}" class="button-secondary">New organisation</a>
</div>
{% endblock %}

View File

@@ -1,17 +1,13 @@
{% extends "org_template.html" %}
{% block per_page_title %}
{{ current_org.name }}
{% endblock %}
{% block org_page_title %}
{{ current_org.name }}
Services
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
{{ current_org.name }}
Services
</h1>
<ul>
{% for service in organisation_services %}

View File

@@ -2,11 +2,11 @@
{% from "components/table.html" import mapping_table, optional_text_field, row, text_field, edit_field with context %}
{% block org_page_title %}
Organisation settings
Settings
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">Organisation settings</h1>
<h1 class="heading-large">Settings</h1>
<div class="bottom-gutter-3-2 dashboard-table body-copy-table">
{% call mapping_table(
caption='General',

View File

@@ -44,7 +44,9 @@ def test_organisation_page_shows_all_organisations(
assert page.select('a.browse-list-link')[index].text == org['name']
if not org['active']:
assert page.select_one('.table-field-status-default,heading-medium').text == '- archived'
assert normalize_spaces((page.select('a.browse-list-link')[-1]).text) == 'Create an organisation'
assert normalize_spaces(
page.select_one('a.button-secondary').text
) == 'New organisation'
def test_view_organisation_shows_the_correct_organisation(
@@ -66,7 +68,7 @@ def test_view_organisation_shows_the_correct_organisation(
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert normalize_spaces(page.select_one('.heading-large').text) == org['name']
assert normalize_spaces(page.select_one('.heading-large').text) == 'Services'
def test_create_new_organisation(
@@ -484,7 +486,7 @@ def test_organisation_settings(
page = client_request.get('.organisation_settings', org_id=organisation_one['id'])
assert page.find('h1').text == 'Organisation settings'
assert page.find('h1').text == 'Settings'
rows = page.select('tr')
assert len(rows) == len(expected_rows)
for index, row in enumerate(expected_rows):
@@ -493,7 +495,8 @@ def test_organisation_settings(
def test_organisation_settings_for_platform_admin(
logged_in_platform_admin_client,
client_request,
platform_admin_user,
mock_get_organisation,
organisation_one
):
@@ -504,18 +507,16 @@ def test_organisation_settings_for_platform_admin(
'Label Value Action',
'Organisation type Not set Change',
'Crown organisation Yes Change',
'Data sharing and financial agreement Signed Change',
'Default email branding Not set Change',
'Default letter branding Not set Change',
'Data sharing and financial agreement Not signed Change',
'Default email branding GOV.UK Change',
'Default letter branding No branding Change',
'Known email domains None Change',
]
response = logged_in_platform_admin_client.get(url_for('.organisation_settings', org_id=organisation_one['id']))
client_request.login(platform_admin_user)
page = client_request.get('.organisation_settings', org_id=organisation_one['id'])
assert response.status_code == 200
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.find('h1').text == 'Organisation settings'
assert page.find('h1').text == 'Settings'
rows = page.select('tr')
assert len(rows) == len(expected_rows)
for index, row in enumerate(expected_rows):

View File

@@ -130,7 +130,7 @@ def test_a_page_should_nave_selected_header_navigation_item(
@pytest.mark.parametrize('endpoint, selected_nav_item', [
('main.organisation_dashboard', 'Dashboard'),
('main.organisation_dashboard', 'Services'),
('main.manage_org_users', 'Team members'),
])
def test_a_page_should_nave_selected_org_navigation_item(