mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 15:53:41 +08:00
f72899401d
This PR refactors the following: * leaving all the CSS applied to the old `modal-body` classes in their respective files * made new clean styling for `.d-modal` and refactored the template to use the new BEM classes * `inner-`, `middle-`, `outer-` container classes are gone and replaced with simplified `wrapper` and `container` classes * use standardised max-sizes with modifiers `-large` and `-max` * lighter backdrop, * min-width to prevent puny modals * other styling changes regarding padding, close button,… * pulled out all modal overrides into a general `modal-overrides` file + cleanup of outdated CSS * pulled out login and create account modal styling into their own file, cause it's such a big override * removed old general login.scss file for mobile & desktop * only kept some remainders I don't want to touch in `app/assets/stylesheets/common/base/login.scss`
33 lines
781 B
Ruby
33 lines
781 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Modals
|
|
class Badge < PageObjects::Pages::Base
|
|
GRANTABLE_BADGES_DROPDOWN = ".select-kit"
|
|
|
|
def modal
|
|
find(".grant-badge-modal")
|
|
end
|
|
def select_badge(badge_name)
|
|
within(modal) do
|
|
grantable_badges_dropdown.expand
|
|
grantable_badges_dropdown.select_row_by_name(badge_name)
|
|
end
|
|
end
|
|
|
|
def grant
|
|
within(modal) { find(".d-modal__footer .btn").click }
|
|
end
|
|
|
|
def has_success_flash_visible?
|
|
within(modal) { has_css?(".alert-success") }
|
|
end
|
|
|
|
def grantable_badges_dropdown
|
|
@grantable_badges_dropdown ||=
|
|
PageObjects::Components::SelectKit.new(GRANTABLE_BADGES_DROPDOWN)
|
|
end
|
|
end
|
|
end
|
|
end
|