Commit Graph
3195 Commits
Author SHA1 Message Date
Jorge Pinna Puissant cac3ba62e5 [IMP] test_lint, *: add caughtErrors option to no-unused-vars
All named arguments on the catch block must be used. If for some motive
the named argument on the catch block is not used, its name must begin
with '_'.

closes odoo/odoo#85569

Related: odoo/enterprise#24867
Related: odoo/design-themes#552
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-03-02 13:05:42 +00:00
Jorge Pinna Puissant bc20eb4790 [IMP] test_lint, *: enable no-unused-vars rule
Part-of: odoo/odoo#85569
2022-03-02 13:05:42 +00:00
Nicolas Bayet 923a92a0bb [FIX] web_editor: only include website commands in website
task-2696972

closes odoo/odoo#85628

X-original-commit: c1ff3260a8e09ba4af3ad44138d44d4457c7c689
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-02 08:36:10 +00:00
Nicolas Bayet 1b4a390b73 [FIX] web_editor: select checklist when language is rtl
task-2734731

closes odoo/odoo#85627

X-original-commit: 0a236b11e770b6a8db5192685a2c36ce1e303399
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-03-02 08:36:06 +00:00
qsm-odoo 1ab7210ae3 [REF] web_editor, website: review the web_editor.assets model
- Three controllers were actually useless as the relevant public methods
  of the web_editor.assets can be called directly via RPC in the related
  usecases.

- Review the web_editor.assets model methods organization in the model
  declaration.

closes odoo/odoo#85392

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-28 12:56:05 +00:00
qsm-odoo aec6925b17 [MOV] web_editor: move web_editor.assets main methods at the top
Part-of: odoo/odoo#85392
2022-02-28 12:56:04 +00:00
Thibault Delavallée 2a3d8dd1c2 [MOV] various: move ir.qweb.fields code into right files
When working on qweb fields it is difficult to find some custom override as
they are never in the right file. Finding them is always a bit of random pick.

Task-2607416

Part-of: odoo/odoo#74171
2022-02-28 11:07:39 +00:00
Antoine Guenet e13b4fdb9f [FIX] web_editor: ensure powerbox gets selection from owner document
When checking if the powerbox should open, we check the selection but
that was done on the global document, which returns a wrong selection
for the editable if it's in an iframe. As a result, the powerbox never
opened in mass_mailing.

task-2778414

closes odoo/odoo#85352

X-original-commit: d5b8c26c46b1daf795a6b286af80bb4dad8072ff
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-25 08:26:03 +00:00
Antoine Guenet c797a41d19 [FIX] web_editor: hide inactive modal behind fullscreen editor
`.modal.o_inactive_modal` (in modal.scss) had a z-index that was
superior to that of a fullscreen editor. As a result we could end up
with the editor being partially hidden by a modal.

task-2741872

closes odoo/odoo#85315

X-original-commit: 6ef3c1cf59ac66f00462468079500c449f189fae
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-24 14:37:35 +00:00
Nicolas Bayet 69ea40215b [FIX] mass_mailing: show media modal when fullcreen
Whenever the user clicked on the fullscreen in mass_maliing, then
trying to show the media modal was not possible as the div that
contains it was hidden.

Task-2731907

closes odoo/odoo#85314

X-original-commit: 4026bc2075b7109dd18471aabf11ff3f76d6c57d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-24 14:37:31 +00:00
Julien Castiaux c0647b5c52 [REF] core: HTTPocalypse (14) changes all addons
This commit is the 14th commit of a comprehensive refactor of our HTTP
framework. See odoo/odoo#78857 for complete historic, discussions and
rationnals.

* `request.uid = x` => `request.update_env(user=x)`.
* `request.context = x` => `request.update_env(context=x)`.
* `request.context = dict(request.context, x=y)`
   => `request.update_context(x=y)`.
* `request.cr = None` => `request.cr.close()`.
* `http.mono_db()` => `request.db`.
* `http.dispatch_rpc()` => `service.dispatch_rpc()`.
* `@service.model.check` => `service.model.retrying()`.
* `request.endpoint`
   => `env['ir.http']._match(request.httprequest.path)[0].endpoint`.
* `request.routing_iteration `=> `removed`.
* `request.jsonrequest` => `request.dispatcher.jsonrequest`.

Note that `request.params` is now set much later in the process. If you
are in a situation where you values from the query string or the
http body you can use `request.get_http_params()`.

Note that using the new `request.future_response`, it is possible to
add headers and cookies on the response object before the response
object is initialized. Please note that headers/cookies saved on
the future response will NOT be injected in case of error.

PR: odoo#78857
Task: 2571224
2022-02-24 13:30:51 +00:00
Benjamin Vray 169dd13df3 [FIX] web_editor: fix cover when there is modal inside a snippet
Since this commit [1], we considered that if a snippet contained a
modal, it is that the overlay had to cover the modal itself.

But that is not correct, because in some cases a snippet can contain
closed modals (e.g. the course page in the website slides module
contains modals).

After this commit, we avoid applying an overlay on a modal that is not
open.

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

task-2710582

closes odoo/odoo#85240

X-original-commit: 9f3eac25b1806d13e270902848c6ead523c7e6bc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-02-24 12:33:04 +00:00
qsm-odoo 863266530a [FIX] web_editor: avoid multiple calls to access asset content
Instead of calling get_resource_path multiple times, Odoo utils were
able to be used, allowing custo.

task-2774978

closes odoo/odoo#85182

X-original-commit: 5cda0604358f40bd3ec74b922539088386093a86
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-02-23 09:06:58 +00:00
Sébastien Geelen (sge) 8a5c8a3cb9 [FIX] web_editor: fix icon replacement is mass_mailing
In mass mailing edition :
Replacing a font awesome icon with an image was not working properly.

task-2733908

closes odoo/odoo#85167

X-original-commit: d4d25c8b497e465753cef030292faa4824145cb1
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2022-02-22 21:05:40 +00:00
Antoine Guenet b8176448c3 [FIX] web_editor: ensure uploaded images in backend are not public
When uploading an image in the editor, we go through
`_attachment_create`, which sets the image to public if `res_model` is
`ir.ui.view` (the default if none was passed). Because of a wrong
reference to the editable DOM element (which contains the `res_model` as
data), when instantiating the media dialog, we were passing no
`res_model`. As a result, when saving an attachment, no `res_model` was
passed to `_attachment_create` and the attachment was made public.
Attachments in the backend should not be public and should be linked to
the proper model.

task-2759034

closes odoo/odoo#85132

X-original-commit: 5b664f0c04433091c3d6f85f245887d1808c308f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-22 16:16:35 +00:00
Antoine Guenet 51c9629aa1 [FIX] web_editor: prevent traceback on apply style to empty lines
When the selection only contains empty lines, no text nodes are
selected. `applyInlineStyle` however counted on text nodes being
selected, resulting in a traceback.

task-2740204

closes odoo/odoo#85059

X-original-commit: ee6c71a3bcd6ec927acbe4eaf4c21acb28396e87
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-22 15:19:38 +00:00
Benoit Socias c5e96ac750 [FIX] web_editor: revert text color previews
Before this commit when a text color was applied on a text within
which an already colored text already existed, the inner coloring was
lost during preview. All text was therefore set to the initial coloring
of the external selected text.

After this commit the "reset" of the text color preview is done by
undoing the draft "in progress" history step that contains the preview
changes, but that is not stored within the history itself.

Steps to reproduce:
- drop the Text snippet
- select a word in the middle of a sentence (e.g. "personality")
- set text color to red
- select several words containing the colored one (e.g. "story with
personality for potential")
- open text color palette
- hover over colors but do not click
- leave color palette
=> colored word is not colored anymore

Steps to reproduce a secondary problem also fixed by this commit:
- drop the Text snippet
- select text surrounding some bold (e.g. "have a personality. Consider")
- open text color palette
- quickly hover through several colors (i.e. move pointer downwards)
=> text selection range changed between some of the color previews

task-2742112 (was task-2666200)

closes odoo/odoo#84998

X-original-commit: 9cb5a138244783580c2d1baa4dc01d1824ed20f4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-21 14:14:09 +00:00
Sébastien Geelen (sge) b160eabafd [FIX] web_editor: keep cursor in empty inline tag
Ensure the user can keep typing inside a newly emptied inline tag:

* Add Zero-width Spaces (ZWS) in empty html tag

> We add zero-width spaces in elements in certain cases where they would
> not be correctly displayed by the browser if they were truly empty.
> This also ensure the user cursor can stay in an empty elements,
> and thus we keep the ability to add content in those elements.
>
> See the `fillEmpty` utils function.

* Remove lingering zero-width spaces

> However, we never remove those zero-width spaces when they are not
> useful anymore. In particular, keeping those invisible characters in the
> content prevents the ecommerce from saving the new price of a product if
> the previous price was previously completely emptied during edition.
> This commit fixes that.
>
> The issue didn't happen with the previous editor because they were
> using non-breaking space instead, which is removed by the text_content
> method of lxml. However, non-breaking space were visible during edition,
> which was weird on its own.
>
> Some changes had to be made to the deleteForward and backward commands,
> to ensure the new behaviors.
> Author : @dmo-odoo

* Adapt the deleteForward and backward commands

> To ensure the added ZWS do not break the Deletes behaviors,
> we need to adapt the `deleteForward` and `deleteBackward` commands.

Co-authored-by David Monjoie <dmo@odoo.com>

task-2622455

closes odoo/odoo#84891

X-original-commit: 4360643a446271d4ff1898d67a5b5287722a0820
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-18 14:29:30 +00:00
Sébastien Geelen (sge) 9e12a209de [FIX] web_editor: add missing tests + fix some tests
* Fix some tests that will break when we change the empty inline tag handling.
* Add missing tests to ensure the new empty tag management
  behave correctly.
* Improve some tests with `contentBeforeEdit` and `contentAfterEdit`

X-original-commit: af379b11462d9393c3c9846aaecb9488ffaa9212
Part-of: odoo/odoo#84891
2022-02-18 14:29:30 +00:00
Sébastien Geelen (sge) c2b37d7cfb [FIX] web_editor: fix and add missing test utils
* Ensure the test environment is clean from previous editor instances.
* Provide a way to clean the successfully test cases
  to have a better and quicker overview of the failed tests.
* Better error messages in test report

X-original-commit: 9a362195ad7b3485877946d18d64fd84c62605f9
Part-of: odoo/odoo#84891
2022-02-18 14:29:29 +00:00
Sébastien Geelen (sge) ef404e974d [FIX] web_editor: Fix linting errors
X-original-commit: 554f4871d913cc24decfff07b55f8d7bf80f89db
Part-of: odoo/odoo#84891
2022-02-18 14:29:29 +00:00
Gorash a9343fae75 [FIX] web_editor: properly show snippet names via t-install directive
Since the refactoring done on ir.qweb at [1], directives are more
autonomous, so `t-att`, `t-options`, etc are no longer evaluated by
other directives. These directives are also ordered.

Before this commit, when directives such as `t-snippet`, `t-install`,
etc were called, the other attributes had already been consumed. Indeed,
at the end of the compilation, tags should no longer have attributes,
`t-att` removes all statics ones. So relying on the `string` attribute
in `t-install` was broken and so the snippet names for the snippets to
install from the editor panel in edit mode were gone.

This commit fixes that by evaluating those specific directives earlier.

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

task-2762377

closes odoo/odoo#84752

X-original-commit: f40b9522f20d5fbfe62c3718566c1d92ccfad75b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-02-16 18:41:23 +00:00
Antoine Guenet bf61c9a36a [FIX] web_editor: properly convert fonts to images
export_icon_to_png sometimes failed because PIL's getbbox returned None.
This fixes it by not using a default color of (0, 0, 0, 0) when creating
the image but using the actual color of the image instead.
Also, the size of the image was wrong because of using the default size
when width and height are defined.

task-2761098

closes odoo/odoo#84638

X-original-commit: efcb432f4c459b2d2d819c3aed7d63d53fc93809
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-15 14:55:05 +00:00
Antoine Guenet afc2e84a9b [FIX] web_editor: better align converted icons
Icons converted to images were improperly aligned because as inline
elements their vertical-align style property used their first block
ancestor as reference.

closes odoo/odoo#84513

X-original-commit: eb0fa518b563206afcc214a81f89cea45820b34c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:27 +00:00
Antoine Guenet 608a9909bc [FIX] web_editor: ensure border around comparison snippet
The conversion of the comparison snippet for mail compatibility involves
heavy changes in the html. In order to preserve the style, some style
changes were needed as well. This change to the style of cards allows us
to restore the border around the snippet.

X-original-commit: fae07f2dcd74ed3ce85d37cc7ea0180b40994ff1
Part-of: odoo/odoo#84513
2022-02-14 14:51:26 +00:00
Antoine GuenetandNicolas Bayet 18fb205c41 [REF] web_editor, mass_mailing: replace use of jQuery in convert_inline
jQuery was used extensively in `convert_inline`, slowing it down by a
factor of more than 2. This replaces all use of jQuery with vanilla
javascript so as to improve performance significantly.

X-original-commit: 8573a4ebbfe951c9ce0d3ef753174f4f0a6c829b
Part-of: odoo/odoo#84513
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
2022-02-14 14:51:26 +00:00
Antoine Guenet 612cd4e092 [REF] web_editor: remove _applyOverDescendants
Rules used to be applied in the DOM sequencially, in traversal order.
This is slow and confusing to debug. Meanwhile, most functions had been
adapted to process the rules in a simple loop on the concerned nodes.
This commit does that for `classToStyle`, the last remaining function
that wasn't doing it yet, and removes the utility function
`_applyOverDescendants` altogether.

X-original-commit: 70253a98bd9d6752c29cfe61debf4567d0a872e8
Part-of: odoo/odoo#84513
2022-02-14 14:51:26 +00:00
Antoine GuenetandNicolas Bayet c40d9357fd [IMP] web_editor: apply rules only where needed
This improves performance of `classToStyle` by first selecting which
nodes and which rules will be concerned.
When parsing the css rules, we computed their specificity and normalized
their styles one by one. This applies these processes only on the
concerned rules, all at once.

X-original-commit: bb28624dcd69efe1aff546b37e66c05c001a5927
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:25 +00:00
Antoine GuenetandNicolas Bayet 6ec2d52c6f [FIX] web_editor: remove rule grouping in css rules parsing
Since some css was loaded twice, when parsing rules, we grouped similar
rules in order to minimize the amount of rules on which to iterate
during conversion, so as to improve performance. This is not needed
anymore now css is loaded only once, so we can remove this extra
processing.

X-original-commit: 3db6f4a345015adf99c2a744066dcdf8f076a657
Part-of: odoo/odoo#84513
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
2022-02-14 14:51:25 +00:00
Nicolas BayetandAntoine Guenet 96c859eb0a [IMP] web_editor: batch write in formatTables to avoid layout thrashing
This batches all writes in the `formatTables` method of `convert_inline`
so as to minimize layout thrashing and therefore improve performance.

X-original-commit: f3c0f0c62b9f31e47ef8644c79e1b9751d0ba746
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:25 +00:00
Nicolas BayetandAntoine Guenet 382b77bec2 [IMP] web_editor: batch write in classToStyle to avoid layout thrashing
This batches all writes in the `classToStyle` method of `convert_inline`
so as to minimize layout thrashing and therefore improve performance.

X-original-commit: addf3e8fa37f4f2cc212a55a332ec61090655232
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:24 +00:00
Nicolas BayetandAntoine Guenet a8cf97bdee [FIX] web_editor: prevent double-loading css in mass_mailing
`web.assets_frontend` was called in `wysiwyg_iframe_editor_assets` _and_
in `iframe_css_assets_edit`. As a result, they were loaded twice in edit
mode.

X-original-commit: 4bea292681039c1954c6c9038742fa6e2cc2c31e
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 14:51:24 +00:00
Nicolas Bayet 8f829fb7bc [REF] web_editor, mass_mailing: remove unused code
`__extraAssetsForIframe` had been kept in `mass_mailing` and
`web_editor` for historical reasons but was not used anymore. This
removes it.

X-original-commit: 88b91df3ff75bb0be9a84761cb251d0b7b3c976d
Part-of: odoo/odoo#84513
2022-02-14 14:51:24 +00:00
Antoine Guenet 0791c31654 [FIX] web_editor: correct reference to editable in tests
Some tests depended on a variable to be defined, which was only defined
in other tests.

X-original-commit: d3e30a532526e7be54d6153a3ed375ff30d8f8e3
Part-of: odoo/odoo#84513
2022-02-14 14:51:23 +00:00
Martin Trigaux 9fbf706ba8 [I18N] *: export saas-15.2 translations
closes odoo/odoo#84475

X-original-commit: 8ea2605fbfec6277d7a01b6e73548a9585866c61
Related: odoo/enterprise#24289
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-14 10:44:50 +00:00
Guillaume (gdi) 05d133c47c [FIX] website, web_editor: fix form ids generation
Commit [1] modified the function that generates HTML ids, unfortunately
this was not done correctly and should have been done in all versions
since 14.0. This commit fixes that by bringing the benefits that commit
[1] brings (correction so that HTML Ids don't start with a number) but
without the defaults that it has.
See the related discussion here [2].

[1]: https://github.com/odoo/odoo/commit/3dde03308d4adffd861570230edcef1c5f7fc1c4
[2]: https://github.com/odoo/odoo/pull/80217#discussion_r787975515

task-2760205

closes odoo/odoo#84474

X-original-commit: 105f80e57cacf48dcdafc41dc3d1cf418c75311e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-02-14 10:44:46 +00:00
David MonjoieandAntoine Guenet d4835b20a8 [FIX] web_editor: properly solve image in image button bug
Commit 57701b2 resulted in another bug as links could not longer be
edited. This refines it so it fixes the bug it solved without the
nefarious side effect.

closes odoo/odoo#84464

X-original-commit: 84fd0b0a1bc1d874e7d6d6ff10b4fb6351f5a1af
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
2022-02-14 08:49:51 +00:00
qsm-odoo 7c0b026487 [FIX] web_editor: remove divs created by default shadow computation
The shadow option needs to create a div on the fly to be able to
retrieve the default shadow value. This commit makes sure these divs
are also removed when no longer needed.

This also simplifies the code and actually avoids that div creation when
it is not needed.

task-2752326

closes odoo/odoo#84324

X-original-commit: 309f03c011fc8e5e0bec9882af54a8147025118f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-02-11 15:04:48 +00:00
Antoine Guenet 1eba237f64 [FIX] web_editor: prevent traceback on create and quick discard mailing
In mass_mailing:
1. Click CREATE
2. As soon as it appears, click "DISCARD"
3. Wait a little bit
-> A traceback appeared.

That is because wysiwyg was still busy starting and, in that process,
requested the window object of the iframe that was already removed.

closes odoo/odoo#84358

X-original-commit: 48ce4f0f834b55692e32868194a635b817c6ed13
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-10 15:43:00 +00:00
Antoine Guenet 533bf1ee1e [ADD] mass_mailing, web_editor: add editor message on empty mass_mailing
When choosing the empty template for mass_mailing, it was confusing to
face a blank page with a tiny dropzone. With this we adopt the website
builder's solution, which is to include a message when the page is
empty. That message functions as a bigger dropzone.

task-2734469

closes odoo/odoo#84356

X-original-commit: fbe048c202ff7878984adf26bef0651a45851f0a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-10 15:42:56 +00:00
Antoine Guenet 03ffa1d1c7 [FIX] web_editor: prevent traceback on destroy link tools
When saving a mailing with the link tools open, link tools' destroy
is called after OdooEditor's destroy, causing a traceback when link
tools tries to set a history step.

task-2733825

closes odoo/odoo#84354

X-original-commit: f565f965fdc15d744efd38cfca9b098e24181e7e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-10 15:42:52 +00:00
Nicolas Bayet 9ab1bb66f5 [FIX] web_editor: add youtube video from paste
The PR #44537 changed the method _createVideoNode to be async while
the wysiwyg still called the method as if being sync.
This commit adapt the code to be asynchronous.

Task-2727906

closes odoo/odoo#84327

X-original-commit: 683de2b41c2e3699c39126852c82f1bb988bd3e9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-10 13:30:48 +00:00
Antoine Guenet 34e8b7874b [FIX] web_editor: properly add image in editable rather than in toolbar
In mass_mailing, when clicking the media button in the toolbar, the
image would end up being added to the media button itself rather than
at the selection. That is because the selection had been replaced by
the button. This fixes it by preventing default behavior of the
mousedown event on toolbar (thereby preventing the change of selection).

task-2745984

closes odoo/odoo#84218

X-original-commit: da55a5fa6344734bf751a5976e0dc5bdacd4e119
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-09 08:13:54 +00:00
Antoine Guenet 3b5497169d [FIX] web_editor: prevent horizontal overflow of toolbar in website
Since the introduction of the strikethrough button, the text toolbar
overflowed website's sidebar. This reduces their size so they don't
overflow.

task-2758967

closes odoo/odoo#84190

X-original-commit: 896c64cdf74e5c602a92a28f95f79e20c08ffd87
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-08 15:48:12 +00:00
Antoine Guenet 23278b7b5a [FIX] web_editor: prevent height 0 on mailing
When saving a mailing (mass_mailing) with invalid fields, the mailing
ended up having a height of 0. This is because some changes from
convert_inline are applied inline and may be incompatible with the grid
structure of the mailing. This was the case with height=0 applied on the
mail layout element as a result of it having a child with a height
expressed in percents. Rather than set the height to 0, we now set it
to whatever the height was measured to be.

task-2734605

closes odoo/odoo#84174

X-original-commit: 5c606188d1a57a0702213298f5ffa3ace8fd5523
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
2022-02-08 14:53:59 +00:00
stefanorigano (SRI) 0f64e506f2 [MOV] web, * : move font-awesome library in an editable location
This commit "forks" fontAwesome into `src/libs` in order to allow
further customization.
Part of v16 overall restyle (task-2704984).

task-2745275

Part-of: odoo/odoo#83501
2022-02-08 12:05:54 +00:00
Antoine Guenet 3b7a9671fd [FIX] web_editor: ensure fontawesome icons displayed on buttons
The undo-redo buttons on top of the snippets menu of mass_mailing had no
icon when website was not installed. This was because there was css
forcing the font family to something other than fontawesome. This
ensures we don't do that for elements with the "fa" class.

task-2746002

closes odoo/odoo#84126

X-original-commit: b3a91899cd7e6772a241badfc0bd9699bb6e0e74
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-08 07:20:06 +00:00
qsm-odoo a0ddaa8931 [FIX] website, *: restore unconventional dialogs opening + review scroll
*: web_editor

Commit [1] was not coded defensively enough: after it, dialogs not using
a proper bootstrap structure triggered a traceback once they were opened
(this was discovered on odoo.com where such unconventional dialogs do
exist). Bad luck: there was actually a check to allow unconventional
dialogs but it was not done at the right location.

However, fixing this, it was found that more than this was not ok. There
is actually no need to consider the modal-content element at all. Just
using our `hasScrollableContent` method is enough and requires no extra
search in the DOM. This actually also properly computes if the modal
overflows or not while it was not the case before as it did not consider
the modal-dialog element's paddings.

Finally, the whole customized behavior of the modal scrollbar here was
only designed to affect our Odoo modals with the s_popup_no_backdrop
class (see original commit [2]). Indeed, only in that case we want to be
able to switch between body scrolling and modal scrolling while the
modal is opened. In custom cases and other Odoo cases, we want the
standard Boostrap behavior of only being able to interact with the modal
while opened. This commit cleans the code to restore that spirit
(hopefully this does not cause stability issues as [1] was introduced
only a week ago). Sorry for any inconvenience.

[1]: https://github.com/odoo/odoo/commit/8f1dd6d6087ad8252d6e7b22d13aad2c4a3f19c6
[2]: https://github.com/odoo/odoo/commit/e5a5f98819b3a70b3e2564fb91722cab415ceea9

X-original-commit: a2363337355ccf4363249657000cd85bfcb3ab4e
Part-of: odoo/odoo#84139
2022-02-08 00:07:22 +00:00
Nasreddin Boulif (bon) 2ca5fdcaac [FIX] web_editor: resize favicon preview image
Steps to reproduce:

  - Install Website
  - Go to Settings -> Website
  - Replace favicon with a 'big' image
  - Go to Website and edit any page
  - Click on Home

Issue:

  Favicon preview in popover is too big.

Solution:

  Set a max height/width for favicon preview (16x16).

opw-2744522

closes odoo/odoo#84101

X-original-commit: bb90ff7f320f815310ca8e76d19bccadf4204cc2
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-02-07 17:15:52 +00:00
Nicolas Bayet defccba4b3 [FIX] web_editor: add label in link_dialog from wysiwg
Open the link dialog from the wysiwyg with the label input.

Task-2704538

closes odoo/odoo#83454

X-original-commit: f7a0c321d94f84ed7daf4f6abff0740ad81024bb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-07 13:10:40 +00:00