2022-03-14 15:38:39 +03:00
|
|
|
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() {
|
2022-05-11 20:11:54 +03:00
|
|
|
const {tier} = this.args;
|
|
|
|
return !!tier.active;
|
2022-03-14 15:38:39 +03:00
|
|
|
}
|
|
|
|
|
2022-05-11 20:11:54 +03:00
|
|
|
get tier() {
|
|
|
|
return this.args.tier;
|
2022-03-14 15:38:39 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
handleArchiveTier() {
|
2022-05-11 20:11:54 +03:00
|
|
|
if (!this.tier.isNew) {
|
2022-03-14 15:38:39 +03:00
|
|
|
this.modals.open('modals/tiers/archive', {
|
2022-05-11 20:11:54 +03:00
|
|
|
tier: this.tier,
|
2022-03-14 15:38:39 +03:00
|
|
|
onArchive: this.args.onArchive
|
|
|
|
}, {
|
|
|
|
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
handleUnarchiveTier() {
|
2022-05-11 20:11:54 +03:00
|
|
|
if (!this.tier.isNew) {
|
2022-03-14 15:38:39 +03:00
|
|
|
this.modals.open('modals/tiers/unarchive', {
|
2022-05-11 20:11:54 +03:00
|
|
|
tier: this.tier,
|
2022-03-14 15:38:39 +03:00
|
|
|
onUnarchive: this.args.onUnarchive
|
|
|
|
}, {
|
|
|
|
className: 'fullscreen-modal fullscreen-modal-action fullscreen-modal-wide'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|