mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 20:23:38 +08:00
967010e545
This feature will allow sites to define which emoji are not allowed. Emoji in this list should be excluded from the set we show in the core emoji picker used in the composer for posts when emoji are enabled. And they should not be allowed to be chosen to be added to messages or as reactions in chat. This feature prevents denied emoji from appearing in the following scenarios: - topic title and page title - private messages (topic title and body) - inserting emojis into a chat - reacting to chat messages - using the emoji picker (composer, user status etc) - using search within emoji picker It also takes into account the various ways that emojis can be accessed, such as: - emoji autocomplete suggestions - emoji favourites (auto populates when adding to emoji deny list for example) - emoji inline translations - emoji skintones (ie. for certain hand gestures)
40 lines
1.3 KiB
Ruby
40 lines
1.3 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class AdminSettings < PageObjects::Pages::Base
|
|
def visit_filtered_plugin_setting(filter)
|
|
visit("/admin/site_settings/category/plugins?filter=#{filter}")
|
|
self
|
|
end
|
|
|
|
def visit_category(category)
|
|
page.visit("/admin/site_settings/category/#{category}")
|
|
self
|
|
end
|
|
|
|
def toggle_setting(setting_name, text = "")
|
|
setting = find(".admin-detail .row.setting[data-setting='#{setting_name}']")
|
|
setting.find(".setting-value span", text: text).click
|
|
setting.find(".setting-controls button.ok").click
|
|
end
|
|
|
|
def select_from_emoji_list(setting_name, text = "", save_changes = true)
|
|
setting = find(".admin-detail .row.setting[data-setting='#{setting_name}']")
|
|
setting.find(".setting-value .value-list > .value button").click
|
|
setting.find(".setting-value .emoji-picker .emoji[title='#{text}']").click
|
|
setting.find(".setting-controls button.ok").click if save_changes
|
|
end
|
|
|
|
def values_in_list(setting_name)
|
|
vals = []
|
|
setting = find(".admin-detail .row.setting[data-setting='#{setting_name}']")
|
|
setting
|
|
.all(:css, ".setting-value .values .value .value-input span")
|
|
.map { |e| vals << e.text }
|
|
vals
|
|
end
|
|
end
|
|
end
|
|
end
|