mirror of
https://github.com/discourse/discourse.git
synced 2024-12-02 14:45:02 +08:00
533b91dec6
The Digital Services Act requires a checkbox for any user who's flagging a post as illegal to confirm that they are flagging in good faith. This PR adds that.
34 lines
746 B
Ruby
34 lines
746 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(".d-modal__footer .reviewable-action-dropdown")
|
|
select_kit.expand
|
|
select_kit.select_row_by_value(action)
|
|
end
|
|
|
|
def fill_message(message)
|
|
body.fill_in("message", with: message)
|
|
end
|
|
|
|
def check_confirmation
|
|
body.check("confirmation")
|
|
end
|
|
end
|
|
end
|
|
end
|