mirror of
https://github.com/discourse/discourse.git
synced 2025-01-23 19:51:52 +08:00
47c8197ea1
This change adds a new dropdown trigger next to the "New Topic" button. When clicked a menu will display a list of topic/post drafts that can be clicked to resume the draft within the composer. The "New Topic" button will no longer change text to show "Open Draft" when a draft topic exists, it will still attempt to load the existing draft if one exists (this will change later when we support multiple drafts in a separate PR). The "My Posts" link in desktop sidebar will now be "My Drafts" and only appear when the current user has existing drafts.
25 lines
507 B
Ruby
25 lines
507 B
Ruby
# frozen_string_literal: true
|
|
module PageObjects
|
|
module Modals
|
|
class DiscardDraft < PageObjects::Modals::Base
|
|
MODAL_SELECTOR = ".discard-draft-modal"
|
|
|
|
def open?
|
|
has_css?(".modal.d-modal#{MODAL_SELECTOR}")
|
|
end
|
|
|
|
def closed?
|
|
has_no_css?(".modal.d-modal#{MODAL_SELECTOR}")
|
|
end
|
|
|
|
def click_save
|
|
footer.find("button.save-draft").click
|
|
end
|
|
|
|
def click_discard
|
|
footer.find("button.discard-draft").click
|
|
end
|
|
end
|
|
end
|
|
end
|