Skip to content

Commit

Permalink
updated width when sms is zero
Browse files Browse the repository at this point in the history
  • Loading branch information
heyitsmebev committed Aug 22, 2024
1 parent 5a3f3e5 commit b40cb5a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/totalMessagesChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion app/templates/views/activity/all-activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ <h2 class="margin-top-4 margin-bottom-1">Sent jobs</h2>
{% endfor %}
{% else %}
<tr class="table-row">
<td class="table-empty-message" colspan="10">No batched job messages found (messages are kept for {{ service_data_retention_days }} days).</td>
<td class="table-empty-message" colspan="10">No messages found</td>
</tr>
{% endif %}
</tbody>
Expand Down
4 changes: 1 addition & 3 deletions app/templates/views/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ <h2 id="chartTitle">Total messages</h2>
</div>
<div id="totalMessageTable" class="margin-0"></div>

<h2 class="line-height-sans-2 margin-bottom-0 margin-top-4">
Activity snapshot
</h2>
<h2 class="line-height-sans-2 margin-bottom-0 margin-top-4">Recent Activity</h2>
<div id="activityChartContainer">
<form class="usa-form">
<label class="usa-label" for="options">Account</label>
Expand Down

0 comments on commit b40cb5a

Please sign in to comment.