From 14c4f3a72618171d155ebdf23b40f811ffcd2e44 Mon Sep 17 00:00:00 2001 From: Beverly Nguyen Date: Tue, 14 Oct 2025 12:59:49 -0700 Subject: [PATCH] we only need current financial year --- .ds.baseline | 4 +- app/config.py | 8 +++- app/main/views/organizations.py | 8 +--- .../organizations/organization/index.html | 42 ++++++++----------- 4 files changed, 27 insertions(+), 35 deletions(-) diff --git a/.ds.baseline b/.ds.baseline index 3a60a1545..0c5680c97 100644 --- a/.ds.baseline +++ b/.ds.baseline @@ -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" } diff --git a/app/config.py b/app/config.py index f691f7a7a..8135ec45e 100644 --- a/app/config.py +++ b/app/config.py @@ -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") diff --git a/app/main/views/organizations.py b/app/main/views/organizations.py index ac332f765..525fe72a9 100644 --- a/app/main/views/organizations.py +++ b/app/main/views/organizations.py @@ -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, diff --git a/app/templates/views/organizations/organization/index.html b/app/templates/views/organizations/organization/index.html index 731ddfa44..baabccb73 100644 --- a/app/templates/views/organizations/organization/index.html +++ b/app/templates/views/organizations/organization/index.html @@ -9,37 +9,14 @@ {{ page_header('Organization Dashboard', size='large') }} -

Overall {{ selected_year }} Total Message Usage

-

Combined totals across all services in {{ current_org.name }}

- -
- -
-
-

Total messages

+

Overall {{ selected_year }} Total Message Allowance

+
+

What is a service?

+

+ 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: +

+
    +
  1. Create and edit message templates
  2. +
  3. Send messages to recipients
  4. +
  5. View message status and history
  6. +
  7. Manage team members and permissions
  8. +
  9. Track usage and delivery statistics
  10. +
  11. If you work for multiple organizations, you may belong to multiple services and can switch between them.
  12. +
+
+ {% endblock %}