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

@@ -169,7 +169,7 @@
{% if notification.status|format_notification_status_as_url(notification.notification_type) %} {% if notification.status|format_notification_status_as_url(notification.notification_type) %}
</a> </a>
{% endif %} {% 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.status|format_notification_status_as_time(
notification.created_at|format_datetime_short, notification.created_at|format_datetime_short,
(notification.updated_at or notification.created_at)|format_datetime_short (notification.updated_at or notification.created_at)|format_datetime_short
@@ -180,6 +180,42 @@
{% endif %} {% endif %}
{% endmacro %} {% 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( {% macro spark_bar_field(
count, count,

View File

@@ -1,6 +1,6 @@
{% from "components/page-footer.html" import page_footer %} {% from "components/page-footer.html" import page_footer %}
{% from "components/previous-next-navigation.html" import previous_next_navigation %} {% 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'> <div class="ajax-block-container" id='pill-selected-item'>
@@ -12,17 +12,19 @@
caption="Recent activity", caption="Recent activity",
caption_visible=False, caption_visible=False,
empty_message='No messages found &thinsp;(messages are kept for {} days)'.format(limit_days)|safe, 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 field_headings_visible=False
) %} ) %}
{% call row_heading() %} {% 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> <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 }} {{ item.preview_of_content }}
</p> </p>
{% endcall %} {% endcall %}
{{ notification_status_field(item) }} {{ notification_status_field(item) }}
{{ notification_carrier_field(item) }}
{{ notification_carrier_message_field(item)}}
{% endcall %} {% endcall %}
{% if notifications %} {% if notifications %}