feat(collaboration): enable EnableInsertRemoteFile and EnableInsertRemoteImage WOPI flags#12192
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
|
@pedropintosilva Thanks for the PR. Please check the following to prepare approval to run the workflow:
|
|
Code looks fine, although I'm not sure if we want to have the feature enabled at the moment. As you've said, we need changes in the frontend to make it work, otherwise the feature would look like broken (unless they provide something by default). For the frontend changes, it's better to check with the frontend devs (https://github.com/owncloud/web), so you can open a ticket there. |
To clarify a bit, since we needed changes in the frontend to make it work, I decided not to include it (so it was set to false by default). It was intentional. |
590eeab to
8b245c2
Compare
thanks I have forced pushed, now signed and with the extra markdown file. |
|
@jvillafanez shall we approve the workflow run to see if any coding issues pop up? |
8b245c2 to
43b56dc
Compare
…rtFile postMessages
Add frontend handling for Collabora's remote file insertion and document
comparison features. When oCIS sets EnableInsertRemoteFile and
EnableInsertRemoteImage in the WOPI CheckFileInfo response, Collabora
shows new menu items that send UI_InsertGraphic and UI_InsertFile
postMessages to the parent window.
- Add Host_PostmessageReady handshake: reply to App_LoadingStatus with
Host_PostmessageReady so Collabora accepts Action postMessages.
- Handle UI_InsertGraphic: open a file picker modal filtered to image
MIME types, resolve the selected file to a signed WebDAV download URL,
and send Action_InsertGraphic back to the Collabora iframe.
- Handle UI_InsertFile: read callback and mimeTypeFilter from the
Collabora message, open the file picker accordingly, and send back
the appropriate Action (Action_InsertMultimedia or
Action_CompareDocuments).
- Create InsertRemoteFileModal.vue: new modal component that embeds the
oCIS file browser in embed mode, resolves the picked file to a
download URL via clientService.webdav.getFileUrl(), and calls back
with { filename, url }.
- Replace catchClickMicrosoftEdit with a unified handleAppMessage
listener that handles all app iframe postMessages (UI_Edit,
App_LoadingStatus, UI_InsertGraphic, UI_InsertFile).
Companion server-side PR: owncloud/ocis#12192
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
Thanks, I have created another PR against that repo. I hope it helps. |
…rtFile postMessages
Add frontend handling for Collabora's remote file insertion and document
comparison features. When oCIS sets EnableInsertRemoteFile and
EnableInsertRemoteImage in the WOPI CheckFileInfo response, Collabora
shows new menu items that send UI_InsertGraphic and UI_InsertFile
postMessages to the parent window.
- Add Host_PostmessageReady handshake: reply to App_LoadingStatus with
Host_PostmessageReady so Collabora accepts Action postMessages.
- Handle UI_InsertGraphic: open a file picker modal filtered to image
MIME types, resolve the selected file to a signed WebDAV download URL,
and send Action_InsertGraphic back to the Collabora iframe.
- Handle UI_InsertFile: read callback and mimeTypeFilter from the
Collabora message, open the file picker accordingly, and send back
the appropriate Action (Action_InsertMultimedia or
Action_CompareDocuments).
- Create InsertRemoteFileModal.vue: new modal component that embeds the
oCIS file browser in embed mode, resolves the picked file to a
download URL via clientService.webdav.getFileUrl(), and calls back
with { filename, url }.
- Replace catchClickMicrosoftEdit with a unified handleAppMessage
listener that handles all app iframe postMessages (UI_Edit,
App_LoadingStatus, UI_InsertGraphic, UI_InsertFile).
Companion server-side PR: owncloud/ocis#12192
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
|
@pedropintosilva please rebase / update your branch to the latest master code. |
942a19d to
08d7e45
Compare
|
rebased; |
…moteImage WOPI flags
Add EnableInsertRemoteFile flag to Collabora CheckFileInfo response,
enabling multimedia insertion and document comparison menus in Collabora
Online (UI_InsertFile postMessage, available since 24.04.10).
Also wire up EnableInsertRemoteImage which was defined but never set in
the CheckFileInfo infoMap.
Tests:
go test ./services/collaboration/...
All 134 connector tests pass locally.
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
…rtFile postMessages
Add frontend handling for Collabora's remote file insertion and document
comparison features. When oCIS sets EnableInsertRemoteFile and
EnableInsertRemoteImage in the WOPI CheckFileInfo response, Collabora
shows new menu items that send UI_InsertGraphic and UI_InsertFile
postMessages to the parent window.
- Add Host_PostmessageReady handshake: reply to App_LoadingStatus with
Host_PostmessageReady so Collabora accepts Action postMessages.
- Handle UI_InsertGraphic: open a file picker modal filtered to image
MIME types, resolve the selected file to a signed WebDAV download URL,
and send Action_InsertGraphic back to the Collabora iframe.
- Handle UI_InsertFile: read callback and mimeTypeFilter from the
Collabora message, open the file picker accordingly, and send back
the appropriate Action (Action_InsertMultimedia or
Action_CompareDocuments).
- Create InsertRemoteFileModal.vue: new modal component that embeds the
oCIS file browser in embed mode, resolves the picked file to a
download URL via clientService.webdav.getFileUrl(), and calls back
with { filename, url }.
- Replace catchClickMicrosoftEdit with a unified handleAppMessage
listener that handles all app iframe postMessages (UI_Edit,
App_LoadingStatus, UI_InsertGraphic, UI_InsertFile).
Companion server-side PR: owncloud/ocis#12192
Signed-off-by: Pedro Pinto Silva <pedro.silva@collabora.com>
08d7e45 to
080eee4
Compare
|
I think the workflow needs approval. |
Add EnableInsertRemoteFile flag to Collabora CheckFileInfo response,
enabling multimedia insertion and document comparison menus in Collabora
Online (UI_InsertFile postMessage, available since 24.04.10).
Also wire up EnableInsertRemoteImage which was defined but never set in
the CheckFileInfo infoMap.
Tests:
All 134 connector tests pass locally.
Signed-off-by: Pedro Pinto Silva pedro.silva@collabora.com
Screenshots
PR's Notes
Collabora Online documentation:
This is just the server side change we still require a frontend side (owncloud/web#13658) change to handle the UI_InsertGraphic and UI_InsertFile postMessages that Collabora sends when the user clicks the new menu items.
The existing FilePickerModal.vue (https://github.com/owncloud/web/blob/master/packages/web-pkg/src/components/Modals/FilePickerModal.vue#L68) at packages/web-pkg/src/components/Modals/FilePickerModal.vue is for "Open With App" (user picks a file and it opens that file in a new editor tab) but we need something different here, something that:
I'm not sure if I can do it or how would you prefer it (to refactor the existing FilePickerModal or create a new one for this case)