Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Production Deploy 8/19/2024 #1879

Merged
merged 21 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
33 changes: 31 additions & 2 deletions app/assets/javascripts/activityChart.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@
deliveredData = [];
failedData = [];

let totalMessages = 0;

for (var dateString in data) {
if (data.hasOwnProperty(dateString)) {
const dateParts = dateString.split('-');
Expand All @@ -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(`
<div class="usa-alert usa-alert--info usa-alert--slim">
<div class="usa-alert__body">
<p class="usa-alert__text">
No messages sent in the last 7 days
</p>
</div>
</div>
`);
// 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));
Expand Down
3 changes: 3 additions & 0 deletions app/assets/sass/uswds/_data-visualization.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ $failed: color('gray-cool-20');
&.usage {
height: units(4);
}
svg {
overflow: visible;
}
}

#totalMessageChartContainer {
Expand Down
4 changes: 2 additions & 2 deletions app/templates/views/activity/all-activity.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h2 class="margin-top-4 margin-bottom-1">Sent jobs</h2>
<td class="table-field report">
{% if job.time_left != "Data no longer available" %}
<a href="{{ job.download_link }}"><img src="{{ url_for('static', filename='img/material-icons/file_download.svg') }}" alt="File Download Icon"></a>
{% elif job %}
{% else %}
<span>N/A</span>
{% endif %}
</td>
Expand All @@ -122,7 +122,7 @@ <h2 class="margin-top-4 margin-bottom-1">Sent jobs</h2>
<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>
</tr>
{% endif %}
{% endif %}
</tbody>
</table>
<div class="usa-sr-only usa-table__announcement-region" aria-live="polite"></div>
Expand Down
1 change: 0 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading