linagora / Twake

Twake is a secure open source collaboration platform to improve organizational productivity.
https://twake.app
GNU Affero General Public License v3.0
1.79k stars 195 forks source link

Migrate OnlyOffice/R7 connector to node #2583

Open RomaricMourgues opened 2 years ago

RomaricMourgues commented 2 years ago

Introduction

OnlyOffice / R7 is the only connector we did not migrate yet to node. It is a collaborative document editor plugin.

You can see the old code here for reference:

And example of connectors here:

Work to do

Rebuild this connector:

Define the plugin display configuration:

=> In the end we should be able to preview docx files from Twake chat (note: Twake frontend may not automatically display buttons for the new display configuration object, some changes are to be planned on Twake code side if this is the case)

Some first steps

  1. Create an application on your own company on Twake staging (workspace name > workspace settings > integrations > create integration on the top)

  2. Set the correct "display configuration" to say to Twake that this plugin is able to preview some kind of files, and why not add an "actions" to files like {name: "Open in OnlyOffice", id: "open"}

  3. Update Twake code to ensure such actions and preview works (for the actions it should appear in the "..." menu next to any file thumbnail, and in the "..." on bottom right of the previewing mode ; for the preview to work we need to update the code that automatically select the previewer system (the one who actually choose between image, video, code, pdf) ). This is important because we'll use this features then to add for instance actions like "Move to TDrive", etc.

  4. Now we can work on the connector itself, when previewing a file it will display an iframe loading the url put in the display configuration, for now this url can be localhost

  5. To be discussed... if you try to find your own solutions keep in mind it should be secure. For instance tries to find a way to get which user is currently connected on the plugins side from a single use token in the preview url, or a jwt that you would send back to the Twake backend API)