Skip to content

Commit

Permalink
added proper title with link to ReviewablePostVotingComments
Browse files Browse the repository at this point in the history
  • Loading branch information
jdmartinez1062 committed Dec 14, 2023
1 parent 928250e commit 6ebfb0e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require_dependency "reviewable_serializer"

class ReviewablePostVotingCommentSerializer < ReviewableSerializer
target_attributes :cooked, :raw, :comment_cooked
target_attributes :cooked, :raw, :comment_cooked, :post_id
payload_attributes :comment_cooked, :transcript_topic_id, :cooked, :raw, :created_by
attributes :target_id, :comment_cooked

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<div class="flagged-post-header">
<LinkTo
@route="post-voting-comment.near-message"
@models={{array
this.comment.slugifiedTitle
this.comment.id
@reviewable.target_id
}}
/>
<div class="post-topic">
<a class="title-text" href={{this.post.url}}> {{html-safe
@reviewable.topic.fancyTitle
}}</a>
{{category-badge @reviewable.category}}
</div>

<div class="post-contents-wrapper">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import Component from "@glimmer/component";
import { cached } from "@glimmer/tracking";
import { tracked } from "@glimmer/tracking";
import { inject as service } from "@ember/service";
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";

export default class ReviewableChatMessage extends Component {
@service store;
@service chatChannelsManager;
@tracked post;

@cached
get chatChannel() {
return ChatChannel.create(this.args.reviewable.chat_channel);
constructor() {
super(...arguments);
this.store.find("post", this.args.reviewable.post_id).then((post) => {
this.post = post;
});
}
}
1 change: 1 addition & 0 deletions lib/post_voting/comment_review_queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def flag_comment(comment, guardian, flag_type_id, opts = {})
target: comment,
reviewable_by_moderator: true,
potential_spam: flag_type_id == ReviewableScore.types[:spam],
topic: comment.post.topic,
payload: payload,
)
reviewable.update(target_created_by: comment.user)
Expand Down

0 comments on commit 6ebfb0e

Please sign in to comment.