From ea49c4d89c02b586c1fc5219b3c4950b2e4bccf4 Mon Sep 17 00:00:00 2001 From: Rishabh Date: Thu, 6 May 2021 17:55:16 +0530 Subject: [PATCH] Fixed paid signup input in portal setting refs https://github.com/TryGhost/Team/issues/637 The paid signup setting was incorrectly still checking only for Monthly and yearly prices instead of custom prices list to show the paid signup input. --- .../admin/app/components/modal-portal-settings.hbs | 2 +- ghost/admin/app/components/modal-portal-settings.js | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/modal-portal-settings.hbs b/ghost/admin/app/components/modal-portal-settings.hbs index 34ecf7aee7..a957e93157 100644 --- a/ghost/admin/app/components/modal-portal-settings.hbs +++ b/ghost/admin/app/components/modal-portal-settings.hbs @@ -221,7 +221,7 @@ />

Redirect to this URL after free signup

- {{#if (and this.isStripeConfigured (or this.isMonthlyChecked this.isYearlyChecked))}} + {{#if (and this.isStripeConfigured hasPaidPriceChecked)}} { + const prices = this.prices || []; + return prices.filter((d) => { return d.amount !== 0 && d.type === 'recurring'; }).map((price) => { return { @@ -65,6 +66,16 @@ export default ModalComponent.extend({ }); }), + hasPaidPriceChecked: computed('prices', 'settings.portalPlans.[]', function () { + const portalPlans = this.get('settings.portalPlans'); + const prices = this.prices || []; + return prices.filter((d) => { + return d.amount !== 0 && d.type === 'recurring'; + }).some((price) => { + return !!portalPlans.find(d => d === price.id); + }); + }), + buttonIcon: computed('settings.portalButtonIcon', function () { const defaultIconKeys = this.defaultButtonIcons.map(buttonIcon => buttonIcon.value); return (this.settings.get('portalButtonIcon') || defaultIconKeys[0]);