Ghost/ghost/admin/app/components/settings/members/archive-tier.js
Rishabh Garg baf6ec07a8 Wired UI for archiving tiers (#2231)
refs https://github.com/TryGhost/Team/issues/1252

- allows site owners to (un)archive existing tiers via Admin UI
- adds option to switch between archived or active tiers view

Co-authored-by: Djordje Vlaisavljevic <dzvlais@gmail.com>
2022-01-31 23:56:12 +05:30

41 lines
1.0 KiB
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {inject as service} from '@ember/service';
export default class ArchiveTierComponent extends Component {
@service notifications;
@service router;
@service modals;
get isActive() {
const {product} = this.args;
return !!product.active;
}
get product() {
return this.args.product;
}
@action
handleArchiveTier() {
if (!this.product.isNew) {
this.modals.open('modals/tiers/archive', {
product: this.product
}, {
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
});
}
}
@action
handleUnarchiveTier() {
if (!this.product.isNew) {
this.modals.open('modals/tiers/unarchive', {
product: this.product
}, {
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
});
}
}
}