Commit Graph
2515 Commits
Author SHA1 Message Date
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
Emilien Durieu (edu) c65e284dcc [FIX] web_editor: image overlay did not update with changes
The blue overlay on the snippet currently being edited did not update when the size or place of the element changed.
The overlay is now edited on each Jabberwock commit.

closes odoo/odoo#61716

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-13 12:16:22 +00:00
qsm-odoo 3c53748d7a [FIX] web_editor, *: ease understanding of snippet drag, not click
*: web, website

Make the empty oe_structure messages "wizz" when the user clicks on a
snippet to drag instead of dragging it.

Note: also rename the "_onSnippetMouseDown" handler to not confuse it
with this new "_onSnippetClick" and add the missing documentation
comment for it.

Part of https://github.com/odoo/odoo/pull/60837
Related to task-2363616

closes odoo/odoo#61724

X-original-commit: bdfddace29b16404c06a7ebfc0cc242463a0e768
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-13 15:36:43 +00:00
qsm-odoo dc1ebbafde [FIX] web_editor: encourage to use snippets in empty oe_structure (wizz)
Make the draggable snippets "wizz" when the user clicks on an empty
oe_structure.

Part of https://github.com/odoo/odoo/pull/60837
Related to task-2363616

X-original-commit: 3ed3537abd416ebc35f8bc2ee65f209840c071bf
2020-11-13 15:30:42 +00:00
IEL dcf3519a64 [FIX] *: Change some terms to unambiguous ones
WHY: odoo translation framework still cannot properly handle terms that have
different translations, so we need to avoid english terms with double meaning.
Also, this improves term understanding for translators.

---

closes odoo/odoo#61668

Discussion: #60765 #61272
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-12 12:44:07 +00:00
Samuel Degueldre c5a2652c9b [FIX] web_editor: fix gap between transformed shape and next section
Previously, when flipping some shapes vertically on chrome, and
vertically or horizontally on firefox, there was a gap of 1px or less at
some screen widths. This is caused by the way these browsers render
backgrounds on transformed elements. It seems like firefox will round
the size of the element to render the background image on it if the
element is transformed, while chrome will always render the background
at the correct size (or render it at a larger size and clip it to the
correct size after the fact), but will round the coordinates of the
symmetry point, causing only the vertical flip to have this issue, and
only if the background image would not extend beyond the bounds of the
element (on firefox, even shapes that would extend beyond the bounds of
the element would showcase a gap, eg origins 1)

This commit fixes that by applying the transform to the SVG rather than
to the element, by use of the shapes controller.

task-2369560

closes odoo/odoo#61609

X-original-commit: 42b3ad10e0b32b7fc72f801e2c67d6baf938c566
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-10 18:27:45 +00:00
Siddarth Gajjar 4f69f742c1 [FIX] web_editor: restore website menu creation
Broken by new editor merge at [1].

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

task-2370575

closes odoo/odoo#61530

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-09 16:01:46 +00:00
Antoine Guenet 4e252d02f8 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
closes odoo/odoo#61525

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-09 10:18:42 +00:00
Benjamin Vray bd6749e750 [FIX] web_editor: allow single quotes in getShapeData
Before this commit, the value of data-oe-shape-data required double
quotes to be properly parsed in JSON in the getShapeData method.

After this commit, we also allow single quotes to prevent issue if
someone doesn't use double quotes in the the value of
data-oe-shape-data. Which was precisely the case in one of the themes
and this is why this commit is a fix.

task-2327741

closes odoo/odoo#61487

X-original-commit: 10ac750aaecf502500dc08966f4642a8604a685b
Related: odoo/design-themes#423
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-06 15:14:17 +00:00
Antoine Guenet 1547ea1985 [IMP] note: restyle note without sheet or resizer
This change of style is a special request from FP: full width, full
height, no <sheet>, no resizer.
I did end up using a <sheet> and restyling it specially for note because
the styles that allow us to have the note next to chatter is too
intricately linked to the style of the sheet in form view to make it
safe to remove the sheet. Indeed, fully removing the sheet implied
duplicating a lot of css from community and enterprise alike. This way
is the least intrusive even though semantically unsound.

closes odoo/odoo#61405

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-06 13:34:44 +00:00
Sébastien Geelen (sge) 7da9cc2f27 [FIX] web_editor: fix image remove from images wall
* on image remove was removing two images instead of one -> fixed
* reactivate the image adder helper if you manually remove the last image

----

bug report :
[QSM] Images wall snippet -> Add images -> click on one -> Delete via the trash icon button on the overlay -> Sometimes (most of the time) delete 2 images instead of the selected one

closes odoo/odoo#61462

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-06 09:58:41 +00:00
Antoine Guenet b211cf9664 [FIX] web_editor: ensure dom is properly cleaned at end of save test
closes odoo/odoo#61421

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-05 14:33:02 +00:00
Benoit Socias 91419a811a [IMP] web_editor, website_form: put add action in front of other options
Before this commit the add field actions are in the middle of the editor
top options

After this commit the add field actions are in front of the editor top
options

task-2367124

closes odoo/odoo#60996

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-03 07:24:46 +00:00
Benjamin Vray 2ca115f650 [FIX] web_editor, website, website_mass_mailing: center bg images
Before this commit, background images were not centered by default.
It was especially annoying on mobile device. We created a new class
to center background image and we added it on all the snippets with a
background image except those with a parallax effect because they
already have a background-position in inline style.

task-2318526

closes odoo/odoo#60430

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-04 14:53:37 +00:00
David Monjoie 34892f3cd0 [IMP] web_editor: update Jabberwock library to commit de13ed7e
Changelog:
[IMP] DomLayout: Some errors are logged without doing an automatic undo
[FIX] Build: add back odoo-integration
[FIX] Core: snapshots do not alter the operation of memory slice switches
[FIX] polyfill: ensure shadow caret position fallback in contenteditable
[FIX] Dom: properly target deepest in a siblingless shadow

closes odoo/odoo#61314

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-11-04 11:19:05 +00:00
Gorash 7a717b221c [FIX] web_editor: fix shadow selector for Safari 2020-11-04 10:43:19 +00:00
qsm-odoo f81cb46b3d [FIX] web_editor: unblock the editor after dropping the "Quotes" snippet
Before this commit, when the user dropped the "Quotes" snippet, the
editor was not allowing to drop any more snippet (see [1]). This was
because the editors initialization related to the drop of the "Quotes"
snippet was not able to be fully performed. Indeed, it is composed of
carousel items, themself containing images. As some of those carousel
items are hidden, the images they contains are too... and some options
actually wait to access their naturalWidth. As the images are lazy
loaded since [2], we were thus waiting infinitely.

[1]: https://github.com/odoo/odoo/commit/277f39904e7218bef2dd23b1c5b719ce8660008f
[2]: https://github.com/odoo/odoo/commit/617c716aeafd7bbc776d81da134a9b25329f08c9

closes odoo/odoo#61308

X-original-commit: 2e37befbf84f0f587774d4c2fa095487148b549b
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2020-11-04 08:39:29 +00:00
Antoine Guenet fcd2f942c2 [FIX] web_editor: disable snippet in preview mode on mouse leave options
closes odoo/odoo#61030

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-10-30 10:54:37 +00:00
Antoine Guenet a6b7d082e8 [FIX] web_editor: properly deactivate snippets and reactivate the last
Some lines had been wrongly (re-)moved during the process of integration
of Jabberwock. This restores them. Among other things, this fixes the
issue that made the popover snippet options still appear when the
snippet was invisible.
2020-10-30 10:12:43 +00:00
xO-Tx 3ab48f5f56 [FIX] web_editor, website: restore footer visibility option
Making the footer visible after having made it disappear was not
possible anymore because of [1].

Part of https://github.com/odoo/odoo/pull/59624
task-2312878

[1]: https://github.com/odoo/odoo/commit/61ffe97d03deae0aee72568311c453d1cd3470c8

closes odoo/odoo#61275

X-original-commit: fab31e378d2069ff6f2bd18365de2f116a43b872
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-03 14:16:31 +00:00
Benjamin Vray 2c21649d35 [FIX] web_editor: avoid traceback on form inputs double-clicks
Before this commit, double clicking on the border or on the padding of
a form input generated a traceback.

task-2312878

closes odoo/odoo#61201

X-original-commit: 904af21214a5a6924ec80b5690a523819aaec5f1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-11-02 16:37:49 +00:00
Antoine Guenet 069d61cf5a [REF] web_editor, website: use editor helper setClass
This helper is the equivalent of jquery's `toggleClass` with a value for
the `force` attribute. I chose to name it `setClass` instead because
with that attribute it's technically not toggling: it's setting.
2020-10-27 11:25:46 +00:00
Sébastien Geelen (sge) 71b3fc7c17 [IMP] web_editor: update Jabberwock library to commit 43a10003
Changelog:
[FIX] List: Keep lonely containers in LI if they have attribute(s)
[ADD] Core: handle triple-click delete special case
[FIX] formattingSpace: properly ignore empty text and hidden inputs.
[FIX] should use the dev mode with mobile and multi devices in same time
[FIX] DomEditable: remove flickering in browsers without auto-completion
[FIX] DomLayout,KeyMap: remove flickering on delete, backspace, enter...
[REF] Core: merge .eslintignore inside .eslintrc.js
[REF] Core: remove odoo webpack build

closes odoo/odoo#61074

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-10-30 15:57:44 +00:00