diff --git a/app/assets/javascripts/activityChart.js b/app/assets/javascripts/activityChart.js index 8bece8276..5d2f89b39 100644 --- a/app/assets/javascripts/activityChart.js +++ b/app/assets/javascripts/activityChart.js @@ -238,17 +238,28 @@ // Update ARIA live region const liveRegion = document.getElementById('aria-live-account'); - liveRegion.textContent = `Data updated for ${selectedText} - Last 7 Days`; - }; + liveRegion.textContent = `Data updated for ${selectedText} - Last 7 Days`; - document.addEventListener('DOMContentLoaded', function() { - // Initialize activityChart chart and table with service data by default - fetchData('service'); - - // Add event listener to the dropdown - const dropdown = document.getElementById('options'); - dropdown.addEventListener('change', handleDropdownChange); + // Switch tables based on dropdown selection + const selectedTable = selectedValue === "individual" ? "table1" : "table2"; + const tables = document.querySelectorAll('.table-overflow-x-auto'); + tables.forEach(function(table) { + table.classList.add('hidden'); // Hide all tables by adding the hidden class + table.classList.remove('visible'); // Ensure they are not visible }); + const tableToShow = document.getElementById(selectedTable); + tableToShow.classList.remove('hidden'); // Remove hidden class + tableToShow.classList.add('visible'); // Add visible class + }; + + document.addEventListener('DOMContentLoaded', function() { + // Initialize activityChart chart and table with service data by default + fetchData('service'); + + // Add event listener to the dropdown + const dropdown = document.getElementById('options'); + dropdown.addEventListener('change', handleDropdownChange); + }); // Resize chart on window resize window.addEventListener('resize', function() { diff --git a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss index 902e90ee5..61cd543ef 100644 --- a/app/assets/sass/uswds/_uswds-theme-custom-styles.scss +++ b/app/assets/sass/uswds/_uswds-theme-custom-styles.scss @@ -332,6 +332,12 @@ td.table-empty-message { bottom: 0; } +.table-overflow-x-auto { + &.hidden { + display: none; + } +} + @media (max-width: units('desktop-lg')) { .table-overflow-x-auto { overflow-x: auto; diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index 114667f2d..94fd08faa 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -54,75 +54,88 @@ {% if current_user.has_permissions('manage_service') %}{% endif %} - {{ ajax_block(partials, updates_url, 'template-statistics') }} -
| - File name - | -- Template - | -- Job status - | -- Sender - | -- # of Recipients - | -- Report - | -
|---|
| Job ID# | +Template | +Job status | +Sender | +# of Recipients | +||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
- {{ job.original_file_name[:12] if job.original_file_name else 'Manually entered number'}}
- - View Batch + | + + {{ job.job_id[:8] if job.job_id else 'Manually entered number' }} + | -- {{ job.template_name }} - | -+ | {{ job.template_name }} | +Sent on {{ (job.processing_finished if job.processing_finished else job.processing_started if job.processing_started else job.created_at)|format_datetime_table }} | -- {{ job.created_by.name }} - | -- {{ job.notification_count}} - | -- {% if job.time_left != "Data no longer available" %} - Download - {{ job.time_left }} - {% elif job %} - {{ job.time_left }} - {% endif %} - | +{{ job.created_by.name }} | +{{ job.notification_count }} |
Note: Report data is only available for 7 days after your message has been sent
+