mirror of
https://github.com/discourse/discourse.git
synced 2025-04-25 16:04:30 +08:00
FIX: Broken topic invite button.
This commit is contained in:
parent
d89d279416
commit
bdf1be65a3
@ -26,7 +26,12 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed('model.admin', 'emailOrUsername', 'invitingToTopic', 'isPrivateTopic', 'model.groupNames', 'model.saving', 'model.details.can_invite_to')
|
@computed
|
||||||
|
isAdmin() {
|
||||||
|
return this.currentUser.admin;
|
||||||
|
},
|
||||||
|
|
||||||
|
@computed('isAdmin', 'emailOrUsername', 'invitingToTopic', 'isPrivateTopic', 'model.groupNames', 'model.saving', 'model.details.can_invite_to')
|
||||||
disabled(isAdmin, emailOrUsername, invitingToTopic, isPrivateTopic, groupNames, saving, can_invite_to) {
|
disabled(isAdmin, emailOrUsername, invitingToTopic, isPrivateTopic, groupNames, saving, can_invite_to) {
|
||||||
if (saving) return true;
|
if (saving) return true;
|
||||||
if (Ember.isEmpty(emailOrUsername)) return true;
|
if (Ember.isEmpty(emailOrUsername)) return true;
|
||||||
@ -43,7 +48,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
|
||||||
@computed('model.admin', 'emailOrUsername', 'model.saving', 'isPrivateTopic', 'model.groupNames', 'hasCustomMessage')
|
@computed('isAdmin', 'emailOrUsername', 'model.saving', 'isPrivateTopic', 'model.groupNames', 'hasCustomMessage')
|
||||||
disabledCopyLink(isAdmin, emailOrUsername, saving, isPrivateTopic, groupNames, hasCustomMessage) {
|
disabledCopyLink(isAdmin, emailOrUsername, saving, isPrivateTopic, groupNames, hasCustomMessage) {
|
||||||
if (hasCustomMessage) return true;
|
if (hasCustomMessage) return true;
|
||||||
if (saving) return true;
|
if (saving) return true;
|
||||||
@ -93,9 +98,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
// Allow Existing Members? (username autocomplete)
|
// Allow Existing Members? (username autocomplete)
|
||||||
allowExistingMembers: Ember.computed.alias('invitingToTopic'),
|
allowExistingMembers: Ember.computed.alias('invitingToTopic'),
|
||||||
|
|
||||||
@computed("model.admin", "model.group_users")
|
@computed("isAdmin", "model.group_users")
|
||||||
isGroupOwnerOrAdmin(isAdmin, groupUsers) {
|
isGroupOwnerOrAdmin(isAdmin, groupUsers) {
|
||||||
return isAdmin || groupUsers.some(groupUser => groupUser.owner);
|
debugger;
|
||||||
|
return isAdmin || (groupUsers && groupUsers.some(groupUser => groupUser.owner));
|
||||||
},
|
},
|
||||||
|
|
||||||
// Show Groups? (add invited user to private group)
|
// Show Groups? (add invited user to private group)
|
||||||
@ -113,7 +119,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Instructional text for the modal.
|
// Instructional text for the modal.
|
||||||
@computed('isMessage', 'invitingToTopic', 'emailOrUsername', 'isPrivateTopic', 'model.admin', 'canInviteViaEmail')
|
@computed('isMessage', 'invitingToTopic', 'emailOrUsername', 'isPrivateTopic', 'isAdmin', 'canInviteViaEmail')
|
||||||
inviteInstructions(isMessage, invitingToTopic, emailOrUsername, isPrivateTopic, isAdmin, canInviteViaEmail) {
|
inviteInstructions(isMessage, invitingToTopic, emailOrUsername, isPrivateTopic, isAdmin, canInviteViaEmail) {
|
||||||
if (!canInviteViaEmail) {
|
if (!canInviteViaEmail) {
|
||||||
// can't invite via email, only existing users
|
// can't invite via email, only existing users
|
||||||
|
Loading…
x
Reference in New Issue
Block a user