mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
Merge pull request #5694 from kevinansfield/zelda-invite-fixes
Minor UI fixes for invitations
This commit is contained in:
commit
566bc03f5f
@ -4,6 +4,7 @@ export default Ember.Component.extend({
|
||||
tagName: '',
|
||||
|
||||
user: null,
|
||||
isSending: false,
|
||||
|
||||
notifications: Ember.inject.service(),
|
||||
|
||||
@ -16,8 +17,10 @@ export default Ember.Component.extend({
|
||||
actions: {
|
||||
resend: function () {
|
||||
var user = this.get('user'),
|
||||
notifications = this.get('notifications');
|
||||
notifications = this.get('notifications'),
|
||||
self = this;
|
||||
|
||||
this.set('isSending', true);
|
||||
user.resendInvite().then(function (result) {
|
||||
var notificationText = 'Invitation resent! (' + user.get('email') + ')';
|
||||
|
||||
@ -31,6 +34,8 @@ export default Ember.Component.extend({
|
||||
}
|
||||
}).catch(function (error) {
|
||||
notifications.showAPIError(error);
|
||||
}).finally(function () {
|
||||
self.set('isSending', false);
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -74,7 +74,7 @@ export default Ember.Controller.extend({
|
||||
if (newUser.get('status') === 'invited-pending') {
|
||||
self.get('notifications').showAlert('Invitation email was not sent. Please try resending.', {type: 'error'});
|
||||
} else {
|
||||
self.get('notifications').showAlert(notificationText, {type: 'success'});
|
||||
self.get('notifications').showNotification(notificationText);
|
||||
}
|
||||
}).catch(function (errors) {
|
||||
newUser.deleteRecord();
|
||||
|
@ -37,12 +37,16 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
<aside class="user-list-item-aside">
|
||||
<a class="user-list-action" href="#" {{action "revoke" target=component}}>
|
||||
Revoke
|
||||
</a>
|
||||
<a class="user-list-action" href="#" {{action "resend" target=component}}>
|
||||
Resend
|
||||
</a>
|
||||
{{#if component.isSending}}
|
||||
<span>Sending Invite...</span>
|
||||
{{else}}
|
||||
<a class="user-list-action" href="#" {{action "revoke" target=component}}>
|
||||
Revoke
|
||||
</a>
|
||||
<a class="user-list-action" href="#" {{action "resend" target=component}}>
|
||||
Resend
|
||||
</a>
|
||||
{{/if}}
|
||||
</aside>
|
||||
</div>
|
||||
{{/gh-user-invited}}
|
||||
|
Loading…
Reference in New Issue
Block a user