mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-07 10:08:25 -04:00
Split list of user’s services into live and trial
This gives us as platform admin users a bit more context when we’re looking at a user’s profile.
This commit is contained in:
@@ -13,15 +13,37 @@
|
|||||||
</h1>
|
</h1>
|
||||||
<p>{{ user.email_address }}</p>
|
<p>{{ user.email_address }}</p>
|
||||||
<p>{{ user.mobile_number }}</p>
|
<p>{{ user.mobile_number }}</p>
|
||||||
<h2 class="heading-medium">Services</h2>
|
<h2 class="heading-medium">Live services</h2>
|
||||||
<nav class="browse-list">
|
<nav class="browse-list">
|
||||||
<ul>
|
{% if user.live_services %}
|
||||||
{% for service in user.services %}
|
<ul>
|
||||||
<li class="browse-list-item">
|
{% for service in user.live_services %}
|
||||||
<a class="browse-list-hint" href={{url_for('.service_dashboard', service_id=service.id)}}>{{ service.name }}</a>
|
<li class="browse-list-item">
|
||||||
</li>
|
<a class="browse-list-hint" href={{url_for('.service_dashboard', service_id=service.id)}}>{{ service.name }}</a>
|
||||||
{% endfor %}
|
</li>
|
||||||
</ul>
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p class="hint">
|
||||||
|
No live services
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
|
</nav>
|
||||||
|
<h2 class="heading-medium">Trial mode services</h2>
|
||||||
|
<nav class="browse-list">
|
||||||
|
{% if user.trial_mode_services %}
|
||||||
|
<ul>
|
||||||
|
{% for service in user.trial_mode_services %}
|
||||||
|
<li class="browse-list-item">
|
||||||
|
<a class="browse-list-hint" href={{url_for('.service_dashboard', service_id=service.id)}}>{{ service.name }}</a>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</ul>
|
||||||
|
{% else %}
|
||||||
|
<p class="hint">
|
||||||
|
No services in trial mode
|
||||||
|
</p>
|
||||||
|
{% endif %}
|
||||||
</nav>
|
</nav>
|
||||||
<h2 class="heading-medium">Last login</h2>
|
<h2 class="heading-medium">Last login</h2>
|
||||||
{% if not user.logged_in_at %}
|
{% if not user.logged_in_at %}
|
||||||
|
|||||||
@@ -101,8 +101,8 @@ def test_user_information_page_shows_information_about_user(
|
|||||||
mocker.patch(
|
mocker.patch(
|
||||||
'app.user_api_client.get_organisations_and_services_for_user',
|
'app.user_api_client.get_organisations_and_services_for_user',
|
||||||
return_value={'organisations': [], 'services_without_organisations': [
|
return_value={'organisations': [], 'services_without_organisations': [
|
||||||
{"id": 1, "name": "Fresh Orchard Juice"},
|
{"id": 1, "name": "Fresh Orchard Juice", "restricted": True},
|
||||||
{"id": 2, "name": "Nature Therapy"},
|
{"id": 2, "name": "Nature Therapy", "restricted": False},
|
||||||
]},
|
]},
|
||||||
autospec=True
|
autospec=True
|
||||||
)
|
)
|
||||||
@@ -116,10 +116,12 @@ def test_user_information_page_shows_information_about_user(
|
|||||||
assert document.xpath("//p/text()[normalize-space()='test@gov.uk']")
|
assert document.xpath("//p/text()[normalize-space()='test@gov.uk']")
|
||||||
assert document.xpath("//p/text()[normalize-space()='+447700900986']")
|
assert document.xpath("//p/text()[normalize-space()='+447700900986']")
|
||||||
|
|
||||||
assert document.xpath("//h2/text()[normalize-space()='Services']")
|
assert document.xpath("//h2/text()[normalize-space()='Live services']")
|
||||||
assert document.xpath("//a/text()[normalize-space()='Fresh Orchard Juice']")
|
|
||||||
assert document.xpath("//a/text()[normalize-space()='Nature Therapy']")
|
assert document.xpath("//a/text()[normalize-space()='Nature Therapy']")
|
||||||
|
|
||||||
|
assert document.xpath("//h2/text()[normalize-space()='Trial mode services']")
|
||||||
|
assert document.xpath("//a/text()[normalize-space()='Fresh Orchard Juice']")
|
||||||
|
|
||||||
assert document.xpath("//h2/text()[normalize-space()='Last login']")
|
assert document.xpath("//h2/text()[normalize-space()='Last login']")
|
||||||
assert not document.xpath("//p/text()[normalize-space()='0 failed login attempts']")
|
assert not document.xpath("//p/text()[normalize-space()='0 failed login attempts']")
|
||||||
|
|
||||||
@@ -137,8 +139,8 @@ def test_user_information_page_displays_if_there_are_failed_login_attempts(
|
|||||||
mocker.patch(
|
mocker.patch(
|
||||||
'app.user_api_client.get_organisations_and_services_for_user',
|
'app.user_api_client.get_organisations_and_services_for_user',
|
||||||
return_value={'organisations': [], 'services_without_organisations': [
|
return_value={'organisations': [], 'services_without_organisations': [
|
||||||
{"id": 1, "name": "Fresh Orchard Juice"},
|
{"id": 1, "name": "Fresh Orchard Juice", "restricted": True},
|
||||||
{"id": 2, "name": "Nature Therapy"},
|
{"id": 2, "name": "Nature Therapy", "restricted": True},
|
||||||
]},
|
]},
|
||||||
autospec=True
|
autospec=True
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user