Ghost/ghost/admin/app/components/gh-members-list-item-column.js
Rishabh Garg c1ad9475d7 Added filter by tiers to members filter UI (#2274)
closes https://github.com/TryGhost/Team/issues/1029

- allows site owner to filter members on specific tier
- needs tiers beta flag enabled and site should have more than 1 paid tiers.
2022-02-28 16:08:44 +05:30

29 lines
842 B
JavaScript

import Component from '@glimmer/component';
export default class GhMembersListItemColumn extends Component {
constructor(...args) {
super(...args);
}
get labels() {
const labelData = this.args.member.get('labels') || [];
return labelData.map(label => label.name).join(', ');
}
get products() {
const productData = this.args.member.get('products') || [];
return productData.map(product => product.name).join(', ');
}
get subscriptionStatus() {
const subscriptions = this.args.member.get('subscriptions') || [];
return subscriptions[0]?.status;
}
get billingPeriod() {
const subscriptions = this.args.member.get('subscriptions') || [];
const billingPeriod = subscriptions[0]?.price?.interval;
return billingPeriod;
}
}