Commit Graph
2993 Commits
Author SHA1 Message Date
Tom De Caluwé 4fd5fd4a97 [FIX] web_editor, website: fix removal of last item inside active slides
A bug currently makes the carousel snippet collapse/disappear when its
active contents are removed. This happens because after the removal,
the carousel no longer has an active item.

The solution that was chosen was to not allow the removal of slides
unless using the dedicated option which is there for that. This solution
has the advantage to also allow users to create empty slides (using a
background image for example) by simply removing the columns inside.

Note: Newly created carousels will include the oe_unremovable class on
their slides. As such they will no longer depend on isEmptyAndRemovable
checking them for having a carousel-item class on the parent.

task-2506165

closes odoo/odoo#79892

X-original-commit: 0cf36a227e7b90fb64b1bc8024de813894d10d14
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-16 19:21:14 +00:00
Siddarth Gajjarandqsm-odoo f23ef1e6be [FIX] web_editor: fix drag & drop with restricted editor access rights
task-2345098

closes odoo/odoo#79851

X-original-commit: cd051046c191f9f4cd6df4627319931720ceb257
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-11-16 16:58:00 +00:00
Sébastien Geelen (sge) 3a02d3970d [FIX] web_editor: remove warning on save
Pop-up warning was appearing when saving website pages.

task-2666177

closes odoo/odoo#79842

X-original-commit: 2b35640d9e1fb7f037eee1983a19876879936d67
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-16 13:03:17 +00:00
Nicolas Bayet 2706f6d7af [FIX] web_editor: prevent re-rendering of linktool
Before this commit, the linktool was re-rendered clicking on
same link twice.
If between click, the some property of the link changed, they
were lost after the linktool being needlessly re-rendered.

Task-2691483

closes odoo/odoo#79820

X-original-commit: 110790cb2482367867dbc0bdaa97ad0e224a3d1e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-16 10:49:39 +00:00
Nicolas Bayet 55cd20db47 [FIX] web_editor: not override root on website
Before this commit, if the editor was initiated as a simple
editor rather than the website editor (eg. the editor in the forum or profile)
the $root of the wysiwyg was wrongly assigned to #wrapwrap rather
than the $editable.

Subsequent binding (eg. LinkPopover) was bound to too many elements
which generated incorrect behaviors (eg, link popover on triggered on every
links).

Task-2691117

closes odoo/odoo#79810

X-original-commit: 58c1b04de1ec9179b940ee930984a232bb5de30d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-16 10:02:37 +00:00
Nicolas Bayet a101887f66 [FIX] web_editor: remove overlay of link
Before this commit, in the website builder or in mass_mailing, when
creating a link then hitting enter, then click somewhere in the page,
the outline was not removed from all the links.

In mass mailing, the overlay was never removed. Not even upon save.

Task-2682176

closes odoo/odoo#79634

X-original-commit: 71325540712342ef8f251a37ee29270bd3b87469
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-16 10:02:33 +00:00
Nicolas Bayet 12953e98b9 [FIX] web_editor: avoid scroll on undo/redo
When performing undo/redo on some page, because some unneded mutation
get recorded, the page scroll to another location (either up or down).
This commit add a mechanic that filter out thoses unnecessary mutations.

task-2667885

closes odoo/odoo#79620

X-original-commit: 125730ffd9322d34ef1c7d8d0298457de3e65f90
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-16 10:02:29 +00:00
Nicolas Bayet ebb4d39571 [FIX] web_editor: activate the redo button when needed
Because the `_historyStepsStates` was not fully set at the time of
calling `historyStep` in `historyUndo` or `historyRedo`, the listener
for the event "historyStep" was triggered to early and `historyCanRedo` at
that time could not possibly be accurate.

This commit call `historyStep` after setting all ids in
`_historyStepsStates`.

task-2667885

X-original-commit: 659b530516e13df77eed6254b81e72b8009a71bf
Part-of: odoo/odoo#79620
2021-11-16 10:02:28 +00:00
Sébastien Geelen (sge) c3bff57df2 [FIX] web_editor: avoid onbeforeunload pop-up issue
Remove onbeforeunload pop-up if editor has no snippet.
This fix pop-ups wrongly showing outside website editing.

see: #79731

task-2666177

closes odoo/odoo#79781

X-original-commit: 2f587eea4eea947597f0c4f7e5473c08e2175bcd
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 15:54:42 +00:00
Nicolas Bayet 6f972d9f9c [FIX] web_editor: undo after dropping a snippet
The commit 1b80fe9b56acea09a6784691561df65fe6349f50 made impossible
to undo after dropping a snippet.

Task-2688104

closes odoo/odoo#79649

X-original-commit: 92b1f78e8de6c343a9d1ef19459522b868cf108f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:34 +00:00
Nicolas Bayet 8087bd00e8 [FIX] web_editor: allow to move snippets
As an oversight of 2185e89e3f2a15b98b9cb8c3371a6031f9a6f055, it became
impossible to move snippets.

Task-2688281

closes odoo/odoo#79648

X-original-commit: f76ba944c516a0377cec324f564df604e52c2ffd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:30 +00:00
Nicolas Bayet b6ea6d14d2 [FIX] web_editor: enable selection under toolbar triangle
In the editor, there was a little spot where it was impossible to
click in order to select a text.

Task-2684378

closes odoo/odoo#79642

X-original-commit: 02c0cce926b1252596f10299597a9c984a8341ac
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:26 +00:00
Nicolas Bayet 34d0f92a78 [FIX] web_editor: wait untill colorpicker is inserted
Before this commit, an update to the colorpicker could be called
multiples times with a `colorpicker` not yet in the document.

If a colorbpicker has been created, we need to await it's start method
to be fully resolved.

Task-2667983

closes odoo/odoo#79641

X-original-commit: 105208c8363f77130ee644ce8ec2e993d9955763
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-15 11:22:22 +00:00
Nicolas Bayet 7146a6fbf4 [FIX] web_editor: have correct linkPopover reference
Before this commit, the reference of the linkPopover was
the last popover being created which is not what this property
is supposed to correspond to. It should correspond to the latest
opened linkPopover.

Without this fix, the code that want to act on the last linkPopover
would not work as expected (e.g. `this.linkPopover.hide();` in
`_onSelectionChange`).

Task-2667983

X-original-commit: d1abbc9d66a5858c771fa643f8c73990e8f14792
Part-of: odoo/odoo#79641
2021-11-15 11:22:21 +00:00
Nicolas Bayet f726f40d25 [FIX] web_editor: prevent link o_default_snippet_text
Whenever a link is being manipulated through the link tool,
the classes are being saved before the manipulation. However,
the class `o_default_snippet_text` is removed in the meantime.

Because we never want that class after the manipulation, this commit
systematically remove it.

Task-2667983

X-original-commit: f82f004e1e1439c38a09d5eb0fded5197e058c1b
Part-of: odoo/odoo#79641
2021-11-15 11:22:21 +00:00
Nicolas Bayet 93537cf82a [FIX] web_editor: allow to select a link already selected
Before this commit, selecting a link was not working all the time.
This commit allow to properly select a link all the time.

Task-2667983

X-original-commit: 8c90772470046d0b932443ac7b2c2a868c443a85
Part-of: odoo/odoo#79641
2021-11-15 11:22:21 +00:00
qsm-odoo 1ebc7c301b [FIX] web_editor, website: fix onFocus/onBlur flow + add test
The flow has been broken multiple times across the years. Let's add a
test in all stable versions.

For the 14.0 forward-port, the test came with a fix which restores the
13.0 flow which we tried to change in 14.0... but only ended up broking
it. Indeed, with [1], the 13.0 was fixed. And, with [2], we tried to
simplify the flow... but the explanation given by the commit is just
wrong: the flow was just broken and the simplification that was to be
done in fact practically never occurs. The more the reason to add a
test, proving how the flow is working. The simplification may be done
someday but not sure it is really worth it.

For the 15.0 forward-port, another fix was needed because of [3] which
introduced a bug which makes the onBlur method be called multiple times
when hiding a whole editor hierarchy.

[1]: https://github.com/odoo/odoo/commit/076992bdf099f3a645c9a1ef6df2cdcccbf1c2b2
[2]: https://github.com/odoo/odoo/commit/5c007305c9998ade32c6677cac5552101c3a96af
[3]: https://github.com/odoo/odoo/commit/806a8db35b5e0e6a461422f5bba7c97180c3ef29

closes odoo/odoo#79734

X-original-commit: 0acc5e784b15d9c963660da3781763448503f33e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-11-14 21:40:48 +00:00
Sébastien Geelen (sge) 287913ebbf [FIX] web_editor: fix translate button position
The translate button was overlapping the codeview button
in the mail template view.

task-2683847

closes odoo/odoo#79704

X-original-commit: 8a6de9089bfd77f5fdc6f4a11016906454e442cc
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-12 13:35:54 +00:00
Nasreddin Boulif (bon) 33f8c747b3 [FIX] web_editor: Display correctly top buttons of the editor sidebar
Steps to reproduce :

  - Install website module
  - Activate (and translate website) French language
  - Go to translated terms and fetch for "Discard" in website module
  - Replace the translated value by "Ne pas sauvegarder"
  - Go to Website -> Configuration -> Websites
  - Select main website and change language to french then save
  - Go to Website and edit homepage
  - Add any block

Issues :

  On top of editor sidebar, buttons are not displayed correctly.

Solutions :

  Add css class `d-flex` to the div arround the buttons.

opw-2683602

closes odoo/odoo#79612

X-original-commit: 772156078418544907f9073e242e4491ddae1e5d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2021-11-10 13:46:21 +00:00
Martin Trigaux c7942f19f2 [FIX] web_editor: translate init message
X-original-commit: 4e466182e89e835dd04809d53ef58ddbf4020d05
Part-of: odoo/odoo#79594
2021-11-10 07:45:53 +00:00
Nicolas Bayet e68a9d37dc [IMP] web_editor: allow to use link popover everywhere
Before this commit, the link popover was only available in the website
builder. Now it is available anywhere the wysiwyg is used.

Task-2678412

closes odoo/odoo#79542

X-original-commit: 161c5fc8e742294e8d85c889b4bf8d3d8cd484f5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-09 14:00:56 +00:00
Sébastien Geelen (sge) 90f0df32ac [FIX] web_editor: stop passing variables to _t function
Some variables were used in _t function instead of raw strings.
One string was not translated properly.

task-2686066

closes odoo/odoo#79505

X-original-commit: 7c5b475532dca1efea5599fb5a3f61ea646d8267
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-08 13:24:33 +00:00
Nicolas Bayet d5a031a9a3 [FIX] web_editor, website: only save dirty element
Before this commit, when inserting a new snippet or moving a snippet
that was already in the page would temporarily create hooks (`we-hook`)
in the page. The insertion of thoses hooks would trigger mutation
in the dirty observer (observer defined in edit.js) and mark all
oe_structure for which a hook was temporarily inserted.
Thus, creating unnecessary views in the backend.

Now, the code skip the mutations of the drag and drop hooks.

Task-2567752

closes odoo/odoo#79394

X-original-commit: 1b80fe9b56acea09a6784691561df65fe6349f50
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2021-11-08 10:15:56 +00:00
Sébastien Geelen (sge) 66851b042c [FIX] web_editor: fix the beforeunload warning
The warning shown on beforeunload when quiting a page during edition
was missing since the new editor merge.

task-2666177

closes odoo/odoo#79325

X-original-commit: 6a7fa263e72de45d2e92c436321c01c4b70870a8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-03 16:44:40 +00:00
Hubert Van de Walle (huvw) 5f2c143623 [FIX] web_editor: don't show the active style entry if absent
Steps to follow

  - Edit a report with studio
  - Add an inline text element
  - Select it
  - Select the text in the sidebar
  -> An error is raised

Cause of the issue

  firstButtonEl is undefined because the style section is not always
  present in the toolbar

opw-2674302

closes odoo/odoo#79335

X-original-commit: 45b590d8961d56f8d207c22efbf1ba7188a3b1fa
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-11-03 16:02:11 +00:00
Nicolas Bayet bd8260b3f5 [FIX] web_editor: not showing toolbar in theme tab
In the website builder, the toolbar was appearing in the theme tab
incorrectly.

task-2664956

closes odoo/odoo#79311

X-original-commit: a2198490befddb8c4cc6f3a543f47bbffe243f64
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-03 12:38:59 +00:00
Hubert Van de Walle (huvw) 957ae2b84a [FIX] web_editor: resize the codeview with the field_html resize handle
Steps to follow

  - Go to email templates
  - Select some text
  - Click on the code button
  - Resize the editor
  -> Nothing happens

Cause of the issue

  The default view of the editor is resized but not the code view

Solution

  Change the code view height with the default view

opw-2669259

closes odoo/odoo#79315

X-original-commit: 3adc1ddb04dfc0dcd3b10e56e9ecaef7b04a18d4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-11-03 11:48:51 +00:00
qsm-odoo 41d9546061 [FIX] web_editor: add perf. optimization when toggling editor options
This allows to avoid tens of thousands of instructions being done at
each click in the editor.

At multiple places, the editor is asked to close all its widgets (for
example, when clicking on another snippet to edit). The original cost
of that action was to remove a class on each widget, which is a very
primitive action. But in the end we had to do more to close a widget: we
trigger_up an event and ask to close all sub widgets. When we ask the
editor to close all widgets... it makes sense not letting every sub
button of every select trigger_up an event.

closes odoo/odoo#79220

X-original-commit: 7aaf0e17f9c3d4e78b975dbd3747513d186ccc1e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-11-02 09:58:51 +00:00
Anh Thao Pham (pta) 5e3f143f1c [FIX] web_editor: prevent editing document in iframe with cross-origin access issue
- Go to Email Marketing
- Create a new mailing with template having social media links
- Save
- Click on one of the social links
An error is triggered:
"Error: Blocked a frame with origin xxx from accessing a cross-origin frame."

The traceback occurs because we try to change the content of something we
don't have access to, as these sites prevent display in an iframe.

opw-2599540

closes odoo/odoo#79208

X-original-commit: 9702e541f27616a5249a140878d028335a0b3775
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-10-29 16:05:30 +00:00
Didier (did) 1afcc9c368 [IMP] bus, mail, *: improve longpolling bus notification format
* = auth_signup, calendar, im_livechat, snailmail_account, survey, test_mail,
    web_editor, website_crm_iap_reveal, website_livechat

The aim of this PR is to improve/fix various flaws and limitation of the current
API, to make it easier to use and more efficient.

Notification are now defined with 3 distinct parts:

- the channel determines which client(s) should receive it
- the type determines how it should be handled
- the payload determines any extra information helpful for handling it

Channel
=======

Business code
-------------

- Record channel is introduced for ease of subscribing to and sending
  notifications to specific partners, channels, documents, ...
- String channel is still supported (but it is converted internally to the tuple
  channel).
- Tuple channel is still supported without any change (but should be avoided
  whenever possible due to its complex syntax).

The channel is no longer sent to the client. When the channel was used for
business purpose, the information it contained has been moved into either the
new type, or the payload itself.

Technical note
--------------

All channels are now internally converted to the tuple (db, ...) channel, which
is necessary for the platform code (saas/sh).

Internally, the bus.bus table is not changed, type and payload are grouped
together into what was (and still is) called message.

Type
====

Type is introduced to uniformize the way notifications are sent and handled.
All existing notifications already had some kind of manually-built type in them.
This is now officially supported at the bus API.

In client code this will allow (to be done in future commits) to register one
handler per specific type, instead of having to iterate and to filter all
received notifications on every handler.

Payload
=======

Payload (ex message) did not change, it can still be anything depending on
business needs.

Few adaptations:
- When the type was included on the payload, the type has been moved to the new
  type parameter.
- When the channel was used in business code, its data has been copied into the
  payload.

task-1891151

closes odoo/odoo#79201

X-original-commit: 543af27c7d6836ffac9e80ff8490b6ddbd849221
Related: odoo/enterprise#21998
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-29 16:05:23 +00:00
Benjamin Vray f534d20674 [FIX] web_editor, *: fix active class disappearing on tabs snippet
* = website

Before this commit, the active class of the tabs snippet buttons
disappeared when leaving the edition of the buttons.

After this commit, it is no longer possible to enable link options for
the buttons of the tabs snippet and accordion snippet. Being able to
customize these buttons introduces too many bugs and is not really
necessary.

task-2656662

closes odoo/odoo#79190

X-original-commit: 7f33cdcd14ef753cc5bf823bfc1de0d2431e285a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-29 12:39:58 +00:00
Nicolas Bayet 0f668e28bf [FIX] web_editor: allow non editable to be unbreakable
When starting the editor in a web page, if there is no content, the
oe_structure is not editable. Adding snippet at that moment will
trigger `idSet` on the node with isUnbreakable returning `false` for
the node that is unbreakable because of the check
`!node.isContentEditable` in `isUnbreakable`.

When setting the ouid for the first time with `idSet`, `getOuid` is
called with `optimize` to `true`. So all the ancestor of a node that
should be unbreakable will have the wrong ouid.

Performing any command to a node with a wrong ouid is suceptible to
wrongly be reverted.

By removing `!node.isContentEditable`, the node will have the proper
ouid in case an ancestor is not editable.

task-2633368

closes odoo/odoo#79108

X-original-commit: 13804df7740317b8198e7c1de418ff019c05862b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-28 07:49:29 +00:00
Nicolas Bayet 3c80860110 [FIX] web_editor: properly remove hint on mass_mailing
Before this commit, the editor hint were not properly
removed because the queryselector was made on
the wrong document.

Task-2678410

closes odoo/odoo#79104

X-original-commit: d582f43d81cb570017ef6ff90159cdb6a7ff2874
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-28 07:49:25 +00:00
Nicolas Bayet e2763e0f8b [FIX] web_editor: use wrapper around video
When pasting an youtube url in the website builder, the iframe
was inserted without the wrapper used by the website builder.
Now we use the same wrapper as by adding a video through the
video modal.

task-2668224

closes odoo/odoo#79095

X-original-commit: 0cffd7fcdc631b95795d9d819197e5f91ed8195c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-28 07:49:21 +00:00
Nicolas Bayet 85b0845c65 [FIX] web_editor: poperly add youtube on website builder
In the website builder, when pasting a youtube url,
we can transform it to an iframe in the editor through the
Powerbox.
Adding the iframe did not remove the text in the website builder.
Now it properly remove the text in note and the website builder.

X-original-commit: a9c363cb2c6a88f7f4b1ef09b8a8f9caf39d8f32
Part-of: odoo/odoo#79095
2021-10-28 07:49:21 +00:00
Nicolas Bayet f950fd1190 [FIX] web_editor: wait editor loading in tests
In a undeterministic circumstance, an element in the editor
is not found. It might be because the check is done before the
editor is fully loaded.

The commit 46c22143b22e204e93c70b21d002eb179be34a33 tried to
wait 100ms, but the bug continue to appear.

This commit only perform the check when the editor is fully
loaded. If the undeterministic bug continue to appear, it means
that the cause is different.

Task-2678110

closes odoo/odoo#79078

X-original-commit: 930b6822961f1ffdd1198e1ab2fe52229e14a50d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 17:16:53 +00:00
Nicolas Bayet 403c06504d [FIX] web_editor: always show codeview button
When activating the editor code view, the button is hidden in
the floating toolbar. This commit always shows the button when
the codeview is activated for a particual html field.

Task-2672259

closes odoo/odoo#79072

X-original-commit: 66d706bbcc1cd49e69f58ac154eee2d6f2ec3628
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 14:01:47 +00:00
Nicolas Bayet e795186dec [FIX] web_editor: delete unicode character
Before this commit, when trying to delete one
unicode character (e.g. 😍), only one javascript character was delete
but one unicode character (e.g. 😍) could be two javascript characters
as the javascript string is coded in utf-16.

This commit fixes that by calculating the size of one unicode character
from the javascript string.

Task-2658890

closes odoo/odoo#79071

X-original-commit: fea5b87615077f5f41dec8c4d1480f157bbd26ae
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 14:01:43 +00:00
Antoine Guenet 218e9bb2aa [FIX] web_editor: prevent pasting blocks into paragraph-related elements
When pasting HTML, we have to be careful not to introduce invalid HTML.
The editor corrected for blocks within inlines but failed to prevent the
invalid pasting of blocks within paragraph-related elements
(eg., `<p><h1>text</h1></p>`). This fixes that issue by unwrapping all
blocks from the copied content when trying to paste within an element
that doesn't accept paragraph-related elements as children.

Notably, this fixes an issue that was caused by that problem, in which
pasted HTML content could not be saved because it was invalid.

task-2632676

closes odoo/odoo#79070

X-original-commit: 9c77834e03516f831a9600f0ba4131c957b3ba74
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 14:01:39 +00:00
David Monjoie 30c53a4370 [FIX] web_editor: fix traceback when clicking outside any snippet
This bug was introduced by
https://github.com/odoo/odoo/commit/2a7436d83abe178bd21c0694edc9825f5d70d65f.

closes odoo/odoo#79057

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 11:56:15 +00:00
Antoine Guenet 7dd6698bd4 [FIX] web_editor: properly display the state of list in the toolbar
When selecting text in a list, the toolbar should show that a list is
selected, and which type. It however failed to do that, which is fixed
with this commit.

task-2638422

closes odoo/odoo#77738

X-original-commit: 2a7436d83abe178bd21c0694edc9825f5d70d65f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
Part-of: odoo/odoo#79057
2021-10-27 11:56:15 +00:00
Nicolas Bayet 4c1c38bb85 [FIX] web_editor: allow iframe on website builder
On website, if an iframe was in the page, the iframe was removed
when calling the redo command of the insertion of the iframe (and
also other cases).
 The reason is because of a sanitization process that is usefull only
 in a collaborative context.

 This commit disable the sanitization when the collaboration is not
 active.

task-2670597

closes odoo/odoo#79056

X-original-commit: 2b9595a1f2d8ee1c019751d4cb080fe9b9f4c05c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-27 11:56:10 +00:00
xO-Tx ce3b09dff2 [FIX] web_editor: fix empty save on dialogs
I- mediaDialog/linkDialog:

1- Website editor > Add image/link using "/" commands.
2- The mediaDliaog/linkDialog will be shown to select item.
3- Click on "Add/Save" without selecting any image/setting
   any link.
4- traceback.

II- mediaDialog (Video):

The same flow for videos will add an empty <iframe> (with
no src specified) to the DOM.

The goal of this commit is to prevent this behaviour
by adding a test on values passed to the 'save' event
listeners.

task-2628964

closes odoo/odoo#78967

X-original-commit: 1e5c7d6f3525823101215cb18b44d2b936c9c521
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-26 07:48:10 +00:00
Kishan Gajjar 27e0307c07 [FIX] web_editor: link widget should respect native bootstrap class
Before this commit, When you try to edit the link then the link widget is
removing 'btn-block' class from the class list of the link node.

After this commit, the link widget will allow using 'btn-block' class.

closes #78511

closes odoo/odoo#78783

X-original-commit: 888687b487e95b4bf4fb080118b5eb945c8ab724
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-10-21 19:09:52 +00:00
Benoit Socias 9b854f5d39 [FIX] web_editor: make class-based colors selectable for custom buttons
Before this commit selecting a class-based color (gray scale,
o-color-1~5) was ignored when configuring a custom button colors.

After this commit the color's class is applied.
Additionally, upon switching between Custom and other types, the custom
UI is now cleaned up.

task-2653874

closes odoo/odoo#78720

X-original-commit: 26d37812f0217ae913c8ddf761bcb26b5c44bff5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-20 17:53:40 +00:00
Benoit Socias 6087585f3b [IMP] web_editor: reset button text styles when customizing button
Before this commit if button text had styles, they would override the
color set by customizing the button.

After this commit button text styles are removed when applying custom
button colors.

task-2653874

X-original-commit: 03c02639f1e92b58a38d8efb620b17761ae2d81d
Part-of: odoo/odoo#78720
2021-10-20 17:53:40 +00:00
Aaron Bohy 7bd4ae9566 [FIX] web: prevent some tests from failing undeterministically
This is a tricky one. The problematic tests involve the quick edit
feature. Before this commit, those tests sometimes failed [1],
because there was no guarantee that we waited enough in the test
before doing assertions.

[1] https://runbot.odoo.com/web#id=2012&action=573&model=runbot.build.error&view_type=form&cids=1&menu_id=405

X-original-commit: 78762d0a0017e02f2df00d60140a2709fafaa0d5
Part-of: odoo/odoo#78698
2021-10-20 15:15:23 +00:00
Barad Mahendra 281b65a943 [FIX] web,*_*: fix the html content in notification
Currently markup-ification of the legacy notifications system
display the html content in notification layout for some of the
notification of document and planning from commit: https://github.com/odoo/enterprise/commit/ba44461fea337ed2e5adbdfa1e8eede00b036def

So here in this commit, we make the method `makeLegacyNotificationService`
always `_.escape(message)` and pass `messageIsHtml: true` to the owl
notifications system so notification with html content will be displayed
properly.

Task-2657391

closes odoo/odoo#78627

X-original-commit: 7ce6d8d70be79c9c626865598b898dce9a18b045
Related: odoo/enterprise#21782
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-10-19 14:43:42 +00:00
xlu-odoo 6dd4ddab2b [FIX] web_editor: fixing border-radius on dropdown menu entries
Prior to this commit, every dropdown menu entries in the web editor
had a border-radius on them. It didn't look consistent and clean.

This commit fixes those menu entries by either removing or applying a
correct border-radius.

closes odoo/odoo#78492

X-original-commit: 0239ab7efcaf3895ffb14a56a0686cf5a80bb529
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-18 10:21:53 +00:00
Benjamin Vray 2e57d784d3 [FIX] website, web_editor: fix overlay options of the timeline snippet
Before this commit, the CSS of the overlay option buttons of the
timeline snippet was broken.

task-2648348

closes odoo/odoo#78491

X-original-commit: 13770d650def3107378fe4010aac48dc85a5256a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-18 10:21:49 +00:00