Ghost/ghost/admin/app/components/settings/members/archive-tier.js
Rishabh 498efd00cb Refined tiers list to switch to active list on unarchive
refs https://github.com/TryGhost/Team/issues/1252

- on unarchiving a tier, we switch back to active tier list instead of staying back on archived list
2022-02-02 16:24:20 +05:30

42 lines
1.1 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,
onUnarchive: this.args.onUnarchive
}, {
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
});
}
}
}