mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Handled dummy subscription for comped members
refs https://github.com/TryGhost/Team/issues/986#issuecomment-900281186 The tiers features updated the "comped" functionality to no longer create a Stripe Subscription for members. Since theme developers expect comped members will have a subscription, we added a dummy subscription object for comped members in API. Since Admin previously expected comped members to be ones without any subscription but access to product, this change updates Admin behavior to identify comped subscriptions on a product and show them the same way as before.
This commit is contained in:
parent
23c6547b5b
commit
b5bc870a3b
2 changed files with 97 additions and 60 deletions
|
@ -145,6 +145,41 @@
|
|||
</h3>
|
||||
|
||||
{{#each product.subscriptions as |sub|}}
|
||||
{{#if sub.isComplimentary}}
|
||||
<div class="gh-memberproduct-subscription">
|
||||
<div>
|
||||
<div>
|
||||
<span class="gh-cp-memberproduct-pricelabel">Complimentary</span>
|
||||
<span class="gh-badge active">Active</span>
|
||||
</div>
|
||||
<div class="gh-memberproduct-created">Created on</div>
|
||||
</div>
|
||||
<div class="flex items-center">
|
||||
<div class="gh-product-card-price">
|
||||
<div class="flex items-start">
|
||||
<span class="currency-symbol">$</span>
|
||||
<span class="amount">0</span>
|
||||
</div>
|
||||
<div class="period">yearly</div>
|
||||
</div>
|
||||
<span class="action-menu">
|
||||
<GhDropdownButton @dropdownName="subscription-menu-complimentary" @classNames="gh-btn gh-btn-outline gh-btn-icon gh-btn-subscription-action icon-only" @title="Actions">
|
||||
<span>
|
||||
{{svg-jar "dotdotdot"}}
|
||||
<span class="hidden">Subscription menu</span>
|
||||
</span>
|
||||
</GhDropdownButton>
|
||||
<GhDropdown @name="subscription-menu-complimentary" @tagName="ul" @classNames="product-actions-menu dropdown-menu dropdown-align-right">
|
||||
<li>
|
||||
<button {{action "removeComplimentary" product.id}}>
|
||||
<span class="red">Remove complimentary subscription</span>
|
||||
</button>
|
||||
</li>
|
||||
</GhDropdown>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="gh-memberproduct-subscription">
|
||||
<div>
|
||||
<div>
|
||||
|
@ -207,6 +242,7 @@
|
|||
</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
|
||||
{{#if (and (feature "multipleProducts") (eq product.subscriptions.length 0))}}
|
||||
|
|
|
@ -62,7 +62,8 @@ export default class extends Component {
|
|||
...sub.price,
|
||||
currencySymbol: getSymbol(sub.price.currency),
|
||||
nonDecimalAmount: getNonDecimal(sub.price.amount)
|
||||
}
|
||||
},
|
||||
isComplimentary: !sub.id
|
||||
};
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue