mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 12:35:25 +08:00
FIX: prefills username for new message on first post (#6305)
This commit is contained in:
parent
ac743dab10
commit
07e11a223c
|
@ -275,6 +275,15 @@ export default DropdownSelectBoxComponent.extend({
|
|||
if (postUsername) {
|
||||
usernames = postUsername;
|
||||
}
|
||||
} else if (this.get("composerModel.topic")) {
|
||||
const stream = this.get("composerModel.topic.postStream");
|
||||
|
||||
if (stream.get("firstPostPresent")) {
|
||||
const post = stream.get("posts.firstObject");
|
||||
if (post && !post.get("yours") && post.get("username")) {
|
||||
usernames = post.get("username");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
options.action = PRIVATE_MESSAGE;
|
||||
|
|
|
@ -304,3 +304,23 @@ QUnit.test("replying to post as regular user", async assert => {
|
|||
);
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test(
|
||||
"replying to first post - reply_as_private_message",
|
||||
async assert => {
|
||||
const composerActions = selectKit(".composer-actions");
|
||||
|
||||
await visit("/t/internationalization-localization/280");
|
||||
await click("article#post_1 button.reply");
|
||||
|
||||
await composerActions.expand();
|
||||
await composerActions.selectRowByValue("reply_as_private_message");
|
||||
|
||||
assert.equal(find(".users-input .item:eq(0)").text(), "uwe_keim");
|
||||
assert.ok(
|
||||
find(".d-editor-input")
|
||||
.val()
|
||||
.indexOf("Continuing the discussion") >= 0
|
||||
);
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue
Block a user