mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	support: Rename "downgrade plan" to "modify plan".
Just a naming change to facilitate adding more options to that <select> - mainly, an option to upgrade the plan to Plus.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							10adb6c183
						
					
				
				
					commit
					1a15449e16
				
			@@ -627,7 +627,7 @@ class TestSupportEndpoint(ZulipTestCase):
 | 
				
			|||||||
                "/activity/support",
 | 
					                "/activity/support",
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "realm_id": f"{iago.realm_id}",
 | 
					                    "realm_id": f"{iago.realm_id}",
 | 
				
			||||||
                    "downgrade_method": "downgrade_at_billing_cycle_end",
 | 
					                    "modify_plan": "downgrade_at_billing_cycle_end",
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            m.assert_called_once_with(get_realm("zulip"))
 | 
					            m.assert_called_once_with(get_realm("zulip"))
 | 
				
			||||||
@@ -642,7 +642,7 @@ class TestSupportEndpoint(ZulipTestCase):
 | 
				
			|||||||
                "/activity/support",
 | 
					                "/activity/support",
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    "realm_id": f"{iago.realm_id}",
 | 
					                    "realm_id": f"{iago.realm_id}",
 | 
				
			||||||
                    "downgrade_method": "downgrade_now_without_additional_licenses",
 | 
					                    "modify_plan": "downgrade_now_without_additional_licenses",
 | 
				
			||||||
                },
 | 
					                },
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            m.assert_called_once_with(get_realm("zulip"))
 | 
					            m.assert_called_once_with(get_realm("zulip"))
 | 
				
			||||||
@@ -658,7 +658,7 @@ class TestSupportEndpoint(ZulipTestCase):
 | 
				
			|||||||
                    "/activity/support",
 | 
					                    "/activity/support",
 | 
				
			||||||
                    {
 | 
					                    {
 | 
				
			||||||
                        "realm_id": f"{iago.realm_id}",
 | 
					                        "realm_id": f"{iago.realm_id}",
 | 
				
			||||||
                        "downgrade_method": "downgrade_now_void_open_invoices",
 | 
					                        "modify_plan": "downgrade_now_void_open_invoices",
 | 
				
			||||||
                    },
 | 
					                    },
 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                m1.assert_called_once_with(get_realm("zulip"))
 | 
					                m1.assert_called_once_with(get_realm("zulip"))
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -121,7 +121,7 @@ def get_confirmations(
 | 
				
			|||||||
    return confirmation_dicts
 | 
					    return confirmation_dicts
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
VALID_DOWNGRADE_METHODS = [
 | 
					VALID_MODIFY_PLAN_METHODS = [
 | 
				
			||||||
    "downgrade_at_billing_cycle_end",
 | 
					    "downgrade_at_billing_cycle_end",
 | 
				
			||||||
    "downgrade_now_without_additional_licenses",
 | 
					    "downgrade_now_without_additional_licenses",
 | 
				
			||||||
    "downgrade_now_void_open_invoices",
 | 
					    "downgrade_now_void_open_invoices",
 | 
				
			||||||
@@ -160,8 +160,8 @@ def support(
 | 
				
			|||||||
    ),
 | 
					    ),
 | 
				
			||||||
    sponsorship_pending: Optional[bool] = REQ(default=None, json_validator=check_bool),
 | 
					    sponsorship_pending: Optional[bool] = REQ(default=None, json_validator=check_bool),
 | 
				
			||||||
    approve_sponsorship: bool = REQ(default=False, json_validator=check_bool),
 | 
					    approve_sponsorship: bool = REQ(default=False, json_validator=check_bool),
 | 
				
			||||||
    downgrade_method: Optional[str] = REQ(
 | 
					    modify_plan: Optional[str] = REQ(
 | 
				
			||||||
        default=None, str_validator=check_string_in(VALID_DOWNGRADE_METHODS)
 | 
					        default=None, str_validator=check_string_in(VALID_MODIFY_PLAN_METHODS)
 | 
				
			||||||
    ),
 | 
					    ),
 | 
				
			||||||
    scrub_realm: bool = REQ(default=False, json_validator=check_bool),
 | 
					    scrub_realm: bool = REQ(default=False, json_validator=check_bool),
 | 
				
			||||||
    query: Optional[str] = REQ("q", default=None),
 | 
					    query: Optional[str] = REQ("q", default=None),
 | 
				
			||||||
@@ -251,18 +251,18 @@ def support(
 | 
				
			|||||||
        elif approve_sponsorship:
 | 
					        elif approve_sponsorship:
 | 
				
			||||||
            do_approve_sponsorship(realm, acting_user=acting_user)
 | 
					            do_approve_sponsorship(realm, acting_user=acting_user)
 | 
				
			||||||
            context["success_message"] = f"Sponsorship approved for {realm.string_id}"
 | 
					            context["success_message"] = f"Sponsorship approved for {realm.string_id}"
 | 
				
			||||||
        elif downgrade_method is not None:
 | 
					        elif modify_plan is not None:
 | 
				
			||||||
            if downgrade_method == "downgrade_at_billing_cycle_end":
 | 
					            if modify_plan == "downgrade_at_billing_cycle_end":
 | 
				
			||||||
                downgrade_at_the_end_of_billing_cycle(realm)
 | 
					                downgrade_at_the_end_of_billing_cycle(realm)
 | 
				
			||||||
                context[
 | 
					                context[
 | 
				
			||||||
                    "success_message"
 | 
					                    "success_message"
 | 
				
			||||||
                ] = f"{realm.string_id} marked for downgrade at the end of billing cycle"
 | 
					                ] = f"{realm.string_id} marked for downgrade at the end of billing cycle"
 | 
				
			||||||
            elif downgrade_method == "downgrade_now_without_additional_licenses":
 | 
					            elif modify_plan == "downgrade_now_without_additional_licenses":
 | 
				
			||||||
                downgrade_now_without_creating_additional_invoices(realm)
 | 
					                downgrade_now_without_creating_additional_invoices(realm)
 | 
				
			||||||
                context[
 | 
					                context[
 | 
				
			||||||
                    "success_message"
 | 
					                    "success_message"
 | 
				
			||||||
                ] = f"{realm.string_id} downgraded without creating additional invoices"
 | 
					                ] = f"{realm.string_id} downgraded without creating additional invoices"
 | 
				
			||||||
            elif downgrade_method == "downgrade_now_void_open_invoices":
 | 
					            elif modify_plan == "downgrade_now_void_open_invoices":
 | 
				
			||||||
                downgrade_now_without_creating_additional_invoices(realm)
 | 
					                downgrade_now_without_creating_additional_invoices(realm)
 | 
				
			||||||
                voided_invoices_count = void_all_open_invoices(realm)
 | 
					                voided_invoices_count = void_all_open_invoices(realm)
 | 
				
			||||||
                context[
 | 
					                context[
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -137,16 +137,16 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
<form method="POST" class="downgrade-plan-form">
 | 
					<form method="POST" class="downgrade-plan-form">
 | 
				
			||||||
    <br />
 | 
					    <br />
 | 
				
			||||||
    <b>Downgrade plan</b><br />
 | 
					    <b>Modify plan</b><br />
 | 
				
			||||||
    {{ csrf_input }}
 | 
					    {{ csrf_input }}
 | 
				
			||||||
    <input type="hidden" name="realm_id" value="{{ realm.id }}" />
 | 
					    <input type="hidden" name="realm_id" value="{{ realm.id }}" />
 | 
				
			||||||
    <select name="downgrade_method" class="downgrade-plan-method-select" required>
 | 
					    <select name="modify_plan" class="modify-plan-method-select" required>
 | 
				
			||||||
        <option disabled value="" selected>-- select --</option>
 | 
					        <option disabled value="" selected>-- select --</option>
 | 
				
			||||||
        <option value="downgrade_at_billing_cycle_end">Downgrade at the end of current billing cycle</option>
 | 
					        <option value="downgrade_at_billing_cycle_end">Downgrade at the end of current billing cycle</option>
 | 
				
			||||||
        <option value="downgrade_now_without_additional_licenses">Downgrade now without creating additional invoices</option>
 | 
					        <option value="downgrade_now_without_additional_licenses">Downgrade now without creating additional invoices</option>
 | 
				
			||||||
        <option value="downgrade_now_void_open_invoices">Downgrade now and void open invoices</option>
 | 
					        <option value="downgrade_now_void_open_invoices">Downgrade now and void open invoices</option>
 | 
				
			||||||
    </select>
 | 
					    </select>
 | 
				
			||||||
    <button type="submit" class="btn btn-default support-submit-button">Downgrade</button>
 | 
					    <button type="submit" class="btn btn-default support-submit-button">Modify</button>
 | 
				
			||||||
</form>
 | 
					</form>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{% endif %}
 | 
					{% endif %}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -124,7 +124,7 @@ tr.admin td:first-child {
 | 
				
			|||||||
    top: -75px;
 | 
					    top: -75px;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
.downgrade-plan-method-select {
 | 
					.modify-plan-method-select {
 | 
				
			||||||
    width: auto;
 | 
					    width: auto;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user