mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 15:28:37 +08:00
FEATURE: Reacting to MessageBus in chat thread panel (#21070)
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>
This commit is contained in:
31
spec/system/page_objects/cdp.rb
Normal file
31
spec/system/page_objects/cdp.rb
Normal file
@ -0,0 +1,31 @@
|
||||
# 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
|
Reference in New Issue
Block a user