Commit Graph
103 Commits
Author SHA1 Message Date
Nicolas Bayet 4600086e7a [IMP] web_editor: move odoo-editor into odoo
The code of the Odoo editor was on another repository
and that created unnecessary overhead. This commit move
the code inside Odoo and slightly change the folder
structure.

Related PR:
saas-14.3: #73345
saas-14.4: #73348

closes odoo/odoo#73272

Master: #73272
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-08 15:31:45 +00:00
Ivan Yelizariev 0249f87ed0 [FIX] web: prevent selecting element from html field
html field allows to insert html structures that can be treated as elements of
odoo web client. This patch updates setLocalState method (part of the web
client) to check if an element is inside html field, so such elements will be
ignored

---

opw-2520403

closes odoo/odoo#72877

X-original-commit: d2733da4863bd03b0cf853355596a44e901405d2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-06-28 14:17:07 +00:00
Sébastien Theys c6716847aa [IMP] web, *: clean up notification API
task-2476867

closes odoo/odoo#67009

Related: odoo/enterprise#16760
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-05-27 13:47:23 +00:00
Nicolas Bayet b2dd959373 [IMP] web_editor: cleanup the toolbar 2021-04-28 07:34:43 +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
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
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
Thibault Libioulle 4196af9c03 [IMP] web_editor: open external links in new tab
This commit aims to force to open in a new tab out-of-domain hyper-links
in backend html fields.

Previously:
When a user adds a link in an html backend field, the user is free to
choose if the link will open in a new tab or not with a check box.

After this commit:
When a user adds a link in an html backend field, this link opens a new
window if those two conditions are met:
    - The url doesn't begin with the current location origin;
    - The url doesn't begin with a "/", i.e. an internal link
      that has been stripped.

The user doesn't have the check box option.

Remark:
This doesn't affect previously added links BUT if a previously added
link is opened in a LinkDialog, it will be re-rendered following the
conditions hereabove.

Part of https://github.com/odoo/odoo/pull/64622
task-2377544

closes odoo/odoo#64622

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-03 13:46:06 +00:00
qsm-odoo 834e3f8f9b [IMP] base, *: remove read_template and review colorpicker template
*: web_editor, website

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

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

Related to task-2412544

[1]: 8af75e00bdcda3d5ff4facd2f5f146e1d6bf79e4

closes odoo/odoo#64100

Related: odoo/enterprise#15580
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-06 09:30:13 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

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

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

For reference:

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

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

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

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

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

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

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
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
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
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
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
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
Sébastien Geelen (sge) 2d2f8e6562 [FIX] web_editor: adapt iframe Qunit test to new editor
- iframe editor Qunit test

closes odoo/odoo#60551

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-10-22 15:16:15 +00:00
95d0ca4b2c [REF] web_editor,web: adapt to new jabberwock editor
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2020-10-14 10:29:09 +00:00
Samuel Degueldre c46204dff9 [IMP] web_editor, *: make media-dialog search odoo media-library
*: website, web_unsplash, website_blog

We have recently created an odoo media library that exposes a public API
for searching for open-source media, including dynamic SVGs that can be
used with the dynamic background-shape system to create illustrations
whose colors can be changed by the user. This commit adds the
corresponding client-side functionalty: search for the images in the
media-library, creating a corresponding attachment when selected, as
well as an option to customize the colors of the dynamic SVGs.

In the process, adaptations have been made in the web_unsplash module to
avoid duplicating code and to adapt code that was making assumptions
that are no longer valid.

To make new users more aware of this feature, all default images have
been hidden from the media-dialog, so that the user is prompted so
search for images. Some tests and tours that were relying on having
default images in the media-dialog (eg in website_blog) have been
adapted to match.

task-2316651
Linked to: odoo/iap-apps#235

closes odoo/odoo#57888

X-original-commit: 7a1308b426f94b33e2bd55e5d58e661067e26ff3
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-09-16 16:14:37 +00:00
qsm-odoo bb0cd4d5c8 [IMP] web_editor, *: review background color/image options UI
*: website, mass_mailing, website_blog, doc

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
qsm-odoo 6c31104fa9 [IMP] web_editor, *: remove snippet panel block icons
*: website, mass_mailing

Part of https://github.com/odoo/odoo/pull/53930
task-2157252
2020-07-14 14:43:16 +00:00
Aaron Bohy af85bb5e13 [IMP] web,*: do not deploy services in tests
*mail,point_of_sale,web_editor,website

In the tests, required services are deployed for each test
independently. There is no need to have, in additon, all services
deployed globally. Worse, it could conflict and lead to unexpected
results.

This commit ensures services are no longer deployed globally in
tests. It turns the module 'web.env' into a declarative module with
no side-effect, by moving the service deployment to main.js, which
isn't added to the tests page.

Task 2287397

closes odoo/odoo#53817

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2020-07-13 12:55:07 +00:00
qsm-odoo 7489c1eef2 [FIX] web_editor: adapt test to new transparent.png location
A mockRPC was catching the route to transparent.png file which has been
relocated with [1]. This commit solves that unadapted mockRPC and makes
it easier to grep.

[1]: https://github.com/odoo/odoo/commit/94b59b1972e1a18e18dfcd6c2ded495391380b9a

Part of https://github.com/odoo/odoo/pull/54274
2020-07-09 16:20:14 +00:00
qsm-odoo 94b59b1972 [FIX] web, web_editor, *: review chess-like bg for transparency preview
*: website

The style to achieve the chess-like bg result was duplicated at many
places. The 'web' app was also actually using an image from the
'web_editor' app (we can live with it in stable as web_editor always
comes with web in auto_install but this was still a mistake).

closes odoo/odoo#54154

Also: fix some layout issue in the colorpicker widget.
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-07-06 15:47:06 +00:00
Aaron Bohy b4ba0fc340 [FIX] *: adapt tests to env rework
This commit adapts tests following recent changes on the helpers.
The main change is that addMockEnvironment (and all functions using
it) are now async, as they need to wait for services to be started.
2020-06-12 09:47:48 +00:00
Julien Mougenot c4786fccfd [IMP] *: update notifications to optional title
closes odoo/odoo#52826

Related: odoo/enterprise#11084
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-12 09:01:50 +00:00
qsm-odoo 7736cde22c [IMP] web_editor, website, *: use new color names
*: mass_mailing, website_blog, website_forum, website_hr_recruitment

Deprecate alpha, beta, gamma, delta and espilon color names and now use
a new color system: o-color-x, with x from 1 to 5.

This will allow to review the colors of all themes to have nice visuals
for the new color combinations classes, without breaking the current
uses of bg-alpha, alert-delta, etc in current websites of customers
(by keeping the old color and classes for compatibility).

This will also allow to uniformize all themes under the same conventions
to enforce BS color override:
- o-color-1 used as primary (as before, for alpha)
- o-color-2 used as secondary (as before, for beta)

Before, some themes were not following the 2 guidelines. The users
using those themes will simply have the possibility to choose o-color-1
and o-color-2 colors accordingly to restore their website without
breaking the new system features.

Another change is that those colors are defined through color palettes
and not theme color palettes. This will avoid them to generate automatic
bootstrap classes which we don't want (alert, btn) and generate the one
we want by ourself.

Note: for mass mailing, the colors and classes also have been renamed
but the system stays unchanged.

Part of https://github.com/odoo/odoo/pull/45856
task-2197038
2020-06-02 09:42:19 +00:00
qsm-odoo d9c4d928f7 [IMP] web_editor, *: integrate new o_cc${xxx} classes in the colorpicker
*: website

Part of https://github.com/odoo/odoo/pull/45856
task-2197038
2020-06-02 09:42:19 +00:00
qsm-odoo 3d20d36bad [FIX] web_editor: make a test more robust
Don't know how this test worked before but it will stop working with
next updates. This just make it more robust using the same trick as
other tests: wait for the colorpicker to be opened before actually
using it.

Part of https://github.com/odoo/odoo/pull/52211
Related to task-2197038
2020-05-31 13:36:45 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Samuel Degueldre 49ea7b2b41 [IMP] web_editor: improve image optimization workflow in media dialog
Previously, when selecting an image, the user could optimize their
images by clicking a little cog icon in the media dialog. They would
also be prompted to optimize their images when uploading them. In most
cases, it makes a lot more sense to always save the original in the
database, and optimize the original whenever it's dropped in the page
automatically.

A second problem is that when using the optimization feature, optimized
images would be displayed along the originals by default, resulting in a
lot of duplicates while browsing the media dialog.

This commit changes both of these things:

- By default, when uploading an image, the original uploaded image is
  used. The user can still optimize their image manually through the
  media-dialog by using the cog icon. When choosing an image in the
  media-dialog, if it's not already an optimized image, an optimized copy
  is automatically created and used instead.

- Optimized images are now hidden by default, in the media dialog, and
  can be shown by clicking a checkbox at the top of the modal when in
  debug mode

task-2091417
closes odoo/odoo#45174
2020-03-30 11:06:48 +00:00
Samuel Degueldre 5576a5f84d [IMP] web_editor, web_unsplash: improve media-dialog UX
Previously, searching for images in the database and on unsplash was
mutually exclusive, and controlled by a dropdown menu next to the search
bar. Additionally, the display of db images and unsplash images was very
different, making using the search function inconsistent and awkward.

This commit merges the unsplash search into the db search. When
searching, the first few matches from the database are displayed, then
results from unsplash.

Additionally, the layout of images has been greatly improved,
eliminating almost all padding, using some flex-box magic to allow the
images to take up all the available space without being cropped or
deformed.

The input to add an attachment by URL is now collapsed by
default, and clicking on it will expand it to reduce visual clutter.

Finally, when not in multi-images mode, the clicked image is immediately
used, rather than the user having to click it and then click the add
button, or having to double click, which was not obvious.

task-2091417
closes odoo/odoo#45174
2020-03-30 11:06:45 +00:00
Julien Mougenot 384e516218 [REF] web: Update generic files
General cleaning of some helpers and generic files. The idea is that they are
less likely to be entirely re-written in the near future so this is a way to
keep the code clean, readable and compliant to the current standards. Changes include:
- Use of async/await when possible
- Use of const/let instead of var
- Removal of underscore.js
- Use of native JS instead of jQuery when possible

The logic of the affected code remains the same.
2020-03-13 09:37:29 +00:00
Jason Van Malder cf2f53e4cf [FIX] web_editor: fix required html fields
Issue

    - Studio
    - Add an required html field
    - Create new record
    - Leave it empty

    It is saved

Cause

    The isSet function of FieldHtml widget, have a "/" in the <br> tag
    and summernote empty = <p><br></p>. If you add a space, the value
    becomes <p>&nbsp;&nbsp;   <p>.

Solution

    Remove the "/" and the spaces, check if value != <p></p> &&
    <p><br></p>

OPW-2183687

closes odoo/odoo#44427

X-original-commit: c984b1b1210cea1e63f3bc66cec2120554c76c2a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-01-31 17:20:34 +00:00
b0941d19a0 [FIX] web,*: fix all tests and test utils to use native events
In this commit:
- transformed test_utils helpers to always trigger native events
- introduced new test_utils_create helper: prepareTarget
- updated qunit asserts to support Owl Components
- updated all misused helpers that would crash with the updated test_utils

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2019-12-09 11:09:10 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
qsm-odoo fdac73e99d [IMP] web_editor, *: add new user value colorpicker widget
* web, mass_mailing, website

Introduced a new sub-widget for snippet options: we-colorpicker. This
allows to retrieve a color value (either a normalized css color or a
theme color name) to be used for a snippet option method.

This commit replaces the old 'colorpicker' snippet option whose behavior
is now simply achieved by defining an xml option using a we-colorpicker
widget in combination with the 'selectStyle' standard method.

This commit also adds the possibility to control the border-color of
elements alongside their border-width. Again, just a we-colorpicker
widget in combination with the 'selectStyle' standard method.

Note: this commit reviewed what the colorpalette palette widget
notifies. This is not a cssColor and a 'isClass' flag to say if it is
a css class or not. The colorpalette always returns a color string which
can be the name of a color like 'alpha'. This is up to the caller to
check if the color string is a css color or not with isCSSColor. In the
case it is not, the related code can read the actual color by reading
the related css variable.

Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks
2019-12-01 15:49:57 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
qsm-odooandfja-odoo ea994b0cbb [IMP] web_editor, *: review 'colorPalette' editor UI
*: website, mass_mailing

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2087383

Co-authored-by: fja-odoo <fja@odoo.com>
2019-11-18 09:56:40 +00:00
fja-odoo 22c5fc5dd2 [IMP] web_editor, website: generalize colorpicker
Currently we have:
- a colorpicker for background color of snippets
- a colorpicker for foreground and background text (topbar)
- a colorpicker for menu/footer/navbar/etc
These 3 are separate colorpickers with different options.

After this Commit
All 3 will use the same color palette wich allow you to select
theme color, common colors, custom color and transparent filter.

Part of https://github.com/odoo/odoo/pull/38959
maintask-2066614
task-2087383
2019-11-18 09:56:40 +00:00
qsm-odoo 72a2f417ae [IMP] web_editor, *: introduce select & checkboxes for the left panel UI
* website, website_blog, website_form, website_sale

+ introduce default UI for snippet options
+ refactor style of icon buttons

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:08 +00:00
qsm-odoo d9bbdf15ad [REF] website, *: remove all snippet options UI icons
* web_editor, website_blog, mass_mailing

In preparation of the new left panel UI, remove all snippet options UI
icons as we do not want them anymore to simplify the UI.

Part of https://github.com/odoo/odoo/pull/38959
task-2066614
2019-11-18 09:56:07 +00:00
Vincent Schippefilt 029dd1a214 [IMP] web: edit translations in new dialog
Before this commit, translations were edited in a list view with a filter
on the field that needed to be translated.

After this commit, the translations for each fields are translated in a
dedicated dialog. The changes done to the current language are taken
into account immediately, both ways, from the dialog to the form and
from the form to the dialog.

Translating terms is also available in create mode, the user will be
prompted to save before editing a translation

Task ID: 2028152

closes odoo/odoo#36185

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-09-09 13:09:53 +00:00
qsm-odoo 4f27e52cab [IMP] web_editor, *: introduce and restore new web_editor UI
* mass_mailing, note, website, website_blog, website_form,
website_mass_mailing, website_sale

This commit, unfortunately, mixes three things:

- Restoring as much as possible the scss organisation to allow styling
the web_editor UI properly.

- Fixing some bugs like a border around the page once the editor is
loaded, no ability to scroll the snippets, etc

- Introducing a whole new UI for snippet options: a left panel instead
of the old dropdown & button overlay.

Note: this commit also do some linting and ES6 convertion even though
some of it has been done in the parent commit.

Note 2: some elements that were removed are still styled in the POS apps
but this is because part of a feature was removed while leaving dead
code behind, this is handled in another PR which is to be merged
(https://github.com/odoo/odoo/pull/36136).

Part of https://github.com/odoo/odoo/pull/36068
task-1942370

closes odoo/odoo#36068

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-08-28 09:04:55 +00:00
1eb1c2b029 [REF] web_editor: adapt wysiwyg tests to older summernote version
These modifications crystalize the behavior of the old editor, even
if it makes less sense than the behavior of the saas-12.2 one.

In some cases, the only reasonable adaptation we could do for 13.0
was to delete the tests, as these tests relied on mechanisms of
the newer version of summernote introduced in saas-12.2 which
cannot be easily replicated in the older version from 12.0 that
we are reintroducing in this PR.

It is sad to see these tests go, but we knew this was going to be
something we would lose in reverting back to the older editor.

That being said, since these tests were not present back in 12.0,
we are simply back to the 12.0 state of things, not worse. Don't
weep for them though, they will be back in Odoo 14.

Part of PR 35677.

Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-21 19:11:31 +00:00
912996fe90 [REF] web_editor, website: adapt wysiwyg to 12.0 editor
The wysiwyg abstraction layer was introduced in saas-12.2 by
commit f2969923. Its goal was to provide an external interface
for other modules that wanted to use the editor feature such
that the editor core itself could be changed without requiring
extensive changes in the other modules.

This commit is adapting the wysiwyg interface to instantiate
the 12.0 editor below it rather than the saas-12.2 one, thus
reverting the "new editor" part of f2969923 itself.

Part of PR 35677.

Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-21 19:11:31 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Gorash 8e4b8be4e6 [FIX] web_editor: remove virtual corrector/completion keyboard glitch
For the ours need, we can not let the contentEditable behavior. Indeed,
this one does not have the same behavior according to the browser. The
DOM node could be erase, merge, cut, in them according to the keyboard
interactions. The problem is that if we have to manage these behaviors,
we have to manage everything. It was already the case in the previous
version, however before we created an editor by zone and by a hack we
mix the history.
In the case of the virtual keyboard of some OS / Phone, the events are
different and the autocompletion does not update (bug that prevents
modification interactions with javascript). In order to solve these
problems, we use another event for the insertion of the characters.
However, we must also force the update of the corrector by forcing a blur
and a focus.
The current version is a temporary version. We are currently working on a
version that uses a virtual dom and does not need to do excessive prevent
default.
2019-08-06 10:45:04 +00:00