mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 03:27:25 +08:00
FIX: "Toggle topic bump" wasn't visible for TL4 users
This commit is contained in:
parent
a61d9deba1
commit
dc477d1228
@ -193,8 +193,11 @@ export default DropdownSelectBoxComponent.extend({
|
||||
}
|
||||
|
||||
const currentUser = Discourse.User.current();
|
||||
const showToggleTopicBump =
|
||||
currentUser &&
|
||||
(currentUser.get("staff") || currentUser.trust_level === 4);
|
||||
|
||||
if (action === REPLY && currentUser && currentUser.get("staff")) {
|
||||
if (action === REPLY && showToggleTopicBump) {
|
||||
items.push({
|
||||
name: I18n.t("composer.composer_actions.toggle_topic_bump.label"),
|
||||
description: I18n.t("composer.composer_actions.toggle_topic_bump.desc"),
|
||||
|
@ -291,10 +291,10 @@ QUnit.test("replying to post as staff", async assert => {
|
||||
assert.equal(composerActions.rowByIndex(4).value(), "toggle_topic_bump");
|
||||
});
|
||||
|
||||
QUnit.test("replying to post as regular user", async assert => {
|
||||
QUnit.test("replying to post as TL3 user", async assert => {
|
||||
const composerActions = selectKit(".composer-actions");
|
||||
|
||||
replaceCurrentUser({ staff: false, admin: false });
|
||||
replaceCurrentUser({ staff: false, admin: false, trust_level: 3 });
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await click("article#post_3 button.reply");
|
||||
await composerActions.expand();
|
||||
@ -309,6 +309,18 @@ QUnit.test("replying to post as regular user", async assert => {
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("replying to post as TL4 user", async assert => {
|
||||
const composerActions = selectKit(".composer-actions");
|
||||
|
||||
replaceCurrentUser({ staff: false, admin: false, trust_level: 4 });
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await click("article#post_3 button.reply");
|
||||
await composerActions.expand();
|
||||
|
||||
assert.equal(composerActions.rows().length, 4);
|
||||
assert.equal(composerActions.rowByIndex(3).value(), "toggle_topic_bump");
|
||||
});
|
||||
|
||||
QUnit.test(
|
||||
"replying to first post - reply_as_private_message",
|
||||
async assert => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user