mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
UX: Display tag's description as title in navigation menu (#22710)
Why this change? We're already displaying a category's description as the title attribute on the category section link. We should do the same for tags as well.
This commit is contained in:

committed by
GitHub

parent
e19316aebf
commit
7a790a5f4c
@ -46,7 +46,7 @@ RSpec.shared_examples "User Sidebar Serializer Attributes" do |serializer_klass|
|
||||
end
|
||||
|
||||
describe "#sidebar_tags" do
|
||||
fab!(:tag) { Fabricate(:tag, name: "foo") }
|
||||
fab!(:tag) { Fabricate(:tag, name: "foo", description: "foo tag") }
|
||||
fab!(:pm_tag) do
|
||||
Fabricate(:tag, name: "bar", pm_topic_count: 5, staff_topic_count: 0, public_topic_count: 0)
|
||||
end
|
||||
@ -89,8 +89,8 @@ RSpec.shared_examples "User Sidebar Serializer Attributes" do |serializer_klass|
|
||||
json = serializer.as_json
|
||||
|
||||
expect(json[:sidebar_tags]).to contain_exactly(
|
||||
{ name: tag.name, pm_only: false },
|
||||
{ name: pm_tag.name, pm_only: true },
|
||||
{ name: tag.name, pm_only: false, description: tag.description },
|
||||
{ name: pm_tag.name, pm_only: true, description: nil },
|
||||
)
|
||||
|
||||
user.update!(admin: true)
|
||||
@ -98,9 +98,9 @@ RSpec.shared_examples "User Sidebar Serializer Attributes" do |serializer_klass|
|
||||
json = serializer.as_json
|
||||
|
||||
expect(json[:sidebar_tags]).to contain_exactly(
|
||||
{ name: tag.name, pm_only: false },
|
||||
{ name: pm_tag.name, pm_only: true },
|
||||
{ name: hidden_tag.name, pm_only: false },
|
||||
{ name: tag.name, pm_only: false, description: tag.description },
|
||||
{ name: pm_tag.name, pm_only: true, description: nil },
|
||||
{ name: hidden_tag.name, pm_only: false, description: nil },
|
||||
)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user