Commit Graph
2150 Commits
Author SHA1 Message Date
David Monjoie 21bec66dce [FIX] web_editor: fix double unload popup
task-2710507

closes odoo/odoo#81820

X-original-commit: c32732c142f3a695703f0c60168e02a86374df44
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-23 09:37:08 +00:00
qsm-odoo acab821676 [FIX] web_editor: consider all remaining DOM changes before save
When clicking on save, the saved HTML should be what the user currently
sees. Before this commit, there might be cases where clicking on save
actually triggers a DOM update which occurs too late for the change to
be considered for the save. In 15.0, this manifests for example with
the blog cover saving*: if the color is being changed with the
colorpicker and that the user does not close the colorpicker before
saving, the color change is not considered because the previewMode=false
update of the colorpicker is not received. With this commit, we ensure
that DOM updates which occur because of the click on the save button
are considered before saving.

* That bug is however due to two other issues which are being fixed with
  the PR at [1].

[1]: https://github.com/odoo/odoo/pull/79028

closes odoo/odoo#81762

X-original-commit: 508332963202090bace0a3c877574132063c29a6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-22 11:22:55 +00:00
qsm-odoo f7ad4ff8ec [IMP] web_editor, website: review s_popup drop-in selector
The final forward-port work merged in master at [1] should have been
adapted to avoid the JS "hack".

[1]: https://github.com/odoo/odoo/commit/e51cdc1e60ea8b61f6b1ca24ef7151d487ce8c86

closes odoo/odoo#81699

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-20 19:16:55 +00:00
Benjamin Vrayandqsm-odoo e51cdc1e60 [FIX] web_editor: prevent dropping popup inside a substructure
Before this commit, it was possible to drag and drop a popup inside an
oe_structure which was itself inside an other oe_structure (e.g. snippet
parallax). It didn't make sense and moreover created bugs.

After this commit, it is no longer possible to drag and drop the popup
snippet or the newsletter popup snippet in a substructure.

task-2491976

closes odoo/odoo#81669

X-original-commit: 49050c124795852ce7ad51b92958498972730dcf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-20 16:52:57 +00:00
Antoine Guenet d049e3d7d7 [FIX] web_editor: ensure snippet selection is kept when acting in it
The snippet selection was lost on every action in mass mailing. The code
that prevents that was checking if the target of a click was the body
element but for mass mailing we needed to be a little bit more
restrictive since the editable area is not the body itself and we want
to actually prevent changing the snippet selection when the target is
the iframe target as well.
Since the mailing itself has a options, the sidebar is actually never
empty and therefore removing a snippet doesn't bring us back to the
block tab. Since therefore also ensures that we actually do.

task-2716397

X-original-commit: ecdb71bf6a566f5f6c294904e84f2132561dbb3c
Part-of: odoo/odoo#81662
2021-12-20 16:04:49 +00:00
Arthur Detroux (ard) 583f7ceb2d [IMP] website, web_editor: provide clarity for theme colors
Prior to this commit, the color presets generated by the color palette
would always be visible by the user which could lead to confusion.
Most users would click on the presets and edit them instead of editing
the color palette.

This commit groups the presets into a collapsed section under the color
palette to incentivize the user to click on the color bubbles instead.

task-2687469

closes odoo/odoo#79921

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-17 16:57:57 +00:00
qsm-odoo 037bc4c255 [FIX] web_editor: remove useless test-breaking warning
A console.warn instruction was added with [1] in case an user interacts
with an editor widget which does not declare any linked option method
(as it is most probably a dev mistake). We have cases where it makes
sense though, adding a custom button with more complex events and
interactions or simply in some strange custo. This warning prevents to
test those uncommon behaviors in a tour test (which is what following
commits of this PR are trying to do).

This commit simply removes the warning.

[1]: https://github.com/odoo/odoo/commit/be05ac7e2b8d866a72693b761f3bc8576d54e59e#diff-ffb61e86e6b8297ef8997f9c605de14de896b54161c032d88a80bbaeac4f89beR490

X-original-commit: 1b18747c7a328df142d7b2cf206a84c39d5eac05
Part-of: odoo/odoo#81557
2021-12-17 09:18:07 +00:00
Antoine Guenet 1f9f7a13d4 [FIX] web_editor: prevent traceback on remove flex styles
A traceback was triggered when removing flex styles in convert_inline.
This is fixed by iterating over the styles rather that over all keys of
the style object.

task-2697159

closes odoo/odoo#81540

X-original-commit: 18db94d9fc320c35e811d991fc4a32533d481083
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-16 15:58:25 +00:00
David Monjoie 8b1012a79d [FIX] web_editor: fix css rules computing everywhere
X-original-commit: bf9928d28818324c85318968a235d238398bca68
Part-of: odoo/odoo#81540
2021-12-16 15:58:24 +00:00
David Monjoie 096c3ab82f [FIX] web_editor: remove unneeded calls to jQuery html method
X-original-commit: 41788a90157e50659a338467b9e18113a467957c
Part-of: odoo/odoo#81540
2021-12-16 15:58:24 +00:00
David Monjoie c05b700bed [FIX] web_editor: properly export toInline
X-original-commit: c30029e0c5112a092441353873cc627c6b0bf94c
Part-of: odoo/odoo#81540
2021-12-16 15:58:24 +00:00
Antoine Guenet bd884ae51d [REF] web_editor, mass_mailing: abstract convert_inline function calls
This adds a `toInline` function that replaces the code that was
duplicated between convert_inline and mass_mailing_widget. The
duplication was confusing and error prone.

X-original-commit: 916582af2d707fc1aa462c6feffa3f5defda75a2
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet 770ea95b5b [REF] web_editor: reorder, rename and document convert_inline functions
This simply reorders (alphabetically and public/private), renames and
document (with docstrings) all functions of convert_inline.

X-original-commit: 970a3686b1f5edea97bbf86bf4fadc90cfe63357
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet de558e5da0 [REF] mass_mailing, web_editor: speed up class to inline conversion
When saving an email, its contents pass through convert_inline to ensure
wide e-mail client compatibility. One phase of that process is the
conversion of classes to inline styles, which involves parsing through
all the styles in all the stylesheets of the document, and matching them
with each element in the DOM. That is an extremely expensive process and
because of that, saving an e-mail can take a very long time depending on
how large the DOM is.
This refactors it for performance gains. Tested on an exaggeratingly big
DOM, what used to take about 12s now takes about 5s.

- The process of parsing through the document's stylesheets is now done
  on opening the email (about 500ms) rather than on saving it so we
  split the processing time between the two.
- When parsing the stylesheets, we now also preprocess them by grouping
  whatever can be grouped together and precomputing the specificity so
  as to sort them appropriately. This has the benefit of considerably
  reducing the number of rules to iterate over for each element (from
  11k+ to 3k+).
- In the process, some things were re-written for improved readability.

X-original-commit: 10e749537186dfb80aee1f2537f3b5804f66cfe5
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet 6ec1f4cc4e [FIX] web_editor: include doctype in iframe
This introduces a doctype declaration in the initialization of html
fields iframes and wysiwyg iframes. That prevents the browser from
rendering in Quirks mode[1] which makes tables override the usual style
inheritance patterns. As a result, this fixes an issue with text colors
and alignments that were lost on converting divs to table structures.

[1] See https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode

X-original-commit: da5cf4bcac696a73c33d856ac889342fe8670e65
Part-of: odoo/odoo#81540
2021-12-16 15:58:22 +00:00
Antoine Guenet b1c21a696d [FIX] web_editor: fix missing docstrings and hard-to-read code
This covers minor refactors in convert_inline, and adds docstrings to
some of its functions that were missing them.

X-original-commit: 7c67a703ac5874cbd05ab5e82f566499b1e07849
Part-of: odoo/odoo#81540
2021-12-16 15:58:22 +00:00
Antoine Guenet c9b30ede56 [FIX] web_editor: remove dead code in getMatchedCSSRules
There was a section of code in `getMatchedCSSRules` that didn't do
anything. Essentially its loop did `a === b ? a = b : break`. As for
what was done before the loop (a = b), it's what is done with the styles
returned by `getMatchedCSSRules` in `classToStyle`.

X-original-commit: 835dba6ec02f1eb4dc43c33fc3bd5eab08032707
Part-of: odoo/odoo#81540
2021-12-16 15:58:21 +00:00
Antoine Guenet 29fac54b14 [FIX] web_editor: properly add nested tables where needed
There was dead code in `addTables` that would never get triggered. When
fixing that, the code crashed because of a reference to the wrong
variable. Those two problems are hereby fixed.

X-original-commit: 21dccd1521c654eb9723a93bceda8e3e3ec8cc6a
Part-of: odoo/odoo#81540
2021-12-16 15:58:21 +00:00
Antoine Guenet fabfaff010 [FIX] web_editor: round px values converted from rem to 1 decimal place
When converting an rem size to a pixel size, we sometimes ended up with
values with many decimal places. This rounds them to one decimal place.

X-original-commit: 8f8d5bf93f60560040a37695c3439600d5d88287
Part-of: odoo/odoo#81540
2021-12-16 15:58:21 +00:00
Antoine Guenet db1920df4f [FIX] web_editor: bubble up pixel height to first applicable ancestor
A percentage height will only be applied on an element whose parent has
a set pixel height. This is why convert_inline applies a pixel height to
the parent of each element with a percentage height when possible. But
it failed in the case where said parent also had a percentage height.
This keeps looking up the tree until we find an appropriate suitor for
that pixel height.

X-original-commit: a9b0184087bec08db523a02068cc3d04b5f1381e
Part-of: odoo/odoo#81540
2021-12-16 15:58:21 +00:00
Antoine Guenet c56da63523 [FIX] web_editor: properly pass down padding from table to cells
For the purpose of good compatibility across email clients, we need
paddings to be applied to cells rather than to tables. The mechanism in
charge of that wrongly added up the paddings, and excessively rounded
them to integers. This commit fixes these issues.

X-original-commit: 6c6e0c18176b41bd1c6967973d0e774f8094c76f
Part-of: odoo/odoo#81540
2021-12-16 15:58:20 +00:00
Antoine Guenet c57b3ef541 [FIX] web_editor: prevent <li> in <td>
When converting a list-group to a table, we sometimes ended up with <li>
in <td> element, which is non-sense and is hereby corrected.

X-original-commit: 41eda109d2fbc0eb6616fb03102a205b945ab9b2
Part-of: odoo/odoo#81540
2021-12-16 15:58:20 +00:00
Antoine Guenet ee809da96f [FIX] web_editor: properly convert incomplete overflowing irregular row
When converting the last row of a grid to a table row, we may end up
having handled all of its columns, but there is still space in the row.
This ensures we properly insert the columns and fill the row.

X-original-commit: 52c35361a0cc86e87337ef321c1b198d4f8cc3c1
Part-of: odoo/odoo#81540
2021-12-16 15:58:20 +00:00
Antoine Guenet 33a158502e [FIX] web_editor: properly convert double overflowing grids
This fixes an issue with the conversion to table of rows that had such
long columns that they should span more than two rows.

X-original-commit: 4daf4378db023365415994296ea7bac53ecb907c
Part-of: odoo/odoo#81540
2021-12-16 15:58:20 +00:00
Younn Olivier b82cc9df55 [FIX] web_editor, website: fix inconsistent edit menu test
Before this commit, the EditMenuDialog was closed before reloading the
page. [1] introduced a new test on this dialog using a workaround to go
to the next step when saving, after the page was reloaded. This
workaround used an unreliable event 'unload', which was inconsistent.

To avoid using that event, the edit menu dialog is not closed after
saving. A new parameter closeOnSave is added to the wysiwyg Dialog,
which allows to keep the dialog open until the reload is done.

task-2513588

[1]: 725cad3478e5ab12ad7f0cf5166a2b968a1373da

closes odoo/odoo#81351

X-original-commit: d35125cc0444679488fa1a020b6bd8a6c4409b6f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-14 10:55:11 +00:00
Younn Olivier 9f93fa8e77 [FIX] web_editor, website: fix menu edtion from the "edit menu" button
Before this commit, editing a menu item after clicking on the "edit
menu" button of the link popover, in edit mode, would not save the
change.

This was caused by the "Double-click to edit" tooltip that is shown over
media and links. Triggering the bootstrap tooltip on a target leads to
attribute mutations (data-original-title, title and aria-describedby),
that were processed by the EditPageMenu observer to set a view as
o_dirty.
The website.menu was therefore saved a first time by the edit menu
dialog with the correct value, and a second time with the outdated label
from the page.

To solve that, the observer is deactivated when showing the
"Double-click to edit" tooltip over a link or a media, so that the
website.menu is updated only once, when saving the edit menu dialog.

task-2513588

X-original-commit: 4244b60f36acbdbdc17c24d45144604d1276c15f
Part-of: odoo/odoo#81351
2021-12-14 10:55:10 +00:00
Younn OlivierandArthur Detroux d25033ff1c [FIX] web_editor, website: fix validation issue when saving LinkDialog
There was an issue when saving the LinkDialog with invalid data.
The _DialogLinkWidget.save methods return values were not consistent.

Also, tests are added for the regular menus edition.
The existing mega menu edition test was not played from the python test
suite.

task-2513588

X-original-commit: 725cad3478e5ab12ad7f0cf5166a2b968a1373da
Part-of: odoo/odoo#81351
Co-authored-by: Arthur Detroux (ard) <ard@odoo.com>
2021-12-14 10:55:10 +00:00
Younn Olivier 40a06bfafa [FIX] web_editor: do not toggle link tools/popover for extra menu items
[1] changed the event listener to toggle the link tools and the popover
on links from mousedown to click.

Before that, when clicking on the extra menu items toggle, the mousedown
target was most of the time the icon, so the link tools and the popover
were not initialized. Now, as we listen for the click event, the target
is the <a/> element, for which the tools and the popover are
initialized.
It should not be the case, as this is a technical element that the user
has no control over.

task-2513588

[1]: add3e05840869d4a885ca18a2bbabfcb61c7a83d

X-original-commit: f1f40517be9280c6f770a116e6909a6d147a3e43
Part-of: odoo/odoo#81351
2021-12-14 10:55:10 +00:00
xO-Tx ce5685500c [FIX] web_editor: fix illustration crop issue
when we crop illustrations using the editor crop tool,
the resulted image will disappear as soon as we save the update.

we have this issue because we cannot get the right svg string using
toDataURL on the new cropped canvas with mimetype = 'image/svg+xml'
(see 'web_editor.image_processing' > 'applyModifications')

To solve this issue we set svg illustrations as uncroppable (for now).

task-2312878

closes odoo/odoo#81179

X-original-commit: fdddac4f9c19515f5631ee7e9a05f9ad798b07a1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-09 18:40:56 +00:00
Nicolas Bayet 0076f4b491 [FIX] web_editor: prevent focus when editor is not loaded
It is possible that the wysiwyg focus method is called before the
odooEditor being loaded. This commit insure that the odooEditor
properly being loaded.

Task-2704538

closes odoo/odoo#81114

X-original-commit: 33782020906988322598c4a3e61b8a6b16970aa0
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-09 12:55:50 +00:00
Martin Trigaux 4226b3b4d0 [FIX] web_editor: use helper
A designer may not have access to ir.model.fields, use the fields_get
helper instead

Fixes odoo/odoo#80948

closes odoo/odoo#81123

X-original-commit: 826100a5b5ecaf62dfe6870bf5ad48a37cd2d7f7
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-12-09 12:05:03 +00:00
Antoine Guenet e466fdbaf7 [FIX] web_editor: properly convert overflowing row
closes odoo/odoo#80621

X-original-commit: 5a1d94d29004f0f0ddd81c25020a90083d6b8bea
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-08 09:35:04 +00:00
Antoine Guenet 2750bfa97f [IMP] web_editor: no empty class on convert grid
X-original-commit: 731ffadb08961b6aada283f96d82c0a35726cffe
Part-of: odoo/odoo#80621
2021-12-08 09:35:04 +00:00
Antoine Guenet e4641a8e38 [FIX] web_editor: ensure unstyled tbody in every table on convert inline
This ensures that every `table` element has its contents wrapped in a
`tbody` element, and that that element has its default vertical
alignment replaced with "top" to mimick the grid it's converted from.

X-original-commit: ddf047be9f49ac408c44de26b65ef50be88873b5
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet 5c69d9e50a [FIX] web_editor: properly size masonry cells
On converting emails for mail client compatibility, masonry showed a few
sizing issues, which are fixed with this commit.

X-original-commit: cfcc498c828b542552b098d6f3a58924abddb091
Part-of: odoo/odoo#80621
2021-12-08 09:35:02 +00:00
Antoine Guenet 06225d8498 [FIX] web_editor: properly size media list images
When converting a mailing for mail client compatibility, we guarantee a
height for each image. When none can be found, or in the special case of
media_list, that height should however not be forced so the client can
make it take the full height of the cell automatically. This is what is
accomplished by this commit.

X-original-commit: e80433335020a52d8f683060e98047f5ce77b054
Part-of: odoo/odoo#80621
2021-12-08 09:35:01 +00:00
Antoine Guenet 9ae5e637e1 [FIX] web_editor: prevent several blocks in one column on convert grid
The following structure is not always properly rendered in mail clients:

```html
<table>
    <tbody>
        <tr>
            <td>
                <h1>Text</h1>
                <p>Text</p>
            </td>
        </tr>
    </tbody>
</table>
```

where the h1 and p can be any block-level element.

This prevents that from happening by wrapping each block in a separate
row/column combo like so:

```html
<table>
    <tbody>
        <tr>
            <td>
                <h1>Text</h1>
            </td>
        <tr>
            <td>
                <p>Text</p>
            </td>
        </tr>
    </tbody>
</table>
```

X-original-commit: 01404499277b63dc64a5a26a93bc419cca092440
Part-of: odoo/odoo#80621
2021-12-08 09:35:01 +00:00
Antoine Guenet d4b3daa871 [REF] web_editor: import odoo-editor utils into convertInline
Some code from odoo-editor utils is needed in convertInline. In order to
avoid duplication, we need to import that code. To that effect, we can't
have the utils being lazy loaded into mass mailing's iframe while
convertInline is loaded the usual way.
This loads the lightweight utils together with convertInline and turns
convertInline into an odoo-module, which makes it easier to simply
import the utils and delete duplicated code.

X-original-commit: 067c94b009609caa0bd78a75b826247e37557417
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Antoine Guenet 54a0b8d853 [FIX] web_editor: properly apply table padding to columns
When converting bootstrap grids into tables, we have to move the
containers' paddings into the cells, otherwise they would not render
properly in all mail clients. Before this fix, verical padding was moved
to each cell, which is wrong: it should be applied to the first (top)
and last cell (bottom) only, which it now is.

X-original-commit: 43112d417f70ac0086fbed2a704f208530d31f87
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Antoine Guenet 23df5ab4ed [FIX] web_editor: keep div inline styles on convert to table
When converting a div to a table, we apply some styles to undo the
table's default styles. This makes sure these styles don't override any
inline styles the div might have been holding.

X-original-commit: 0fad86b330a0e1a3228bbbe76fd2b7370cff3eb0
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Brieuc-brd 1e466775fe [IMP] web_editor: add new background shapes
This commit introduces two new background shapes (Float 13 and 14).

task-2687297

closes odoo/odoo#80658

Related: odoo/design-themes#529
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-07 11:00:46 +00:00
Arthur Detroux (ard) 78a1e11326 [FIX] web_editor: show pointer cursor when hovering colors
Prior to this commit, when the user was hovering on colors in the
web editor, the cursor would stay with its default appearance.
Some users weren't able to tell if this was an interactive
element or not.

With this commit, we change the cursor to the pointer cursor when a user
is hovering the element so that they have a visual element indicating
that it's interactive.

task-2687469

closes odoo/odoo#80933

X-original-commit: 40fec954a369c94576b5ed88eade5d3ff120ca4a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-06 18:01:46 +00:00
Nicolas Bayet acd946b8a8 [FIX] mass_mailing: save from the codeview
Whenever opening the codeview from mass_mailing and then directly
saving the document did not work.

Task-2704335

closes odoo/odoo#80899

X-original-commit: d9fe1e22b4f645f1732283ab558de170716a7434
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-06 12:55:14 +00:00
Younn Olivier cfdb6d04a0 [FIX] web_editor: focus url input on double click on link
This commit focuses the url input from the link tools when double
clicking on the link.
It introduces a focusUrl public method on the Link widget, triggered
from the SnippetsMenu after activating a snippet, if the link tools are
shown.

task-2680461

closes odoo/odoo#80796

X-original-commit: add3e05840869d4a885ca18a2bbabfcb61c7a83d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-02 17:44:22 +00:00
Younn Olivier 5a5f3da58b [FIX] web_editor, website: fix existing links edition via link tools
Before this commit, there was an issue with the edition of links that
were already in the page, via the link tools.
1/ In edit mode, drag and drop the s_image_text snippet and save,
2/ Click on edit, click on the "learn more" button,
3/ From the link tools, change the style to secondary,
4/ Click on save again, the button is still styled with as primary.

[1] added a history step to the link creation via the link tools. As the
editor observer is set to unactive at the start of the link tools, the
changes made to the link with the link tools were not processed by the
EditPageMenu observer, and the block was not set as .o_dirty (the
changes were therefore not saved).

This bug was hidden by our use of bootstrap popovers. The
aria-describedby attribute, managed by bootstrap when showing/hiding a
popover, would be recorded as a change from the EditPageMenu observer,
which would set the view as dirty.
Also, changing any other element of the page would set the page as dirty
and hide the bug.

It only became visible when [2] changed the popover initialization from
'focus' to 'manual'. With that, the aria-describedby attribute was
modified inbetween the LinkTools.start and LinkTools.destroy (and was
therefore not recorded at the EditPageMenu level).

To record correctly the changes made from the link tools to the link, we
activate the editor observer when applying the changes to the DOM.

This commit also introduces some tests for the link tools.
The listener on customizable links from the wysiwyg was changed from
mousedown to click for simpler tests.

task-2680461

[1]: 6db6134f97
[2]: 161c5fc8e742294e8d85c889b4bf8d3d8cd484f5

closes odoo/odoo#80763

X-original-commit: c29fe9fa8fc8ff4a5e6f042607ef9b3070d1d339
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-02 15:16:34 +00:00
Nicolas Bayet 7a0e58f8d7 [FIX] web_editor: prevent setting modified link label
When editing the link label from a website page, and then changing its
url from the link tools, the label was reset to what it was before the
edition. This commit fixes it by keeping the label consistent when
changing the link options from the link tools.

task-2680461

X-original-commit: 5f5b9dfa1bdfb6c814e68e355503a8820bb8b452
Part-of: odoo/odoo#80763
2021-12-02 15:16:34 +00:00
Younn Olivier 2a70b21af3 [FIX] web_editor: display drop zones only on dropdowns when shown
It was painful to add an inline snippets, or move elements inside mega
menus. The dropdowns are now behaving as modals: if they are shown, the
user can only add or move snippets inside them, but not outside.

task-2668908

closes odoo/odoo#80757

X-original-commit: edc5c8d69fb5fc6da0b0012abc6539c21ffc421e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-02 13:43:26 +00:00
Nicolas Bayet 094ec14233 [FIX] web_editor: wait popover to be inserted to modify it
In some circumstance, `this.$target.data('bs.popover').tip` was not
defined until added into the DOM.

Task-2666388

closes odoo/odoo#80657

X-original-commit: 4fdd17b7436984ade2ce97dd57d749cc18c452dc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-01 11:05:05 +00:00
Nicolas BayetandAntony Lesuisse f98db923e2 [FIX] web_editor: fix module auto install with web
The web_editor dependency with mail was problematic:
- web_editor would not auto_intall without the mail being installed
- A circular dependency problem with discuss

In order to avoid creating a new module shared by mail
and web editor, the use of a hack has been decided.
By checking if `notification_type` is in the session, we ensure
that the module mail is installed.

Task-2698655

closes odoo/odoo#80640

X-original-commit: 4e611d7527f85fc074115bd018adb7d6e5ea2c53
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antony Lesuisse <al@odoo.com>
2021-12-01 08:01:00 +00:00
Nicolas Bayet 9b3c4e3504 [FIX] web_editor: avoid editor history on image cropper
In some circumstance, the image cropper is being reverted by the
Odoo editor unbreakable mechanics. The reason was that the cropper tool
was appended inside the editable rather than outside the editable.

Task-2693553

closes odoo/odoo#80613

X-original-commit: c09600fe35089cdaed34ec12d8bcb992d24e043f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-30 15:22:19 +00:00