mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 22:43:33 +08:00
DEV: Move calendar date + time picker from local dates into core component (#23023)
This commit moves the calendar date and time picker shown in the local dates modal into a core component that can be reused in other places. Also add system specs to make sure there isn't any breakages with this feature, and a section to the styleguide.
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Modals
|
||||
class InsertDateTime < PageObjects::Modals::Base
|
||||
MODAL_CSS_CLASS = ".discourse-local-dates-create-modal"
|
||||
|
||||
def calendar_date_time_picker
|
||||
@calendar_date_time_picker ||=
|
||||
PageObjects::Components::CalendarDateTimePicker.new(MODAL_CSS_CLASS)
|
||||
end
|
||||
|
||||
def select_to
|
||||
find(".date-time-control.to").click
|
||||
end
|
||||
|
||||
def select_from
|
||||
find(".date-time-control.from").click
|
||||
end
|
||||
|
||||
def delete_to
|
||||
find(".delete-to-date").click
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user