Add extensibility point for suspension modal

This commit is contained in:
Robin Ward 2018-01-10 13:56:39 -05:00
parent 8bb6856fde
commit 213cc2fe51
1 changed files with 10 additions and 5 deletions

View File

@ -28,6 +28,11 @@ export default Ember.Service.extend({
}; };
}, },
// Can be overridden to extend the modal contents if necessary
beforeControlModal() {
return Ember.RSVP.resolve();
},
_showControlModal(type, user, opts) { _showControlModal(type, user, opts) {
opts = opts || {}; opts = opts || {};
@ -39,11 +44,11 @@ export default Ember.Service.extend({
controller.set('post', opts.post); controller.set('post', opts.post);
} }
let promise = user.adminUserView ? return this.beforeControlModal(controller).then(() => {
Ember.RSVP.resolve(user) : return user.adminUserView ?
AdminUser.find(user.get('id')); Ember.RSVP.resolve(user) :
AdminUser.find(user.get('id'));
promise.then(loadedUser => { }).then(loadedUser => {
controller.setProperties({ controller.setProperties({
user: loadedUser, user: loadedUser,
loadingUser: false, loadingUser: false,