2018-01-11 01:57:43 +03:00
|
|
|
/* eslint-disable ghost/ember/alias-model-in-controller */
|
2017-08-22 10:53:26 +03:00
|
|
|
import Controller from '@ember/controller';
|
2017-10-30 12:38:01 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {sort} from '@ember/object/computed';
|
2014-07-20 20:42:03 +04:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
export default Controller.extend({
|
2017-11-24 21:53:19 +03:00
|
|
|
session: service(),
|
|
|
|
|
2015-11-18 13:50:48 +03:00
|
|
|
showInviteUserModal: false,
|
2014-07-02 07:44:39 +04:00
|
|
|
|
2017-03-08 21:21:35 +03:00
|
|
|
activeUsers: null,
|
|
|
|
suspendedUsers: null,
|
2016-09-26 19:03:53 +03:00
|
|
|
invites: null,
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2017-11-24 21:53:19 +03:00
|
|
|
inviteOrder: null,
|
|
|
|
userOrder: null,
|
2015-11-18 13:50:48 +03:00
|
|
|
|
2018-03-19 14:54:54 +03:00
|
|
|
init() {
|
|
|
|
this._super(...arguments);
|
|
|
|
this.inviteOrder = ['email'];
|
|
|
|
this.userOrder = ['name', 'email'];
|
|
|
|
},
|
|
|
|
|
2016-09-26 19:03:53 +03:00
|
|
|
sortedInvites: sort('invites', 'inviteOrder'),
|
2017-03-08 21:21:35 +03:00
|
|
|
sortedActiveUsers: sort('activeUsers', 'userOrder'),
|
|
|
|
sortedSuspendedUsers: sort('suspendedUsers', 'userOrder'),
|
|
|
|
|
2015-11-18 13:50:48 +03:00
|
|
|
actions: {
|
|
|
|
toggleInviteUserModal() {
|
|
|
|
this.toggleProperty('showInviteUserModal');
|
|
|
|
}
|
|
|
|
}
|
2014-07-02 07:44:39 +04:00
|
|
|
});
|