mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
9d67980a7e
refs #5798, closes #5018 - adds new `gh-fullscreen-modal` component - modals are now specified in-context so that they can have deeper interaction with their surrounding components/controller/route, i.e. a modal component can be a thin confirm/deny wrapper over the underlying controller action keeping all context-sensitive logic in one place - adds spin-buttons to all modals with async behaviour - adds/improves behaviour of inline-validation in modals - improves re-authenticate modal to properly handle validation and authentication errors
30 lines
665 B
JavaScript
30 lines
665 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {Controller, computed, inject} = Ember;
|
|
const {alias, filter} = computed;
|
|
|
|
export default Controller.extend({
|
|
|
|
showInviteUserModal: false,
|
|
|
|
users: alias('model'),
|
|
|
|
session: inject.service(),
|
|
|
|
activeUsers: filter('users', function (user) {
|
|
return /^active|warn-[1-4]|locked$/.test(user.get('status'));
|
|
}),
|
|
|
|
invitedUsers: filter('users', function (user) {
|
|
let status = user.get('status');
|
|
|
|
return status === 'invited' || status === 'invited-pending';
|
|
}),
|
|
|
|
actions: {
|
|
toggleInviteUserModal() {
|
|
this.toggleProperty('showInviteUserModal');
|
|
}
|
|
}
|
|
});
|