mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 00:07:02 -04:00
Platform admin: Highlight service in research mode
Research mode trumps live. Copies the same style we use in the page footer.
This commit is contained in:
8
app/assets/stylesheets/components/research-mode.scss
Normal file
8
app/assets/stylesheets/components/research-mode.scss
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
.research-mode {
|
||||||
|
font-weight: bold;
|
||||||
|
display: inline-block;
|
||||||
|
padding: 5px 10px;
|
||||||
|
background: $govuk-blue;
|
||||||
|
color: $white;
|
||||||
|
border-radius: 2px;
|
||||||
|
}
|
||||||
@@ -53,6 +53,7 @@ $path: '/static/images/';
|
|||||||
@import 'components/show-more';
|
@import 'components/show-more';
|
||||||
@import 'components/message';
|
@import 'components/message';
|
||||||
@import 'components/phone';
|
@import 'components/phone';
|
||||||
|
@import 'components/research-mode';
|
||||||
|
|
||||||
@import 'views/job';
|
@import 'views/job';
|
||||||
@import 'views/edit-template';
|
@import 'views/edit-template';
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ def format_stats_by_service(all_stats, services):
|
|||||||
),
|
),
|
||||||
'delivered': stats['sms_delivered'] + stats['emails_delivered'],
|
'delivered': stats['sms_delivered'] + stats['emails_delivered'],
|
||||||
'failed': stats['sms_failed'] + stats['emails_failed'],
|
'failed': stats['sms_failed'] + stats['emails_failed'],
|
||||||
'restricted': services[stats['service']]['restricted']
|
'restricted': services[stats['service']]['restricted'],
|
||||||
|
'research_mode': services[stats['service']]['research_mode']
|
||||||
}
|
}
|
||||||
for stats in all_stats
|
for stats in all_stats
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -112,7 +112,7 @@
|
|||||||
Built by the <a href="https://www.gov.uk/government/organisations/government-digital-service">Government Digital Service</a>
|
Built by the <a href="https://www.gov.uk/government/organisations/government-digital-service">Government Digital Service</a>
|
||||||
<a href="{{ url_for("main.cookies") }}">Cookies</a>
|
<a href="{{ url_for("main.cookies") }}">Cookies</a>
|
||||||
{% if current_service.research_mode %}
|
{% if current_service.research_mode %}
|
||||||
<span id="research-mode" style="font-weight: bold; display: inline-block; padding: 5px 10px; background: #005EA5; color: #fff; border-radius: 2px;">research mode</span>
|
<span id="research-mode" class="research-mode">research mode</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</nav>
|
</nav>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% from "components/big-number.html" import big_number, big_number_with_status %}
|
{% from "components/big-number.html" import big_number, big_number_with_status %}
|
||||||
{% from "components/message-count-label.html" import message_count_label %}
|
{% from "components/message-count-label.html" import message_count_label %}
|
||||||
{% from "components/browse-list.html" import browse_list %}
|
{% from "components/browse-list.html" import browse_list %}
|
||||||
{% from "components/table.html" import list_table, field, right_aligned_field_heading, hidden_field_heading %}
|
{% from "components/table.html" import list_table, field, right_aligned_field_heading, hidden_field_heading, text_field %}
|
||||||
|
|
||||||
{% block page_title %}
|
{% block page_title %}
|
||||||
Platform admin – GOV.UK Notify
|
Platform admin – GOV.UK Notify
|
||||||
@@ -63,11 +63,19 @@
|
|||||||
<a href="{{ url_for('main.service_dashboard', service_id=item['id']) }}" class="browse-list-link">{{ item['name'] }}</a>
|
<a href="{{ url_for('main.service_dashboard', service_id=item['id']) }}" class="browse-list-link">{{ item['name'] }}</a>
|
||||||
</div>
|
</div>
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% call field(status='error') %}
|
{% if item['research_mode'] %}
|
||||||
<span class="heading-medium">
|
{% call field() %}
|
||||||
{{ '' if item['restricted'] else 'Live' }}
|
<span class="research-mode">research mode</span>
|
||||||
</span>
|
{% endcall %}
|
||||||
{% endcall %}
|
{% elif not item['restricted'] %}
|
||||||
|
{% call field(status='error') %}
|
||||||
|
<span class="heading-medium">
|
||||||
|
Live
|
||||||
|
</span>
|
||||||
|
{% endcall %}
|
||||||
|
{% else %}
|
||||||
|
{{ text_field('') }}
|
||||||
|
{% endif %}
|
||||||
{% call field(align='right') %}
|
{% call field(align='right') %}
|
||||||
{{ big_number(item['sending'], smaller=True) }}
|
{{ big_number(item['sending'], smaller=True) }}
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ def create_stats(
|
|||||||
|
|
||||||
def test_format_stats_by_service_gets_correct_stats_for_each_service():
|
def test_format_stats_by_service_gets_correct_stats_for_each_service():
|
||||||
services = [
|
services = [
|
||||||
{'name': 'a', 'id': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'restricted': False},
|
{'name': 'a', 'id': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'restricted': False, 'research_mode': True},
|
||||||
{'name': 'b', 'id': 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'restricted': True}
|
{'name': 'b', 'id': 'bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb', 'restricted': True, 'research_mode': False}
|
||||||
]
|
]
|
||||||
all_stats = [
|
all_stats = [
|
||||||
create_stats('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', emails_requested=1),
|
create_stats('aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', emails_requested=1),
|
||||||
@@ -113,7 +113,7 @@ def test_format_stats_by_service_gets_correct_stats_for_each_service():
|
|||||||
|
|
||||||
def test_format_stats_by_service_sums_values_for_sending():
|
def test_format_stats_by_service_sums_values_for_sending():
|
||||||
services = [
|
services = [
|
||||||
{'name': 'a', 'id': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'restricted': False},
|
{'name': 'a', 'id': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa', 'restricted': False, 'research_mode': False},
|
||||||
]
|
]
|
||||||
all_stats = [
|
all_stats = [
|
||||||
create_stats(
|
create_stats(
|
||||||
|
|||||||
Reference in New Issue
Block a user