mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
affe6743e5
refs: https://github.com/TryGhost/Team/issues/1145 - this should allow us to remove the /products endpoint in v5 It avoids: - `kg-product-card`, that really is meant to say product - `product-cadence` on offers Co-authored-by: Rishabh <zrishabhgarg@gmail.com>
43 lines
1.1 KiB
JavaScript
43 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 {tier} = this.args;
|
|
return !!tier.active;
|
|
}
|
|
|
|
get tier() {
|
|
return this.args.tier;
|
|
}
|
|
|
|
@action
|
|
handleArchiveTier() {
|
|
if (!this.tier.isNew) {
|
|
this.modals.open('modals/tiers/archive', {
|
|
tier: this.tier,
|
|
onArchive: this.args.onArchive
|
|
}, {
|
|
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
|
|
});
|
|
}
|
|
}
|
|
|
|
@action
|
|
handleUnarchiveTier() {
|
|
if (!this.tier.isNew) {
|
|
this.modals.open('modals/tiers/unarchive', {
|
|
tier: this.tier,
|
|
onUnarchive: this.args.onUnarchive
|
|
}, {
|
|
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
|
|
});
|
|
}
|
|
}
|
|
}
|