Added cancellation reason to Members UI (#1782)

refs https://github.com/TryGhost/Ghost/issues/12403

This is only displayed when it is present, so as not to clutter the UI
unless it's required.
This commit is contained in:
Fabien 'egg' O'Carroll 2020-11-24 10:20:21 +00:00 committed by GitHub
parent 50a423ed2b
commit 9cd6ed06a7
2 changed files with 9 additions and 0 deletions

View File

@ -172,6 +172,14 @@
{{/if}}
</td>
</tr>
{{#if subscription.cancellationReason}}
<tr>
<td class="gh-member-stripe-label">Cancellation reason</td>
<td class="gh-member-stripe-data">
<span class="gh-member-stripe-cancellation-reason">{{subscription.cancellationReason}}</span>
</td>
</tr>
{{/if}}
<tr>
<td class="gh-member-stripe-label">Next renewal date</td>
<td class="gh-member-stripe-data">

View File

@ -45,6 +45,7 @@ export default Component.extend({
plan: subscription.plan,
amount: parseInt(subscription.plan.amount) ? (subscription.plan.amount / 100) : 0,
cancelAtPeriodEnd: subscription.cancel_at_period_end,
cancellationReason: subscription.cancellation_reason,
validUntil: subscription.current_period_end ? moment(subscription.current_period_end).format('D MMM YYYY') : '-'
};
}).reverse();