mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 01:33:43 +08:00
0a4b1b655d
This commit fixes an issue where clicking the default "Take Action" option on a flag for a post doesn't always end up with the post hidden. This is because the "take_action" score bonus doesn’t take into account the final score required to hide the post. Especially with the `hide_post_sensitivity` site setting set to `low` sensitivity, there is a likelihood the score needed to hide the post won’t be reached. Now, the default "Take Action" button has been changed to "Hide Post" to reflect what is actually happening and the description has been improved, and if "Take Action" is clicked we _always_ hide the post regardless of score and sensitivity settings. This way the action reflects expectations of the user.
26 lines
578 B
Ruby
26 lines
578 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class Flag < PageObjects::Modals::Base
|
|
BODY_SELECTOR = ".flag-modal-body"
|
|
MODAL_SELECTOR = ".flag-modal"
|
|
|
|
def choose_type(type)
|
|
body.find("#radio_#{type}").click
|
|
end
|
|
|
|
def confirm_flag
|
|
click_primary_button
|
|
end
|
|
|
|
def take_action(action)
|
|
select_kit =
|
|
PageObjects::Components::SelectKit.new(".modal-footer .reviewable-action-dropdown")
|
|
select_kit.expand
|
|
select_kit.select_row_by_value(action)
|
|
end
|
|
end
|
|
end
|
|
end
|