Skip to content

Commit

Permalink
remove stripe subscription (mdn#4223)
Browse files Browse the repository at this point in the history
  • Loading branch information
peterbe authored Jul 22, 2021
1 parent 8273a52 commit 20bcaa2
Show file tree
Hide file tree
Showing 11 changed files with 4 additions and 177 deletions.
5 changes: 0 additions & 5 deletions build/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 71,6 @@ const HOMEPAGE_FEED_DISPLAY_MAX = JSON.parse(
process.env.BUILD_HOMEPAGE_FEED_DISPLAY_MAX || "5"
);

// If you want to enable this on local development use http://localhost.org:8000/api/v1/subscriptions/config/
const BUILD_SUBSCRIPTION_CONFIG_URL =
process.env.BUILD_SUBSCRIPTION_CONFIG_URL || null;

module.exports = {
BUILD_OUT_ROOT,
DEFAULT_FLAW_LEVELS,
Expand All @@ -92,5 88,4 @@ module.exports = {
ALWAYS_ALLOW_ROBOTS,
HOMEPAGE_FEED_URL,
HOMEPAGE_FEED_DISPLAY_MAX,
BUILD_SUBSCRIPTION_CONFIG_URL,
};
11 changes: 1 addition & 10 deletions build/spas.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 10,8 @@ const {
BUILD_OUT_ROOT,
HOMEPAGE_FEED_URL,
HOMEPAGE_FEED_DISPLAY_MAX,
BUILD_SUBSCRIPTION_CONFIG_URL,
} = require("./constants");
const { getFeedEntries } = require("./feedparser");
const { getSubscriptionConfig } = require("./subscriptionconfig");
// eslint-disable-next-line node/no-missing-require
const { renderHTML } = require("../ssr/dist/main");

Expand All @@ -39,10 37,6 @@ async function buildSPAs(options) {
console.log("Wrote", path.join(outPath, path.basename(url)));
}

const subscriptionConfig = BUILD_SUBSCRIPTION_CONFIG_URL
? await getSubscriptionConfig(BUILD_SUBSCRIPTION_CONFIG_URL)
: null;

// Basically, this builds one (for example) `search/index.html` for every
// locale we intend to build.
for (const root of [CONTENT_ROOT, CONTENT_TRANSLATED_ROOT]) {
Expand Down Expand Up @@ -97,10 91,7 @@ async function buildSPAs(options) {
}
if (prefix === "settings") {
const filePathContext = path.join(outPath, "index.json");
fs.writeFileSync(
filePathContext,
JSON.stringify({ ...context, subscriptionConfig })
);
fs.writeFileSync(filePathContext, JSON.stringify(context));
buildCount ;
if (options.verbose) {
console.log("Wrote", filePathContext);
Expand Down
20 changes: 0 additions & 20 deletions build/subscriptionconfig.js

This file was deleted.

11 changes: 0 additions & 11 deletions client/src/settings/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 6,13 @@ import { Loading } from "../ui/atoms/loading";
import { DISABLE_AUTH } from "../constants";
import { useUserData } from "../user-context";
import { useLocale } from "../hooks";
import { Subscription, SubscriptionConfig } from "./subscription";
import { AuthDisabled } from "../ui/atoms/auth-disabled";

import "./index.scss";

interface UserSettings {
csrfmiddlewaretoken: string;
locale: string;
subscription: object;
}

interface Locale {
Expand All @@ -25,7 23,6 @@ interface Locale {

interface SettingsData {
possibleLocales: Locale[];
subscriptionConfig: null | SubscriptionConfig;
}

export default function SettingsApp({ ...appProps }) {
Expand All @@ -50,7 47,6 @@ export default function SettingsApp({ ...appProps }) {
initialData: appProps.possibleLocales
? {
possibleLocales: appProps.possibleLocales,
subscriptionConfig: null,
}
: undefined,
revalidateOnFocus: false,
Expand Down Expand Up @@ -130,13 126,6 @@ export default function SettingsApp({ ...appProps }) {
/>
)}
<CloseAccount userSettings={data} />
{settingsData?.subscriptionConfig && (
<Subscription
config={settingsData.subscriptionConfig}
csrfmiddlewaretoken={data.csrfmiddlewaretoken}
current={data.subscription}
/>
)}
</div>
);
}
Expand Down
102 changes: 0 additions & 102 deletions client/src/settings/subscription.tsx

This file was deleted.

8 changes: 0 additions & 8 deletions docs/envvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 184,6 @@ Which RSS feed URL to parse for displaying feed entries on the home page.

How many RSS feed entries to display on the home page.

### `BUILD_SUBSCRIPTION_CONFIG_URL`

**Default: `''`**

URL from which to fetch the subscription config. You need Kuma running and for local
dev you will likely want to point it to
`http://localhost.org:8000/api/v1/subscriptions/config/`

## Server

### `SERVER_PORT`
Expand Down
10 changes: 3 additions & 7 deletions libs/fundamental-redirects/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1183,13 1183,9 @@ const MISC_REDIRECT_PATTERNS = [
localeRedirect(/^account\/?$/i, "/settings", {
permanent: false,
}),
localeRedirect(
/^profile(?:|\/stripe_subscription|\/edit)\/?$/i,
"/settings",
{
permanent: false,
}
),
localeRedirect(/^profile(?:|\/edit)\/?$/i, "/settings", {
permanent: false,
}),
localeRedirect(
/^profiles\/(?:[^\/] )(?:|\/edit|\/delete)\/?$/i,
"/settings",
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 42,6 @@
"@caporal/core": "2.0.2",
"@fast-csv/parse": "4.3.6",
"@mdn/browser-compat-data": "3.3.11",
"@stripe/stripe-js": "^1.16.0",
"accept-language-parser": "1.5.0",
"browser-specs": "^2.4.0",
"chalk": "4.1.1",
Expand Down
2 changes: 0 additions & 2 deletions testing/integration/headless/map_301.py
Original file line number Diff line number Diff line change
Expand Up @@ -998,8 998,6 @@
url_test("/en-US/profile/", "/en-US/settings", status_code=302),
url_test("/en-US/profile/edit", "/en-US/settings", status_code=302),
url_test("/en-US/profile/edit/", "/en-US/settings", status_code=302),
url_test("/en-US/profile/stripe_subscription", "/en-US/settings", status_code=302),
url_test("/en-US/profile/stripe_subscription/", "/en-US/settings", status_code=302),
url_test("/zh-CN/profiles/sheppy", "/zh-CN/settings", status_code=302),
url_test("/en-US/profiles/sheppy", "/en-US/settings", status_code=302),
url_test("/en-US/profiles/sheppy/", "/en-US/settings", status_code=302),
Expand Down
6 changes: 0 additions & 6 deletions testing/tests/redirects.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1213,12 1213,6 @@ const MISC_REDIRECT_URLS = [].concat(
url_test("/en-US/profile/", "/en-US/settings", { statusCode: 302 }),
url_test("/en-US/profile/edit", "/en-US/settings", { statusCode: 302 }),
url_test("/en-US/profile/edit/", "/en-US/settings", { statusCode: 302 }),
url_test("/en-US/profile/stripe_subscription", "/en-US/settings", {
statusCode: 302,
}),
url_test("/en-US/profile/stripe_subscription/", "/en-US/settings", {
statusCode: 302,
}),
url_test("/zh-CN/profiles/sheppy", "/zh-CN/settings", { statusCode: 302 }),
url_test("/en-US/profiles/sheppy", "/en-US/settings", { statusCode: 302 }),
url_test("/en-US/profiles/sheppy/", "/en-US/settings", { statusCode: 302 }),
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3560,11 3560,6 @@
resolve-from "^5.0.0"
store2 "^2.12.0"

"@stripe/stripe-js@^1.16.0":
version "1.16.0"
resolved "https://registry.yarnpkg.com/@stripe/stripe-js/-/stripe-js-1.16.0.tgz#73bce24fb7f47d719caa6b151e58e49b4167d463"
integrity sha512-ZSHbiwTrISoaTbpercmYGuY7QTg7HxfFyNgbJBaYbwHWbzMhpEdGTsmMpaBXIU6iiqwEEDaIyD8O6yJ H5DWCg==

"@stylelint/postcss-css-in-js@^0.37.2":
version "0.37.2"
resolved "https://registry.yarnpkg.com/@stylelint/postcss-css-in-js/-/postcss-css-in-js-0.37.2.tgz#7e5a84ad181f4234a2480803422a47b8749af3d2"
Expand Down

0 comments on commit 20bcaa2

Please sign in to comment.