Commit Graph
2563 Commits
Author SHA1 Message Date
qsm-odoo a848ad6c4f [FIX] web_editor: restore website header once page content is removed
The affixed header was not reappearing if page content was removed and
the page thus indirectly scrolled.

task-2446020

closes odoo/odoo#64999

X-original-commit: 4da6df09a4df195ad7c0caa7de7fbc7389339958
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-25 12:40:34 +00:00
Benoit Socias 865cf39db5 [FIX] web_editor: save custom snippets per website
Before this commit the custom snippets were saved across websites
because the RPC mechanism used by the save & reload does not include the
context by default.

After this commit the custom snippets are saved for the specific website
as initially intended.
No migration is needed: already created snippets that have been created
across all sites will have the correct lifecycle because of the
copy-on-unlink system: trying to delete one will make it specific on
other websites.

Related to task-2374802

closes odoo/odoo#64963

X-original-commit: 42e0f9112404541d1c11ba35e7a3d9bcb939f73b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-22 17:33:44 +00:00
Benjamin Vray 9a9a288927 [FIX] website, web_editor: fix drop zones when dragging a snippet
Before this commit:

-when moving a snippet using the drag and drop button, two drop zones
instead of one was added at the initial location of the dragged
snippet.

-when moving a snippet using the drag and drop button, no drop zone
was added at the initial location of the dragged snippet if the snippet
was alone in its parent. For example, the left jumbotron in the banner
snippet.

-the drop zones handled by the "children rules" were never vertical
when it was necessary.

This commit also refactors the code to avoid some duplicated lines.

task-2312878

closes odoo/odoo#64884

X-original-commit: b259b8069f74088bd8add50ddab76c1a7630ac8f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-21 16:55:17 +00:00
qsm-odoo 16656e7113 [REV] web_editor, *: remove JW empty assets
*: mass_mailing, website

The revert of Jabberwock at [1] was made reverting all the commits
that happened during and after the Jabberwock merge. This missed a
preparation commit [2] which added empty asset files a few days earlier.
This reverts that commit.

[1]: https://github.com/odoo/odoo/commit/e5572c317a7775a58675ed73efc89b5c9f6c0c39
[2]: https://github.com/odoo/odoo/commit/55f10ac9a0bb574a893e84c3ee6237e1d439750b

closes odoo/odoo#64860

Related: odoo/upgrade#2098
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-21 13:32:10 +00:00
Benoit Socias b6494fcf28 [IMP] website, web_editor: default image gallery and highlighted actions
Before this commit the image wall and image gallery snippets had no
default images (unless overridden by some themes), and the buttons to
add or remove images where not easily visible

After this commit the image wall and image gallery snippets have default
images and the action buttons are their first option line and have
highlighted backgrounds colors

task-2431420
https://github.com/odoo/design-themes/pull/442

closes odoo/odoo#64427

Related: odoo/design-themes#442
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-15 10:35:22 +00:00
qsm-odoo 9fcaeb96ef [FIX] web_editor: solve bold command issues
Summernote uses execCommand and, worth, obsolete queryCommandState
function to customize the edited content. Here we try to hack the
function to solve some problems by making the DOM and style easier to
understand for the base functions for the duration of their executions.
This won't obviously solves all problems but this is an improvement
while waiting for the new Odoo editor coming in future versions.

The original problem this solves is handling bold text in blog posts.
Posts are using font-weight: 300 which is enough to confuse summernote.
Hitting bold on a selected paragraph wraps its content in a <b> tag but
hitting bold again does nothing... having a <b> rendered as fw-400 is
enough to break it. What this commit does is: before any execCommand or
queryCommandState being used to modify the DOM or retrieve its state,
the whole DOM is forced to fw-400 and <b> elements to fw-700. This also
solves issues in some base snippets.

closes odoo/odoo#64483

X-original-commit: 424d9661c5657cbcf10ce40acb94a7a200c2a48b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-13 13:45:35 +00:00
Samuel Degueldre e68a37f379 [FIX] web_editor: fix steps snippet line removed when change icon bg-col
Previously, when changing the background-color of an icon in the
s_process_steps snippet, the line that goes through the snippet would
disappear from that block. This was caused by our font-application code
attempting to remove extraneous DOM nodes when changing a font color or
backrgound-color, but not considering elements with a ::before or
::after pseudoelement has having content, and subsequently removing
them.

opw-2423785

closes odoo/odoo#64412

X-original-commit: 6b363d202d9c35e8249f7bb2b0730b995fdf4a7d
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-01-12 13:50:20 +00:00
Martin Trigaux ade40f9028 [I18n] *: export saas-14.1 source terms
closes odoo/odoo#64393

X-original-commit: eaf7ec38b2f13b044768ccb457c5523cd24753f6
Related: odoo/enterprise#15693
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-01-12 10:38:54 +00:00
Samuel Degueldre 3bb892cfab [FIX] web_editor: fix icons losing classes when modifying them
Previously, when double clicking and image, video, icon, or document in
the web-editor and replacing it with a different media type, it would
lose its custom classes. This means among other things, that it would
lose margins and paddings from bootstrap classes, or in the case of the
three columns snippet, that the new media would not be properly rounded
in its top corner, or not show up at all in the case of the video. The
only exception was when changing any media type to an icon, but in that
case it would also keep some of the media-specific classes that are
supposed to be removed (eg img-fluid or media_iframe_video).

This commit fixes that as well as some _clear behaviour that didn't
remove all classes that had to be removed, eg some fa-classes would
linger depending on their order, and the o_image class from documents
would always remain

Part of https://github.com/odoo/odoo/pull/64234
task-2282542

closes odoo/odoo#64234

X-original-commit: 99531f5dd8966fc4ad89d1e9c2886ad701527f3a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-12 06:52:14 +00:00
Samuel Degueldre 398259c93f [FIX] web_editor: fix replacing media leaving unexpected elements
Previously, changing a media from a video/icon/document to a different
type would leave empty elements in the DOM, this is because summernote's
range API `range.insertNode` function deletes the content but not the
structure (HTML elements).

This commit fixes that by using jQuery's replaceWith method instead of
summernote's insertNode when a media was found, and only using
summernote in case no media was found (eg. a text range).

Part of https://github.com/odoo/odoo/pull/64234

X-original-commit: 63f80995a05eeab1061b769c7733a1cfa98c726e
2021-01-12 06:52:14 +00:00
Romain Derie ec132b530f [FIX] web_editor, website: prevent multiple click on save
Clicking on save on html editor is taking quite some time. The user might think
something is not happening and need to click again.
If he does click again, 2 write RPC will be sent, making the COW business code
being triggered twice, ultimately leading to create 2 COW.

Instead of
  A
 / \
B   B'

It will be
    A
  / | \
B   B' B'
With as many B' than there is click on save.

This commit adds a generic helper to make a button load/spin.

closes odoo/odoo#64366

X-original-commit: 80592abda266ef3f9f463854c3101eb3f728087b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-01-11 18:41:32 +00:00
Nasreddin (bon) 82ca092bd1 [FIX] misc: Babel; handle 'kur' (kurdish) locale
Issue

	- add a new language with locale code KUR (for Kurdish)
	- print any report with a datetime on it (RFQ for example)

Cause

	Babel (version < 2.7.0) does not handle locale "KUR".

Solution

	If wrong locale or not managed by Babel, try to fallback
	on server default locale.
	If still wrong locale or not managed, then fallback on "en_US" as locale.

opw-2416482

closes odoo/odoo#64304

X-original-commit: e6ccdb397792db62c3b08d96435b3c1667c1aa9d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-01-10 19:59:01 +00:00
qsm-odoo 089ae3d28b [IMP] web_editor: review image size display
Now the size is displayed in a badge in a better location.

Also, the size is now always displayed even if the user did not just
apply a modification (so that if the user saves then reopens edit mode
and clicks on an image, he can inspect the image size).

task-2424917

closes odoo/odoo#64036

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-07 16:17:13 +00:00
Benoit Socias 1feebf2a4d [FIX] web_editor: review public_render_template
The normal flow to render a template is now to use `render_public_asset`
which bypasses the read access rights if the user matches the groups
the view declares.

For public users, we still cannot use that as they do not have access
to calling model methods at all. The route `public_render_template` is
thus still needed, but it should use the `render_public_asset` util.

Related to task-2412544

closes odoo/odoo#64167

X-original-commit: 3fd40ba2030fef7dccf4046a932e3b3a172dc53f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-06 17:01:34 +00:00
Samuel Degueldre fc089f32b0 [FIX] web_editor: DOM is not cleaned before saving custom snippets
Previously, when saving a custom snippet, the outerHTML of the snippet
was naively read directly and saved as a new custom snippet.
Unfortunately this completely bypasses all cleanup mechanisms that we
have before saving, such as stopping the public widgets, or creating
attachments for cropped or optimized images. This would result in weird
bugs, where public widgets would appear twice when dropping a custom
snippet containing one, as well as the creating a new attachment for any
image that was optimized or cropped before saving the custom snippet
every time it was dropped in the page again.

Unfortunately there is no good mechanism for an option to ask the editor
to clean the DOM without actually saving it, as a temporary measure, the
snippet-save option will instead save the whole page (which will clean
up the DOM) and save the custom snippet after the save, before
refreshing the page and reopening the editor, not unlike some theme
options.

task-2341612

closes odoo/odoo#64166

X-original-commit: 38569777935a7939182f49ca978d98f4079e8f2f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-06 15:49:34 +00:00
qsm-odoo 73093edc18 [FIX] web_editor: stop showing text tools on empty oe_structure
Do not switch to text tools if the cursor is in an empty oe_structure
(to encourage using snippets there and actually avoid breaking tours
which suppose the snippet list is visible).

Part of https://github.com/odoo/odoo/pull/64088
Related to task-2352339

This commit has been merged twice as it was lost during JW revert.

closes odoo/odoo#64104

X-original-commit: 455f4ec1c5d60d1868f181075ce97a24ee6bc62e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-05 17:16:18 +00:00
qsm-odoo 0283ce986c [FIX] web_editor: prevent switching to text tools immediately
On editor start, "the cursor enters editable text" at a "random" time
thus switching immediately to text tools or not depending on the fact
text tools switching was initialized or not. We now only allow to do so
after some fixed delay after the editor is ready, to prevent any
automatic switching on editor start (which may break tours).

Part of https://github.com/odoo/odoo/pull/64088
task-2352339

This commit has been merged twice as it was lost during JW revert.

X-original-commit: 8e0efcd42b6254343aae8faf402e3d8dc630dd14
2021-01-05 17:16:18 +00:00
qsm-odoo 834e3f8f9b [IMP] base, *: remove read_template and review colorpicker template
*: web_editor, website

In stable versions, [1] was made as a fix to allow access to read
the colorpicker template for mass mailing users when they do not have
the read access right on ir.ui.view records.

This commit, for master, remove the need of using the confusing
read_template method by using render_public_asset instead (thus turning
the read into a render, which is the same for our colorpicker but might
be a change for potential custo). At the same time, this allows to
remove the read_template public method entirely.

Related to task-2412544

[1]: 8af75e00bdcda3d5ff4facd2f5f146e1d6bf79e4

closes odoo/odoo#64100

Related: odoo/enterprise#15580
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-06 09:30:13 +00:00
Samuel Degueldre dfcfca15d5 [FIX] web_editor: don't reoptimize already optimized image if repicked
Previously, if you double-clicked an image in the web editor with the
intention to change it, but the image had already been optimized, and
then repicked the same, already optimized image, the image would be
optimized again even though it had not changed. This commit fixes that
by making the media-dialog not trigger an image_changed event in those
cases, and by leaving the initial image untouched.

Linked to issue #57604

closes odoo/odoo#64038

X-original-commit: 4d3655304205cc9785ef696a47a17a41242d297a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-04 17:45:37 +00:00
Samuel Degueldre 0d215ac63d [FIX] web_editor: fix shape transparency color preview handling
Previously, the transparency color for shapes was not taken into account
when handling the preview state transitions of the background shape
snippet option. This caused strange behaviours where the shape
transparency color would always get reset when it was a class color,
either when changing to a different shape (expected, all shape colors
should get reset) or when changing any other shape setting like other
shape colors or flipping the shape (not expected). On the other hand, if
the transparency color was not a class color, it would always remain
untouched, when changing other shapes settings (expected) but also when
changing shape type (eg Origins 01 -> Blocks 02, unwanted).

This commit fixes that by cloning the entire shape container during
preview, and restoring it on preview-reset.

task-2380815

closes odoo/odoo#63955

X-original-commit: 39baa6dadd8b34d4a210b6fedd1c20c5df2621f6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-31 17:33:20 +00:00
qsm-odoo 923ae6415c [FIX] web_editor: fix post-JW revert button edition
Failed to remove a line at conflict resolution during JW revert at [1].

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

task-2424849

closes odoo/odoo#63908

X-original-commit: 15fd0b765d38199961d4210f362770216af23a42
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-30 11:09:20 +00:00
Samuel DegueldreandKishan Gajjar 0015426708 [FIX] web_editor: show currently active aspect ratio in crop widget
When changing the crop widget from being inside of a modal window to
using an inline crop widget, the functionality to show the currently
active aspect ratio was lost. This commit restores that behaviour.

Linked to https://github.com/odoo/odoo/issues/57604

closes odoo/odoo#63859

X-original-commit: df339cd0d65913548646abe6ca8182f06554333c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Kishan Gajjar <kishanegajjar@gmail.com>
2020-12-28 19:18:09 +00:00
Samuel Degueldre 89d70f198f [FIX] web_editor: fix shape transparency colorpicker appearing on parent
Previously, when adding a shape to a child element of a snippet, the
colorpicker to configure the shape's transparency color would also
appear on the snippet itself. This was caused by the selector for the
option not being specific enough, and finding the shape of the child as
a target, and thus showing up in the snippet menu.

This commit fixes the selector so that it only finds the current snippet
own shape, and not shapes of its children.

task-2390341

closes odoo/odoo#63857

X-original-commit: 26abfd452dac2a778e4e2ba4c1c26a0896e82565
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-28 18:30:15 +00:00
Benoit Socias 28f0853a2d [FIX] web_editor, test_website: will fix the deletion of custom snippets
This commit is a manual forward port of #62555. The tour test needed to
be adapted because the navigation flow is slightly different: upon
custom snippet creation, the editor page used to be saved and reloaded
in 14.0 but this is not the case anymore.

Before this commit the deletion of custom snippets failed because the
button click event got intercepted by the drag'n'drop mechanism.
The currentTarget of the event was used in an asynchronous call where it
had already been replaced by the jQuery's event bubbling mechanism when
invoking the other handler.

After this commit the deletion of custom snippets works again and a test
tour is introduced to make sure it does not get broken again

task-2405854

closes odoo/odoo#63108

X-original-commit: 4de0519d5b54634604e22b32d91a099695378088
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-10 08:28:14 +00:00
qsm-odoo d624a4f4f5 [FIX] web_editor: stop suggesting shapes for model-related images
Those kind of images use a specific route (/web_editor/shape/...) to
be fetched. While waiting for a more complete solution to maybe handle
them for model-related images, this commit only allows their use for
images in views and HTML fields.

closes odoo/odoo#63825

X-original-commit: dca6d7382e5d84997648952d442ad77df5d6ee82
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-28 11:54:19 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

New solutions are being investigated in master. For the moment, it seems
better to remove Jabberwock to unlock difficult forward-port between
14.0 and 14.1/master, until we decide what to do once and for all in
a later master. We may un-revert this later but that would be way easier
than reverting Jabberwock in a few months.

This was done as safely as possible by removing any commit related to
Jabberwock, then resolving conflicts, then reforcing commits from 14.0
that were hugely adapted for 14.1/master, then forcing the whole diff
over a rebased 14.1/master. The only possible miss (other than me making
a mistake) would be commits that were not forward-ported to 14.1 thanks
to Jabberwock handling the issue on its own (I know we had such commits
in website, which I manually included in this revert, see below).

For reference:

Commits which were reforced to their 14.0 version:
- https://github.com/odoo/odoo/commit/1a916fc2362c0b006460d94a219366ade1cce058
- https://github.com/odoo/odoo/commit/fd9e58a675bb7ec1bf97cb77b21b3c65369d51fe
- https://github.com/odoo/odoo/commit/bdfddace29b16404c06a7ebfc0cc242463a0e768
- https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
- https://github.com/odoo/odoo/commit/710784da1f02d45cbe898da426ba7e2ac63dc711
- https://github.com/odoo/odoo/commit/597585c9b8b1350bcfd84e8433ea6c82060bcc3d
- https://github.com/odoo/odoo/commit/333a9124608ff655bd9ad5e63044a5cb7ef9c636

Commits that were not forward-ported to 14.1/master and now are:
- https://github.com/odoo/odoo/commit/55ff2d971b672dec5f103215be39101c88856b6c
- https://github.com/odoo/odoo/commit/ebbb3de1e5f363689a5ba1647bb4c26416e42d5b

+ Adapt this forward-port: https://github.com/odoo/odoo/pull/60976 (as
  it was simplified for non-stable master version relying to the
  Jabberwock implementation and now needed to be adapted to the
  summernote implementation).
  See `!$el.data('oe-expression') && $el.data('oe-xpath')`

+ Revert https://github.com/odoo/odoo/pull/60477 and reforce original
  14.0 fix https://github.com/odoo/odoo/commit/746bf53b4aecfc601f0581a948d7cb7153812c82

Note: this also means that any good refactoring that was done by the
Jabberwock-related commits is lost for now. Once the revert reaches
master, I'll try and restore what we want from those commits. Here
are their references (but obviously they have the opposite conflicts
than those resolved during this revert):

e766842a92b6 [REM] web_editor,website: empty summernote files
08c94c986e09 [REF] web_editor,web: adapt to new jabberwock editor
1546c1b74713 [REF] mass_mailing: adapt to new jabberwock editor
fd0b963c6028 [REF] website: adapt to new jabberwock editor
0113d05c6c94 [ADD] web_editor: add new Jabberwock editor lib
d0c88a396493 [FIX] web_editor: don't change background color out of the website editor
d52d3d67d4e1 [FIX] web_editor : better icon in text style dropdown
61cb2f0d21da [FIX] web_editor: should not ask if want to leave the page twice
c42012b863b5 [FIX] web_editor: trigger a resize when use the mobile preview
d934d05d6e39 [FIX] web_editor: need to build the snippet before commit it into vDom
495bea924745 [FIX] web_editor: remove box shadow on the #wrap container
bffb5612e689 [ADD] field_html: add resizer in most field_html
f3c94e40cccf [IMP] web_editor: update Jabberwock library to commit 41e4063
cc87dea3ef32 [FIX] web_editor: update header change position to work with JW
5d9b25f66704 [FIX] web_editor: do not insert chars around step icon on click
70d3f0e4630c [IMP] web_editor: update Jabberwock library to commit 0bd94881
a57f13891f82 [FIX] web_editor: open media modal in appropriate tab on dblclick media
5b7537397e08 [IMP] web_editor: update Jabberwock library to commit a7ba7c34
a8d7ec235eeb [FIX] web_editor: adapt iframe Qunit test to new editor
5f794eac7209 [FIX] mass_mailing: hide all panels on show themes
551d45641d19 [IMP] website: remove unused reference
10580e1c102f [IMP] wesbite: add comment in tour
c17049f6b764 [FIX] web_editor: Fix description toggle in pricelist snippet
18a428e854b1 [IMP] web_editor: update Jabberwock library to commit 43a10003
58a161c645a5 [REF] web_editor, website: use editor helper setClass
62dd0bd3bc66 [FIX] web_editor: properly deactivate snippets and reactivate the last
99eebcaa34cb [FIX] web_editor: disable snippet in preview mode on mouse leave options
a84216932958 [FIX] web_editor: fix the image gallery snippet
f8dd4ea3e7d5 [FIX] web_editor: fix shadow selector for Safari
e50a4f3a16de [IMP] web_editor: update Jabberwock library to commit de13ed7e
4a2718f7a5ba [FIX] web_editor: ensure dom is properly cleaned at end of save test
03684c004a4e [FIX] website: ensure reset of bg-image on add bg-video
d63397159708 [FIX] web_editor: fix image remove from images wall
82fa5142f1a5 [IMP] note: restyle note without sheet or resizer
8b9f1ce603d5 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
fc2183b66305 [FIX] web_editor: image overlay did not update with changes
cd0d2f5791cd [FIX] web_editor: add color preview to color picker
28a168172454 [FIX] web_editor: restore removal of spinner
67c90dd3b946 [FIX] website_forum: properly initialize editor
920dfe2a430a [FIX] website_forum: better css in the JW toolbar
43f33fd651af [IMP] web_editor: update Jabberwock library to commit 6853b60
71246c92f8de [FIX] Web_editor: table options button should be inside the toolbar
12b9e5916692 [FIX] web_editor: properly update the image options on replace image
e889cf8583da [FIX] website, website_sale: properly save filter id of dynamic snippets
e0fd11e36e45 [IMP] web_editor: update Jabberwock library to commit 4b2c903b
8f2b7ba35614 [FIX] web_editor: properly stop snippet option changed event propagation
a30c2c4105c7 [FIX] website: fix megamenu snippet editor behavior
312091cf822b [FIX] web_editor: fix overlay that is not reappearing
9f1d03dda613 [FIX] web_editor: table picker not fully displayed
814ddada6124 [IMP] web_editor: remove message before leaving page if editor is destro
4f38e26af7da [FIX] web: allow saving copyright footer
01e947b6123b [FIX] web_editor: only save translations that changed
103676072c50 [FIX] web_editor: prevent traceback on open crop dialog
5844ff66d4a0 [FIX] web_editor: apply image crop in jw on save dialog
1b435652e4a0 [FIX] website_forum: ensure media modal opens on click button
4f4a6ca0b8ac [FIX] web_editor: ensure valid default html value
51e22026ac7b [IMP] web_editor: update Jabberwock library to commit ab1184f8
2413fa19be0e [FIX] web_editor: Qunit test properly wait for editor stop
aa89e1ea3e97 [FIX] web_editor: properly save view blocks with an id
e2e90b53992e [FIX] web_editor: ensure language selector is non editable
0efd72089d5c [IMP] web_editor: clean useless lines
f54dfc7631f9 [IMP] web_editor: remove useless comment
3995ab1b84f2 [IMP] web_editor: update Jabberwock library to commit b8d73691
0834b1e5740a [IMP] web_editor: withDomMutations
f1459fb7b45c [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
6e8acc6c8cc7 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
18a0c95d51cb [FIX] website, web_editor: #wrapwrap in body
4686a92e742c [FIX] website_form: allow edition of success message
78cc4da075cc [FIX] web_editor: allow edition of branded nodes only
bcffa7353448 [FIX] web: dialog should not use field value footer items
67ff56e14746 [FIX] web_editor,website_mass_mailing: display the popup preview
3cb9bea50c20 [IMP] web_editor: update Jabberwock library to commit a20492ea
518f03e6f1c9 [FIX] web_editor: use withIntangibles to find ZoneNode
d0ad6a568f49 [FIX] website: move sidebar out of theme
d690f5da13ea [FIX] website: properly save popup id
43b3433df3e6 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
4ee8f4dedc30 [FIX] web_editor: prevent deadlock when removing child snippet of popup
850be198ef6d [FIX] web_editor: prevent traceback on reposition background image
4c3eaba41f5d [FIX] mass_mailing: adapt tour to the new editor design.
496d3ea272ed [FIX] web_editor: properly position sidebar scrollbar
5be4de703074 [FIX] web_editor: Show the toolbar when select the text in forum edition

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
Samuel Degueldre e8b2b966b8 [FIX] web_editor: fix permanent loading effect on option double-click
Previously, double clicking an arrow to change the order of images in
the image-gallery snippet would cause the loading effect to permanently
stay and block the snippet editor completely. This was caused by the
fact that when clicking the arrow, the gallery snippet rebuilds itself
from scratch. After a snippet option is used (in this case, the
reordering arrow), we update the snippet overlay, and destroy
snippet-editors whose target is no longer in the DOM. When double
clicking, by the time we handle the second click, the target of the
option has been removed from the DOM, and the widget has been destroyed.
However, when we try to apply the option anyway, we trigger_up some
events (eg to refresh the public widgets) and wait for the trigger_up to
call back. Since the widget is already destroyed, it no longer has a
parent and trigger_up fails silently, never calling us back, and
blocking the mutex.

This commit fixes that by checking whether the widget is destroyed
before trying to apply the option, bailing immediately if it is the
case, and unlocking the mutex.

opw-2394953

closes odoo/odoo#63557

X-original-commit: b23dd1b20fbd656d40e2d8bc4a32a27652e50ee1
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2020-12-17 19:49:07 +00:00
Gorash 1a8ac6b79e [FIX] web_editor: Show the toolbar when select the text in forum edition
closes odoo/odoo#63527

X-original-commit: 610c546138bdfea952d775bef48ea9046f8cfb5b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-17 12:06:15 +00:00
Antoine Guenet 96fdf12ff1 [FIX] web_editor: properly position sidebar scrollbar
closes odoo/odoo#63495

X-original-commit: 3c249d385f46c0276ce04d5c3cce4fda620d2ba3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-17 09:33:19 +00:00
Antoine Guenet 61b0ac731b [FIX] web_editor: prevent traceback on reposition background image
closes odoo/odoo#63413

X-original-commit: 9cd778e683a5978c920bb0d367b3eb01ddf21c6f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-15 17:14:33 +00:00
Antoine Guenet c9d9b4cc2c [FIX] web_editor: prevent deadlock when removing child snippet of popup
closes odoo/odoo#63410

X-original-commit: b087f6a0c7b708ba45ad465310ac8064d3732591
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-15 15:40:34 +00:00
Sébastien Geelen (sge) 83b81cc44d [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
Another try at fixing the non-deterministic error in the `field_html_test > save` QUnit test which use the JW wysiwyg editor.

closes odoo/odoo#63409

X-original-commit: e3ff253e433397b05a809f1267083475b53c7fb5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-15 15:40:06 +00:00
Gorash 1beea8c4f1 [FIX] web_editor: use withIntangibles to find ZoneNode
ZoneNodes are now intangible containers

closes odoo/odoo#63384

X-original-commit: b6164a683cdca4ebdbcd802166323a83be7c6fa8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-15 12:04:19 +00:00
David Monjoie 4b8cbea36c [IMP] web_editor: update Jabberwock library to commit a20492ea
Changelog:
[IMP] BundleOdooWebsiteEditor: share withIntangibles object for odoo
[FIX] *: use withIntangibles walker to find intangible ZoneNodes
[REF] Layout: ZoneNode is now intangible
[REF] Core: refactor allowEmpty
[FIX] DomHelpers, DomLayout: ensure mutation on correct vdom match
[IMP] core: move browse the arch methods into a walker object
[IMP] core: add support for not tangible container
[ADD] Small: handle <small>
[ADD] Test: some new space tests

X-original-commit: 19661cf0bb8b5ec1fb832c6a935f816da4730b20
2020-12-15 12:04:18 +00:00
Gorash 9a02c39977 [FIX] web_editor,website_mass_mailing: display the popup preview
closes odoo/odoo#63343

X-original-commit: a0470eed4e57f2df19d4306ab4e894b986971eef
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-14 14:40:22 +00:00
qsm-odoo 89c1b47fbb [FIX] website: remove multi snippets zones in the header
task-2387598

closes odoo/odoo#63312

X-original-commit: 7c1b38ddbcd80b34bd0195b8900a52493eebea93
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-14 13:39:40 +00:00
Antoine Guenet 4e103b25f1 [FIX] web_editor: allow edition of branded nodes only
To be able to be saved, nodes have to provide information on where to
save them. This is done through the use of data attributes. Nodes that
do not have these data attributes or are not contained within nodes that
do, should therefore not be editable.
Recent changes in Jabberwock ensure that the nodes with these data
attributes are saved either as `OdooStructureNode` or as `OdooFieldNode`
so we can simply check for these.

closes odoo/odoo#63311

X-original-commit: adf778d4bb499c6beb6b54d8093ced4f81d2ac57
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-14 11:01:24 +00:00
Benjamin Vray 49e2a7136c [FIX] web_editor: fix css of active items
Before this commit, the css of the active items considered the items
to always be <a> elements. But a PR, coming after the one who
introduced this css code, changed the items generation system and now
the items are no longer <a> elements but <div> elements.

This caused a flickering effect when hovering over the last item in
the dropdown.

Part of #62971

task-2312878

closes odoo/odoo#63112

X-original-commit: b046fb31c34fd61086a492b2b8abf59a4e205dad
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-09 17:49:12 +00:00
Goaman 73ca6f191e [FIX] website, web_editor: #wrapwrap in body
Make the element #wrapwrap be placed directly in the body as in 14.0
instead of wrapped inside containers.

FIX: [QSM] Header effects don't work in edit mode even though they are started
FIX: [QSM] The editor overlay on top of snippets does not disappear during scroll
      anymore
FIX: [QSM] Click on the header, it is deletable while it should not (I precise
      that here asit is a kinda different case: the header has options even though
      it's not editable but it's not deletable)

closes odoo/odoo#63268

X-original-commit: e0331583cf995b7cfe7d7928918c71b51c854f2d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-11 17:56:51 +00:00
David Monjoie c498dfcb19 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
Changelog:
[IMP] Odoo: add option to wrap the main zone

X-original-commit: 3fff28df08678a1ca4f5b60d5d96bfeb6115f31c
2020-12-11 17:56:51 +00:00
Sébastien Geelen (sge) dc9017be05 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
closes odoo/odoo#63261

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-11 17:03:37 +00:00
Nicolas Bayet 3fa7894106 [IMP] web_editor: withDomMutations
1) Replace editor function that change the editor internal structure
   with a new mechansim that does it automatically by observing dom
   mutations. Welcome wysiwyg.withDomMutations.

2) Add a mechanism to reuse the active editor execution context
   when a wysiwyg.execCommand or wysiwyg.withDomMutations is called
   inside itself.

   Example:

   await wysiwyg.execCommand(async ()=> {
      ...
      await wysiwyg.execCommand(()=>{...})
      await wysiwyg.withDomMutations(()=>{...})
   })

closes odoo/odoo#63237

X-original-commit: fe7056ccb450c9767693671e8d980a6aebacd6ab
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-11 15:32:36 +00:00
David Monjoie 7498d58edc [IMP] web_editor: update Jabberwock library to commit b8d73691
Changelog:
[IMP] Odoo: allow empty structure nodes
[IMP] Odoo: expand parsing range of OdooStructureNode
[FIX] DomHelpers: removeNodes only when they exist
[FIX] withDomMutations : getParentModifiers
[FIX] withDomMutations: don't get node loosely
[FIX] withDomMutations: remove the proper observer
[FIX] OdooField: do not apply empty class if placeholder
[FIX] OdooWebsiteEditor: add expected Theme plugin

X-original-commit: 537c3318a6f2751d83a011345602456125420590
2020-12-11 15:32:36 +00:00
Goaman a692cf42f4 [IMP] web_editor: remove useless comment
X-original-commit: c435b7febe11aec99827fc81eb6ea62a74d82edd
2020-12-11 15:32:35 +00:00
Goaman 3da99844aa [IMP] web_editor: clean useless lines
X-original-commit: 21e5e44fb71850a2e03b9afbf8e8467b554d6bef
2020-12-11 15:32:35 +00:00
Antoine Guenet f059f85bca [FIX] web_editor: ensure language selector is non editable
closes odoo/odoo#63242

X-original-commit: d08d97c73991ad2e1c8976e29e017607ab8fdd96
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-11 13:22:51 +00:00
Antoine Guenet f8b10518b2 [FIX] web_editor: properly save view blocks with an id
X-original-commit: d72a58f0596b67ebc16a39ba9e4a7c14d8e90eec
2020-12-11 13:22:51 +00:00
Martin Trigaux 3f13751e9b [I18N] *: export saas-14.1 source terms
Without demo data

closes odoo/odoo#63238

X-original-commit: 4e6683973b1d1ecc67f1312a8ef98b1272e2d5a5
Related: odoo/enterprise#15268
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-12-11 12:30:42 +00:00
Benjamin Vray 39a3a7caaa [FIX] web_editor: fix background position on shapes
Before this commit, the background-position was not removed from a
shape when it was re-flipped to its original orientation.

introduced in #61114

closes odoo/odoo#63197

X-original-commit: 597585c9b8b1350bcfd84e8433ea6c82060bcc3d
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-10 16:55:09 +00:00
Benjamin Vray ec8860448d [FIX] web_editor: fix color-customize dynamic svgs on snippet drop
Before this commit, the theme colors did not update dynamic svg images
due to an inversion between key and value in the code.

closes odoo/odoo#63154

X-original-commit: 9b1916c382f105d30e7d693c0b914c05db593da0
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-10 12:06:37 +00:00