From b35f060bef568ec34f57a6a3b3a8eb56f2513549 Mon Sep 17 00:00:00 2001 From: Fabien O'Carroll Date: Tue, 4 May 2021 15:43:18 +0100 Subject: [PATCH] Added settings for members 'free' price refs https://github.com/TryGhost/Team/issues/637 The "free" price - when Members signup without using Stripe, should have a name and description, so that it can be displayed in Portal in a similar way to paid price's. As there is only ever one, and it is not a fully fledged price, a setting makes more sense than a dedicated db table. --- core/server/data/schema/default-settings.json | 8 ++++++++ test/regression/api/canary/admin/settings_spec.js | 2 ++ test/regression/api/v2/admin/settings_spec.js | 2 ++ test/regression/api/v3/admin/settings_spec.js | 2 ++ test/unit/data/schema/integrity_spec.js | 2 +- 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/core/server/data/schema/default-settings.json b/core/server/data/schema/default-settings.json index 8bfe05e167..93d1e8876b 100644 --- a/core/server/data/schema/default-settings.json +++ b/core/server/data/schema/default-settings.json @@ -304,6 +304,14 @@ "stripe_connect_account_id": { "defaultValue": null, "type": "string" + }, + "members_free_price_name": { + "defaultValue": "Free", + "type": "string" + }, + "members_free_price_description": { + "defaultValue": "", + "type": "string" } }, "portal": { diff --git a/test/regression/api/canary/admin/settings_spec.js b/test/regression/api/canary/admin/settings_spec.js index fd753426f7..65b84acea9 100644 --- a/test/regression/api/canary/admin/settings_spec.js +++ b/test/regression/api/canary/admin/settings_spec.js @@ -43,6 +43,8 @@ const defaultSettingsKeyTypes = [ {key: 'members_reply_address', type: 'members'}, {key: 'members_paid_signup_redirect', type: 'members'}, {key: 'members_free_signup_redirect', type: 'members'}, + {key: 'members_free_price_name', type: 'members'}, + {key: 'members_free_price_description', type: 'members'}, {key: 'stripe_product_name', type: 'members'}, {key: 'stripe_plans', type: 'members'}, {key: 'stripe_secret_key', type: 'members'}, diff --git a/test/regression/api/v2/admin/settings_spec.js b/test/regression/api/v2/admin/settings_spec.js index 68c107b1c6..a879d5c79f 100644 --- a/test/regression/api/v2/admin/settings_spec.js +++ b/test/regression/api/v2/admin/settings_spec.js @@ -38,6 +38,8 @@ const defaultSettingsKeyTypes = [ {key: 'members_reply_address', type: 'members'}, {key: 'members_paid_signup_redirect', type: 'members'}, {key: 'members_free_signup_redirect', type: 'members'}, + {key: 'members_free_price_name', type: 'members'}, + {key: 'members_free_price_description', type: 'members'}, {key: 'stripe_product_name', type: 'members'}, {key: 'stripe_plans', type: 'members'}, {key: 'stripe_secret_key', type: 'members'}, diff --git a/test/regression/api/v3/admin/settings_spec.js b/test/regression/api/v3/admin/settings_spec.js index 448fa3ec99..a0e1b54a9c 100644 --- a/test/regression/api/v3/admin/settings_spec.js +++ b/test/regression/api/v3/admin/settings_spec.js @@ -41,6 +41,8 @@ const defaultSettingsKeyTypes = [ {key: 'members_reply_address', type: 'members'}, {key: 'members_paid_signup_redirect', type: 'members'}, {key: 'members_free_signup_redirect', type: 'members'}, + {key: 'members_free_price_name', type: 'members'}, + {key: 'members_free_price_description', type: 'members'}, {key: 'stripe_product_name', type: 'members'}, {key: 'stripe_plans', type: 'members'}, {key: 'stripe_secret_key', type: 'members'}, diff --git a/test/unit/data/schema/integrity_spec.js b/test/unit/data/schema/integrity_spec.js index f94b3ab969..0e241bb3e3 100644 --- a/test/unit/data/schema/integrity_spec.js +++ b/test/unit/data/schema/integrity_spec.js @@ -34,7 +34,7 @@ describe('DB version integrity', function () { // Only these variables should need updating const currentSchemaHash = '7886f066821a240b85c6b61ba2dcff65'; const currentFixturesHash = '8671672598d2a62e53418c4b91aa79a3'; - const currentSettingsHash = '5529b6fd5ee65b65bb78954fd721b248'; + const currentSettingsHash = '1f41d1a0a21500bcaf2829288dff5a67'; const currentRoutesHash = '3d180d52c663d173a6be791ef411ed01'; // If this test is failing, then it is likely a change has been made that requires a DB version bump,