From b40cb5a9ad971d8d42c9b4135254a21972437cea Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Thu, 22 Aug 2024 15:46:17 -0700 Subject: [PATCH 1/4] updated width when sms is zero --- app/assets/javascripts/totalMessagesChart.js | 2 +- app/templates/views/activity/all-activity.html | 2 +- app/templates/views/dashboard/dashboard.html | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/totalMessagesChart.js b/app/assets/javascripts/totalMessagesChart.js index a3c10d7a3..68c9fd8f9 100644 --- a/app/assets/javascripts/totalMessagesChart.js +++ b/app/assets/javascripts/totalMessagesChart.js @@ -14,7 +14,7 @@ document.getElementById('message').innerText = `${sms_sent.toLocaleString()} sent / ${sms_remaining_messages.toLocaleString()} remaining`; // Calculate minimum width for "Messages Sent" as 1% of the total chart width - var minSentPercentage = 0.02; // Minimum width as a percentage of total messages (1% in this case) + var minSentPercentage = (sms_sent === 0) ? 0 : 0.02; var minSentValue = totalMessages * minSentPercentage; var displaySent = Math.max(sms_sent, minSentValue); var displayRemaining = totalMessages - displaySent; diff --git a/app/templates/views/activity/all-activity.html b/app/templates/views/activity/all-activity.html index d952eb3a1..5b5d8a665 100644 --- a/app/templates/views/activity/all-activity.html +++ b/app/templates/views/activity/all-activity.html @@ -120,7 +120,7 @@ {% endfor %} {% else %} - No batched job messages found (messages are kept for {{ service_data_retention_days }} days). + No messages found {% endif %} diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index 2254c3c78..d5510b790 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -29,9 +29,7 @@
-

- Activity snapshot -

+

Recent Activity

From 1768a4bbd9719151fb6ba2a73b4f44b2e6c40dad Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Fri, 23 Aug 2024 18:31:05 -0700 Subject: [PATCH 2/4] changed scale y --- app/assets/javascripts/activityChart.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/activityChart.js b/app/assets/javascripts/activityChart.js index da9c65e38..19d8bcc49 100644 --- a/app/assets/javascripts/activityChart.js +++ b/app/assets/javascripts/activityChart.js @@ -64,7 +64,7 @@ .padding(0.1); // Adjust the y-axis domain to add some space above the tallest bar const maxY = d3.max(deliveredData.map((d, i) => d + (failedData[i] || 0))); - const y = d3.scaleLinear() + const y = d3.scaleSqrt() .domain([0, maxY + 2]) // Add 2 units of space at the top .nice() .range([height, 0]); From ca7c2e0c9332a98e6dfef8bcc6c8e1edffd7df44 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Fri, 23 Aug 2024 18:36:16 -0700 Subject: [PATCH 3/4] captialization --- app/templates/views/dashboard/dashboard.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/views/dashboard/dashboard.html b/app/templates/views/dashboard/dashboard.html index d5510b790..3ea625bb3 100644 --- a/app/templates/views/dashboard/dashboard.html +++ b/app/templates/views/dashboard/dashboard.html @@ -29,7 +29,7 @@
-

Recent Activity

+

Recent activity

From bb106c04f1edef0e8b38ecdceb938d8294a6edda Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Tue, 27 Aug 2024 12:19:55 -0700 Subject: [PATCH 4/4] fixed testing --- tests/app/main/views/test_jobs_activity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/app/main/views/test_jobs_activity.py b/tests/app/main/views/test_jobs_activity.py index cfc61b96e..498ff048e 100644 --- a/tests/app/main/views/test_jobs_activity.py +++ b/tests/app/main/views/test_jobs_activity.py @@ -146,7 +146,7 @@ def test_all_activity_no_jobs(client_request, mocker): no_jobs_message_td = page.find("td", class_="table-empty-message") assert no_jobs_message_td is not None, "No jobs message not found in the response" - expected_message = "No batched job messages found (messages are kept for 7 days)." + expected_message = "No messages found" actual_message = no_jobs_message_td.get_text(strip=True) assert (