mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Reduce usage of the platform admin index page
This page is slow to load which means: - it’s annoying for us - it’s potentially causing load on the database This commit does two things to reduce the amount we’re unnecessarily looking at this page: 1. Avoid redirecting to it when signing in as a platform admin user 2. Don’t go directly to it when clicking ‘platform admin’ at the top, but instead show a holding page (there’s a fair chance you’ve clicked that link in order to go and manage some email branding or find a user, not wait for stats to load)
This commit is contained in:
@@ -42,6 +42,14 @@ ZERO_FAILURE_THRESHOLD = 0
|
||||
|
||||
@main.route("/platform-admin")
|
||||
@user_is_platform_admin
|
||||
def platform_admin_splash_page():
|
||||
return render_template(
|
||||
'views/platform-admin/splash-page.html',
|
||||
)
|
||||
|
||||
|
||||
@main.route("/platform-admin/summary")
|
||||
@user_is_platform_admin
|
||||
def platform_admin():
|
||||
form = DateFilterForm(request.args, meta={'csrf': False})
|
||||
api_args = {}
|
||||
|
||||
@@ -111,7 +111,5 @@ def redirect_when_logged_in(platform_admin):
|
||||
next_url = request.args.get('next')
|
||||
if next_url and _is_safe_redirect_url(next_url):
|
||||
return redirect(next_url)
|
||||
if platform_admin:
|
||||
return redirect(url_for('main.platform_admin'))
|
||||
|
||||
return redirect(url_for('main.show_accounts_or_dashboard'))
|
||||
|
||||
@@ -101,6 +101,7 @@ class HeaderNavigation(Navigation):
|
||||
'platform_admin_list_complaints',
|
||||
'platform_admin_reports',
|
||||
'platform_admin_returned_letters',
|
||||
'platform_admin_splash_page',
|
||||
'suspend_service',
|
||||
'trial_services',
|
||||
'update_email_branding',
|
||||
@@ -580,6 +581,7 @@ class MainNavigation(Navigation):
|
||||
'platform_admin_list_complaints',
|
||||
'platform_admin_reports',
|
||||
'platform_admin_returned_letters',
|
||||
'platform_admin_splash_page',
|
||||
'pricing',
|
||||
'privacy',
|
||||
'public_agreement',
|
||||
@@ -828,6 +830,7 @@ class CaseworkNavigation(Navigation):
|
||||
'platform_admin_reports',
|
||||
'platform_admin_returned_letters',
|
||||
'platform_admin',
|
||||
'platform_admin_splash_page',
|
||||
'pricing',
|
||||
'privacy',
|
||||
'public_agreement',
|
||||
@@ -1117,6 +1120,7 @@ class OrgNavigation(Navigation):
|
||||
'platform_admin_list_complaints',
|
||||
'platform_admin_reports',
|
||||
'platform_admin_returned_letters',
|
||||
'platform_admin_splash_page',
|
||||
'pricing',
|
||||
'privacy',
|
||||
'public_agreement',
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
"active": header_navigation.is_selected('user-profile')
|
||||
},
|
||||
{
|
||||
"href": url_for('main.platform_admin'),
|
||||
"href": url_for('main.platform_admin_splash_page'),
|
||||
"text": "Platform admin",
|
||||
"active": header_navigation.is_selected('platform-admin')
|
||||
},
|
||||
|
||||
17
app/templates/views/platform-admin/splash-page.html
Normal file
17
app/templates/views/platform-admin/splash-page.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{% extends "views/platform-admin/_base_template.html" %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Summary
|
||||
{% endblock %}
|
||||
|
||||
{% block platform_admin_content %}
|
||||
|
||||
<h1 class="heading-large">
|
||||
Summary
|
||||
</h1>
|
||||
|
||||
<p class="govuk-body">
|
||||
<a class="govuk-link govuk-link--no-visited-state" href="{{ url_for('main.platform_admin') }}">Load summary</a>
|
||||
</p>
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user