0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

🐛 Fixed wording when a canceled subscription has not ended yet (#19523)

fixes PROD-325
fixes https://github.com/TryGhost/Product/issues/3489

- a canceled subscription that is still valid till the end of the
current period now correctly shows "Has access until x", instead of
"Ended x"
This commit is contained in:
Sag 2024-01-18 16:56:43 +01:00 committed by GitHub
parent 501b1a2640
commit b216aa0628
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 4 deletions

View file

@ -123,9 +123,9 @@
<h3 class="gh-membertier-name" data-test-text="tier-name" style="align-items:center !important; justify-content:flex-start !important;">
{{tier.name}}
{{#if (eq sub.status "canceled")}}
<span class="gh-badge archived" data-test-text="member-subscription-status">Cancelled</span>
<span class="gh-badge archived" data-test-text="member-subscription-status">Canceled</span>
{{else if sub.cancel_at_period_end}}
<span class="gh-badge archived" data-test-text="member-subscription-status">Cancelled</span>
<span class="gh-badge archived" data-test-text="member-subscription-status">Canceled</span>
{{else if sub.compExpiry}}
<span class="gh-badge active" data-test-text="member-subscription-status">Active</span>
{{else if sub.trialUntil}}
@ -147,9 +147,9 @@
{{/if}}
{{/if}}
{{#if (eq sub.status "canceled")}}
{{#if sub.hasEnded}}
<span class="gh-cp-membertier-renewal">Ended {{sub.validUntil}}</span>
{{else if sub.cancel_at_period_end}}
{{else if sub.willEndSoon}}
<span class="gh-cp-membertier-renewal">Has access until {{sub.validUntil}}</span>
{{else if sub.compExpiry}}
<span class="gh-cp-membertier-renewal">Expires {{sub.compExpiry}}</span>

View file

@ -63,6 +63,7 @@ export default class extends Component {
let subscriptionData = subscriptions.filter((sub) => {
return !!sub.price;
}).map((sub) => {
const periodEnded = sub.current_period_end && new Date(sub.current_period_end) < new Date();
const data = {
...sub,
attribution: {
@ -72,6 +73,8 @@ export default class extends Component {
},
startDate: sub.start_date ? moment(sub.start_date).format('D MMM YYYY') : '-',
validUntil: sub.current_period_end ? moment(sub.current_period_end).format('D MMM YYYY') : '-',
hasEnded: sub.status === 'canceled' && periodEnded,
willEndSoon: sub.cancel_at_period_end || (sub.status === 'canceled' && !periodEnded),
cancellationReason: sub.cancellation_reason,
price: {
...sub.price,