2017-09-11 10:41:17 +03:00
|
|
|
import ModalComponent from 'ghost-admin/components/modal-base';
|
2017-08-22 10:53:26 +03:00
|
|
|
import {alias} from '@ember/object/computed';
|
2022-07-12 15:09:02 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2017-01-19 14:40:31 +03:00
|
|
|
import {task} from 'ember-concurrency';
|
2015-11-18 13:50:48 +03:00
|
|
|
|
|
|
|
export default ModalComponent.extend({
|
2022-07-12 15:09:02 +03:00
|
|
|
store: service(),
|
|
|
|
|
2018-03-20 17:57:59 +03:00
|
|
|
// Allowed actions
|
|
|
|
confirm: () => {},
|
2015-11-18 13:50:48 +03:00
|
|
|
|
2016-08-24 16:26:29 +03:00
|
|
|
user: alias('model'),
|
2015-11-18 13:50:48 +03:00
|
|
|
|
2018-01-11 20:43:23 +03:00
|
|
|
actions: {
|
|
|
|
confirm() {
|
2019-03-06 16:53:54 +03:00
|
|
|
this.deleteUser.perform();
|
2018-01-11 20:43:23 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2022-07-12 15:09:02 +03:00
|
|
|
get ownerUser() {
|
|
|
|
return this.store.peekAll('user').findBy('isOwnerOnly', true);
|
|
|
|
},
|
|
|
|
|
2017-01-19 14:40:31 +03:00
|
|
|
deleteUser: task(function* () {
|
|
|
|
try {
|
2018-03-20 17:57:59 +03:00
|
|
|
yield this.confirm();
|
2017-01-19 14:40:31 +03:00
|
|
|
} finally {
|
|
|
|
this.send('closeModal');
|
|
|
|
}
|
2018-01-11 20:43:23 +03:00
|
|
|
}).drop()
|
2015-11-18 13:50:48 +03:00
|
|
|
});
|