mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 07:48:02 +08:00
FEATURE: Bulk topic tagging allowing restricted operations on sole categories (#26602)
The bulk actions menu for topics has multiple options to work with tags on topics (append, replace, remove). Our tagging system along with categories allows for some complicated tag restrictions to be applied via tag groups. This was a problem for the topic bulk actions because you couldn't append restricted tags to topics. This commit allows restricted tags to be used in bulk tagging actions as long as all selected topics are for a sole category. The category information will be shown in the modal, and the category ID is used for the tag search.
This commit is contained in:
17
spec/system/page_objects/components/category_badge.rb
Normal file
17
spec/system/page_objects/components/category_badge.rb
Normal file
@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Components
|
||||
class CategoryBadge < PageObjects::Components::Base
|
||||
SELECTOR = ".badge-category__wrapper"
|
||||
|
||||
def find_for_category(category)
|
||||
find(category_selector(category))
|
||||
end
|
||||
|
||||
def category_selector(category)
|
||||
"#{SELECTOR} .badge-category[data-category-id='#{category.id}']"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -75,12 +75,12 @@ module PageObjects
|
||||
find("#topic-entrance button.jump-top").native.send_keys(:return)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def topic_list_item_class(topic)
|
||||
"#{TOPIC_LIST_ITEM_SELECTOR}[data-topic-id='#{topic.id}']"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def topic_list_item_closed(topic)
|
||||
"#{topic_list_item_class(topic)} .topic-statuses .topic-status svg.locked"
|
||||
end
|
||||
|
@ -30,6 +30,12 @@ module PageObjects
|
||||
).click
|
||||
end
|
||||
|
||||
def click_bulk_button(name)
|
||||
find(bulk_select_dropdown_item(name)).click
|
||||
end
|
||||
|
||||
# TODO (martin) Remove all this once discourse-assign is using the new bulk select
|
||||
# modal page object in specs.
|
||||
def has_close_topics_button?
|
||||
page.has_css?(bulk_select_dropdown_item("close-topics"))
|
||||
end
|
||||
@ -57,6 +63,7 @@ module PageObjects
|
||||
def click_dismiss_read_confirm
|
||||
find("#dismiss-read-confirm").click
|
||||
end
|
||||
### /TODO
|
||||
|
||||
private
|
||||
|
||||
|
Reference in New Issue
Block a user