mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-25 14:48:44 +08:00
When an admin silences a user with both a reason and an email message,
the private email body was visible publicly on user profile cards.
This applies the same fix previously used (commit 4ae1bba) for
suspension reasons: only the short reason is shown publicly, while the
full text including the email body is reserved for admin views.
46 lines
1.2 KiB
Ruby
Vendored
46 lines
1.2 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Components
|
|
class UserCard < PageObjects::Components::Base
|
|
USER_CARD_SELECTOR = ".user-card"
|
|
FILTER_BUTTON_SELECTOR = "#{USER_CARD_SELECTOR} .usercard-controls .d-icon-filter"
|
|
|
|
def visible?
|
|
has_css?(USER_CARD_SELECTOR)
|
|
end
|
|
|
|
def showing_user?(username)
|
|
has_css?("#{USER_CARD_SELECTOR}.user-card-#{username}")
|
|
end
|
|
|
|
def has_filter_button?
|
|
has_css?(FILTER_BUTTON_SELECTOR)
|
|
end
|
|
|
|
def has_no_filter_button?
|
|
has_no_css?(FILTER_BUTTON_SELECTOR)
|
|
end
|
|
|
|
def filter_button_text
|
|
find("#{FILTER_BUTTON_SELECTOR} + .d-button-label").text
|
|
end
|
|
|
|
def click_filter_button
|
|
find("#{FILTER_BUTTON_SELECTOR} + .d-button-label").click
|
|
end
|
|
|
|
def has_profile_hidden?
|
|
has_css?("#{USER_CARD_SELECTOR} .profile-hidden", visible: true)
|
|
end
|
|
|
|
def has_inactive_user?
|
|
has_css?("#{USER_CARD_SELECTOR} .inactive-user", visible: true)
|
|
end
|
|
|
|
def silence_reason_description
|
|
find("#{USER_CARD_SELECTOR} .silence-reason .silence-reason-description").text
|
|
end
|
|
end
|
|
end
|
|
end
|