mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 15:43:43 +08:00
973a0028b4
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.
37 lines
934 B
Ruby
37 lines
934 B
Ruby
# frozen_string_literal: true
|
|
module PageObjects
|
|
module Modals
|
|
class TopicBulkActions < PageObjects::Modals::Base
|
|
MODAL_SELECTOR = ".topic-bulk-actions-modal"
|
|
|
|
def tag_selector
|
|
PageObjects::Components::SelectKit.new(".tag-chooser")
|
|
end
|
|
|
|
def click_bulk_topics_confirm
|
|
find("#bulk-topics-confirm").click
|
|
end
|
|
|
|
def click_silent
|
|
find("#topic-bulk-action-options__silent").click
|
|
end
|
|
|
|
def fill_in_close_note(message)
|
|
find("#bulk-close-note").set(message)
|
|
end
|
|
|
|
def has_category_badge?(category)
|
|
within(MODAL_SELECTOR) do
|
|
PageObjects::Components::CategoryBadge.new.find_for_category(category)
|
|
end
|
|
end
|
|
|
|
def has_no_category_badge?(category)
|
|
within(MODAL_SELECTOR) do
|
|
has_no_css?(PageObjects::Components::CategoryBadge.new.category_selector(category))
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|