From 920019da47b5ee0a8768954d50b4c91f0f0058c6 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Thu, 24 Mar 2022 16:33:19 +0530 Subject: [PATCH 1/2] Fixed layout for prices with custom description One of the early betas for multiple products allowed adding custom description for prices, which Portal had an extra check for when rendering. The price description is not a valid scenario anymore, and this change allows Portal to ignore description of prices so it shows consistent layout for single tier scenario. --- ghost/portal/src/components/common/PlansSection.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ghost/portal/src/components/common/PlansSection.js b/ghost/portal/src/components/common/PlansSection.js index ef3bd665aa..da1d63abce 100644 --- a/ghost/portal/src/components/common/PlansSection.js +++ b/ghost/portal/src/components/common/PlansSection.js @@ -483,15 +483,16 @@ function PriceLabel({currencySymbol, price, interval}) { function addDiscountToPlans(plans) { const filteredPlans = plans.filter(d => d.id !== 'free'); const monthlyPlan = plans.find((d) => { - return d.name === 'Monthly' && !d.description && d.interval === 'month'; + return d.name === 'Monthly' && d.interval === 'month'; }); const yearlyPlan = plans.find((d) => { - return d.name === 'Yearly' && !d.description && d.interval === 'year'; + return d.name === 'Yearly' && d.interval === 'year'; }); if (filteredPlans.length === 2 && monthlyPlan && yearlyPlan) { const discount = calculateDiscount(monthlyPlan.amount, yearlyPlan.amount); yearlyPlan.description = discount > 0 ? `${discount}% discount` : ''; + monthlyPlan.description = ''; } } @@ -647,10 +648,10 @@ function getPlanClassNames({changePlan, cookiesDisabled, plans = [], selectedPla const filteredPlans = plans.filter(d => d.id !== 'free'); const monthlyPlan = plans.find((d) => { - return d.name === 'Monthly' && !d.description && d.interval === 'month'; + return d.name === 'Monthly' && d.interval === 'month'; }); const yearlyPlan = plans.find((d) => { - return d.name === 'Yearly' && !d.description && d.interval === 'year'; + return d.name === 'Yearly' && d.interval === 'year'; }); if (filteredPlans.length === 2 && monthlyPlan && yearlyPlan) { From 57773744c46f70b6e9b9f894a043c27d72e64fe0 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Thu, 24 Mar 2022 16:40:12 +0530 Subject: [PATCH 2/2] v1.17.2 --- ghost/portal/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghost/portal/package.json b/ghost/portal/package.json index 5bb7598650..1f681629eb 100644 --- a/ghost/portal/package.json +++ b/ghost/portal/package.json @@ -1,6 +1,6 @@ { "name": "@tryghost/portal", - "version": "1.17.1", + "version": "1.17.2", "license": "MIT", "repository": { "type": "git",