mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Clarify websocket address is needed
This commit is contained in:
+2
-2
@@ -63,10 +63,10 @@ module Documents
|
||||
def invalid_hocuspocus_url?
|
||||
return false if Setting.collaborative_editing_hocuspocus_url.blank?
|
||||
|
||||
!valid_hocuspocus_url?(Setting.collaborative_editing_hocuspocus_url)
|
||||
!websocket_url?(Setting.collaborative_editing_hocuspocus_url)
|
||||
end
|
||||
|
||||
def valid_hocuspocus_url?(url)
|
||||
def websocket_url?(url)
|
||||
uri = URI.parse(url)
|
||||
uri.is_a?(URI::WS) || uri.is_a?(URI::WSS)
|
||||
rescue URI::InvalidURIError
|
||||
|
||||
@@ -151,7 +151,7 @@ en:
|
||||
some_unwritable: Some values are configured via environment variables and cannot be edited here.
|
||||
hocuspocus_server_url:
|
||||
label: "Hocuspocus server URL"
|
||||
caption: "The address of a working Hocuspocus server."
|
||||
caption: "The WebSocket address of a working Hocuspocus server."
|
||||
invalid_scheme: "Must use a WebSocket protocol (ws:// or wss://)."
|
||||
hocuspocus_server_secret:
|
||||
label: "Client secret"
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ RSpec.describe "Document collaboration settings admin",
|
||||
click_on("Save")
|
||||
|
||||
# Inline validation shown on the field
|
||||
expect(page).to have_content("is not a supported protocol")
|
||||
expect(page).to have_content("Must use a WebSocket protocol (ws:// or wss://).")
|
||||
|
||||
# Setting unchanged
|
||||
expect(Setting.collaborative_editing_hocuspocus_url).to eq("wss://hocuspocus.example.com")
|
||||
|
||||
Reference in New Issue
Block a user