Merge pull request #989 from GSA/925-log-response-ui-dashboard

Added 2 new macros for carrier and carrier message
This commit is contained in:
Steven Reilly
2023-12-12 17:02:16 -05:00
committed by GitHub
2 changed files with 44 additions and 6 deletions

View File

@@ -69,7 +69,7 @@
'table-field-right-aligned' if align == 'right' else
'table-field-center-aligned' if align == 'center' else
'table-field-left-aligned'
%}
%}
{% set border = '' if border else 'table-field-noborder' %}
{% set wrap = 'table-field-wrap-text' if wrap else '' %}
@@ -169,7 +169,7 @@
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
</a>
{% endif %}
<p class="status-hint margin-0 width-card-lg">
<p class="status-hint margin-0 width-card ">
{{ notification.status|format_notification_status_as_time(
notification.created_at|format_datetime_short,
(notification.updated_at or notification.created_at)|format_datetime_short
@@ -180,6 +180,42 @@
{% endif %}
{% endmacro %}
{% macro notification_carrier_field(notification) %}
<!-- {% set displayed_on_single_line = notification.status in ['created', 'pending', 'sending', 'delivered', 'accepted', 'received'] %} -->
{% if not notification %}
{% call field(align='right') %}{% endcall %}
{% else %}
<!-- {% set status = notification.status|format_notification_status_as_field_status(notification.notification_type) %} -->
{% call field(
align='right'
) %}
<p class="status-hint margin-0 width-card">
{{ notification.carrier}}
</p>
{% if displayed_on_single_line %}</span>{% endif %}
{% endcall %}
{% endif %}
{% endmacro %}
{% macro notification_carrier_message_field(notification) %}
{% if not notification %}
{% call field(align='right') %}{% endcall %}
{% else %}
<!-- {% set status = notification.status|format_notification_status_as_field_status(notification.notification_type) %} -->
{% call field(
status=status,
align='right'
) %}
<p class="status-hint margin-0 width-card">
{{notification.provider_response}}
</p>
{% if displayed_on_single_line %}</span>{% endif %}
{% endcall %}
{% endif %}
{% endmacro %}
{% macro spark_bar_field(
count,
@@ -189,7 +225,7 @@
{% call field(align='right') %}
<span {% if id %}id="{{ id }}"{% endif %} class="spark-bar">
<span class="spark-bar-bar">
{{ '{:,.0f}'.format(count) }}
{{ '{:,.0f}'.format(count) }}
<!-- {% if count == 1 -%}
message sent
{% else -%}

View File

@@ -1,6 +1,6 @@
{% from "components/page-footer.html" import page_footer %}
{% from "components/previous-next-navigation.html" import previous_next_navigation %}
{% from "components/table.html" import list_table, field, text_field, link_field, right_aligned_field_heading, hidden_field_heading, row_heading, notification_status_field %}
{% from "components/table.html" import list_table, field, text_field, link_field, right_aligned_field_heading, hidden_field_heading, row_heading, notification_status_field, notification_carrier_field, notification_carrier_message_field %}
<div class="ajax-block-container" id='pill-selected-item'>
@@ -12,17 +12,19 @@
caption="Recent activity",
caption_visible=False,
empty_message='No messages found &thinsp;(messages are kept for {} days)'.format(limit_days)|safe,
field_headings=['Recipient', 'Status'],
field_headings=['Recipient', 'Status', 'Carrier', 'Carrier Response'],
field_headings_visible=False
) %}
{% call row_heading() %}
<a class="usa-link file-list-filename" href="{{ single_notification_url(notification_id=item.id) }}">{{ item.to.splitlines()|join(', ') if item.to else '' }}</a>
<p class="file-list-hint">
<p class="file-list-hint width-card">
{{ item.preview_of_content }}
</p>
{% endcall %}
{{ notification_status_field(item) }}
{{ notification_carrier_field(item) }}
{{ notification_carrier_message_field(item)}}
{% endcall %}
{% if notifications %}