From b216aa0628454b6a4a8816003487c9014eb188f1 Mon Sep 17 00:00:00 2001 From: Sag Date: Thu, 18 Jan 2024 16:56:43 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20wording=20when=20a=20can?= =?UTF-8?q?celed=20subscription=20has=20not=20ended=20yet=20(#19523)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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" --- ghost/admin/app/components/gh-member-settings-form.hbs | 8 ++++---- ghost/admin/app/components/gh-member-settings-form.js | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ghost/admin/app/components/gh-member-settings-form.hbs b/ghost/admin/app/components/gh-member-settings-form.hbs index a4da152d91..4eac44c1a0 100644 --- a/ghost/admin/app/components/gh-member-settings-form.hbs +++ b/ghost/admin/app/components/gh-member-settings-form.hbs @@ -123,9 +123,9 @@

{{tier.name}} {{#if (eq sub.status "canceled")}} - Cancelled + Canceled {{else if sub.cancel_at_period_end}} - Cancelled + Canceled {{else if sub.compExpiry}} Active {{else if sub.trialUntil}} @@ -147,9 +147,9 @@ {{/if}} {{/if}} - {{#if (eq sub.status "canceled")}} + {{#if sub.hasEnded}} Ended {{sub.validUntil}} - {{else if sub.cancel_at_period_end}} + {{else if sub.willEndSoon}} Has access until {{sub.validUntil}} {{else if sub.compExpiry}} Expires {{sub.compExpiry}} diff --git a/ghost/admin/app/components/gh-member-settings-form.js b/ghost/admin/app/components/gh-member-settings-form.js index 467a240a24..8596af3b45 100644 --- a/ghost/admin/app/components/gh-member-settings-form.js +++ b/ghost/admin/app/components/gh-member-settings-form.js @@ -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,