Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

support: Show the first human user in realm search result.

Vishnu KSab771e4b19c9
diff --git a/analytics/tests/test_views.py b/analytics/tests/test_views.py
index 2a930516ab8..e7d1f795a1c 100644
--- a/analytics/tests/test_views.py
+++ b/analytics/tests/test_views.py
@@ -618,8 +618,11 @@ class TestSupportEndpoint(ZulipTestCase):
def check_zulip_realm_query_result(result: HttpResponse) -> None:
zulip_realm = get_realm("zulip")
+ first_human_user = zulip_realm.get_first_human_user()
+ assert first_human_user is not None
self.assert_in_success_response(
[
+ f"<b>First human user</b>: {first_human_user.delivery_email}\n",
f'<input type="hidden" name="realm_id" value="{zulip_realm.id}"',
"Zulip Dev</h3>",
'<option value="1" selected>Self hosted</option>',
diff --git a/static/styles/portico/activity.css b/static/styles/portico/activity.css
index 4aa2e7c31ef..bd0370c5ff6 100644
--- a/static/styles/portico/activity.css
+++ b/static/styles/portico/activity.css
@@ -69,6 +69,11 @@ tr.admin td:first-child {
top: -2px;
}
+.support-realm-status-form {
+ position: relative;
+ top: 20px;
+}
+
.support-discount-form {
position: relative;
top: -50px;
diff --git a/templates/analytics/realm_details.html b/templates/analytics/realm_details.html
index 6bcb350fdf0..a08137ab6f2 100644
--- a/templates/analytics/realm_details.html
+++ b/templates/analytics/realm_details.html
@@ -19,7 +19,18 @@
<i class="fa fa-copy"></i>
</a>
{% endif %}
-<form method="POST">
+<br>
+{% set first_human_user = realm.get_first_human_user() %}
+{% if first_human_user %}
+<b>First human user</b>: {{ first_human_user.delivery_email }}
+<a title="Copy emails" class="copy-button" data-copytext="{{ first_human_user.delivery_email }}">
+ <i class="fa fa-copy"></i>
+</a>
+{% else %}
+<b>First human user</b>:
+{% endif %}
+
+<form method="POST" class="support-realm-status-form">
<b>Status</b>:<br>
{{ csrf_input }}
<input type="hidden" name="realm_id" value="{{ realm.id }}" />