feat(web-app-external): handle Collabora UI_InsertGraphic and UI_InsertFile postMessages#13658
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. |
…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>
50f5d95 to
8eeedfc
Compare
|
|
I wonder if the workflow can be approved here |
|
@pedropintosilva thank you for this PR. We're currently in a process of rewriting our CI to GH actions. I would kindly ask you to have a little patience right now. As soon as the E2E tests pipelines are moved to GH action, this PR would need to be rebased and we could then run the workflows. I'll let you know as soon as it is ready. |
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
and insert images from cloud storage: