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:
Chris Hill-Scott
2020-03-19 10:49:40 +00:00
parent b2a75af8bb
commit 2a76fd9ee8
7 changed files with 51 additions and 3 deletions

View File

@@ -37,6 +37,7 @@ def test_should_redirect_if_not_logged_in(
@pytest.mark.parametrize('endpoint', [
'main.platform_admin',
'main.platform_admin_splash_page',
'main.live_services',
'main.trial_services',
])
@@ -589,6 +590,20 @@ def test_get_tech_failure_status_box_data_removes_percentage_data():
assert 'percentage' not in tech_failure_data
def test_platform_admin_splash_doesnt_talk_to_api(
client_request,
platform_admin_user,
):
client_request.login(platform_admin_user)
page = client_request.get('main.platform_admin_splash_page')
assert page.select_one('main .govuk-body a')['href'] == url_for(
'main.platform_admin',
)
def test_platform_admin_with_start_and_end_dates_provided(mocker, platform_admin_client):
start_date = '2018-01-01'
end_date = '2018-06-01'