Friday, March 15, 2024
1 change · master
New functionality added to Odoo
Knowledge users can now add an Excalidraw room to an article with the new /draw command, making it easier to capture visual ideas directly alongside written content. The feature embeds a pre-created Excalidraw+ room and preserves the link when moving between articles.
Original PR description
This commit adds a new command to the editor of Knowledge, `/draw`. It creates an `<iframe>` inside the editor linked to a room ExcaliDraw that the user created in advance with its Excalidraw+ account. This enables the user to draw inside a canvas all of their ideas instead of having to write them inside the article. We are creating a new Behavior called `DrawBehavior`, this behavior uses the data-behavior-props of its anchor to store the URL of the room. This is necessary because iframes are sanitized by the editor, meaning that everytime we change article the iframe is removed from the body and the url would be lost everytime we change article. We unfortunately cannot embed public rooms as this is a limitation of ExcaliDraw themselves. In order to have public rooms, the usage of their React Library is necessary which is not compatible with the OWL Framework and would require a lot of adjustments for it to work. task-3060490