FIX: info not working, not suppressing hidden tags from report (#696)

2 small fixes

1. The info button was not properly working post refactor
2. Suppress any secured tags from report input
This commit is contained in:
Sam
2024-07-02 16:38:33 +10:00
committed by GitHub
parent a5a39dd2ee
commit b671ffe7fa
4 changed files with 86 additions and 3 deletions
+4 -2
View File
@@ -85,8 +85,10 @@ module DiscourseAi
info << "topic_id: #{topic.id}"
info << "solved: true" if @solutions.key?(topic.id)
info << "category: #{topic.category&.name}"
tags = topic.tags.pluck(:name)
info << "tags: #{topic.tags.pluck(:name).join(", ")}" if tags.present?
# We may make this optional, but for now we remove all
# tags that are not visible to anon
tags = topic.tags.visible(Guardian.new).pluck(:name)
info << "tags: #{tags.join(", ")}" if tags.present?
info << topic.created_at.strftime("%Y-%m-%d %H:%M")
{ created_at: topic.created_at, info: info.join("\n"), posts: {} }
end