Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixup! [IMP] html_editor: convert table of content to an embedded com… #3455

Open
wants to merge 22 commits into
base: master-knowledge-html-editor
Choose a base branch
from

Conversation

thjo-odoo
Copy link

…ponent

abd-msyukyu-odoo and others added 22 commits September 19, 2024 08:28
This commit adds the embedded_component_env resource management inside the
embedded component plugin
Embedded components such as a table of contents should also be mounted to be
used in readonly. This commit extracts the minimal mount logic from the embedded
component plugin and put it in the HtmlViewer in order to do so.
…html_editor: keep wysiwyg when saving content with JSON attrs

Before this commit, editing an html field containing at least one element with
one attribute with a JSON string as its value and then saving caused a rebuild
of the Wysiwyg and therefore the creation of a new editor, inducing flickering
and multiple reloadings (i.e. embedded components).

Reason:
Server side, the html string value is stored without html entities. In frontend,
the html string value extracted from the editor is done through `innerHTML`, and
therefore contains html entities. In `_commitChanges`, two values with different
formats could be compared and were therefore always different if at least one
HTML entity was present.

Solution:
Add a `decodeHTMLEntities` util which should be used when comparing values
extracted from the DOM through `innerHTML` and html values coming from the
server.
This commit is part of the big refactoring project to convert every Knowledge
commands and behaviors to the new html_editor.

This here adds the /draw command as standard inside the editor, so that it can
be used anywhere.

task-4061015
@robodoo
Copy link

robodoo commented Sep 19, 2024

This PR targets the un-managed branch odoo-dev/odoo:master-knowledge-html-editor, it needs to be retargeted before it can be merged.

@abd-msyukyu-odoo abd-msyukyu-odoo force-pushed the master-knowledge-html-editor branch 7 times, most recently from 53975fa to d52f5ac Compare September 22, 2024 06:42
@abd-msyukyu-odoo abd-msyukyu-odoo force-pushed the master-knowledge-html-editor branch 26 times, most recently from fbc5507 to 880402b Compare September 27, 2024 15:38
@abd-msyukyu-odoo abd-msyukyu-odoo force-pushed the master-knowledge-html-editor branch 3 times, most recently from d992fae to 9851067 Compare September 30, 2024 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants