mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-21 08:29:27 -04:00
Move organisations out of platform admin area
It’s annoying having to go through the slow-to-load platform admin index page to get to organisations. And it makes more sense for them to be in the same place as other organisations and services that you can see.
This commit is contained in:
@@ -89,7 +89,6 @@ class HeaderNavigation(Navigation):
|
||||
'letter_branding',
|
||||
'live_services',
|
||||
'live_services_csv',
|
||||
'organisations',
|
||||
'performance_platform_xlsx',
|
||||
'platform_admin',
|
||||
'platform_admin_letter_validation_preview',
|
||||
@@ -214,6 +213,7 @@ class HeaderNavigation(Navigation):
|
||||
'organisation_settings',
|
||||
'organisation_preview_email_branding',
|
||||
'organisation_preview_letter_branding',
|
||||
'organisations',
|
||||
'privacy',
|
||||
'public_agreement',
|
||||
'public_download_agreement',
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
</h1>
|
||||
<nav class="browse-list">
|
||||
<ul>
|
||||
{% if current_user.platform_admin %}
|
||||
<li class="browse-list-item">
|
||||
<a href="{{ url_for('.organisations') }}" class="browse-list-link">All organisations</a>
|
||||
</li>
|
||||
<div class ="keyline-block"></div>
|
||||
{% endif %}
|
||||
{% for org in organisations %}
|
||||
<li class="browse-list-item">
|
||||
<a href="{{ url_for('.organisation_dashboard', org_id=org.id) }}" class="browse-list-link">{{ org.name }}</a>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
{% extends "views/platform-admin/_base_template.html" %}
|
||||
{% extends "withoutnav_template.html" %}
|
||||
{% from "components/live-search.html" import live_search %}
|
||||
{% from "components/page-footer.html" import page_footer %}
|
||||
{% from "components/page-header.html" import page_header %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Organisations
|
||||
{% endblock %}
|
||||
|
||||
{% block org_page_title %}
|
||||
Organisations
|
||||
{% endblock %}
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
{{ page_header(
|
||||
'Organisations',
|
||||
back_link=url_for('main.choose_account'),
|
||||
) }}
|
||||
|
||||
<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 %}
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
('Summary', url_for('main.platform_admin')),
|
||||
('Live services', url_for('main.live_services')),
|
||||
('Trial mode services', url_for('main.trial_services')),
|
||||
('Organisations', url_for('main.organisations')),
|
||||
('Providers', url_for('main.view_providers')),
|
||||
('Reports', url_for('main.platform_admin_reports')),
|
||||
('Email branding', url_for('main.email_branding')),
|
||||
|
||||
@@ -106,6 +106,22 @@ def test_choose_account_should_show_choose_accounts_page_if_no_services(
|
||||
assert add_service_link['href'] == url_for('main.add_service')
|
||||
|
||||
|
||||
def test_choose_account_should_should_organisations_link_for_platform_admin(
|
||||
client_request,
|
||||
platform_admin_user,
|
||||
mock_get_orgs_and_services,
|
||||
mock_get_organisation,
|
||||
mock_get_organisation_services,
|
||||
):
|
||||
client_request.login(platform_admin_user)
|
||||
|
||||
page = client_request.get('main.choose_account')
|
||||
|
||||
first_link = page.select_one('.browse-list-item a')
|
||||
assert first_link.text == 'All organisations'
|
||||
assert first_link['href'] == url_for('main.organisations')
|
||||
|
||||
|
||||
def test_choose_account_should_show_back_to_service_link(
|
||||
client_request,
|
||||
mock_get_orgs_and_services
|
||||
|
||||
Reference in New Issue
Block a user