Ghost/ghost/admin/app/components/modal-select-user-role.js
Gabriel Csapo d51f2bcf23 [chore] migrate to eslint@8 and run --fix (#2256)
closes https://github.com/TryGhost/Admin/pull/2107

- updated related babel dependencies
- bumped eslint
- ran `yarn lint:js --fix`
- added eslint ignore comments for some required non-camel-case properties
2022-02-10 10:41:36 +00:00

40 lines
919 B
JavaScript

import ModalBase from 'ghost-admin/components/modal-base';
import classic from 'ember-classic-decorator';
import {action} from '@ember/object';
import {tracked} from '@glimmer/tracking';
// TODO: update modals to work fully with Glimmer components
@classic
export default class ModalPostPreviewComponent extends ModalBase {
@tracked role;
// TODO: rename to confirm() when modals have full Glimmer support
@action
confirmAction() {
this.confirm(this.role);
this.close();
}
@action
close(event) {
event?.preventDefault?.();
this.closeModal();
}
@action
setRoleFromModel() {
this.role = this.model;
}
actions = {
confirm() {
this.confirmAction(...arguments);
},
// needed because ModalBase uses .send() for keyboard events
closeModal() {
this.close();
}
};
}