mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Removed add complimentary option for member when no active tiers
refs https://github.com/TryGhost/Team/issues/1252 "Add complimentary subscription" doesn't make sense when there are no active tiers for site in member detail screen
This commit is contained in:
parent
c67e76a1ff
commit
40c78b6be6
2 changed files with 17 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
<div class="gh-member-settings" ...attributes>
|
||||
<div class="gh-member-settings" ...attributes {{did-insert this.setup}}>
|
||||
|
||||
<GhMemberDetails class="gh-main-section no-heading" @member={{@member}} />
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ export default class extends Component {
|
|||
this.scratchMember = this.args.scratchMember;
|
||||
}
|
||||
|
||||
@tracked
|
||||
showMemberProductModal = false;
|
||||
@tracked showMemberProductModal = false;
|
||||
@tracked productsList;
|
||||
|
||||
get canShowStripeInfo() {
|
||||
return !this.member.get('isNew') && this.membersUtils.isStripeEnabled;
|
||||
|
@ -37,6 +37,10 @@ export default class extends Component {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (this.feature.get('multipleProducts')) {
|
||||
return !!this.productsList?.length;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -86,6 +90,11 @@ export default class extends Component {
|
|||
return null;
|
||||
}
|
||||
|
||||
@action
|
||||
setup() {
|
||||
this.fetchProducts.perform();
|
||||
}
|
||||
|
||||
get isCreatingComplimentary() {
|
||||
return this.args.isSaveRunning;
|
||||
}
|
||||
|
@ -173,4 +182,9 @@ export default class extends Component {
|
|||
this.store.pushPayload('member', response);
|
||||
return response;
|
||||
}
|
||||
|
||||
@task({drop: true})
|
||||
*fetchProducts() {
|
||||
this.productsList = yield this.store.query('product', {filter: 'type:paid+active:true', include: 'monthly_price,yearly_price'});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue