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

Remove the FF_BOUNCE_RATE_V15 feature flag #1659

Merged
merged 2 commits into from
Sep 12, 2023
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
1 change: 0 additions & 1 deletion app/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class Config(object):

# FEATURE FLAGS
FF_SALESFORCE_CONTACT = env.bool("FF_SALESFORCE_CONTACT", False)
FF_BOUNCE_RATE_V15 = env.bool("FF_BOUNCE_RATE_V15", False)
FF_SALESFORCE_CONTACT = env.bool("FF_SALESFORCE_CONTACT", False)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate line:

Suggested change
FF_SALESFORCE_CONTACT = env.bool("FF_SALESFORCE_CONTACT", False)


@classmethod
Expand Down
15 changes: 3 additions & 12 deletions app/main/views/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ def redirect_service_dashboard(service_id):
@user_has_permissions("view_activity", "send_messages")
def problem_emails(service_id):
# get the daily stats
dashboard_totals_daily, highest_notification_count_daily, all_statistics_daily = _get_daily_stats(service_id)
bounce_rate_data = (
get_bounce_rate_data_from_redis(service_id)
if current_app.config["FF_BOUNCE_RATE_V15"]
else calculate_bounce_rate(all_statistics_daily, dashboard_totals_daily)
)
bounce_rate_data = get_bounce_rate_data_from_redis(service_id)

problem_one_off_notifications_7days = notification_api_client.get_notifications_for_service(
service_id=service_id,
Expand Down Expand Up @@ -303,11 +298,7 @@ def get_dashboard_partials(service_id):
column_width, max_notifiction_count = get_column_properties(number_of_columns=2)
stats_weekly = aggregate_notifications_stats(all_statistics_weekly)
dashboard_totals_weekly = (get_dashboard_totals(stats_weekly),)
bounce_rate_data = (
get_bounce_rate_data_from_redis(service_id)
if current_app.config["FF_BOUNCE_RATE_V15"]
else calculate_bounce_rate(all_statistics_daily, dashboard_totals_daily)
)
bounce_rate_data = get_bounce_rate_data_from_redis(service_id)

return {
"upcoming": render_template("views/dashboard/_upcoming.html", scheduled_jobs=scheduled_jobs),
Expand All @@ -320,7 +311,7 @@ def get_dashboard_partials(service_id):
"weekly_totals": render_template(
"views/dashboard/_totals.html",
service_id=service_id,
statistics=dashboard_totals_weekly[0] if current_app.config["FF_BOUNCE_RATE_V15"] else dashboard_totals_daily[0],
statistics=dashboard_totals_weekly[0],
column_width=column_width,
smaller_font_size=(highest_notification_count_daily > max_notifiction_count),
bounce_rate=bounce_rate_data,
Expand Down
74 changes: 17 additions & 57 deletions app/templates/views/dashboard/_totals.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
{% set address_plural = _('addresses') %}
<div class="ajax-block-container">
<h2 class="heading-medium mt-8">
{% if config["FF_BOUNCE_RATE_V15"] %}
{{ _("Sent in the last week") }}
{% else %}
{{ _("Email in the last 24 hours") }}
{% endif %}
{{ _("Sent in the last week") }}
</h2>
<div class="grid-row contain-floats">
<div id="total-email" class="{{column_width}}">
Expand All @@ -29,42 +25,23 @@ <h2 class="heading-medium mt-8">
smaller=smaller_font_size
) }}
</div>
{% if config["FF_BOUNCE_RATE_V15"] %}
<div id="total-sms" class="{{column_width}}">
{{ big_number_with_status(
statistics['sms']['requested'],
message_count_label(statistics['sms']['requested'], 'sms', suffix=sent_single, suffix_plural=sent_plural),
statistics['sms']['failed'],
statistics['sms']['failed_percentage'],
statistics['sms']['show_warning'],
failure_link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='failed') if statistics['sms']['failed'] > 0 else None,
link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='sending,delivered,failed'),
smaller=smaller_font_size
) }}
</div>
{% else %}
<div id="problem-email-addresses" class="{{column_width}}">
{{ big_number_review_emails_with_status(
number=bounce_rate["bounce_total"],
label=problem_email_label(bounce_rate["bounce_total"]),
problem_percentage=bounce_rate["bounce_percentage_display"],
bounce_status=bounce_rate["bounce_status"],
below_volume_threshold=bounce_rate["below_volume_threshold"],
failure_link=url_for('.problem_emails', service_id=service_id) if bounce_rate["bounce_percentage"] > 0 else None,
link=None,
smaller=smaller_font_size,
failure_link_label=_("Review email addresses")
) }}
</div>
{% endif %}
<div id="total-sms" class="{{column_width}}">
{{ big_number_with_status(
statistics['sms']['requested'],
message_count_label(statistics['sms']['requested'], 'sms', suffix=sent_single, suffix_plural=sent_plural),
statistics['sms']['failed'],
statistics['sms']['failed_percentage'],
statistics['sms']['show_warning'],
failure_link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='failed') if statistics['sms']['failed'] > 0 else None,
link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='sending,delivered,failed'),
smaller=smaller_font_size
) }}
</div>
</div>
{% if config["FF_BOUNCE_RATE_V15"] %}
{{ show_more(
url_for('.monthly', service_id=current_service.id),
_('See all messages sent')
) }}
{% endif %}
{% if config["FF_BOUNCE_RATE_V15"] %}
{{ show_more(
url_for('.monthly', service_id=current_service.id),
_('See all messages sent')
) }}
<div>
<h2 class="heading-medium mt-8">
{{ _('Problem email addresses') }}
Expand Down Expand Up @@ -93,22 +70,5 @@ <h2 class="heading-medium mt-8">
</div>
</div>
</div>
{% else %}
<div id="total-sms">
<h2 class="heading-medium mt-8">
{{ _('Text messages in the last 24 hours') }}
</h2>
{{ big_number_with_status(
statistics['sms']['requested'],
message_count_label(statistics['sms']['requested'], 'sms', suffix=sent_single, suffix_plural=sent_plural),
statistics['sms']['failed'],
statistics['sms']['failed_percentage'],
statistics['sms']['show_warning'],
failure_link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='failed'),
link=url_for(".view_notifications", service_id=service_id, message_type='sms', status='sending,delivered,failed'),
smaller=smaller_font_size
) }}
</div>
{% endif %}
</div>
</div>
7 changes: 0 additions & 7 deletions app/templates/views/dashboard/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ <h2 class="heading-medium mt-8">{{ _("Scheduled sends") }}</h2>

{{ ajax_block(partials, updates_url, 'weekly_totals', interval=5) }}

{% if not config["FF_BOUNCE_RATE_V15"] %}
{{ show_more(
url_for('.monthly', service_id=current_service.id),
_('See all messages sent')
) }}
{% endif %}

{% if partials['has_template_statistics'] %}
<h2 class="heading-medium mt-8">{{ _("Templates used") }}</h2>
{{ ajax_block(partials, updates_url, 'template-statistics', interval=5) }}
Expand Down
Loading