mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Arrive at topic must be hidden when must_approve_users
(#18504)
This commit is contained in:
parent
73e9875a1d
commit
70d0892ac9
@ -182,6 +182,14 @@ export default Controller.extend(
|
|||||||
return staff || groups.any((g) => g.owner);
|
return staff || groups.any((g) => g.owner);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@discourseComputed("currentUser.staff")
|
||||||
|
canArriveAtTopic(staff) {
|
||||||
|
if (staff && !this.siteSettings.must_approve_users) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
|
||||||
@discourseComputed
|
@discourseComputed
|
||||||
timeShortcuts() {
|
timeShortcuts() {
|
||||||
const timezone = this.currentUser.timezone;
|
const timezone = this.currentUser.timezone;
|
||||||
|
@ -59,7 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if this.currentUser.staff}}
|
{{#if this.canArriveAtTopic}}
|
||||||
<div class="input-group invite-to-topic">
|
<div class="input-group invite-to-topic">
|
||||||
<label for="invite-topic">{{d-icon "hand-point-right"}}{{i18n "user.invited.invite.invite_to_topic"}}</label>
|
<label for="invite-topic">{{d-icon "hand-point-right"}}{{i18n "user.invited.invite.invite_to_topic"}}</label>
|
||||||
<TopicChooser @value={{this.buffered.topicId}} @content={{this.topics}} @onChange={{action "onChangeTopic"}} @options={{hash
|
<TopicChooser @value={{this.buffered.topicId}} @content={{this.topics}} @onChange={{action "onChangeTopic"}} @options={{hash
|
||||||
|
@ -229,3 +229,17 @@ acceptance(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
acceptance(
|
||||||
|
"Invites - Create Invite on Site with must_approve_users Setting",
|
||||||
|
function (needs) {
|
||||||
|
needs.user();
|
||||||
|
needs.settings({ must_approve_users: true });
|
||||||
|
|
||||||
|
test("hides `Arrive at Topic` field on sites with `must_approve_users`", async function (assert) {
|
||||||
|
await visit("/u/eviltrout/invited/pending");
|
||||||
|
await click(".user-invite-buttons .btn:first-child");
|
||||||
|
assert.ok(!exists(".invite-to-topic"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user