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.

sponsorship: Remove from billing and upgrade pages.

Aman Agrawal3ba0fe434971
diff --git a/templates/corporate/billing.html b/templates/corporate/billing.html
index 54c1b592c6e..7fbd93266b2 100644
--- a/templates/corporate/billing.html
+++ b/templates/corporate/billing.html
@@ -27,7 +27,6 @@
<li class="active"><a data-toggle="tab" href="#overview">Overview</a></li>
<li><a data-toggle="tab" href="#payment-method">Payment method</a></li>
<li><a data-toggle="tab" href="#settings">Settings</a></li>
- <li><a data-toggle="tab" href="#sponsorship">💚 Request sponsorship</a></li>
</ul>
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}" />
@@ -171,8 +170,6 @@
<div class="tab-pane" id="loading">
</div>
</div>
-
- {% include "corporate/sponsorship.html" %}
</div>
<div id="goto-zulip-organization-link">
diff --git a/templates/corporate/upgrade.html b/templates/corporate/upgrade.html
index e81acec0ed7..46ef7fe7360 100644
--- a/templates/corporate/upgrade.html
+++ b/templates/corporate/upgrade.html
@@ -47,7 +47,6 @@
<ul class="nav nav-tabs" id="upgrade-tabs">
<li class="active"><a data-toggle="tab" href="#autopay">💳 Pay automatically</a></li>
<li><a data-toggle="tab" href="#invoice">🧾 Pay by invoice</a></li>
- <li><a data-toggle="tab" href="#sponsorship">💚 Request sponsorship</a></li>
</ul>
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}" />
@@ -240,9 +239,6 @@
Upgrade complete! The page will now reload.
</div>
</div>
-
- {% include "corporate/sponsorship.html" %}
-
</div>
<div class="support-link">
<p>
diff --git a/web/src/billing/billing.ts b/web/src/billing/billing.ts
index 6bda7f928af..bbb6fb2c6fd 100644
--- a/web/src/billing/billing.ts
+++ b/web/src/billing/billing.ts
@@ -16,7 +16,6 @@ export function create_update_license_request(): void {
export function initialize(): void {
helpers.set_tab("billing");
- helpers.set_sponsorship_form();
$("#update-card-button").on("click", (e) => {
helpers.create_ajax_request(
diff --git a/web/src/billing/upgrade.ts b/web/src/billing/upgrade.ts
index 1419d2ef798..c44c601fb9b 100644
--- a/web/src/billing/upgrade.ts
+++ b/web/src/billing/upgrade.ts
@@ -6,7 +6,6 @@ import {page_params} from "./page_params";
export const initialize = (): void => {
helpers.set_tab("upgrade");
- helpers.set_sponsorship_form();
$("#add-card-button").on("click", (e) => {
const license_management = $<HTMLInputElement>(
"input[type=radio][name=license_management]:checked",
diff --git a/web/tests/billing.test.js b/web/tests/billing.test.js
index e447cf95e49..831d11686ff 100644
--- a/web/tests/billing.test.js
+++ b/web/tests/billing.test.js
@@ -21,7 +21,6 @@ const location = set_global("location", {});
const portico_modals = mock_esm("../src/portico/portico_modals", {});
const helpers = mock_esm("../src/billing/helpers", {
set_tab() {},
- set_sponsorship_form() {},
});
zrequire("billing/billing");
@@ -32,13 +31,8 @@ run_test("initialize", ({override}) => {
assert.equal(page_name, "billing");
set_tab_called = true;
});
- let set_sponsorship_form_called = false;
- override(helpers, "set_sponsorship_form", () => {
- set_sponsorship_form_called = true;
- });
$.get_initialize_function()();
assert.ok(set_tab_called);
- assert.ok(set_sponsorship_form_called);
});
run_test("card_update", ({override}) => {
diff --git a/web/tests/upgrade.test.js b/web/tests/upgrade.test.js
index 5b871bbdd5a..037433ae3ff 100644
--- a/web/tests/upgrade.test.js
+++ b/web/tests/upgrade.test.js
@@ -58,15 +58,6 @@ run_test("initialize", ({override_rewire}) => {
};
success_callback();
break;
- case "sponsorship":
- assert.equal(url, "/json/billing/sponsorship");
- assert.deepEqual(ignored_inputs, []);
- assert.equal(type, "POST");
- location.replace = (new_location) => {
- assert.equal(new_location, "/");
- };
- success_callback();
- break;
/* istanbul ignore next */
default:
throw new Error("Unhandled case");
@@ -99,21 +90,17 @@ run_test("initialize", ({override_rewire}) => {
const add_card_click_handler = $("#add-card-button").get_on_handler("click");
const invoice_click_handler = $("#invoice-button").get_on_handler("click");
- const request_sponsorship_click_handler = $("#sponsorship-button").get_on_handler("click");
override_rewire(helpers, "is_valid_input", () => true);
add_card_click_handler(e);
assert.equal(create_ajax_request_form_call_count, 1);
invoice_click_handler(e);
assert.equal(create_ajax_request_form_call_count, 2);
- request_sponsorship_click_handler(e);
- assert.equal(create_ajax_request_form_call_count, 3);
override_rewire(helpers, "is_valid_input", () => false);
add_card_click_handler(e);
invoice_click_handler(e);
- request_sponsorship_click_handler(e);
- assert.equal(create_ajax_request_form_call_count, 3);
+ assert.equal(create_ajax_request_form_call_count, 2);
override_rewire(helpers, "show_license_section", (section) => {
assert.equal(section, "manual");