mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-01 19:00:38 +08:00
This change simplifies controls of confirmation dialog when post is discarded in composer: * `Discard` button stays unchanged * `Save draft for later` button is removed * `Keep editing` button is renamed to `Cancel` (functionality is unchanged) * changes modal copy from `What would you like to do with your post?` to `Do you want to discard your post?` |Before|After| |---|---| |<img width="614" height="138" alt="Screenshot 2025-10-10 at 13 18 06" src="https://github.com/user-attachments/assets/76be21fa-c9d9-4c1d-9cb2-079d87d0e913" />|<img width="618" height="142" alt="Screenshot 2025-10-10 at 13 09 40" src="https://github.com/user-attachments/assets/b106a6f0-e420-4351-8785-cb69ee587a49" />| NOTE: do not mind the design on screenshots (dark/light mode). They showcase change in controls. This PR doesn't change UI.
24 lines
537 B
Ruby
24 lines
537 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_discard
|
|
footer.find(".discard-draft-modal__discard-btn").click
|
|
end
|
|
|
|
def click_cancel
|
|
footer.find(".discard-draft-modal__cancel-btn").click
|
|
end
|
|
end
|
|
end
|
|
end
|