we only need current financial year

This commit is contained in:
Beverly Nguyen
2025-10-14 12:59:49 -07:00
parent f4d326738c
commit 14c4f3a726
4 changed files with 27 additions and 35 deletions

View File

@@ -161,7 +161,7 @@
"filename": "app/config.py",
"hashed_secret": "577a4c667e4af8682ca431857214b3a920883efc",
"is_verified": false,
"line_number": 123,
"line_number": 127,
"is_secret": false
}
],
@@ -634,5 +634,5 @@
}
]
},
"generated_at": "2025-10-14T19:37:07Z"
"generated_at": "2025-10-14T19:59:45Z"
}

View File

@@ -78,7 +78,9 @@ class Config(object):
# TODO: reassign this
NOTIFY_SERVICE_ID = "d6aa2c68-a2d9-4437-ab19-3ae8eb202553"
ORGANIZATION_DASHBOARD_ENABLED = getenv("ORGANIZATION_DASHBOARD_ENABLED", "False") == "True"
ORGANIZATION_DASHBOARD_ENABLED = (
getenv("ORGANIZATION_DASHBOARD_ENABLED", "False") == "True"
)
NOTIFY_BILLING_DETAILS = json.loads(getenv("NOTIFY_BILLING_DETAILS") or "null") or {
"account_number": "98765432",
@@ -112,7 +114,9 @@ class Development(Config):
NOTIFY_LOG_LEVEL = "DEBUG"
# Feature Flags - Enable in development for testing
ORGANIZATION_DASHBOARD_ENABLED = getenv("ORGANIZATION_DASHBOARD_ENABLED", "True") == "True"
ORGANIZATION_DASHBOARD_ENABLED = (
getenv("ORGANIZATION_DASHBOARD_ENABLED", "True") == "True"
)
# Buckets
CSV_UPLOAD_BUCKET = _s3_credentials_from_env("CSV")

View File

@@ -73,7 +73,8 @@ def organization_dashboard(org_id):
if not current_app.config.get("ORGANIZATION_DASHBOARD_ENABLED", False):
return redirect(url_for(".organization_usage", org_id=org_id))
year, current_financial_year = requested_and_current_financial_year(request)
year = requested_and_current_financial_year(request)[0]
services = current_organization.services_and_usage(financial_year=year)["services"]
total_messages_sent = 0
@@ -88,11 +89,6 @@ def organization_dashboard(org_id):
return render_template(
"views/organizations/organization/index.html",
years=get_tuples_of_financial_years(
partial(url_for, ".organization_dashboard", org_id=current_organization.id),
start=current_financial_year - 2,
end=current_financial_year,
),
selected_year=year,
messages_sent=total_messages_sent,
messages_remaining=total_messages_remaining,

View File

@@ -9,37 +9,14 @@
{{ page_header('Organization Dashboard', size='large') }}
<h2 class="font-heading-md">Overall {{ selected_year }} Total Message Usage</h2>
<p class="usa-body">Combined totals across all services in {{ current_org.name }}</p>
<div class="margin-bottom-3">
<nav aria-label="Financial year selector">
<ul class="usa-list usa-list--unstyled display-flex flex-gap-05 padding-0 margin-0">
{% for label, year, link, display_text in years %}
<li>
{% if selected_year == year %}
<button class="usa-button" disabled aria-current="page">
{{ display_text }}
</button>
{% else %}
<a href="{{ link }}" class="usa-button" role="button">
{{ display_text }}
</a>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
</div>
<div id="totalMessageChartContainer" data-messages-sent="{{ messages_sent|default(0) }}" data-messages-remaining="{{ messages_remaining|default(0) }}">
<div class="grid-row flex-align-center">
<h2 id="chartTitle" class="margin-right-1">Total messages</h2>
<h2 id="chartTitle" class="margin-right-1 margin-y-0">Overall {{ selected_year }} Total Message Allowance</h2>
<button
type="button"
class="usa-tooltip usa-tooltip__information margin-right-0"
data-position="top"
title="Total messages track the sum of messages across all services in this organization: pending, failed, or delivered"
title="Combined totals across all services in {{ current_org.name }}: pending, failed, or delivered"
>
<span class="usa-sr-only">More information</span>
i
@@ -50,4 +27,19 @@
</div>
<div id="totalMessageTable" class="margin-bottom-3"></div>
<div class="margin-top-5 margin-bottom-5">
<h2 class="font-heading-lg">What is a service?</h2>
<p class="usa-body">
When you join Notify, you're added to a service. This is your organization's workspace for sending text messages and emails. Within your service, you can:
</p>
<ol class="usa-list">
<li>Create and edit message templates</li>
<li>Send messages to recipients</li>
<li>View message status and history</li>
<li>Manage team members and permissions</li>
<li>Track usage and delivery statistics</li>
<li>If you work for multiple organizations, you may belong to multiple services and can switch between them.</li>
</ol>
</div>
{% endblock %}