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:
Guo Xiang Tan 2017-05-12 09:25:38 +08:00
parent 55b61e9bea
commit e63614024d
3 changed files with 1 additions and 24 deletions

View File

@ -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) {

View File

@ -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

View File

@ -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 }