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>
|
</section>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|
||||||
<section class="gh-member-stripe-info pa5 pb0 pt4 flex flex-column flex-row-ns items-start justify-between">
|
<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 items-start w-100">
|
||||||
<div class="flex-auto">
|
<div class="flex-auto">
|
||||||
|
@ -223,16 +224,16 @@
|
||||||
<tr class="gh-member-stripe-row">
|
<tr class="gh-member-stripe-row">
|
||||||
<td class="gh-member-stripe-label">Stripe customer ID</td>
|
<td class="gh-member-stripe-label">Stripe customer ID</td>
|
||||||
<td class="gh-member-stripe-data gh-member-stripe-id">
|
<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">
|
<a href="https://dashboard.stripe.com/customers/{{customer.id}}" target="_blank" rel="noopener" data-tooltip="View on Stripe">
|
||||||
{{subscription.customer.id}}
|
{{customer.id}}
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="gh-member-stripe-row">
|
<tr class="gh-member-stripe-row">
|
||||||
<td class="gh-member-stripe-label">Name</td>
|
<td class="gh-member-stripe-label">Name</td>
|
||||||
<td class="gh-member-stripe-data">
|
<td class="gh-member-stripe-data">
|
||||||
{{#if subscription.customer.name}}
|
{{#if customer.name}}
|
||||||
{{subscription.customer.name}}
|
{{customer.name}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="midgrey-d1">No name</span>
|
<span class="midgrey-d1">No name</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -241,8 +242,8 @@
|
||||||
<tr class="gh-member-stripe-row">
|
<tr class="gh-member-stripe-row">
|
||||||
<td class="gh-member-stripe-label">Email</td>
|
<td class="gh-member-stripe-label">Email</td>
|
||||||
<td class="gh-member-stripe-data gh-member-stripe-email">
|
<td class="gh-member-stripe-data gh-member-stripe-email">
|
||||||
{{#if subscription.customer.email}}
|
{{#if customer.email}}
|
||||||
{{subscription.customer.email}}
|
{{customer.email}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="midgrey-d1">No email</span>
|
<span class="midgrey-d1">No email</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
@ -251,8 +252,8 @@
|
||||||
<tr class="gh-member-stripe-row">
|
<tr class="gh-member-stripe-row">
|
||||||
<td class="gh-member-stripe-label">Customer since</td>
|
<td class="gh-member-stripe-label">Customer since</td>
|
||||||
<td class="gh-member-stripe-data">
|
<td class="gh-member-stripe-data">
|
||||||
{{#if subscription.startDate}}
|
{{#if customer.startDate}}
|
||||||
{{subscription.startDate}}
|
{{customer.startDate}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<span class="midgrey-d1">No data</span>
|
<span class="midgrey-d1">No data</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
|
@ -56,6 +56,16 @@ export default Component.extend({
|
||||||
return null;
|
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: {
|
actions: {
|
||||||
setProperty(property, value) {
|
setProperty(property, value) {
|
||||||
this.setProperty(property, value);
|
this.setProperty(property, value);
|
||||||
|
|
Loading…
Add table
Reference in a new issue