Ghost/ghost/admin/app/components/gh-membership-products-alpha.js
Rishabh 72ca4ded76 Removed portal option for default product for tiers UI
no refs

This change reverts the last commit to add portal option to product as it breaks the model that is passed to popup.

This reverts commit 5f538b5036.
2021-06-04 16:14:05 +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();
}
}