Commit Graph
2665 Commits
Author SHA1 Message Date
Nicolas LempereurandKamen Zhekov 38464f5aaf [FIX] web_editor: have transcoder apply text-decoration
The transcoder (transforming CSS rules into inline CSS for mail clients)
was not working for text-decoration property because it would transform
text-decoration values in:

{'text-decoration-thickness': 'normal', 'text-decoration': none}

And the regex that ensures we don't add duplicates check if there is:

"(^|;)\s*text-decoration"

so if there is text-decoration-thickness, text-decoration is not added.

The regexp could be changed to:

"(^|;)\s*text-decoration[^\w-]"

but we already have special case for other text-decoration-* properties.

With this change we should get text-decoration applied in:

- edit mode (was already the case)
- readonly mode (new)
- mail client (only if mail client does not override it)

As a side note: text-decoration-thickness seems to be rather new[^1] so
at one point in time there was probably no issue.

[^1]: https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness

opw-2496490

closes odoo/odoo#69078

X-original-commit: f4f1b890e15e98d9a7e72586faf73327d3f7b716
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Kamen Zhekov <kzh@odoo.com>
2021-04-09 18:24:21 +00:00
Sébastien Geelen (sge) ef83c6af8f [FIX] web_editor: re-implement focus method
Focus is sometimes called on the Wysiwyg class in Note.
When the user use TAB to select the next field.

Implementation was missing.

closes odoo/odoo#69033

X-original-commit: 720c1f38a17ef54cf30e0a52bab5bceed70c2144
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-09 10:48:31 +00:00
Sébastien Geelen (sge) d7c4362319 [FIX] web_editor: update odoo-editor lib to commit 68108b2a
X-original-commit: d3c17baf260d962eb620c77e03afccea8c16c1d1
2021-04-09 10:48:30 +00:00
Sébastien Geelen (sge) 92d0713478 [IMP] web_editor, mass_mailing: activate undo/redo button in mail edition
closes odoo/odoo#68912

X-original-commit: 2b12674fcfdebf362e5bd806bc8374d82c30de82
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-07 15:44:43 +00:00
Julien Mougenot 3e3dce0eb8 [REF] *: rename assets 'glob' to 'path'
Rationale:
The majority of cases where an ir.asset is manually declared
outside of manifest files is to specifically add a single asset file.
This means developers are specifying a single asset *path*, and not a
glob expression. In this context, it seems better to name the filepath
field `path`, and document that it can be specified with a glob
expression when (seldom) needed, rather than making the exception appear
to be the norm - possibly puzzling many developers (What's a glob and
why do I need one?)

The doc is updated as well, and some spell-checking and wording
improvements were done too.

This required some adaptations to the existing `ir.asset` declarations:
- odoo/enterprise#17465
- odoo/design-themes#459

closes odoo/odoo#68695

Related: odoo/upgrade#2348
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2021-04-07 20:39:10 +00:00
Sébastien Geelen (sge) 510da70768 [FIX] web_editor: adapt $.tranfo() to be iframe compatible
closes odoo/odoo#68878

X-original-commit: c180c8d76862cd65df413f40787e05bad76367b5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-07 10:25:49 +00:00
Christophe Monniez ed3f25c145 [FIX] web_editor: fix scss typo
last-of-type pseudo class does not need parentheses [0].

This typo throws an exception only with recent versions of libsass.

[0] https://developer.mozilla.org/en-US/docs/Web/CSS/:last-of-type

closes odoo/odoo#68866

X-original-commit: 2b55306c3ad69f8b7588b2223c94e0db6449e5df
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-04-07 08:37:11 +00:00
Younn Olivier dcd60f8de2 [FIX] website_sale, *: make the product image container not editable
*: web_editor

It prevents user writing in the image preview of products.
Also, the product image view now fit its container so that the user can
click wherever in the frame to change the picture.

Part of https://github.com/odoo/odoo/pull/68823
task-2446852

closes odoo/odoo#68850

X-original-commit: e4f06666307e79b9a5b26357a1545a56e6bd40b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-06 17:50:19 +00:00
Sébastien Geelen (sge) 8b2cff3f78 [FIX] web_editor: have a default icon for media align toolbar button
closes odoo/odoo#68830

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-06 13:09:43 +00:00
Sébastien Geelen (sge) 7ccc011833 [FIX] web_editor: fix traceback when selection is null
closes odoo/odoo#68827

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-06 12:39:47 +00:00
Younn Olivier 0a0341ee6a [FIX] web_editor: update the media search bar layout
Before, depending on the screen size, it was not always clear for the
user that he can use the search bar to find library images.

The upload buttons and search bars have been switched in order to make
the search the first choice for the user. Also, make the arrow pointing
at the searchbar more understandable.

task-2446852

closes odoo/odoo#68821

X-original-commit: 4237916d1f103baef5760e8508c9ebd5e91ac163
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-06 12:08:35 +00:00
Sébastien Geelen (sge) 158d0c78fa [FIX] web_editor: override CTRL+A select all to avoid traceback
Odoo Task : https://www.odoo.com/web#id=2497783&action=333&active_id=1695&model=project.task&view_type=form&cids=1&menu_id=4720

Bug report from LNA:
 > In Google Slides, when you press ctrl+a, it selects the content of your container (ex : your shape or title or whatever) which is pretty useful to quickly replace big blobs of text whereas here, it takes the entire email and if I press suppr  => traceback  https://pastebin.com/KnCzV3Hc https://tinyurl.com/yzen23cc
And my mailing is then empty and completely broken https://tinyurl.com/yhhu9zj6
I can't even drop so it's just over since I cannot click on "cancel"  https://tinyurl.com/yef5c55s

closes odoo/odoo#68819

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-06 12:45:41 +00:00
Antoine Guenet 5d8a8841a6 [IMP] web_editor: update odoo-editor lib to commit fb68d86
closes odoo/odoo#68687

Related: odoo/enterprise#17463
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-02 09:44:12 +00:00
Antoine Guenet 62261b6c9d [IMP] web_editor: make toolbar fixed on top of editable on mobile
Mobile browsers implement their own floating toolbar in text selections.
As a consequence, Odoo Editor's floating toolbar ends up mingled with
the native one, making it hard to use.
This commit, in conjunction with adaptations on Odoo Editor's side,
replaces the floating toolbar on mobile devices with a static toolbar on
top of the editor and adapts styles accordingly.
2021-04-02 09:44:03 +00:00
Antoine Guenet 82ba0ce081 [REF] web_editor, website_forum: remove unused wysiwyg options
Some instance options of Summernote remained in the code after replacing
Summernote with Odoo-Editor. This removes them as they effectively did
nothing.
2021-04-02 09:43:39 +00:00
qsm-odoo 179fe1e4a6 [FIX] web_editor, website: solve broken link popover test
- The test was clicking on a link "too soon" in some cases (editing a
  link then immediatly clicking on it while the save action is not fully
  performed). Ideally, this should probably be more robust around the
  save action to first edit the link synchronously then perform the
  actual save in DB but this can be checked later on.

- Removed useless popover update while it was hidden.

- Make sure that two consecutive update of the popover only updates its
  UI relying on the last asked data.

- Make sure the popover correctly clean what it did once destroyed
  (however, it is never actually destroyed for now... to check later).

closes odoo/odoo#68686

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-04-02 09:19:44 +00:00
740168ce8d [REF] web_editor, website_*, mass_mailing: adapt to Odoo Editor
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 16:01:06 +00:00
93e88da2e6 [ADD] web_editor: introduce Odoo Editor wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
Co-authored-by: Fabien Pinckaers <fp@odoo.com>
Co-authored-by: Quentin Smetz <qsm@odoo.com>
2021-04-01 12:49:47 +00:00
27166ff9df [REM] web_editor, website: remove Summernote wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 12:49:47 +00:00
Romain Derie 8fcf930a6b [IMP] web_editor, website, *: introduce popover as edit system for links
*: website_form

This commit introduces a simple & light popover/tooltip (as in Google Doc) when
editing a link.

It will be used:
1. (web_editor) On every page links.
2. (website) In the website navbar, when clicking on a menu, it will replace the
popup shown to ask the user what he wants to do (edit the menu or go to the link
or do nothing). That popup was a bit invasive and old-fashioned.

Part of https://github.com/odoo/odoo/pull/64756
task-2439860

closes odoo/odoo#64756

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-01 09:49:45 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
8cc066173d [IMP] *: Improve assets management
This commit changes the way assets are declared in Odoo modules.

Before: assets were declared in template files. Template bundles were
generated from primary templates, so technically any qweb template could
have been called as an asset bundle, with the 't-call-assets' directive.

Being standard qweb templates, they had access to standard HTML tags
(script, link, with or without raw scripts or style definition), qweb
directives (t-call, t-raw, etc.) and could be inherited by other
templates.

Now: assets are defined in the module's manifest and generated by the
't-call-assets' directive.

More information on the new system can be found on the updated user
documentation (see the "JavaScript Reference" section).

Task: 2352566

Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin 043079d4dd [REF] web_editor: clean up assets views
This commit handles 2 things:

- Moves snippets used to call the summernte library inside several new
dedicated files.

- Removes a raw script declaration to move it to a dedicated file.

Also the calls to the lib files have been changed from a qweb loop to an
explicit list of script tags.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Julien MougenotandSimon Genin ebe86f5ca5 [REF] web,*: Flatten _assets_helpers
Before this commit, the asset bundle "_assets_helpers" was the only
bundle using a "t-raw" directive to insert assets in between other asset
calls.

Now _assets_helpers only contains the assets called before the t-raw
directive, and the second part (1 file actually) has been added after
every call of the bundle.

This has been done to improve consistency in asset bundles declarations
by reducing them to the simplest possible templates.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:17 +02:00
Nicolas Lempereur a92e702a43 [FIX] web_editor: show XML editor error if rejection value
Override in enterprise web_studio of _saveView on error never rejected
promises. But now it does so the XML editor interface is not blocked
after error.

But we were already showing the correct error in web_studio use case, so
we don't want another one and this change allow that by only showing an
error if we received rejection value.

opw-2460081

closes odoo/odoo#68569

X-original-commit: 43184af875f3eb52586348b383627cb0140484f5
Related: odoo/enterprise#17395
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-03-31 06:49:32 +00:00
Romain Derie 603ace1966 [IMP] web_editor: add error support for too big image files
ValueError is raised when image resolution is too big (over 45e6[1]).

[1]: https://github.com/odoo/odoo/blame/4c91e895a98642f10bd1d2d46819705edc38f638/odoo/tools/image.py#L47

Part of https://github.com/odoo/odoo/pull/65828
task-2345082

closes odoo/odoo#65828

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-31 07:07:39 +00:00
Romain Derie 9dab9ffce2 [IMP] web_editor: show error if uploaded image type is not suported
We only support .gif, .jpe, .jpeg, .jpg, .png, .svg

This commit won't let the code go though if we know the image format is not
suported.

Part of https://github.com/odoo/odoo/pull/65828
task-2345082
2021-03-31 07:07:31 +00:00
Romain Derie 0d6cdeef2f [IMP] web_editor, *: show a progress bar on image upload
*: web, web_unsplash

Without this commit, the user had no hint to know something was actually
being performed.
It would be worst when uploading multiple image at once, eg in image
wall, as it could take some times for the images to be processed and
uploaded.

The user now has a visual hint about the upload progress through a
toaster and some progress bars.

For unsplash, note that as the actual image download is performed S2S,
the progress bar will automatically jump to 100%, then will wait for the
RPC success once the server is done to show a success progress bar.

Part of https://github.com/odoo/odoo/pull/65828
task-2345082
2021-03-31 07:06:35 +00:00
Romain Derie 185c50a740 [IMP] web_editor: whitelist supported image formats in URL
Only allow URL ending with extension of supported image formats.
Don't let anything else goes though, so we remove the magic behavior
that was uploading a non-image url as a document.

Part of https://github.com/odoo/odoo/pull/65828
task-2345082
2021-03-31 07:06:22 +00:00
Romain Derie 1dc4ca96c4 [REM] web_editor: leftover of aa8d2a8be2
Part of https://github.com/odoo/odoo/pull/65828
task-2345082
2021-03-31 07:05:51 +00:00
Aaron Bohy c89cdcf11c [FIX] web: tests: patch form multiClickTime once for all
A lot of tests in different QUnit modules need this delay to be
patched to 0. Some of them (e.g. the 'ActionManager > Misc' module)
didn't patch it correctly. It worked before because a patch was
done in a previous test, and wasn't unpatch. The previous commit
ensures the patch is removed, so now we have at least 2 tests of
the above mentionned module that fail. This commit ensures that
the delay is patched in every tests, and allows to specify a
custom delay if necessary.
2021-03-31 09:30:07 +00:00
Nicolas Lempereur 26b29de7d2 [FIX] web_editor: no quick edit on html link click
When clicking on link in html fields, we do not wish to start quick
edition. With this change this is excluded.

closes #68023

closes odoo/odoo#68212

X-original-commit: ecbdddbf0cff0964b44e7f0571d372ccbd051a72
Related: odoo/enterprise#17235
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-03-22 16:59:38 +00:00
Nicolas Lempereur 8a5d22826c [FIX] website_forum: show normal image modal in forum
In #67893 the image icon was removed, but it contradicts the interface
and made a feature that was working for employee less available.

Since saas-12.3, we always use the full media dialog when showing the
editor on the forum so we could not add an image with the image icon if
were not an employee.

Before saas-12.3, the original summernote image dialog was shown for
everyone but website editor that saw the full media dialog (beecause we
are using the same editor to do both things).

With this change, we always have the original dialog in the forum
message editor thanks to a new option "disableFullMediaDialog".

opw-2470720

closes odoo/odoo#68166

X-original-commit: c026c360fb77ce43f47f7645f48e37bced988b85
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-03-19 18:30:00 +00:00
Sébastien Mottet (oms) 2323af4451 [REF] website, *: centralize color palettes in website
*: web_editor

All theme specific color palettes have been moved into website.
It allows to access them without having to install theme modules and
this is a preparation for our website configuration screen task.

Lists of palettes have been replaced by maps with palette names as keys.
Those names are composed of the palette's original theme name ('generic'
or 'base' for palettes not specific to a theme) and of an index
(ex: 'anelusia-2'), for compatibility.
To keep compatibility with previous version we also convert old color
palettes number to color palette name, specifically for each theme.

A side effect of this change is that we got rid of all gray palettes
which existed in some themes. Those were not fitting the new possibility
of gray customization in the third panel and were not always really a
good customization of the default grays (they still were there mainly
for historical purposes). Unfortunately, this may have some side effect
for old websites which used those grays but the new gray palettes (left
to the default one) should most of the time come as an improvement of
the old ones, and they are now customizable by the user. In the future,
we may associate a perfectly-chosen default gray palette, fitting the
customization system, for each color palette.

PR: https://github.com/odoo/odoo/pull/67488
task-2451965

closes odoo/odoo#67488

Related: odoo/design-themes#455
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-26 11:31:17 +00:00
Romain Derie bad0926ab1 [FIX] web_editor: don't run code when input is emptied
Before this commit:
  - Edit mode, open image dialog
  - Upload an image to the media dialog
  - Reclick on Upload but don't select an image, close the browser image
    selector
  - This will trigger the input change event, as the input was emptied

This is needed since in later commit, `_addData()` will do some code outside
of the `files` loop, which is useless if there is no files selected.
In thise case, the issue would be that it would open an empty toastr.

task-2345082
Coming from #65828
Closes #68326

closes odoo/odoo#68340

X-original-commit: 94c45412714c1263788b2567ce3c9581453b2cd4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-25 12:35:11 +00:00
Romain Derie 46ea05ab03 [FIX] web_editor: prevent mismatch between mimetype and content type
Since the image util method `image_base64()` is converting BMP images to PNG
automatically[1], there would be a mismatch between the attachment content type
and the attachment mimetype.

  - Content type: retrieve with `base64_to_image(data).format` -> return PNG as
                  the image data was converted from BMP to PNG
  - Mimetype: set on `write()` and `create()` with `_check_contents()` which
              call `mimetypes.guess_type(file_name)`.
              BMP image `my_file_image.bmp` would have a mimetype set to BMP

The computed field `image_src` would return `False` since the image.mimetype
would be BMP, making the dialog picker not showing the image but loading
`http://localhost:8069/false` instead.

[1] https://github.com/odoo/odoo/blame/097f29d0f6a5b295c81fd074665dbd261eaf12fb/odoo/tools/image.py#L124

task-2345082
Coming from #65828
Closes #68326

X-original-commit: ef5b108b781df73342bb99342a1116fad86d3b58
2021-03-25 12:35:10 +00:00
Samuel DegueldreandArthur Detroux fb05e0f554 [FIX] web_editor: fix race condition in option selection
Previously, when selecting certain options, especially ones which had
slow updateUI methods, the selected value was sometimes reset to its
previous value. This was caused by a race condition in which, when a
snippet option updated its value, it would wait for options on the
parent snippet editors to update all of their options' UI, but it
incorrectly only waited for *one* of the snippet editors to finish
instead of waiting for all of them.

This commit fixes that by stopping the event propagation and triggering
a new event that will let the direct parent know when all parent editors
are done updating their options' UI before signalling that the UI update
is done.

task-2487578

closes odoo/odoo#68341

X-original-commit: 7623a0c771495cd41bf40af37c0d2b6e4beb7cdc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Arthur Detroux <ard@odoo.com>
2021-03-25 12:37:35 +00:00
Samuel Degueldre 73f4fad9ee [REF] website_blog, *: adapt blog-post option to use new m2m for tags
*: web_editor

This commit refactors the website blog option to use the newly
introduced Many2manyUserValueWidget

Part of https://github.com/odoo/odoo/pull/67832
task-2274732

closes odoo/odoo#67832

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-25 09:27:18 +00:00
Samuel Degueldre be05ac7e2b [IMP] web_editor, website_form: introduce m2m UserValueWidget
This commit introduces a many2many as a standalone, reusable
UserValueWidget. This widget is built on top of the ListUserValueWidget
which was until now only used in website form that had to be updated to
allow more generic use of the widget.

Part of https://github.com/odoo/odoo/pull/67832
task-2274732
2021-03-25 09:26:53 +00:00
Oussama MESSAOUDIandqsm-odoo 35d27a6c1d [IMP] website, *: control hue and saturation of grays
*: web_editor

The purpose of this commit is to control the hue and the saturation of
the gray palette.

task-2362091

closes odoo/odoo#66428

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-03-24 17:36:14 +00:00
Oussama MESSAOUDI 0edb5e2985 [IMP] web_editor: trigger event oninput for input range type
Add an event listener triggered on current value change of input range.

task-2362091

closes odoo/odoo#66812

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-23 16:18:19 +00:00
Oussama MESSAOUDI 91703b9ff5 [IMP] website, *: improve the UI of the mobile visibility option
*: web_editor

Adding the option to show/hide on mobile at snippet level + review the
UI (now a top action button).

task-2431659

closes odoo/odoo#65013

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-23 10:15:24 +00:00
Samuel Degueldre 7e1ba0de41 [FIX] web, web_editor, website: fix incorrectly translated template literals
closes odoo/odoo#68105

X-original-commit: e1d280880c26d6139dc6a3679fb7df7e07defdd6
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-03-18 16:05:37 +00:00
Xavier Morel 73d25e253e [FIX] web_editor: selector exclusion rule
The current rules would allow through a selector of the form

    :not(sel1, sel2)

then because the matcher thing just splits on `,` it would store the
incorrect sections

    :not sel1(

and

    sel2)

as separate selectors in the rules cache, raising an exception when
matching against elements.

Move all the rules to a single regex, and add a rule to exclude any
situation where a comma or an open parenthesis is inside of an open
parenthesis pair: we can't just check if there's a closing parenthesis
with no intermediate `,`, because the selector could be

    :not(:nth-child(3), sel2)

in which case the selector would "pass" as the regex would match the
nth-child's closing paren to the not's opening. This means some
selectors *could* be unnecessarily blacklisted, but currently we don't
have any such nested pseudo-classes so...

If we want to resolve this, we need to actually parse the
selector (using something like Sizzle I guess) in order to properly
split the selector-list and take a real look at the selector's
structure. Maybe one day.

closes odoo/odoo#68093

X-original-commit: d50c3b07f1c0644ac8e412f099ddd7b139671060
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-03-18 14:55:13 +00:00
xO-Txandqsm-odoo f98d1c4b21 [FIX] web_editor: fix selection style for icons
The code added in [1] to update style for multi image selection
is not compatible with .fa icons and causes a strange behaviour when
trying to select one.
The goal of this commit is to fix style for selected icons on media
dialog.

Also fixes the fact the icons were not centered before.

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

closes odoo/odoo#67846

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-03-15 17:05:48 +00:00
Younn Olivier 9bbe5be3fb [IMP] web_editor, *: display handles overlay only when needed
*: website

When declaring a SnippetOption, it is now possible to specify if the
display of the handles overlay should be visible on the snippet element.

By default, it is set to false, and if the selected snippet element does
not have any option that require the handles to be displayed, we will
display them on the first parent element that needs the handles to be
displayed.

In the context of an image, the handles will be displayed on the parent
column, as the image does not have an option that require the handles.

Part of https://github.com/odoo/odoo/pull/66550
task-2431684

closes odoo/odoo#66550

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-12 10:16:14 +00:00
Younn Olivier f3ccc91d42 [IMP] website, web_editor: add an icon to replace images in edition
From the editor, when clicking on an image there is a new refresh icon
next to the delete icon that will open the media dialog to allow for its
replacement.

Part of https://github.com/odoo/odoo/pull/66550
task-2431684
2021-03-12 10:16:04 +00:00
Samuel Degueldre ff8070033b [FIX] web_editor: show mimetype warning for illustrations
Previously, when clicking on an illustration in the editor, the image
options would be unavailable with a message saying that it was due to
technical limitations, and that the user should reselect the image in
the media-dialog for quality options to become available. This was
caused by the fact that in order to support more than one customizable
color in illustrations, they are now saved inside the database with an
url containing which colors are customizable inside the url's query
parameters. Since the endpoint that finds which attachment corresponds
to which image src was looking for an exact URL match, but query params
are trimmed on the client side before talking to the endpoint, they were
no longer matching.

This commit fixes that by searching for attachments whose URL matches
the provided one with or without any extra query parameters.

closes odoo/odoo#67625

X-original-commit: b26319c3c9409e8724fadeec80e63ea94dc8d599
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-10 17:59:34 +00:00
xO-Tx 9d2398ac59 [IMP] web_editor: update style for background button
The goal of this commit is to update style for Media Picker button.

Part of https://github.com/odoo/odoo/pull/66544
task-2326573

closes odoo/odoo#66544

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-09 11:02:50 +00:00
xO-Tx 38dc9c82c5 [IMP] website, *: replace spacing selection by a slider
*: web_editor

The goal of this commit is to tweak the code of <we-range> widget
to be able to select a css using class values.
This way, the image spacing selection can be easily replaced by
a slider of 4 levels [0 -> none, 1 -> small, 2 -> medium, 3 -> big].

Part of https://github.com/odoo/odoo/pull/66544
task-2326573
2021-03-09 11:02:42 +00:00