mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
ffe5416b77
closes https://github.com/TryGhost/Team/issues/572 Role selection when inviting users was updated to show information about each staff role. This change updates the staff edit screen to use the same UI for changing the role of an existing user. - added `select-user-role` modal which uses `<GhRoleSelection>` to allow role selection - replaced the `<select>` input for changing a user's role with a button that triggers the role selection modal - role is not set unless the "Set role" button is clicked after making a selection, cancel or close will leave the original role selected
40 lines
923 B
JavaScript
40 lines
923 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.args.close();
|
|
}
|
|
}
|
|
}
|