Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
support: Add a link to remote server's installation analytics page.
Lauryn Menard92ebeb7baa48
diff --git a/analytics/tests/test_support_views.py b/analytics/tests/test_support_views.pyindex c57a93946ab..faa13b9f074 100644--- a/analytics/tests/test_support_views.py+++ b/analytics/tests/test_support_views.py@@ -147,7 +147,7 @@ class TestRemoteServerSupportEndpoint(ZulipTestCase):) -> None:self.assert_in_success_response([- f"<h3>{hostname}</h3>",+ f"<h3>{hostname} <a",f"<b>Contact email</b>: admin@{hostname}","<b>Date created</b>:","<b>UUID</b>:",@@ -158,7 +158,7 @@ class TestRemoteServerSupportEndpoint(ZulipTestCase):],html_response,)- self.assert_not_in_success_response(["<h3>zulip-0.example.com</h3>"], result)+ self.assert_not_in_success_response(["<h3>zulip-0.example.com"], result)def assert_realm_details_in_response(html_response: "TestHttpResponse", name: str, host: str@@ -173,12 +173,12 @@ class TestRemoteServerSupportEndpoint(ZulipTestCase):],html_response,)- self.assert_not_in_success_response(["<h3>zulip-1.example.com</h3>"], result)+ self.assert_not_in_success_response(["<h3>zulip-1.example.com"], result)def check_remote_server_with_no_realms(result: "TestHttpResponse") -> None:assert_server_details_in_response(result, "zulip-1.example.com")self.assert_not_in_success_response(- ["<h3>zulip-2.example.com</h3>", "<b>Remote realm host:</b>"], result+ ["<h3>zulip-2.example.com", "<b>Remote realm host:</b>"], result)self.assert_in_success_response(["<b>Has remote realms</b>: False<br />"], result)@@ -259,10 +259,10 @@ class TestRemoteServerSupportEndpoint(ZulipTestCase):server = 0result = self.client_get("/activity/remote/support", {"q": "example.com"})- self.assert_not_in_success_response([f"<h3>zulip-{server}.example.com</h3>"], result)+ self.assert_not_in_success_response([f"<h3>zulip-{server}.example.com"], result)for i in range(5):if i != server:- self.assert_in_success_response([f"<h3>zulip-{i}.example.com</h3>"], result)+ self.assert_in_success_response([f"<h3>zulip-{i}.example.com <a"], result)server = 1result = self.client_get("/activity/remote/support", {"q": f"zulip-{server}.example.com"})diff --git a/analytics/views/support.py b/analytics/views/support.pyindex 207ed36d4f9..ab1f561ea0b 100644--- a/analytics/views/support.py+++ b/analytics/views/support.py@@ -15,6 +15,7 @@ from django.utils.timesince import timesincefrom django.utils.timezone import now as timezone_nowfrom django.utils.translation import gettext as _+from analytics.views.activity_common import remote_installation_stats_linkfrom confirmation.models import Confirmation, confirmation_urlfrom confirmation.settings import STATUS_USEDfrom zerver.actions.create_realm import do_change_realm_subdomain@@ -541,6 +542,7 @@ def remote_servers_support(context["get_org_type_display_name"] = get_org_type_display_namecontext["format_discount"] = format_discount_percentagecontext["dollar_amount"] = cents_to_dollar_string+ context["server_analytics_link"] = remote_installation_stats_linkcontext["SPONSORED_PLAN_TYPE"] = RemoteZulipServer.PLAN_TYPE_COMMUNITYreturn render(diff --git a/templates/analytics/remote_server_support.html b/templates/analytics/remote_server_support.htmlindex a9494a901ba..170a11b5c43 100644--- a/templates/analytics/remote_server_support.html+++ b/templates/analytics/remote_server_support.html@@ -37,7 +37,7 @@<div class="support-query-result"><div class="remote-server-information"><span class="label">remote server</span>- <h3>{{ remote_server.hostname }}</h3>+ <h3>{{ remote_server.hostname }} {{ server_analytics_link(remote_server.id ) }}</h3>{% if remote_server.plan_type == SPONSORED_PLAN_TYPE %}<h4>On 100% sponsored Zulip Community plan 🎉</h4>{% endif %}