This commit focuses the url input from the link tools when double
clicking on the link.
It introduces a focusUrl public method on the Link widget, triggered
from the SnippetsMenu after activating a snippet, if the link tools are
shown.
task-2680461
closesodoo/odoo#80796
X-original-commit: add3e05840869d4a885ca18a2bbabfcb61c7a83d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, there was an issue with the edition of links that
were already in the page, via the link tools.
1/ In edit mode, drag and drop the s_image_text snippet and save,
2/ Click on edit, click on the "learn more" button,
3/ From the link tools, change the style to secondary,
4/ Click on save again, the button is still styled with as primary.
[1] added a history step to the link creation via the link tools. As the
editor observer is set to unactive at the start of the link tools, the
changes made to the link with the link tools were not processed by the
EditPageMenu observer, and the block was not set as .o_dirty (the
changes were therefore not saved).
This bug was hidden by our use of bootstrap popovers. The
aria-describedby attribute, managed by bootstrap when showing/hiding a
popover, would be recorded as a change from the EditPageMenu observer,
which would set the view as dirty.
Also, changing any other element of the page would set the page as dirty
and hide the bug.
It only became visible when [2] changed the popover initialization from
'focus' to 'manual'. With that, the aria-describedby attribute was
modified inbetween the LinkTools.start and LinkTools.destroy (and was
therefore not recorded at the EditPageMenu level).
To record correctly the changes made from the link tools to the link, we
activate the editor observer when applying the changes to the DOM.
This commit also introduces some tests for the link tools.
The listener on customizable links from the wysiwyg was changed from
mousedown to click for simpler tests.
task-2680461
[1]: 6db6134f97
[2]: 161c5fc8e742294e8d85c889b4bf8d3d8cd484f5
closesodoo/odoo#80763
X-original-commit: c29fe9fa8fc8ff4a5e6f042607ef9b3070d1d339
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When editing the link label from a website page, and then changing its
url from the link tools, the label was reset to what it was before the
edition. This commit fixes it by keeping the label consistent when
changing the link options from the link tools.
task-2680461
X-original-commit: 5f5b9dfa1bdfb6c814e68e355503a8820bb8b452
Part-of: odoo/odoo#80763
It was painful to add an inline snippets, or move elements inside mega
menus. The dropdowns are now behaving as modals: if they are shown, the
user can only add or move snippets inside them, but not outside.
task-2668908
closesodoo/odoo#80757
X-original-commit: edc5c8d69fb5fc6da0b0012abc6539c21ffc421e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In some circumstance, `this.$target.data('bs.popover').tip` was not
defined until added into the DOM.
Task-2666388
closesodoo/odoo#80657
X-original-commit: 4fdd17b7436984ade2ce97dd57d749cc18c452dc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
The web_editor dependency with mail was problematic:
- web_editor would not auto_intall without the mail being installed
- A circular dependency problem with discuss
In order to avoid creating a new module shared by mail
and web editor, the use of a hack has been decided.
By checking if `notification_type` is in the session, we ensure
that the module mail is installed.
Task-2698655
closesodoo/odoo#80640
X-original-commit: 4e611d7527f85fc074115bd018adb7d6e5ea2c53
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antony Lesuisse <al@odoo.com>
In some circumstance, the image cropper is being reverted by the
Odoo editor unbreakable mechanics. The reason was that the cropper tool
was appended inside the editable rather than outside the editable.
Task-2693553
closesodoo/odoo#80613
X-original-commit: c09600fe35089cdaed34ec12d8bcb992d24e043f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, setting a value from the editor did not created
steps but kept the mutations inside _currentStep.
Commands like delete or enter revert the _currentStep.
So each time enter or delete was pressed just after setValue, the
content being set was lost.
Task-2695041
closesodoo/odoo#80597
X-original-commit: 9e9fe73e8124d5d5527f5c5ce205f01f791aac30
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When leaving the code view, we need to apply its html to the editable.
This failed in mass_mailing because the editor rolled back the changes
due to the top element being unremovable. To avoid that, we set the
`skipRollback` argument of `historyStep` to `true` and thereby trust the
user's changes.
task-2701024
closesodoo/odoo#80522
X-original-commit: 17f0ca0d6b7a583192caa33bb9d3e35c72256d4e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
Before this commit, when the user made an error in the HTML/SCSS editor
(most of the time due to user pasting HTML code while our code excepts
*XML*), the user was stuck most of the time because the error indicator
did not always appear. And even if it did, it disappeared on scroll and
the user had to guess where to click to show the error message.
Now, the UI for the error is way clearer, with the error message opening
itself directly and pointing at the line where the error occurs. The
UI of that error message is now more robust (even though suffering
because of the ace editor which likes to re-render itself at unknown
times). The error message is also still not super clear (default error
message given by the browser) although some parsing is now done on it to
try and display it better.
task-2698641
closesodoo/odoo#80499
X-original-commit: 0d2dbb663653659c8afbf3a515444a6db633fbf9
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When switching to files that can only appear in debug mode in the HTML /
SCSS editor and editing them, the page reloads... and crash for no
reason. This was because the filter that allows those files to appear
is lost after reloading, now we simply ignore the file switch if not
present in the default filter.
task-2698641
X-original-commit: ef8b153a6ed80ff6e551b6eee9bc0f53a012e360
Part-of: odoo/odoo#80499
Before this commit, when a tour tooltip was located in the snippet
list, it could cause an overflow that would partly hide the tip and
would bug out when being hovered.
With this commit, the list is made full height, simplifying the look
and giving enough space for the tip to not overflow.
task-2670809
X-original-commit: d8c25d400af61bdfb4afd9d7921c3e93745f2407
Part-of: odoo/odoo#80466
Prior to this commit, if three colors were selected for a gradient and
the user would click on the third color, if that color had a value of
100%, in some conditions the picker would resize infinitely.
Also prior to this commit, the color picker slider was not supported
well under safari.
This commit fixes the SCSS rules in order to fix those behaviours.
task-2670809
X-original-commit: 5a91d8b00c35cb597b0ee5f5ec8605e4589f81c9
Part-of: odoo/odoo#80466
Issue:
1- Website editor > Set shape on image
2- Crop > shape is reapplied on the croped image
3- Change another option (e.g. image width)
4- Undo > image will be shown cropped but without any
shape applied on it.
In the current code we apply shapes on cropped images using
the event listener 'ImageOptimize > _onImageCropped', so in
'ImageTools', the 'crop()' option method will record the
"crop" action but the step where the shape is added is lost.
(See: SnippetOptionWidget > _onUserValueUpdate()).
The goal of this commit is to merge the 'ImageTools' and
'ImageOptimize' in one option so we can simply use shape
related methods to apply shapes when the crop() & resetCrop()
methods are called.
This way, the step to record will be a "cropped image with
a shape on it" instead of just a "cropped image".
task-2628964
closesodoo/odoo#80208
X-original-commit: 7c17d78fbdbb64b1aa5b55f78d3202a64a85ed2f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the styles of the table were not kept when
copy/pasting a table generated by the Odoo editor. Now it is.
Task-2657445
closesodoo/odoo#80246
X-original-commit: 6f4eff378fc24bdd5e8a84ee485832162108a400
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, if the link dialog had unvalid form data, and the
user clicked on the "save" button, the link dialog tried to close
and save with no data.
Now, it is not possible to close the dialog if the form data is invalid.
Task-2583696
closesodoo/odoo#80245
X-original-commit: c7f574c1044d5710c156f747c9b8647d6aeb3ff7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Whenever the qweb plugin modified the dom for rendering purposes,
the mutations were observed but shouldn't. The reason was that the
reference to the editor was missing in the plugin and therfore it did
not call `observerUnactive` and `observerActive`.
Task-2695658
closesodoo/odoo#80182
X-original-commit: e973526ffe6deba778a613eb4053ba3017f9fb00
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
*: web_editor, website_sale
This commit adds the abibility to get an image thumbnail based on the
video provider URL and to avoid duplicating the regexes. It also
improves those URL regexes.
All the regexes are kept in a python tools file and are called in JS
using an RPC.
task-2154812
closesodoo/odoo#44537
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: ras-odoo <ras@odoo.com>
Co-authored-by: bbh-odoo <bbh@odoo.com>
Changing value in monetary fields was not working properly in FF :
The ZeroWidthSpace inserted by the deleteRange function cannot be selected;
trying to do so loses the selection for some reason.
task-2679088
closesodoo/odoo#80071
X-original-commit: 1b36b4e8a6b319de10b6c1144c37533dab0e2f36
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Value changed in monetary fields were not saved correctly.
Zero Width Spaces in the monetary field new value caused
the model to reject the value as the format (numerical) was not compliant.
task-2679088
X-original-commit: a776e55c6fb03861eed9668fad259c0a92b9aff8
Part-of: odoo/odoo#80071
The forced selection of the entire text value was preventing the user
from changing the selection after the initial click inside the monetary field.
task-2679088
X-original-commit: d33d55aad46c9223192d15c01b7516340be77cce
Part-of: odoo/odoo#80071
Before this commit saving an incomplete link dialog triggered the
display of a stacktrace error popup.
After this commit saving is cancelled when an attempt at saving an
incomplete link dialog is done. The incorrect fields already did display
their error status.
task-2675252
closesodoo/odoo#80043
X-original-commit: 47f0596233c2d8a09d91cdfae117aa3f595bb6bf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the link could be removed from the DOM
before hiding the query popover. After being removed, the
reference of the popover from the jquery element was lost.
We now keep the reference to the popover to always be able
to hide it.
Task-2684819
closesodoo/odoo#79943
X-original-commit: 72c46aef751ebc0de3873c644e3b159ffa349d1e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When trying to drop a snippet that could not be possibly dropped,
a traceback is shown but shouldn't.
Task-2692492
closesodoo/odoo#79924
X-original-commit: 4408dbaf74aa26272b6ed3ce718a2d915975d4b3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
On an html field whenever selecting only text that contain an url
and opening the link dialog, the url was not reused.
Task-2580485
closesodoo/odoo#79923
X-original-commit: 8049c7cf937aec02fe0097ee4f233e2e76fb8ae3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Whenever the link tooltip hide, the tooltip of the buttons
could remain in the page but shouldn't.
Task-2692301
closesodoo/odoo#79922
X-original-commit: 5a5fce48852a6ac2a60db205e99d49e2095d1730
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
A new option StepsConnector is added to the steps snippets, allowing to
pick the type of the steps connector and its color.
The option listens to changes in the UI or in the columns size to
recompute the width and position of the arrows.
The width of the connector is computed based on the widths of the
current step and the next step, which are defined in bootstrap columns.
The s_process_steps snippet CSS version is now 001.
task-2463009
closesodoo/odoo#77282
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Matthieu Stockbauer <tsm@odoo.com>
This commit fixes and improves the suggested width that we compute for
images optimizations.
Before, images displayed outside .container elements were resized to
their container size. As a result logos were resized to 2.5rem (40px).
Now, it handles these scenarios :
- The image is in the navbar, it is a logo
- The image is in a container/container-small
- The image is in a container-fluid
- The image is outside a container
Values are read from the css instead of being hardcoded.
Note: another issue remains with our resizing method. Drawing on a
canvas is not performant enough when there are large differences between
the width and the resize width. A solution could be to use
createImageBitmap for the resize, but it is not supported by enough
browsers.
In the meantime, imageSmoothing was enabled on the context.
Note 2: this also fixes rounding issues when computing the optimized
width which may break the UI update as comparing the integer and
floating value returned false.
task-2506205
closesodoo/odoo#79983
X-original-commit: 8355c10676e1dbb668702337863218bdda7c23dc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
A bug currently makes the carousel snippet collapse/disappear when its
active contents are removed. This happens because after the removal,
the carousel no longer has an active item.
The solution that was chosen was to not allow the removal of slides
unless using the dedicated option which is there for that. This solution
has the advantage to also allow users to create empty slides (using a
background image for example) by simply removing the columns inside.
Note: Newly created carousels will include the oe_unremovable class on
their slides. As such they will no longer depend on isEmptyAndRemovable
checking them for having a carousel-item class on the parent.
task-2506165
closesodoo/odoo#79892
X-original-commit: 0cf36a227e7b90fb64b1bc8024de813894d10d14
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the linktool was re-rendered clicking on
same link twice.
If between click, the some property of the link changed, they
were lost after the linktool being needlessly re-rendered.
Task-2691483
closesodoo/odoo#79820
X-original-commit: 110790cb2482367867dbc0bdaa97ad0e224a3d1e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, if the editor was initiated as a simple
editor rather than the website editor (eg. the editor in the forum or profile)
the $root of the wysiwyg was wrongly assigned to #wrapwrap rather
than the $editable.
Subsequent binding (eg. LinkPopover) was bound to too many elements
which generated incorrect behaviors (eg, link popover on triggered on every
links).
Task-2691117
closesodoo/odoo#79810
X-original-commit: 58c1b04de1ec9179b940ee930984a232bb5de30d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, in the website builder or in mass_mailing, when
creating a link then hitting enter, then click somewhere in the page,
the outline was not removed from all the links.
In mass mailing, the overlay was never removed. Not even upon save.
Task-2682176
closesodoo/odoo#79634
X-original-commit: 71325540712342ef8f251a37ee29270bd3b87469
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When performing undo/redo on some page, because some unneded mutation
get recorded, the page scroll to another location (either up or down).
This commit add a mechanic that filter out thoses unnecessary mutations.
task-2667885
closesodoo/odoo#79620
X-original-commit: 125730ffd9322d34ef1c7d8d0298457de3e65f90
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Because the `_historyStepsStates` was not fully set at the time of
calling `historyStep` in `historyUndo` or `historyRedo`, the listener
for the event "historyStep" was triggered to early and `historyCanRedo` at
that time could not possibly be accurate.
This commit call `historyStep` after setting all ids in
`_historyStepsStates`.
task-2667885
X-original-commit: 659b530516e13df77eed6254b81e72b8009a71bf
Part-of: odoo/odoo#79620
The commit 1b80fe9b56acea09a6784691561df65fe6349f50 made impossible
to undo after dropping a snippet.
Task-2688104
closesodoo/odoo#79649
X-original-commit: 92b1f78e8de6c343a9d1ef19459522b868cf108f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
As an oversight of 2185e89e3f2a15b98b9cb8c3371a6031f9a6f055, it became
impossible to move snippets.
Task-2688281
closesodoo/odoo#79648
X-original-commit: f76ba944c516a0377cec324f564df604e52c2ffd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
In the editor, there was a little spot where it was impossible to
click in order to select a text.
Task-2684378
closesodoo/odoo#79642
X-original-commit: 02c0cce926b1252596f10299597a9c984a8341ac
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
Before this commit, an update to the colorpicker could be called
multiples times with a `colorpicker` not yet in the document.
If a colorbpicker has been created, we need to await it's start method
to be fully resolved.
Task-2667983
closesodoo/odoo#79641
X-original-commit: 105208c8363f77130ee644ce8ec2e993d9955763
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
Before this commit, the reference of the linkPopover was
the last popover being created which is not what this property
is supposed to correspond to. It should correspond to the latest
opened linkPopover.
Without this fix, the code that want to act on the last linkPopover
would not work as expected (e.g. `this.linkPopover.hide();` in
`_onSelectionChange`).
Task-2667983
X-original-commit: d1abbc9d66a5858c771fa643f8c73990e8f14792
Part-of: odoo/odoo#79641
Whenever a link is being manipulated through the link tool,
the classes are being saved before the manipulation. However,
the class `o_default_snippet_text` is removed in the meantime.
Because we never want that class after the manipulation, this commit
systematically remove it.
Task-2667983
X-original-commit: f82f004e1e1439c38a09d5eb0fded5197e058c1b
Part-of: odoo/odoo#79641
Before this commit, selecting a link was not working all the time.
This commit allow to properly select a link all the time.
Task-2667983
X-original-commit: 8c90772470046d0b932443ac7b2c2a868c443a85
Part-of: odoo/odoo#79641
The flow has been broken multiple times across the years. Let's add a
test in all stable versions.
For the 14.0 forward-port, the test came with a fix which restores the
13.0 flow which we tried to change in 14.0... but only ended up broking
it. Indeed, with [1], the 13.0 was fixed. And, with [2], we tried to
simplify the flow... but the explanation given by the commit is just
wrong: the flow was just broken and the simplification that was to be
done in fact practically never occurs. The more the reason to add a
test, proving how the flow is working. The simplification may be done
someday but not sure it is really worth it.
For the 15.0 forward-port, another fix was needed because of [3] which
introduced a bug which makes the onBlur method be called multiple times
when hiding a whole editor hierarchy.
[1]: https://github.com/odoo/odoo/commit/076992bdf099f3a645c9a1ef6df2cdcccbf1c2b2
[2]: https://github.com/odoo/odoo/commit/5c007305c9998ade32c6677cac5552101c3a96af
[3]: https://github.com/odoo/odoo/commit/806a8db35b5e0e6a461422f5bba7c97180c3ef29closesodoo/odoo#79734
X-original-commit: 0acc5e784b15d9c963660da3781763448503f33e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The translate button was overlapping the codeview button
in the mail template view.
task-2683847
closesodoo/odoo#79704
X-original-commit: 8a6de9089bfd77f5fdc6f4a11016906454e442cc
Signed-off-by: Antoine Guenet <age@odoo.com>
Steps to reproduce :
- Install website module
- Activate (and translate website) French language
- Go to translated terms and fetch for "Discard" in website module
- Replace the translated value by "Ne pas sauvegarder"
- Go to Website -> Configuration -> Websites
- Select main website and change language to french then save
- Go to Website and edit homepage
- Add any block
Issues :
On top of editor sidebar, buttons are not displayed correctly.
Solutions :
Add css class `d-flex` to the div arround the buttons.
opw-2683602
closesodoo/odoo#79612
X-original-commit: 772156078418544907f9073e242e4491ddae1e5d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>