mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
FIX: Users can't request to join group due to alias level restriction.
https://meta.discourse.org/t/request-to-join-group-not-working/62371
This commit is contained in:
parent
55b61e9bea
commit
e63614024d
@ -8,11 +8,6 @@ export default Ember.Component.extend({
|
||||
return publicGroup;
|
||||
},
|
||||
|
||||
@computed('model.allow_membership_requests', 'model.alias_level')
|
||||
canRequestMembership(allowMembershipRequests, aliasLevel) {
|
||||
return allowMembershipRequests && aliasLevel === 99;
|
||||
},
|
||||
|
||||
@computed("model.is_group_user", "model.id", "groupUserIds")
|
||||
userIsGroupUser(isGroupUser, groupId, groupUserIds) {
|
||||
if (isGroupUser !== undefined) {
|
||||
|
@ -12,7 +12,7 @@
|
||||
label="groups.join"
|
||||
disabled=updatingMembership}}
|
||||
{{/if}}
|
||||
{{else if canRequestMembership}}
|
||||
{{else if model.allow_membership_requests}}
|
||||
{{#if userIsGroupUser}}
|
||||
{{#if showMembershipStatus}}
|
||||
{{d-button
|
||||
|
@ -18,24 +18,6 @@ test('canJoinGroup', function() {
|
||||
equal(this.subject().get("canJoinGroup"), true, "can't join group when not logged in");
|
||||
});
|
||||
|
||||
test('canRequestMembership', function() {
|
||||
this.subject().setProperties({
|
||||
model: { allow_membership_requests: false, alias_level: 0 }
|
||||
});
|
||||
|
||||
equal(this.subject().get('canRequestMembership'), false);
|
||||
|
||||
this.subject().setProperties({
|
||||
currentUser: currentUser(), model: { allow_membership_requests: true, alias_level: 99 }
|
||||
});
|
||||
|
||||
equal(this.subject().get('canRequestMembership'), true);
|
||||
|
||||
this.subject().set("model.alias_level", 0);
|
||||
|
||||
equal(this.subject().get('canRequestMembership'), false);
|
||||
});
|
||||
|
||||
test('userIsGroupUser', function() {
|
||||
this.subject().setProperties({
|
||||
model: { is_group_user: true }
|
||||
|
Loading…
Reference in New Issue
Block a user