analytics-activity: Remove link with realm owners emails.

Note that a link to copy these emails to the clipboard is still
availabe on the realm's support page.
This commit is contained in:
Lauryn Menard 2022-12-01 16:45:58 +01:00 committed by Tim Abbott
parent a59d6d6581
commit 90d0531e20
3 changed files with 2 additions and 18 deletions

View File

@ -32,7 +32,7 @@ class ActivityTest(ZulipTestCase):
user_profile.save(update_fields=["is_staff"])
flush_per_request_caches()
with self.assert_database_query_count(19):
with self.assert_database_query_count(18):
result = self.client_get("/activity")
self.assertEqual(result.status_code, 200)

View File

@ -26,7 +26,7 @@ from analytics.views.support import get_plan_name
from zerver.decorator import require_server_admin
from zerver.lib.request import has_request_variables
from zerver.lib.timestamp import timestamp_to_datetime
from zerver.models import Realm, UserActivityInterval, UserProfile, get_org_type_display_name
from zerver.models import Realm, UserActivityInterval, get_org_type_display_name
if settings.BILLING_ENABLED:
from corporate.lib.stripe import (
@ -187,19 +187,10 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
rows = dictfetchall(cursor)
cursor.close()
# Fetch all the realm administrator users
realm_owners: Dict[str, List[str]] = defaultdict(list)
for up in UserProfile.objects.select_related("realm").filter(
role=UserProfile.ROLE_REALM_OWNER,
is_active=True,
):
realm_owners[up.realm.string_id].append(up.delivery_email)
for row in rows:
row["date_created_day"] = row["date_created"].strftime("%Y-%m-%d")
row["age_days"] = int((now - row["date_created"]).total_seconds() / 86400)
row["is_new"] = row["age_days"] < 12 * 7
row["realm_owner_emails"] = ", ".join(realm_owners[row["string_id"]])
# get messages sent per day
counts = get_realm_day_counts()
@ -283,7 +274,6 @@ def realm_summary_table(realm_minutes: Dict[str, float]) -> str:
arr=total_arr,
stats_link="",
date_created_day="",
realm_owner_emails="",
dau_count=total_dau_count,
user_profile_count=total_user_profile_count,
bot_count=total_bot_count,

View File

@ -9,7 +9,6 @@
<li><strong>active (user)</strong> - sent a message, or advanced the pointer (reading messages doesn't count unless advances the pointer)</li>
<li><strong>ARR</strong> (Annual recurring revenue) - the number of users they are paying for * annual price/user.</li>
<li><strong>Rate</strong> - % of full price the customer pays, or will pay, if on a paid plan.</li>
<li><strong><th><i class="fa fa-envelope"></i></th></strong> - copies realm admin emails to clipboard</li>
<li><strong>DAU</strong> (daily active users) - users active in last 24hr</li>
<li><strong>WAU</strong> (weekly active users) - users active in last 7 * 24hr</li>
<li><strong>DAT</strong> (daily active time) - total user-activity time in last 24hr</li>
@ -80,11 +79,6 @@
{% endif %}
<td>
{% if not loop.first %}
<a class="envelope-link" data-admin-emails="{{ row.realm_owner_emails }}">
<i class="fa fa-envelope"></i>
</a>
{% endif %}
{{ row.stats_link }}
</td>