Fixes complimentary subscription display issues (#20563)

Fixes
https://linear.app/tryghost/issue/DES-324/complimentary-plan-issues

We were showing renewal copy for subscriptions that are forever
complimentary. We also had a trailing en-dash in the Member detail
screen when their subscription was complimentary and had no end date.

Those things are solved now. We don't show dates or renewal copy when we
don't need to.
This commit is contained in:
Daniël van der Winden 2024-07-09 11:53:02 +02:00 committed by GitHub
parent 480f192f75
commit 4084a3d00f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 2 deletions

View File

@ -32,6 +32,10 @@ const AccountWelcome = () => {
return null;
}
if (isComplimentary) {
return null;
}
if (subscriptionHasFreeTrial({sub: subscription})) {
const trialEnd = getDateString(subscription.trial_end_at);
return (

View File

@ -143,11 +143,21 @@
{{else}}
{{#if (or (eq sub.price.nickname "Monthly") (eq sub.price.nickname "Yearly"))}}
{{else}}
<span class="gh-cp-membertier-pricelabel">{{sub.price.nickname}}</span><span class="gh-cp-membertier-renewal"> &ndash; </span>
<span class="gh-cp-membertier-pricelabel">{{sub.price.nickname}}</span>
{{/if}}
{{/if}}
<span class="gh-cp-membertier-renewal">{{sub.validityDetails}}</span>
{{#if sub.trialUntil}}
<span class="gh-cp-membertier-renewal"> &ndash; </span>
<span class="gh-cp-membertier-renewal">{{sub.validityDetails}}</span>
{{/if}}
{{#if sub.compExpiry}}
<span class="gh-cp-membertier-renewal"> &ndash; </span>
<span class="gh-cp-membertier-renewal">{{sub.validityDetails}}</span>
{{/if}}
</div>
<Member::SubscriptionDetailBox @sub={{sub}} @index={{index}} />
</div>