mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
support: Show scrub realm button only when realm is deactivated.
This commit is contained in:
committed by
Tim Abbott
parent
696bdf0b17
commit
405dc6131f
@@ -839,11 +839,10 @@ class TestSupportEndpoint(ZulipTestCase):
|
||||
'<option value="active" selected>Active</option>',
|
||||
'<option value="deactivated" >Deactivated</option>',
|
||||
f'<option value="{zulip_realm.org_type}" selected>',
|
||||
'scrub-realm-button">',
|
||||
'data-string-id="zulip"',
|
||||
],
|
||||
result,
|
||||
)
|
||||
self.assert_not_in_success_response(["scrub-realm-button"], result)
|
||||
|
||||
def check_lear_realm_query_result(result: "TestHttpResponse") -> None:
|
||||
self.assert_in_success_response(
|
||||
@@ -856,8 +855,6 @@ class TestSupportEndpoint(ZulipTestCase):
|
||||
'input type="number" name="annual_discounted_price" value="None"',
|
||||
'<option value="active" selected>Active</option>',
|
||||
'<option value="deactivated" >Deactivated</option>',
|
||||
'scrub-realm-button">',
|
||||
'data-string-id="lear"',
|
||||
"<b>Plan name</b>: Zulip Cloud Standard",
|
||||
"<b>Status</b>: Active",
|
||||
"<b>Billing schedule</b>: Annual",
|
||||
@@ -870,6 +867,7 @@ class TestSupportEndpoint(ZulipTestCase):
|
||||
],
|
||||
result,
|
||||
)
|
||||
self.assert_not_in_success_response(["scrub-realm-button"], result)
|
||||
|
||||
def check_preregistration_user_query_result(
|
||||
result: "TestHttpResponse", email: str, invite: bool = False
|
||||
@@ -1827,6 +1825,10 @@ class TestSupportEndpoint(ZulipTestCase):
|
||||
iago = self.example_user("iago")
|
||||
self.login_user(iago)
|
||||
|
||||
# Confirm scrub realm button is shown for deactivated realms.
|
||||
result = self.client_get("/activity/support", {"q": "limited"})
|
||||
self.assert_in_success_response(["scrub-realm-button"], result)
|
||||
|
||||
result = self.client_post(
|
||||
"/activity/support",
|
||||
{"realm_id": f"{limited_realm.id}", "approve_sponsorship": "true"},
|
||||
|
@@ -180,7 +180,7 @@
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if realm.deactivated %}
|
||||
<form method="POST" class="scrub-realm-form support-form">
|
||||
<h3>❌ Scrub realm</h3>
|
||||
{{ csrf_input }}
|
||||
@@ -188,5 +188,6 @@
|
||||
<input type="hidden" name="scrub_realm" value="true" />
|
||||
<button data-string-id="{{realm.string_id}}" class="scrub-realm-button">Scrub realm (danger)</button>
|
||||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user