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.
closesodoo/odoo#67625
X-original-commit: b26319c3c9409e8724fadeec80e63ea94dc8d599
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: 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
*: website
The goal of this commit is to improve multi image selection
(Image Wall, Gallery...) using the same layout as in selected themes
for selected images.
Part of https://github.com/odoo/odoo/pull/66544
task-2326573
This was caused by trying to not show dynamic-svgs that had already been
downloaded when the option to not allow the media-library was activated
(eg in the website logo, we do not want to allow dynamic SVGs)
Unfortunately the domain was doing a string comparison to make sure the
url wasn't like the one from dynamic SVGs but implicitly required that
the url field be not null. This commit fixes that by explicitly allowing
images with a null url field.
task-2466819
part of odoo/odoo#66732closesodoo/odoo#67411
X-original-commit: 0784e14dd39817720e6fc70c2b41ea3bbad5843a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, when quality options were not available, the option would
simply not be displayed. User feedback suggests that this is confusing,
as for example, in the case of modifying the image in a t-field, quality
options would not be available when starting the editor, but would
become available when picking the image again in the media-dialog.
Some leftover code allowed to display a warning about why the quality
options were not available in the case where the image is not local to
the database. This warning has been adapted to display a more
informative message about why quality options are not available, as well
as suggest a solution:
- External image => download the image and upload it in odoo
- t-field => "You need to choose this image again in the media-dialog or
reupload it to have access to quality options"
- Images that are in an unsupported format (anything other than PNG or
JPEG) => short explanation that quality options are only available on
PNG and JPEG images.
task-2466819
part of odoo/odoo#66732
X-original-commit: 84417a174bc2bb76730cc89783d3426a3a3b07d9
Styles for the hex and rgba inputs from the color picker were modified
on directly from the web module, which means that for a specification
concerning only the frontend colorpicker, the backend colorpicker was
also changed.
This commit reverts the changes that were made and only applies the new
style for the website editor.
Related to https://github.com/odoo/odoo/pull/65249closesodoo/odoo#67396
X-original-commit: 9529e29615699942aac89099cd37144e052b9004
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When a block is removed, the parent will be activated.
If the parent element is empty and removable:
1) It will be removed too.
2) In '_activateSnippet' method, we look for the right element to
be selected using the block's parent (removed from the DOM...).
The goal of this commit is to fix this behaviour by computing the
selected element before parent removal.
task-2431506
closesodoo/odoo#67354
X-original-commit: 1d483ab5e2f9bba0fd86c6fe4595a9959b2f125d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When we double click a form submit anchor, and depending on the selected
element before click, the selection range ("document.getSelection()") can
start from a parent of the targeted node. This will send a wrong range
to be used in LinkDialog widget.
The goal of this commit is to prevent this behaviour by adjusting the range
if it starts from anchor parent.
Note: the bug only occurred in Firefox.
Part of https://github.com/odoo/odoo/pull/62206
task-2381305
closesodoo/odoo#62206closesodoo/odoo#67171closesodoo/odoo#67176
X-original-commit: 9a16c313f131ed2e1017566a5f1bed134e22cc10
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor, website_mass_mailing
When we double click a link/button, a link dialog appears
to update the target properties, and since the current link dialog
can only handle anchor targets, using it on buttons leads to some
inconsistencies :
- visible href options for button & url required to save changes.
- missing preview when button style changed.
...
The goal of this commit is to add a fix (with minimum of code) on
summernote linkdialog to handle button elements using the same logic as
anchor nodes.
Also, update website form test tour to test those new changes.
Part of https://github.com/odoo/odoo/pull/62206
task-2381305
X-original-commit: 19fbbdc0327482b5d70bdbcf17c2a5a950327d63
CONTEXT: Within a container, delete a block which has a sibling.
The actual behaviour is to select the container after deletion.
The goal of this commit is to select the previous sibling (if exists),
or next one. Otherwise the parent element will be selected (default behaviour).
task-2431506
closesodoo/odoo#64875
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* When clicking on a button that is a preview for a "mass mailing",
always open it in a new window for the user that is editing the form, so
that changes are not discarded (when leaving the page).
- The option "Open in a new window" remains effective for the recipients of the mail.
* Rename Mailing Campaign to Campaign : this is just a mailing campaign,
they are used everywhere in the marketing scope now. And it can be part of
a multi-channel campaign.
* Show/hide mailings count depending on settings :
- Mailing Campaign must be activated in the email marketing settings in
order to display the Mailings count in the utm.campaign kanban view
* When there is no matching recipient for a mailing campaign,
properly display 0 / 0 instead of 0 / 1 to better indicate that it is
not expected that anyone will receive an email.
Task ID : 2410217
PR : https://github.com/odoo/odoo/pull/63370
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
closesodoo/odoo#64622
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* = web_editor
Add support for default values on website form
Compatible fields are: textarea, text, number, date, datetime, unique
checkox, multiple checkboxes, radio buttons, select.
Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
* = website
Add we-datepicker
Allow empty date/datetime inputs
The countdown was the only snippet using this so if no date it will
default to timestamp 0 and display a resolved countdown.
Before it was the moment().now() datetime which is the same result:
0 time remaining.
Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
Empty attributes were not removed from the element.
This is an issue for attributes like checked/selected on input/select.
Part of: https://github.com/odoo/odoo/pull/47949
task-2011583
If a field is sanitized, a6e2b48 would hide the video button because
the video does not show in backend. It is better for the consistency but
if the field appear in frontend, the video would still show so we
prevent something that worked (but is very not user friendly when
editing in backend).
This changeset go back to the previous behavior (keeping the code
simplification), at one point there should be a fix so at least when
editing we see the video (currently we see an empty div in given
conditions).
opw-2463746
closesodoo/odoo#66920
X-original-commit: 73f5781
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Scenario:
- set new background image
- set parallax
- save
=> on next edition, the editor doesn't work on background anymore
Why:
- backgroundOptimize copy attributes of the original image to the real
target element on save
- parallax change the real target element to a new child
=> so if the original element was an editor (with data-oe-model, ...)
attributes, with the combination of the two options we will save
these editing attribute on the child element which is wrong (the
editing attributes are added dynamically and should not be saved).
With this changeset, we don't copy the editing attributes in
backgroundOptimize when we copy the original target image.
opw-2427560
opw-2429340
closesodoo/odoo#66691
X-original-commit: 6e47db5efcd78157f054144315a4812bbb6fbbd9
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The goal of this commit is to enable the click on Style tab
in "Edit mode".
The click on this tab with no block selected will display a
message to inform the user that he has to select a block
before editing.
task-2443297
closesodoo/odoo#65573
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Scenario:
- go to /slides and start editing the page
- change the position of background banner
- save
=> traceback
Why:
The code for pan tool duplicates the target element in an overlay. In
the given use case, it means a node with .o_editable class is created
that will cause an error when saving because the code expect the cloned
element to be an editor (in `RTEWidget.save()`) but it is not (and is
eg. missing `.data('options')`).
opw-2427560
closesodoo/odoo#66643
X-original-commit: 96c22e816981d72c185520750167c514c6bded5b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Context:
1) Edit mode
2) Click on anchor edition button of website form submit button
3) Traceback occurs
The "focus" triggered on $editable element in editor's 'getLinkInfo()'
discards user's text selection on submit button, as a result,
'range.create()' method returns null since no selection is found.
Note: the bug only occurred in Chrome.
Note 2: [1] apparently tried to solve the same issue but the fix was not
solving it correctly, at least not in all cases.
[1]: https://github.com/odoo/odoo/commit/da14e4449e5e318eb72e1b9f268fb797adb0c6a6
opw-2443441
closesodoo/odoo#66574
X-original-commit: adf3d039acbac60b7ea7e6ab0ea8fdd9f940c3b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Scenario:
- start editing background position
- press TAB key
- press CTRL + Z
=> traceback
Why:
Restoring a snapshot with CTRL Z can send a click event with target not
wrapped in a jQuery object which was not expected by the code.
reported in https://github.com/odoo/odoo/pull/66462#issuecomment-782025417
opw-2423445
closesodoo/odoo#66564
X-original-commit: 2c0aa825ee54ed674ff9f43722031df8e2f35ca6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
For odoo-master Transifex project, no demo data
closesodoo/odoo#66500
X-original-commit: 813931ac850e5ba4181259a5957ec72226fb670c
Related: odoo/enterprise#16510
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Scenario:
- start cropping of an image
- press TAB key
- do CTRL + Z
=> now the image cropping tool are inside the page and there is no way
to remove them.
Why:
The image crop tool was added inside the editable elemnt, so if we did
an action that changed history the cropping tools are saved in the
snapshot and going back to it will add them without any code handling
their removal.
opw-2394877
opw-2423445
closesodoo/odoo#66499
X-original-commit: ce93cbd78e282e6957aaeba6f06945f94bfffb26
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Enter keypress browser event were removed in 3c372d1da8.
It was reintroduced in text fields with d2f024d254 and in source mode
of html field with b10ca1f6094b.
When doing ENTER in the editor, we do our special case of ENTER (eg. it
will split the container in two and have other custom behavior) but when
doing SHIFT+ENTER we let the browser handle it and add a normal newline.
With the "Enter" prevention, SHIFT+ENTER did not work.
opw-2463746
closesodoo/odoo#66455
X-original-commit: 27b84138b422f0dbb3e01c83bb817d0880e3eab3
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When we edit a view with ace in eg. studio, if it works the saved button
would never be enabled again because of missing callback.
Match the behavior of dom.addButtonLoadingEffect other usage (80592abd).
opw-2457046
closesodoo/odoo#66301
X-original-commit: 5324f7a6aa757ff6a728258ea1877ded4a6f86cd
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the preview of the dragged snippet didn't work
when moving a dragged snippet from a drop zone to an other drop zone
when there was no space between those drop zones.
It is because, in this case, the over event of the second drop zone is
triggered before the out event of the first drop zone.
task-2312878
closesodoo/odoo#66267
X-original-commit: 66b468626e046a13a463cff3a2285801016f3ed7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit when toggling shapes on a snippet background, the
shape color palette was always set to the default one.
After this commit when toggling shapes on a snippet background, the
shape color palette is computed by combining the default palette with
the palette of the previous shapes in the page.
task-2431445
https://github.com/odoo/odoo/pull/64515closesodoo/odoo#64515
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit when toggling shapes on a snippet background, the
shape selection dropdown was shown as closed.
After this commit when toggling shapes on a snippet background, the
shape selection dropdown is automatically opened.
We have to use a click() on the toggler instead of an open() on the
dropdown to make the page containing the selected shape appear when
opening.
task-2431445
https://github.com/odoo/odoo/pull/64515
Color palette are only visible once they are opened. However, we
instantiate them a lot to build the "options" editor panel which caused
the editor to appear buggy for some users... even if they would never
open a colorpalette. This fixes that issue. The fix is not entirely
stable but was made as stable as possible... better implementation will
be done in master.
task-2439295
https://github.com/odoo/odoo/pull/65223closesodoo/odoo#66217
X-original-commit: 9aeba7dec95b397ef894f5a181920dff269d6ad4
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Before this commit the palette was rendered each time it was opened.
After this commit if the palette has already been rendered only the
selected color is being updated in the palette (and its colorpicker).
task-2439295
https://github.com/odoo/odoo/pull/65223
X-original-commit: 7f19f63b18bc7d17a393b3535492c7f90595ca39
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Before this commit the loader did not always get displayed when
switching to the options tab.
After this commit the loader always gets displayed ASAP when switching
to the options tab until the tab is ready and displayed.
task-2439295
https://github.com/odoo/odoo/pull/65223
X-original-commit: f2fa17540e130b5cf3f70570a3a97495cfbb7499
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Previously, edition of many2ones in the front-end was done through a
snippet option. While this works fine for raw many2ones in the page, it
is desirable that other snippet options can leverage a many2one as a
part of a more complete or comprehensive option. This commit introduces
a many2one userValueWidget that will be able to be reused by snippet
options, and adapts the existing many2one snippet option to use it
instead.
The interface has also been reworked so as to lean on the existing
we-select UserValueWidget for the sake of interface consistency.
Thanks to fja-odoo for first iteration.
task-2190603
closesodoo/odoo#63835
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Depdending on situation several fixes (f885202, fc8e446) leads to issue
in small screen size:
- in iframe editor with without snippets => the width of the content is
decreased of several times the sidebar that is not shown
- in editor with sidebar => the content gets behind the sidebar
With this changeset we remove part of the above commits which seem to
fix both issue.
note: this also fixes that the mass mailing content applied CSS should
not depend on screen size, or what is send would differ dependin on
which screen size clicked on SAVE (on last inlining of CSS).
opw-2426400
closesodoo/odoo#66104
X-original-commit: 3e41618240036f1f47bb25b993c46b4d268031d5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In ff81fa479 there was some refactoring for change of structure on
frontend, but for the iframe editor (eg. mass mailing), this caused that
the top edition bar was over the content.
opw-2426400
closesodoo/odoo#66099
X-original-commit: d4a2e6cda246b498f604ac5765a5ef5d0041a577
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Previously, the many2one widget from the web_editor used jQuery's
'.html()' method when inserting a record name into the page. The record
name was not HTML-escaped before this, which may have unexpect result
and break the layout.
This commit fixes that by using the '.text()' method instead.
This bug only affects pages containing a many2one (contact excluded)
at the time of selection and not after the selection.
e.g. on the /event page, changing the category of an existing event
via the website editor
closesodoo/odoo#65686
X-original-commit: 53aff7f07317a8261b8b9c3e462d930141c7081b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Before this commit, it was not possible to center a button using the
editor option 'align center'.
It is because, using document.execCommand(), the Chrome browser doesnt
want apply 'text-align: center' on nodes with centered children. And
the buttons have the boostrap class '.btn' which adds text-align:
center.
So the hack here is disabling the text-align property from the '.btn'
class during the execution of document.execCommand().
task-2423935
closesodoo/odoo#65566
X-original-commit: d4f38c344360713287eed22872614f46dec7e0f6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, when removing all the content of a snippet, that snippet
would get automatically deleted. This was not the case for parallax
snippets because we previously intended the user to drop the parallax
snippet, empty it, and drop other content inside of it.
Recently, we added the parallax option on all snippets, rendering the
previous workflow obsolete. There is now no longer any reason to keep
empty parallax snippets. This commit fixes that.
task-2446008
closesodoo/odoo#65551
X-original-commit: 61f410b57f1c28bd6464b86d1582c22b7fd846d5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When you save your custom snippet you probably won't give it a
specific name.
Before this commit several custom snippets name was specified on save
and there was no way to modify their name afterwards
After this commit custom snippets are assigned a generated name but they
can be renamed afterwards
task-2374802
closesodoo/odoo#61483
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Example to reproduce:
Drop the "Cover" snippet and try to remove the background
image. Clicking on image button has to be done 3 times to land on the
correct result:
- First click removes image, but not filter and leaves both buttons
checked
- Second click removes the filter and unchecks its button.
- Third click unchecks the image button.
It should be one click to remove image, filter and uncheck both buttons.
The goal of this commit is to prevent _applyOptions() from setting
background-image values if image is not optimizable. This filter will
solve the issues since empty values (badly parsed by getBgImageURL())
won't be added as background urls.
task-2312878
closesodoo/odoo#65438
X-original-commit: aba9056e7baa58decf147313678ad9d1f4522dee
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit makes the field html quick editable.
We can click on a field html to switch the form view to edit mode but
if we click on a link in the field, the link will have the priority.
task 2330101
Before this commit, dropzones were created around invisible elements
(e.g. the snippet popup). So we had 2 dropzones instead of one at some
locations.
After this commit, we avoid creating dropzones around elements that
must not have dropzones.
task-2312878
closesodoo/odoo#65230
X-original-commit: ad56d50e3da000cacdc70d9230cad308d03680bf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Office Outlook doesn't take into account the [style] attribute, and it
doesn't manage width/height in percent value.
This commit set width/heigth attribute in pixels and also always set the
width/height in style attribute (keeping them in the original unit and
setting them to auto if not present).
This is a reintroduction of 2015 commit bdf58adb46
opw-2447756
closesodoo/odoo#65218
X-original-commit: c51762a790d6fefd97e6c818bfaa9307180dd5b5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, when you dropped a snippet using the move button
in a modal. The modal closed after the drop.
This commit allows to define an element in which to destroy the
editors.
Part of https://github.com/odoo/odoo/pull/61998
task-2312878
closesodoo/odoo#65166
X-original-commit: b7d522e9e7e31ac6bf926aae65e58d9f6cfa8903
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, it was not possible to scroll a popup with a
dragged snippet.
Part of https://github.com/odoo/odoo/pull/61998
task-2312878
X-original-commit: edf28efe19bedfe5eb62baf6fa5832a50d18e775