mirror of
https://github.com/discourse/discourse.git
synced 2025-02-07 11:58:27 +00:00
When we turn on settings automatically for customers, we sometimes use `.set_and_log` which will make a staff action log for the site setting change. This is fine, but there is no context for customers. This change allows setting a message with `.set_and_log`, which will be stored in the `details` column of the staff action log created, which will show up on `/admin/logs/staff_action_logs` --------- Co-authored-by: Kelv <kelv@discourse.org>
35 lines
972 B
Ruby
35 lines
972 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class AdminStaffActionLogs < PageObjects::Pages::Base
|
|
def visit
|
|
page.visit "admin/logs/staff_action_logs"
|
|
self
|
|
end
|
|
|
|
def log_row_selector(user_history)
|
|
".staff-logs tr[data-user-history-id='#{user_history.id}']"
|
|
end
|
|
|
|
def log_row(user_history)
|
|
find(log_row_selector(user_history))
|
|
end
|
|
|
|
def has_log_row?(user_history)
|
|
has_css?(log_row_selector(user_history))
|
|
end
|
|
|
|
def has_no_log_row?(user_history)
|
|
has_no_css?(log_row_selector(user_history))
|
|
end
|
|
|
|
def filter_by_action(action)
|
|
filter = PageObjects::Components::SelectKit.new("#staff-action-logs-action-filter")
|
|
filter.search(I18n.t("admin_js.admin.logs.staff_actions.actions.change_site_setting"))
|
|
filter.select_row_by_value(UserHistory.actions.key(UserHistory.actions[action.to_sym]).to_s)
|
|
end
|
|
end
|
|
end
|
|
end
|