0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

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.
This commit is contained in:
Rishabh 2021-05-06 17:55:16 +05:30
parent 7b340929ef
commit ea49c4d89c
2 changed files with 13 additions and 2 deletions

View file

@ -221,7 +221,7 @@
/>
<p>Redirect to this URL after free signup</p>
</GhFormGroup>
{{#if (and this.isStripeConfigured (or this.isMonthlyChecked this.isYearlyChecked))}}
{{#if (and this.isStripeConfigured hasPaidPriceChecked)}}
<GhFormGroup
@errors={{settings.errors}}
@hasValidated={{settings.hasValidated}}

View file

@ -55,7 +55,8 @@ export default ModalComponent.extend({
filteredPrices: computed('prices', 'settings.portalPlans.[]', function () {
const portalPlans = this.get('settings.portalPlans');
return this.prices.filter((d) => {
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]);