Ghost/ghost/admin/app/components/gh-membership-products-alpha.js
Rishabh 6165441c30 Added UI for handling multiple tiers in membership settings
refs https://github.com/TryGhost/Team/issues/715

Adds new modal and component to handle managing a list of products(tiers) in Admin behind the developer experiments flag. Also adds a new helper for stripe prices to convert amount from decimal value.
2021-06-04 13:30:11 +05:30

42 lines
919 B
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';
export default class extends Component {
@service membersUtils;
@service ghostPaths;
@service ajax;
@service store;
@service config;
@tracked showProductModal = false;
@tracked productModel = null;
get products() {
return this.args.products;
}
@action
async openEditProduct(product) {
this.productModel = product;
this.showProductModal = true;
}
@action
async openNewProduct() {
this.productModel = this.store.createRecord('product');
this.showProductModal = true;
}
@action
closeProductModal() {
this.showProductModal = false;
}
@action
confirmProductSave() {
this.args.confirmProductSave();
}
}