posts/index: fix several "This tag is under discussion" issues.
Several fixes for the "This tag is under discussion" notice on the post index page: * Fix the notice appearing for BURs that aren't pending. * Fix the notice never going away because of the cache never expiring. * List all topics when a tag is involved in multiple BURs. * Link to the forum post instead of the forum topic (fix #4421). * Optimization: don't check for BURs when the search isn't a simple single tag search. * Add a `tags` field to the bulk update requests table for tracking all tags involved in the request (excluding tags in mass updates that are negated/optional/wildcards). Known issue: doesn't handle tag type prefixes in mass updates correctly (e.g. `mass update foo -> artist:bar` doesn't detect the tag `bar`). * Allow searching the /bulk_update_requests page by tags. We don't really need to cache the notice here, but we do it anyway to reduce queries on the post index page.
This commit is contained in:
@@ -70,6 +70,12 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
|
||||
get posts_path(tags: "search:all")
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
should "show a notice for a single tag search with a pending BUR" do
|
||||
create(:bulk_update_request, script: "create alias foo -> bar")
|
||||
get_auth posts_path(tags: "foo"), @user
|
||||
assert_select ".tag-change-notice"
|
||||
end
|
||||
end
|
||||
|
||||
context "with a multi-tag search" do
|
||||
|
||||
Reference in New Issue
Block a user