mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Use modals to edit categories and tags that appear in sidebar (#22295)
Why this change? We are currently not fully satisfied with the current way to edit the categories and tags that appears in the sidebar where the user is redirected to the tracking preferences tab in the user's profile causing the user to lose context of the current page. In addition, the dropdown to select categories or tags limits the amount of information we can display. Since editing or adding a custom categories section is already using a modal, we have decided to switch editing the categories and tags that appear in the sidebar to use a modal as well. This commit removes the `new_edit_sidebar_categories_tags_interface_groups` site setting and make the modals the default for all users.
This commit is contained in:
committed by
GitHub
parent
4d3999de10
commit
aef7c2fe8f
@@ -2,7 +2,6 @@
|
||||
|
||||
RSpec.describe "Editing sidebar categories navigation", type: :system do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:group) { Fabricate(:group).tap { |g| g.add(user) } }
|
||||
|
||||
fab!(:category2) { Fabricate(:category, name: "category2") }
|
||||
|
||||
@@ -22,10 +21,7 @@ RSpec.describe "Editing sidebar categories navigation", type: :system do
|
||||
|
||||
let(:sidebar) { PageObjects::Components::Sidebar.new }
|
||||
|
||||
before do
|
||||
SiteSetting.new_edit_sidebar_categories_tags_interface_groups = group.name
|
||||
sign_in(user)
|
||||
end
|
||||
before { sign_in(user) }
|
||||
|
||||
it "allows a user to edit the sidebar categories navigation" do
|
||||
visit "/latest"
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
RSpec.describe "Editing sidebar tags navigation", type: :system do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:group) { Fabricate(:group).tap { |g| g.add(user) } }
|
||||
fab!(:tag1) { Fabricate(:tag, name: "tag").tap { |tag| Fabricate.times(3, :topic, tags: [tag]) } }
|
||||
|
||||
fab!(:tag2) do
|
||||
@@ -18,10 +17,7 @@ RSpec.describe "Editing sidebar tags navigation", type: :system do
|
||||
|
||||
let(:sidebar) { PageObjects::Components::Sidebar.new }
|
||||
|
||||
before do
|
||||
SiteSetting.new_edit_sidebar_categories_tags_interface_groups = group.name
|
||||
sign_in(user)
|
||||
end
|
||||
before { sign_in(user) }
|
||||
|
||||
it "allows a user to edit the sidebar categories navigation" do
|
||||
visit "/latest"
|
||||
|
||||
@@ -10,22 +10,6 @@ describe "Viewing sidebar preferences", type: :system do
|
||||
context "as an admin" do
|
||||
fab!(:admin) { Fabricate(:admin) }
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:category) { Fabricate(:category) }
|
||||
fab!(:category2) { Fabricate(:category) }
|
||||
fab!(:category_sidebar_section_link) do
|
||||
Fabricate(:category_sidebar_section_link, user: user, linkable: category)
|
||||
end
|
||||
fab!(:category2_sidebar_section_link) do
|
||||
Fabricate(:category_sidebar_section_link, user: user, linkable: category2)
|
||||
end
|
||||
fab!(:tag) { Fabricate(:tag) }
|
||||
fab!(:tag2) { Fabricate(:tag) }
|
||||
fab!(:tag_sidebar_section_link) do
|
||||
Fabricate(:tag_sidebar_section_link, user: user, linkable: tag)
|
||||
end
|
||||
fab!(:tag2_sidebar_section_link) do
|
||||
Fabricate(:tag_sidebar_section_link, user: user, linkable: tag2)
|
||||
end
|
||||
|
||||
before { sign_in(admin) }
|
||||
|
||||
@@ -37,14 +21,6 @@ describe "Viewing sidebar preferences", type: :system do
|
||||
|
||||
user_preferences_navigation_menu_page.visit(user)
|
||||
|
||||
expect(user_preferences_navigation_menu_page).to have_navigation_menu_categories_preference(
|
||||
category,
|
||||
category2,
|
||||
)
|
||||
expect(user_preferences_navigation_menu_page).to have_navigation_menu_tags_preference(
|
||||
tag,
|
||||
tag2,
|
||||
)
|
||||
expect(user_preferences_navigation_menu_page).to have_navigation_menu_preference_checked(
|
||||
"pref-show-count-new-items",
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user