mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
🐛 Fixed blank data in member customer tab
refs 772f5fa766
- when pulling the customer data display out of the subscriptions loop the data output was not updated to match
- adds a `customer` property to the `<GhMemberSettingsForm>` backing class that pulls the customer data from the first available subscription and adds the `startDate` property. Using the first available customer record works because there's a 1:1 mapping of member to stripe customer
This commit is contained in:
parent
0a710d7b70
commit
8c712d62bf
2 changed files with 19 additions and 8 deletions
|
@ -216,6 +216,7 @@
|
|||
</section>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
|
||||
<section class="gh-member-stripe-info pa5 pb0 pt4 flex flex-column flex-row-ns items-start justify-between">
|
||||
<div class="flex items-start w-100">
|
||||
<div class="flex-auto">
|
||||
|
@ -223,16 +224,16 @@
|
|||
<tr class="gh-member-stripe-row">
|
||||
<td class="gh-member-stripe-label">Stripe customer ID</td>
|
||||
<td class="gh-member-stripe-data gh-member-stripe-id">
|
||||
<a href="https://dashboard.stripe.com/customers/{{subscription.customer.id}}" target="_blank" rel="noopener" data-tooltip="View on Stripe">
|
||||
{{subscription.customer.id}}
|
||||
<a href="https://dashboard.stripe.com/customers/{{customer.id}}" target="_blank" rel="noopener" data-tooltip="View on Stripe">
|
||||
{{customer.id}}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="gh-member-stripe-row">
|
||||
<td class="gh-member-stripe-label">Name</td>
|
||||
<td class="gh-member-stripe-data">
|
||||
{{#if subscription.customer.name}}
|
||||
{{subscription.customer.name}}
|
||||
{{#if customer.name}}
|
||||
{{customer.name}}
|
||||
{{else}}
|
||||
<span class="midgrey-d1">No name</span>
|
||||
{{/if}}
|
||||
|
@ -241,8 +242,8 @@
|
|||
<tr class="gh-member-stripe-row">
|
||||
<td class="gh-member-stripe-label">Email</td>
|
||||
<td class="gh-member-stripe-data gh-member-stripe-email">
|
||||
{{#if subscription.customer.email}}
|
||||
{{subscription.customer.email}}
|
||||
{{#if customer.email}}
|
||||
{{customer.email}}
|
||||
{{else}}
|
||||
<span class="midgrey-d1">No email</span>
|
||||
{{/if}}
|
||||
|
@ -251,8 +252,8 @@
|
|||
<tr class="gh-member-stripe-row">
|
||||
<td class="gh-member-stripe-label">Customer since</td>
|
||||
<td class="gh-member-stripe-data">
|
||||
{{#if subscription.startDate}}
|
||||
{{subscription.startDate}}
|
||||
{{#if customer.startDate}}
|
||||
{{customer.startDate}}
|
||||
{{else}}
|
||||
<span class="midgrey-d1">No data</span>
|
||||
{{/if}}
|
||||
|
|
|
@ -56,6 +56,16 @@ export default Component.extend({
|
|||
return null;
|
||||
}),
|
||||
|
||||
customer: computed('subscriptions.[]', function () {
|
||||
let customer = this.subscriptions.firstObject?.customer;
|
||||
if (customer) {
|
||||
return Object.assign({}, this.subscriptions.firstObject?.customer, {
|
||||
startDate: this.subscriptions.firstObject?.startDate
|
||||
});
|
||||
}
|
||||
return null;
|
||||
}),
|
||||
|
||||
actions: {
|
||||
setProperty(property, value) {
|
||||
this.setProperty(property, value);
|
||||
|
|
Loading…
Add table
Reference in a new issue