From 6230c5e53cc0485470c8b0c8ca84cd8b0ec24fb3 Mon Sep 17 00:00:00 2001 From: Sag Date: Tue, 20 Feb 2024 10:10:40 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Added=20option=20to=20change=20t?= =?UTF-8?q?he=20name=20of=20the=20free=20tier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - also added the option to choose between yearly or monthly plan as default Co-authored-by: Simon Backx Co-authored-by: Djordje Vlaisavljevic --- .../settings/advanced/labs/AlphaFeatures.tsx | 4 ---- apps/portal/src/utils/helpers.js | 10 ++++------ ghost/core/core/shared/labs.js | 6 +++--- .../e2e-api/admin/__snapshots__/settings.test.js.snap | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx b/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx index bc6d49a6b913..f6c00ce88042 100644 --- a/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx +++ b/apps/admin-x-settings/src/components/settings/advanced/labs/AlphaFeatures.tsx @@ -59,10 +59,6 @@ const features = [{ title: 'New email addresses', description: 'For self hosters, forces the usage of the mail.from config as from address for all outgoing emails', flag: 'newEmailAddresses' -},{ - title: 'Portal improvements', - description: 'Adds a bunch of improvements to portal and portal settings', - flag: 'portalImprovements' }]; const AlphaFeatures: React.FC = () => { diff --git a/apps/portal/src/utils/helpers.js b/apps/portal/src/utils/helpers.js index eaaffa2a1846..0b45f8089314 100644 --- a/apps/portal/src/utils/helpers.js +++ b/apps/portal/src/utils/helpers.js @@ -431,7 +431,8 @@ export function getSiteProducts({site, pageQuery}) { } if (hasFreeProductPrice({site})) { products.unshift({ - id: 'free' + id: 'free', + type: 'free' }); } return products; @@ -450,11 +451,8 @@ export function getFreeProductBenefits({site}) { } export function getFreeTierTitle({site}) { - if (hasOnlyFreeProduct({site})) { - return 'Free membership'; - } else { - return 'Free'; - } + const freeProduct = getFreeProduct({site}); + return freeProduct?.name || 'Free'; } export function getFreeTierDescription({site}) { diff --git a/ghost/core/core/shared/labs.js b/ghost/core/core/shared/labs.js index 08089aa37d71..756365287658 100644 --- a/ghost/core/core/shared/labs.js +++ b/ghost/core/core/shared/labs.js @@ -23,7 +23,8 @@ const GA_FEATURES = [ 'recommendations', 'listUnsubscribeHeader', 'filterEmailDisabled', - 'newEmailAddresses' + 'newEmailAddresses', + 'portalImprovements' ]; // NOTE: this allowlist is meant to be used to filter out any unexpected @@ -47,8 +48,7 @@ const ALPHA_FEATURES = [ 'lexicalIndicators', // 'adminXOffers', 'filterEmailDisabled', - 'adminXDemo', - 'portalImprovements' + 'adminXDemo' ]; module.exports.GA_KEYS = [...GA_FEATURES]; diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap index 83cbd6d9067a..4b177cdeaa86 100644 --- a/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap +++ b/ghost/core/test/e2e-api/admin/__snapshots__/settings.test.js.snap @@ -1155,7 +1155,7 @@ exports[`Settings API Edit Can edit a setting 2: [headers] 1`] = ` Object { "access-control-allow-origin": "http://127.0.0.1:2369", "cache-control": "no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0", - "content-length": "4534", + "content-length": "4562", "content-type": "application/json; charset=utf-8", "content-version": StringMatching /v\\\\d\\+\\\\\\.\\\\d\\+/, "etag": StringMatching /\\(\\?:W\\\\/\\)\\?"\\(\\?:\\[ !#-\\\\x7E\\\\x80-\\\\xFF\\]\\*\\|\\\\r\\\\n\\[\\\\t \\]\\|\\\\\\\\\\.\\)\\*"/,