mirror of https://github.com/zulip/zulip.git
billing: Show success text after plan change on top after reload.
This commit is contained in:
parent
67bddb3d72
commit
637e9c11ee
|
@ -179,9 +179,6 @@
|
|||
{% endif %}
|
||||
</form>
|
||||
<input name="status" type="hidden" value="{{ CustomerPlan.DOWNGRADE_AT_END_OF_CYCLE }}" />
|
||||
<div id="planchange-success" class="alert alert-success billing-page-success">
|
||||
Plan updated. The page will now reload.
|
||||
</div>
|
||||
{% if onboarding %}
|
||||
<div id="onboarding-go-to-org" class="input-box upgrade-page-field">
|
||||
<a class="not-editable-realm-field" href="/"><b>Go to your Zulip organization</b></a>
|
||||
|
|
|
@ -170,11 +170,33 @@ export function initialize(): void {
|
|||
},
|
||||
);
|
||||
|
||||
$(
|
||||
"#confirm-cancel-subscription-modal .dialog_submit_button, #reactivate-subscription .reactivate-current-plan-button, #confirm-end-free-trial .dialog_submit_button",
|
||||
).on("click", (e) => {
|
||||
$("#confirm-cancel-subscription-modal .dialog_submit_button").on("click", (e) => {
|
||||
helpers.create_ajax_request("/json/billing/plan", "planchange", [], "PATCH", () =>
|
||||
window.location.replace("/billing/"),
|
||||
window.location.replace(
|
||||
"/billing/?success_message=" +
|
||||
encodeURIComponent("Your plan has been canceled and will not renew."),
|
||||
),
|
||||
);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#reactivate-subscription .reactivate-current-plan-button").on("click", (e) => {
|
||||
helpers.create_ajax_request("/json/billing/plan", "planchange", [], "PATCH", () =>
|
||||
window.location.replace(
|
||||
"/billing/?success_message=" +
|
||||
encodeURIComponent(
|
||||
"Your plan has been reactivated and will renew automatically.",
|
||||
),
|
||||
),
|
||||
);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
$("#confirm-end-free-trial .dialog_submit_button").on("click", (e) => {
|
||||
helpers.create_ajax_request("/json/billing/plan", "planchange", [], "PATCH", () =>
|
||||
window.location.replace(
|
||||
"/billing/?success_message=" + encodeURIComponent("Successfully ended trial!"),
|
||||
),
|
||||
);
|
||||
e.preventDefault();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue