diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3e3ce01d3..7df8ef7f0 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,8 +9,16 @@ updates: directory: "/" # Location of package manifests schedule: interval: "daily" + assignees: + - "A-Shumway42" + reviewers: + - "A-Shumway42" - package-ecosystem: "npm" directory: "/" schedule: interval: "daily" versioning-strategy: increase + assignees: + - "alexjanousekGSA" + reviewers: + - "alexjanousekGSA" diff --git a/app/assets/javascripts/activityChart.js b/app/assets/javascripts/activityChart.js index d16d23827..da9c65e38 100644 --- a/app/assets/javascripts/activityChart.js +++ b/app/assets/javascripts/activityChart.js @@ -201,6 +201,8 @@ deliveredData = []; failedData = []; + let totalMessages = 0; + for (var dateString in data) { if (data.hasOwnProperty(dateString)) { const dateParts = dateString.split('-'); @@ -209,11 +211,38 @@ labels.push(formattedDate); deliveredData.push(data[dateString].sms.delivered); failedData.push(data[dateString].sms.failure); + + // Calculate the total number of messages + totalMessages += data[dateString].sms.delivered + data[dateString].sms.failure; } } - createChart('#weeklyChart', labels, deliveredData, failedData); - createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData); + // Check if there are no messages sent + const subTitle = document.querySelector(`#activityChartContainer .chart-subtitle`); + if (totalMessages === 0) { + // Remove existing chart and render the alert message + d3.select('#weeklyChart').selectAll('*').remove(); + d3.select('#weeklyChart') + .append('div') + .html(` +
+
+

+ No messages sent in the last 7 days +

+
+
+ `); + // Hide the subtitle + if (subTitle) { + subTitle.style.display = 'none'; + } + } else { + // If there are messages, create the chart and table + createChart('#weeklyChart', labels, deliveredData, failedData); + createTable('weeklyTable', 'activityChart', labels, deliveredData, failedData); + } + return data; }) .catch(error => console.error('Error fetching daily stats:', error)); diff --git a/app/assets/sass/uswds/_data-visualization.scss b/app/assets/sass/uswds/_data-visualization.scss index 48c5f1256..e479334a3 100644 --- a/app/assets/sass/uswds/_data-visualization.scss +++ b/app/assets/sass/uswds/_data-visualization.scss @@ -9,6 +9,9 @@ $failed: color('gray-cool-20'); &.usage { height: units(4); } + svg { + overflow: visible; + } } #totalMessageChartContainer { diff --git a/app/templates/views/activity/all-activity.html b/app/templates/views/activity/all-activity.html index bd0843aa4..d952eb3a1 100644 --- a/app/templates/views/activity/all-activity.html +++ b/app/templates/views/activity/all-activity.html @@ -110,7 +110,7 @@ {% if job.time_left != "Data no longer available" %} File Download Icon - {% elif job %} + {% else %} N/A {% endif %} @@ -122,7 +122,7 @@ No batched job messages found (messages are kept for {{ service_data_retention_days }} days). - {% endif %} + {% endif %}
diff --git a/poetry.lock b/poetry.lock index 79e925e07..52bab1a90 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2433,7 +2433,6 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, - {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"},