Commit Graph
2537 Commits
Author SHA1 Message Date
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
Sébastien Geelen (sge) fd5fc76677 [FIX] web_editor: Qunit test properly wait for editor stop
closes odoo/odoo#63073

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-09 10:24:14 +00:00
David Monjoie 923b38ba39 [IMP] web_editor: update Jabberwock library to commit ab1184f8
Changelog:
[FIX] Core,Underline: fix compilation errors after cascading
[IMP] DomHelpers: transfer dom mutation in VDocument
[IMP] Core: add iterable capacity to modifiers
[IMP] core: add cascading modifier support
[FIX] DomLayout: firefox screenshot feature
[FIX] Underline: always put <u> as deep as possible in the rendered DOM
[FIX] JWEditor: Await the new stop event mutex + adapat some tests
[FIX] EventNormalizer: Clean _triggerEventBatchOutside at destroy()
[IMP] JWEditor: Wait for all mutex to be done before stopping the editor
[FIX] Textarea: use tag name for textarea parser predicate
[IMP] Quote: add quote plugin
[FIX] DomLayout: Make sure falsy attribute values are not transformed into null
[IMP] Heading, Blockquote, Pre: do not preserve modifiers on end split
[FIX] history: change icon to be compatible with Odoo FA version (1.4.7)
[FIX] table: table-picker rendered under some buttons
[FIX] Odoo: add OdooFields css to OdooWebsiteEditor
[FIX] Color: do not color a ZoneNode
[IMP] Table: add component "Table options" button + visible on group
[IMP] Pre: never duplicate a pre on insertParagraphBreak
[IMP] Blockquote: never duplicate a blockquote on insertParagraphBreak
[FIX] List: should not have the list-style none attribute in the vDoc
[FIX] List: toggle list should removes list-style from li element
[FIX] Iframe: IframeNode should be rendered in the layout.
[ADD] Core: handle deleteHardLine

closes odoo/odoo#63006

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-08 11:25:57 +00:00
Antoine Guenet 6e90af01fc [FIX] web_editor: ensure valid default html value
closes odoo/odoo#63005

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-08 10:14:17 +00:00
Antoine GuenetandSamuel Degueldre 32f46a5075 [FIX] web_editor: apply image crop in jw on save dialog
closes odoo/odoo#62950

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2020-12-07 14:39:16 +00:00
Antoine Guenet ae2b3ef844 [FIX] web_editor: prevent traceback on open crop dialog 2020-12-07 11:17:14 +00:00
Achraf (abz) 61ae6a6ca1 [FIX] survey, web, web_editor, website, website_form: Prevent invalid date stock.picking
What are the steps to reproduce your issue?

1. Install "stock"
2. Go to Inventory/Inventory Overview/Internal Transfer
3. Create new record and set manually a date with year < 1000 like "0008-10-10 18:35:00"
4. Save
What is currently happening?

An error arises when saving the record, and it is then no longer
possible to reopen the records or any view containing it.
This also prevents us from correcting the date to no longer have the error
Why is this happening?

The root cause is an inconsistency in `strftime` for years < 1000 [1, 2]. To take it into
account, a zero-padding is needed in the DateTime parser.
How to fix the bug?

The missing padding is added.

However, such dates lead to problematic behaviors in Python:

```
DT_FORMAT = "%Y-%m-%d %H:%M:%S"
new_date = "0008-02-05 18:10:10"
datetime.strptime(
    datetime.strptime(
        new_date, DT_FORMAT
    ).strftime(DT_FORMAT),
    DT_FORMAT
)
```

This raises:
```
ValueError: time data '8-02-05 18:10:10' does not match format '%Y-%m-%d %H:%M:%S'
```

As of today there was no reported business cases where dates with year < 1000 would be
necessary. Therefore, we limit the range to years >= 1000.
[1] https://bugs.python.org/issue13305
[2] https://docs.python.org/dev/library/datetime.html#strftime-strptime-behavior

opw-2408260

closes odoo/odoo#62889

X-original-commit: b873bda1e560bc49ab707aa238fdc962f23bc1e4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2020-12-04 13:35:47 +00:00
Emilien Durieu (edu) 0693f641bb [FIX] web_editor: only save translations that changed
The translation editor used to save all the translations at once, which was wrong because it made it look like some text had been translated when it hadn't.

closes odoo/odoo#62699

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-02 16:59:28 +00:00
Sébastien Geelen (sge) 947fc39d4c [IMP] web_editor: remove message before leaving page if editor is destro
closes odoo/odoo#62630

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-01 09:26:49 +00:00
Emilien Durieu (edu) 9c6389b782 [FIX] web_editor: table picker not fully displayed
The table picker was hard to use because its container scrolls instead of letting it overflow.

closes odoo/odoo#61783

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-13 13:51:55 +00:00
Martin Trigaux 1658473bf2 [FIX] *: rephrase, correct typos
Courtesy of Transifex's translators for reporting bad/unclear sentences.

closes odoo/odoo#62564

X-original-commit: 9b3b2e8d711e3be75b1faffaf6f4f8f4ec90186e
Related: odoo/enterprise#15038
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-11-30 07:07:58 +00:00
Samuel Degueldre 6efe469941 [REF] web_editor, web: remove unused getRecordInfo event and methods
In the 12.3 editor revert, the handler for the getRecordInfo event was
removed, but the code that triggered this event was forgotten and now
doesn't do anything. This commit removes this dead code.

closes odoo/odoo#49126

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-28 09:32:34 +00:00
Emilien Durieu (edu) 74e00f4efd [FIX] web_editor: fix overlay that is not reappearing
In some situation, the overlay does not reappear after disappearing.

Steps to reproduce:
1. add a title
2. add a few elements between title and footer so you can scroll title out of view
3. click title
4. scroll it out of view
5. click footer
6. scroll back up
7. click title
-> overlay is not reappearing[FIX]

Now overlay should not do that anymore.

closes odoo/odoo#62547

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-27 14:56:05 +00:00
Benoit Socias 61b846463c [FIX] web_editor: avoid translation of ACE warning close button "icon"
Before this commit the close button cross/multiply character was wrongly
translated in some languages (e.g. Spanish)

After this commit the close button cross/multiply character is not a
translatable text anymore

https://github.com/odoo/odoo/pull/60268
task-2365792

closes odoo/odoo#62400

X-original-commit: 517e272da81e4f5ad958d896a75d4f32b44083e5
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-26 13:05:52 +00:00
Jeremy Kersten 3de58cf56e [IMP] web_editor: shape - merge some style + fix color
Blocks and Rainy / Airy and Zigs merged together
Fix color of Bold 5 and bold 6 shape that are not easy to use due to contrast
with black, now it is grey by default.

task-2357174

closes odoo/odoo#62352

X-original-commit: 978fcbd4f6ba9f618b69560cb5fbe26602828bcb
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-25 16:39:42 +00:00
Benoit Socias 8c2dd4aa03 [FIX] web_editor: make Bold shapes 10 & 11 transparent
Before this commit Bold shape 10 & 11 had no transparent color

After this commit Bold shape 10 & 11 have a transparent color instead of
their former color #3 (#F6F6F6)

task-2357174
https://github.com/odoo/odoo/pull/59613

X-original-commit: 71b3b2d61b7acad601da38457671a20357298587
2020-11-25 16:39:41 +00:00
Sébastien Geelen (sge) 1d7fc44b48 [FIX] web_editor: properly stop snippet option changed event propagation
closes odoo/odoo#62307

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-25 10:35:22 +00:00
Benoit Socias bde8abcfeb [IMP] web_editor: support 5 dynamic colors for illustrations
Before this commit only the first default palette color was configurable
on illustrations

After this commit all 5 default palette colors are configurable on
illustrations

task-2368585

closes odoo/odoo#60503

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-20 13:13:15 +00:00
Sébastien Geelen (sge) 5df12c183e [IMP] web_editor: update Jabberwock library to commit 4b2c903b
Changelog:
[FIX] DomLayout: Make sure falsy attribute values are not transformed into null

closes odoo/odoo#61875

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-23 16:03:53 +00:00
Antoine Guenet 4cedbe173c [FIX] web_editor: properly update the image options on replace image
Prior to this fix, replacing a jpeg image with an svg illustration
didn't properly update its mimetype in its dataset. As an effect, the
jpeg image options still appeared, that were irrelevant for an svg.

This was caused by a premature update of the image in Jabberwock's vdom,
before the mimetype was updated, and by the fact that the current image
was not being passed to the constructor of the media dialog, causing it
to create the image from scratch on save instead of replacing the src
attribute of the current image like it did before introducing
Jabberwock.

closes odoo/odoo#62082

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-20 12:25:45 +00:00
Gorash 42d0f6449b [FIX] Web_editor: table options button should be inside the toolbar
closes odoo/odoo#61529

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-09 10:37:43 +00:00
IEL 1051b28970 [FIX] web_editor, website_form: speed up and robustify form editing
STEPS:
* open website page with a form (e.g. /contactus)
* click edit
* slow down connection speed
* click fast between form input lines or change order of the lines

BEFORE:
* 7 svg files are requested every click
* get_authorized_fields is called every click
* random error "'classList' of undefined" in SelectUserValueWidget::close
* random similar errors when a method is called before initialization

AFTER:
* svg and get_authorized_fields are requested once
* random errors are no reproduced or it's hard to do it
* performance of switching between inputs doesn't depend on connection
speed (though, still not instant)

WHY:
* about changing in SelectUserValueWidget::close: posible reason why
this.menuTogglerEl may be undefined is because method start is async
* the other updates just implement caching

---

opw-2368928

closes odoo/odoo#62115

X-original-commit: 710784da1f02d45cbe898da426ba7e2ac63dc711
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-22 13:58:44 +00:00
Antoine Guenet 82cfa94e89 [IMP] web_editor: update Jabberwock library to commit 6853b60
Changelog:
[IMP] Heading, Blockquote, Pre: do not preserve modifiers on end split
[FIX] history: change icon to be compatible with Odoo FA version (1.4.7)
[FIX] table: table-picker rendered under some buttons
[FIX] Odoo: add OdooFields css to OdooWebsiteEditor
[FIX] Color: do not color a ZoneNode
[IMP] Table: add component "Table options" button + visible on group
[IMP] Pre: never duplicate a pre on insertParagraphBreak
[IMP] Blockquote: never duplicate a blockquote on insertParagraphBreak
[FIX] List: should not have the list-style none attribute in the vDoc
[FIX] List: toggle list should removes list-style from li element
[FIX] Iframe: IframeNode should be rendered in the layout.
[ADD] Core: handle deleteHardLine

closes odoo/odoo#61244

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-20 14:26:40 +00:00
Sébastien Geelen (sge) e770066e2f [FIX] website_forum: better css in the JW toolbar 2020-11-20 14:26:40 +00:00
Antoine Guenet eea4601f11 [FIX] website_forum: properly initialize editor 2020-11-20 14:01:15 +00:00
Antoine Guenet 08d72a615f [FIX] web_editor: restore removal of spinner 2020-11-20 14:01:15 +00:00
Emilien Durieu (edu) a4e3685ccb [FIX] web_editor: add color preview to color picker
The web editor offered in-content preview when hovering over a color to change text or background color.
This commit implements this behavior with Jabberwocky.

closes odoo/odoo#61588

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-18 08:57:22 +00:00