mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: use correct attribute method to get post id from dataset. (#14845)
Because of this bug, the post details were not included in the PMs which are initiated from the user cards in posts.
This reverts commit e3e0d025ea
.
This commit is contained in:
parent
0b495e9ad4
commit
d549022afb
@ -206,9 +206,9 @@ export default Component.extend(CardContentsBase, CanCheckEmails, CleansUp, {
|
|||||||
this._close();
|
this._close();
|
||||||
},
|
},
|
||||||
|
|
||||||
composePM(user) {
|
composePM(user, post) {
|
||||||
this._close();
|
this._close();
|
||||||
this.composePrivateMessage(user, this.topic);
|
this.composePrivateMessage(user, post);
|
||||||
},
|
},
|
||||||
|
|
||||||
cancelFilter() {
|
cancelFilter() {
|
||||||
|
@ -63,7 +63,7 @@ export default Mixin.create({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const closestArticle = target.closest("article");
|
const closestArticle = target.closest("article");
|
||||||
const postId = closestArticle ? closestArticle.dataset["post-id"] : null;
|
const postId = closestArticle ? closestArticle.dataset.postId : null;
|
||||||
const wasVisible = this.visible;
|
const wasVisible = this.visible;
|
||||||
const previousTarget = this.cardTarget;
|
const previousTarget = this.cardTarget;
|
||||||
|
|
||||||
|
@ -70,14 +70,14 @@ const ApplicationRoute = DiscourseRoute.extend(OpenComposer, {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
composePrivateMessage(user, topic) {
|
composePrivateMessage(user, post) {
|
||||||
const recipients = user ? user.get("username") : "";
|
const recipients = user ? user.get("username") : "";
|
||||||
const reply = topic
|
const reply = post
|
||||||
? `${window.location.protocol}//${window.location.host}${topic.url}`
|
? `${window.location.protocol}//${window.location.host}${post.url}`
|
||||||
: null;
|
: null;
|
||||||
const title = topic
|
const title = post
|
||||||
? I18n.t("composer.reference_topic_title", {
|
? I18n.t("composer.reference_topic_title", {
|
||||||
title: topic.title,
|
title: post.topic.title,
|
||||||
})
|
})
|
||||||
: null;
|
: null;
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
<li class="compose-pm">
|
<li class="compose-pm">
|
||||||
{{d-button
|
{{d-button
|
||||||
class="btn-primary"
|
class="btn-primary"
|
||||||
action=(action "composePM" this.user)
|
action=(action "composePM" this.user this.post)
|
||||||
icon="envelope"
|
icon="envelope"
|
||||||
label="user.private_message"}}
|
label="user.private_message"}}
|
||||||
</li>
|
</li>
|
||||||
|
Loading…
Reference in New Issue
Block a user