mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-12 06:25:51 +03:00
2555b70456
refs TryGhost/Team#627 This updates the new Products settings screens to use real data from API for existing Custom Products and Prices to populate them on UI and allow site owners to edit them. - List all Products of site and allow editing Product name - List all Prices for a product and allow editing individual Price names - Add new Prices on a Product
36 lines
821 B
JavaScript
36 lines
821 B
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
const PERIODS = [
|
|
{label: 'Monthly', period: 'month'},
|
|
{label: 'Yearly', period: 'year'}
|
|
];
|
|
|
|
export default class GhProductsPriceBillingPeriodComponent extends Component {
|
|
@service feature;
|
|
@service session;
|
|
@service settings;
|
|
|
|
constructor() {
|
|
super(...arguments);
|
|
this.availablePeriods = PERIODS;
|
|
}
|
|
|
|
get value() {
|
|
const {value} = this.args;
|
|
return value;
|
|
}
|
|
get disabled() {
|
|
const {disabled} = this.args;
|
|
return disabled || false;
|
|
}
|
|
|
|
@action
|
|
updatePeriod(newPeriod) {
|
|
if (this.args.updatePeriod) {
|
|
this.args.updatePeriod(this.args.value, newPeriod);
|
|
}
|
|
}
|
|
}
|