Updated activity chart to include additional day (#2862)

This commit is contained in:
Alex Janousek
2025-08-25 17:45:14 -04:00
committed by GitHub
parent 37a86ecb31
commit 9e2dc55500
8 changed files with 20 additions and 18 deletions

View File

@@ -421,7 +421,7 @@ def redact_mobile_number(mobile_number, spacing=""):
return "".join(mobile_number_list)
def get_time_left(created_at, service_data_retention_days=7):
def get_time_left(created_at, service_data_retention_days=8):
return ago.human(
(datetime.now(timezone.utc))
- (

View File

@@ -125,7 +125,7 @@ def get_filtered_jobs(service_id, page):
@main.route("/activity/services/<uuid:service_id>")
@user_has_permissions(ServicePermission.VIEW_ACTIVITY)
def all_jobs_activity(service_id):
service_data_retention_days = 7
service_data_retention_days = 8
page = get_page_from_request()
jobs = get_filtered_jobs(service_id, page)

View File

@@ -41,7 +41,7 @@ def service_dashboard(service_id):
return redirect(url_for("main.choose_template", service_id=service_id))
job_response = job_api_client.get_jobs(service_id)["data"]
service_data_retention_days = 7
service_data_retention_days = 8
active_jobs = [
job for job in job_response if job["job_status"] != JobStatus.CANCELLED
@@ -55,7 +55,7 @@ def service_dashboard(service_id):
messages_remaining = total_messages.get("messages_remaining", 0)
messages_sent = total_messages.get("messages_sent", 0)
all_statistics = template_statistics_client.get_template_statistics_for_service(
service_id, limit_days=7
service_id, limit_days=8
)
template_statistics = aggregate_template_usage(all_statistics)
return render_template(
@@ -361,7 +361,7 @@ def get_stats_date_range():
current_financial_year = get_current_financial_year()
current_month = get_current_month_for_financial_year(current_financial_year)
start_date = datetime.now().strftime("%Y-%m-%d")
days = 7
days = 8
return {
"current_financial_year": current_financial_year,
"current_month": current_month,

View File

@@ -10,7 +10,7 @@
</form>
<div id="activityChart">
<div class="chart-header">
<div class="chart-subtitle">{{ current_service.name }} - last 7 days</div>
<div class="chart-subtitle">{{ current_service.name }}</div>
<div class="chart-legend" role="region" aria-label="Legend"></div>
</div>
<div class="chart-container" id="weeklyChart"></div>