diff --git a/app/assets/javascripts/activityChart.js b/app/assets/javascripts/activityChart.js index 4fa8922ec..be15a3aad 100644 --- a/app/assets/javascripts/activityChart.js +++ b/app/assets/javascripts/activityChart.js @@ -295,24 +295,28 @@ liveRegion.textContent = `Data updated for ${selectedText} - last 7 days`; const tableHeading = document.querySelector('#tableActivity h2'); - const senderColumns = document.querySelectorAll('.sender-column'); + const senderElements = [ + document.querySelector('[data-column="sender"]'), + ...document.querySelectorAll('[data-sender]') + ]; const allRows = document.querySelectorAll('#activity-table tbody tr'); - const caption = document.querySelector('#activity-table caption'); + const table = document.getElementById('activity-table'); + const caption = table.querySelector('caption'); if (selectedValue === 'individual') { tableHeading.textContent = 'My activity'; caption.textContent = `Table showing the sent jobs for ${currentUserName}`; - senderColumns.forEach(col => { - col.style.display = 'none'; + senderElements.forEach(el => { + if (el) el.style.display = 'none'; }); allRows.forEach(row => row.style.display = 'none'); const userRows = Array.from(allRows).filter(row => { - const senderCell = row.querySelector('.sender-column'); - const rowSender = senderCell ? senderCell.textContent.trim() : ''; + const senderCell = row.querySelector('[data-sender]'); + const rowSender = senderCell ? senderCell.dataset.sender : ''; return rowSender === currentUserName; }); @@ -333,8 +337,8 @@ tableHeading.textContent = 'Service activity'; caption.textContent = `Table showing the sent jobs for service`; - senderColumns.forEach(col => { - col.style.display = ''; + senderElements.forEach(el => { + if (el) el.style.display = ''; }); allRows.forEach((row, index) => { diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index 029aaa22f..9aebabd35 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -492,44 +492,12 @@ td.table-empty-message { .job-table { width: 100%; border-collapse: collapse; - td.file-name { - width: 25%; - overflow-wrap: anywhere; - } - td.jobid { - width: 5%; - } - td.template { - width: 25%; - } - td.time-sent { - width: 15%; - } - td.sender { - width: 20%; - overflow-wrap: break-word; - } - td.count-of-recipients { - width: 5%; - } - td.report { - width: 2%; - text-align: center; - } - td.delivered { - width: 2%; - text-align: center; - } - td.failed { - width: 2%; - text-align: center; - } - td.report img { - padding-top: 5px; - } th { padding: 0.5rem 1rem; } + td { + padding: 0.5rem 1rem; + } } @media (max-width: 768px) { diff --git a/app/main/views/activity.py b/app/main/views/activity.py index 1d6d12d98..6481a4832 100644 --- a/app/main/views/activity.py +++ b/app/main/views/activity.py @@ -56,6 +56,7 @@ def all_jobs_activity(service_id): next_page=next_page, prev_page=prev_page, pagination=pagination, + total_jobs=jobs.get("total", 0), **download_availability, download_link_one_day=url_for( ".download_notifications_csv", diff --git a/app/templates/views/activity/all-activity.html b/app/templates/views/activity/all-activity.html index 94209a38c..1db831afc 100644 --- a/app/templates/views/activity/all-activity.html +++ b/app/templates/views/activity/all-activity.html @@ -51,6 +51,11 @@ {% endif %} + {% if pagination and total_jobs %} +
+ Page {{ pagination.current }} of {{ pagination.last }} ({{ total_jobs }} total jobs) +
+ {% endif %} {% endif %} {% endset %} {% block maincolumn_content %} @@ -58,7 +63,7 @@| Job ID# | -+ | Template | -+ | Started | -+ | Sender | -+ | Report | -- Delivered - | -- Failed + | + Status | @@ -90,28 +92,34 @@ {% if all_jobs_dict %} {% for job in all_jobs_dict %}|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| + | {{ job.job_id[:8] if job.job_id else 'Manually entered number' }} | -{{ job.template_name }} | -+ | {{ job.template_name }} | +{{ job.activity_time|format_datetime_table }} | -{{ job.created_by.name }} | -+ | {{ job.created_by.name }} | +
{% if job.can_download %}
- |
- {{ job.delivered_count if job.delivered_count is not none else '0' }} | -{{ job.failed_count if job.failed_count is not none else '0' }} | ++ + {{ job.delivered_count if job.delivered_count is not none else '0' }} delivered + + + {{ job.failed_count if job.failed_count is not none else '0' }} failed + + |
Note: Report data is only available for 7 days after your message has been sent
+Note: Report data is only available for 7 days after your message has been sent
| Job ID# | Template | -Job status | -Sender + | Job status | +Sender | # of Recipients | |||
|---|---|---|---|---|---|---|---|---|---|
| + | {{ job.id[:8] if job.id else 'Manually entered number' }} | -{{ job.template_name }} | -+ | {{ job.template_name }} | +{% if not job.finished_processing %} {% if job.scheduled_for%} Scheduled for {{ job.scheduled_for|format_datetime_table }} @@ -58,8 +58,8 @@ Sent on {{ job.processing_started|format_datetime_table }} {% endif %} | -{{ job.created_by.name }} | -{{ job.notification_count }} | +{{ job.created_by.name }} | +{{ job.notification_count }} |
| Sender | +
|---|
| Test User |
| Other User |
| Test User |
| Test User |
| Other User |
| Test User |
| Test User |
| Test User |
| Other User |
| Test User |
| Test User |
| Other User |
| Test User |
| Test User |
| Sender | +
|---|
| Other User |
| Another User |
| Different User |
| Other User |
| Another User |
| Different User |