feat: enable EnableRemoteLinkPicker WOPI flag for Collabora Online
Set EnableRemoteLinkPicker: true in CheckFileInfo response so Collabora Online exposes its "Smart Picker" UI for link insertion. Clicking it sends a UI_PickLink postMessage to the WOPI host, which is expected to reply with Action_InsertLink carrying the URL of the selected file. Follows the same pattern as the existing EnableInsertRemoteImage / EnableInsertRemoteFile flags. Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
This commit is contained in:
@@ -1278,6 +1278,7 @@ func (f *FileConnector) CheckFileInfo(ctx context.Context) (*ConnectorResponse,
|
|||||||
fileinfo.KeyEnableOwnerTermination: true, // only for collabora
|
fileinfo.KeyEnableOwnerTermination: true, // only for collabora
|
||||||
fileinfo.KeyEnableInsertRemoteImage: true,
|
fileinfo.KeyEnableInsertRemoteImage: true,
|
||||||
fileinfo.KeyEnableInsertRemoteFile: true,
|
fileinfo.KeyEnableInsertRemoteFile: true,
|
||||||
|
fileinfo.KeyEnableRemoteLinkPicker: true,
|
||||||
fileinfo.KeySupportsExtendedLockLength: true,
|
fileinfo.KeySupportsExtendedLockLength: true,
|
||||||
fileinfo.KeySupportsGetLock: true,
|
fileinfo.KeySupportsGetLock: true,
|
||||||
fileinfo.KeySupportsLocks: true,
|
fileinfo.KeySupportsLocks: true,
|
||||||
|
|||||||
@@ -1802,6 +1802,7 @@ var _ = Describe("FileConnector", func() {
|
|||||||
PostMessageOrigin: "https://cloud.opencloud.test",
|
PostMessageOrigin: "https://cloud.opencloud.test",
|
||||||
EnableInsertRemoteImage: true,
|
EnableInsertRemoteImage: true,
|
||||||
EnableInsertRemoteFile: true,
|
EnableInsertRemoteFile: true,
|
||||||
|
EnableRemoteLinkPicker: true,
|
||||||
IsAnonymousUser: true,
|
IsAnonymousUser: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1995,6 +1996,7 @@ var _ = Describe("FileConnector", func() {
|
|||||||
PostMessageOrigin: "https://cloud.opencloud.test",
|
PostMessageOrigin: "https://cloud.opencloud.test",
|
||||||
EnableInsertRemoteImage: true,
|
EnableInsertRemoteImage: true,
|
||||||
EnableInsertRemoteFile: true,
|
EnableInsertRemoteFile: true,
|
||||||
|
EnableRemoteLinkPicker: true,
|
||||||
IsAdminUser: true,
|
IsAdminUser: true,
|
||||||
UserExtraInfo: &fileinfo.UserExtraInfo{
|
UserExtraInfo: &fileinfo.UserExtraInfo{
|
||||||
Mail: "shaft@example.com",
|
Mail: "shaft@example.com",
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ type Collabora struct {
|
|||||||
EnableInsertRemoteImage bool `json:"EnableInsertRemoteImage,omitempty"`
|
EnableInsertRemoteImage bool `json:"EnableInsertRemoteImage,omitempty"`
|
||||||
// If set to true, this will enable the insertion of remote files chosen from the WOPI storage. A UI_InsertFile postMessage will be sent to the WOPI host to request the UI to select the file. This enables multimedia insertion and document comparison features.
|
// If set to true, this will enable the insertion of remote files chosen from the WOPI storage. A UI_InsertFile postMessage will be sent to the WOPI host to request the UI to select the file. This enables multimedia insertion and document comparison features.
|
||||||
EnableInsertRemoteFile bool `json:"EnableInsertRemoteFile,omitempty"`
|
EnableInsertRemoteFile bool `json:"EnableInsertRemoteFile,omitempty"`
|
||||||
|
// If set to true, this will enable picking a link to a remote file from the WOPI storage. A UI_PickLink postMessage will be sent to the WOPI host to request the UI to select the file. The host is expected to reply with an Action_InsertLink message carrying the file URL.
|
||||||
|
EnableRemoteLinkPicker bool `json:"EnableRemoteLinkPicker,omitempty"`
|
||||||
// If set to true, this will disable the insertion of image chosen from the local device. If EnableInsertRemoteImage is not set to true, then inserting images files is not possible.
|
// If set to true, this will disable the insertion of image chosen from the local device. If EnableInsertRemoteImage is not set to true, then inserting images files is not possible.
|
||||||
DisableInsertLocalImage bool `json:"DisableInsertLocalImage,omitempty"`
|
DisableInsertLocalImage bool `json:"DisableInsertLocalImage,omitempty"`
|
||||||
// If set to true, hides the print option from the file menu bar in the UI.
|
// If set to true, hides the print option from the file menu bar in the UI.
|
||||||
@@ -124,6 +126,8 @@ func (cinfo *Collabora) SetProperties(props map[string]any) {
|
|||||||
cinfo.EnableInsertRemoteImage = value.(bool)
|
cinfo.EnableInsertRemoteImage = value.(bool)
|
||||||
case KeyEnableInsertRemoteFile:
|
case KeyEnableInsertRemoteFile:
|
||||||
cinfo.EnableInsertRemoteFile = value.(bool)
|
cinfo.EnableInsertRemoteFile = value.(bool)
|
||||||
|
case KeyEnableRemoteLinkPicker:
|
||||||
|
cinfo.EnableRemoteLinkPicker = value.(bool)
|
||||||
case KeyDisableInsertLocalImage:
|
case KeyDisableInsertLocalImage:
|
||||||
cinfo.DisableInsertLocalImage = value.(bool)
|
cinfo.DisableInsertLocalImage = value.(bool)
|
||||||
case KeyHidePrintOption:
|
case KeyHidePrintOption:
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ const (
|
|||||||
|
|
||||||
KeyEnableInsertRemoteImage = "EnableInsertRemoteImage"
|
KeyEnableInsertRemoteImage = "EnableInsertRemoteImage"
|
||||||
KeyEnableInsertRemoteFile = "EnableInsertRemoteFile"
|
KeyEnableInsertRemoteFile = "EnableInsertRemoteFile"
|
||||||
|
KeyEnableRemoteLinkPicker = "EnableRemoteLinkPicker"
|
||||||
KeyDisableInsertLocalImage = "DisableInsertLocalImage"
|
KeyDisableInsertLocalImage = "DisableInsertLocalImage"
|
||||||
KeyHidePrintOption = "HidePrintOption"
|
KeyHidePrintOption = "HidePrintOption"
|
||||||
KeyHideSaveOption = "HideSaveOption"
|
KeyHideSaveOption = "HideSaveOption"
|
||||||
|
|||||||
Reference in New Issue
Block a user