mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 06:03:12 -04:00
Remove SMS Total Message Limit from Org Dash
This commit is contained in:
@@ -87,18 +87,14 @@ def add_organization():
|
|||||||
return render_template("views/organizations/add-organization.html", form=form)
|
return render_template("views/organizations/add-organization.html", form=form)
|
||||||
|
|
||||||
|
|
||||||
def get_organization_message_allowance(org_id):
|
def get_organization_messages_sent(org_id):
|
||||||
try:
|
try:
|
||||||
message_usage = organizations_client.get_organization_message_usage(org_id)
|
message_usage = organizations_client.get_organization_message_usage(org_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
current_app.logger.error(f"Error fetching organization message usage: {e}")
|
current_app.logger.error(f"Error fetching organization message usage: {e}")
|
||||||
message_usage = {}
|
message_usage = {}
|
||||||
|
|
||||||
return {
|
return message_usage.get("messages_sent", 0)
|
||||||
"messages_sent": message_usage.get("messages_sent", 0),
|
|
||||||
"messages_remaining": message_usage.get("messages_remaining", 0),
|
|
||||||
"total_message_limit": message_usage.get("total_message_limit", 0),
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
def _handle_create_service(org_id):
|
def _handle_create_service(org_id):
|
||||||
@@ -290,7 +286,7 @@ def organization_dashboard(org_id):
|
|||||||
elif action == "delete-service" and service_id:
|
elif action == "delete-service" and service_id:
|
||||||
return _handle_delete_service(org_id, service_id)
|
return _handle_delete_service(org_id, service_id)
|
||||||
|
|
||||||
message_allowance = get_organization_message_allowance(org_id)
|
messages_sent = get_organization_messages_sent(org_id)
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"views/organizations/organization/index.html",
|
"views/organizations/organization/index.html",
|
||||||
@@ -305,7 +301,7 @@ def organization_dashboard(org_id):
|
|||||||
edit_service_data=edit_service_data,
|
edit_service_data=edit_service_data,
|
||||||
new_service_id=session.pop("new_service_id", None),
|
new_service_id=session.pop("new_service_id", None),
|
||||||
updated_service_id=session.pop("updated_service_id", None),
|
updated_service_id=session.pop("updated_service_id", None),
|
||||||
**message_allowance,
|
messages_sent=messages_sent,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,9 +9,9 @@
|
|||||||
|
|
||||||
{{ page_header('Organization Dashboard', size='large') }}
|
{{ page_header('Organization Dashboard', size='large') }}
|
||||||
|
|
||||||
<div id="totalMessageChartContainer" data-messages-sent="{{ messages_sent|default(0) }}" data-messages-remaining="{{ messages_remaining|default(0) }}" data-total-message-limit="{{ total_message_limit|default(0) }}">
|
<div class="margin-bottom-3">
|
||||||
<div class="grid-row flex-align-center">
|
<div class="grid-row flex-align-center">
|
||||||
<h2 id="chartTitle" class="margin-right-1 margin-y-0">Overall {{ selected_year }} Total Message Allowance</h2>
|
<h2 id="chartTitle" class="margin-right-1 margin-y-0">Overall {{ selected_year }} Messages Sent</h2>
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
class="usa-tooltip usa-tooltip__information margin-right-0"
|
class="usa-tooltip usa-tooltip__information margin-right-0"
|
||||||
@@ -22,10 +22,8 @@
|
|||||||
<img src="{{ asset_url('img/usa-icons/info.svg') }}" alt="" class="usa-icon" role="presentation" />
|
<img src="{{ asset_url('img/usa-icons/info.svg') }}" alt="" class="usa-icon" role="presentation" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<svg id="totalMessageChart"></svg>
|
<div class="font-sans-xl text-primary-darker margin-top-1">{{ "{:,}".format(messages_sent|default(0)) }} sent</div>
|
||||||
<div id="message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="totalMessageTable" class="margin-bottom-3"></div>
|
|
||||||
<div class="grid-row margin-bottom-3 maxw-tablet">
|
<div class="grid-row margin-bottom-3 maxw-tablet">
|
||||||
<div class="grid-col-12 tablet:grid-col-6 margin-bottom-2 tablet:margin-bottom-0 tablet:padding-right-1">
|
<div class="grid-col-12 tablet:grid-col-6 margin-bottom-2 tablet:margin-bottom-0 tablet:padding-right-1">
|
||||||
<div class="usa-summary-box height-full" role="region">
|
<div class="usa-summary-box height-full" role="region">
|
||||||
|
|||||||
Reference in New Issue
Block a user