mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 13:09:33 -06:00
bd5c5c4b5f
This commit introduces a ChatChannelPaneSubscriptionsManager and a ChatChannelThreadPaneSubscriptionsManager that inherits from the first service that handle MessageBus subscriptions for the main channel and the thread panel respectively. This necessitated a change to Chat::Publisher to be able to send MessageBus messages to multiple channels based on whether a message was an OM for a thread, a thread reply, or a regular channel message. An initial change to update the thread indicator with new replies has been done too, but that will be improved in future as we have more data to update on the indicators. Still remaining is to fully move over the handleSentMessage functionality which includes scrolling and new message indicator things. Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
32 lines
719 B
Ruby
32 lines
719 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
class CDP
|
|
include Capybara::DSL
|
|
|
|
def allow_clipboard
|
|
cdp_params = {
|
|
origin: page.server_url,
|
|
permission: {
|
|
name: "clipboard-read",
|
|
},
|
|
setting: "granted",
|
|
}
|
|
page.driver.browser.execute_cdp("Browser.setPermission", **cdp_params)
|
|
|
|
cdp_params = {
|
|
origin: page.server_url,
|
|
permission: {
|
|
name: "clipboard-write",
|
|
},
|
|
setting: "granted",
|
|
}
|
|
page.driver.browser.execute_cdp("Browser.setPermission", **cdp_params)
|
|
end
|
|
|
|
def read_clipboard
|
|
page.evaluate_async_script("navigator.clipboard.readText().then(arguments[0])")
|
|
end
|
|
end
|
|
end
|