Prior to this commit, read-only handles were hidden, which created a
layout issue (eg. the header was no longer highlighted when we clicked
on it).
This commit adapts read-only handles to make them visible by using a
border around the selected element.
It also adapts the common borders of all handles to place it
inside the element to avoid being partially hidden when the element is
on the edge of the container (eg. the header or the footer).
task-3537616
closesodoo/odoo#137569
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, owl was in the linter's accepted global variables.
This allowed direct access to owl global object.
For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`
Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:
`import { xml } from "@odoo/owl";`
task-id 3498859
closesodoo/odoo#137517
Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit fixes two bugs with the colorpicker that occur since [1].
Steps to reproduce the 3rd bug:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Change the color of the header by picking a color in the "Background"
sub option (below the "Header Position" selector).
- Save and Edit.
- Go with your mouse over the different colors of the colorpicker (at
least 2).
- Bug: an infinite loader appears on the iframe and prevents from
editing the background color.
Steps to reproduce the color combinations bug:
- Go to Website edit mode.
- Drop a Call to action snippet.
- Change the background color and try to select another preset.
- Bug: the color of the text and buttons is updated, but not the
background color.
Both of these 2 bugs happen after commit [1] because the colorpicker
widget is started before the ColorPalette component is attached to the
DOM (which only happens once the user opens the picker). However, the
colorNames are only set after the setup() of the ColorPalette.
Initializing the colorNames with possible default values is thus
necessary to avoid bugs on `_computeWidgetState()`.
[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
task-3440939
closesodoo/odoo#137306
X-original-commit: https://github.com/odoo/odoo/commit/2ccc01175080ddb549660713d6101dd936e0d304
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce:
- Go to Website edit mode.
- Click on the header.
- Choose "Over The content" for the "Header Position" option of the
header.
- Open the colorpicker (below the "Header Position" selector).
- Bug: we shouldn't be able to choose anything other than a gray.
This bug occurs since [1] because, before the conversion to owl, the
colorpicker widget was added conditionally in JavaScript (so the widget
was not included if the option "custom" color was excluded). However, in
the current version, the color picker is inside the
'web_editor.ColorPalette' XML without any condition to display it or
not.
[1]: https://github.com/odoo/odoo/commit/d7245d2abf528d093226c80e40975e63d61e8997
task-3440939
X-original-commit: https://github.com/odoo/odoo/commit/7919e243427899ca7c09666fbdf8453bc2defa1d
Part-of: odoo/odoo#137306
*: tools
Steps to reproduce the bug:
- Add an image on the website.
- Replace it by a "jpeg". Note that the mimetype of the image is
"image/webp" at the upload since [1].
- Add a shape on the image.
- Save and Edit.
-> If you check on the available "Format", the mimetype of the
"original" is "webp" but it should be "jpeg".
Before this commit, there were two types of mimetype data attribute:
- `mimetype`: the current mimetype of the image.
- `originalMimetype`: the mimetype of the image without a shape.
Before [1], it was also the mimetype of the original image. However,
since [1], the user has the possibility to change the mimetype of the
image so the "originalMimetype" attribute does not always refer to the
mimetype of the original image anymore.
To resolve the problem, another data attribute has to be introduced.
Here is a summary of the mimetype related attribute:
- `mimetype`: the current mimetype of an image.
- `originalMimetype`: the mimetype of the image before a shape has
been applied. It is needed when removing a shape to recover the correct
mimetype.
- `mimetypeBeforeConversion`: the mimetype of the original image. It is
needed in order to be able to change the format of an image and come
back to the original one.
In the case of an uploaded "jpeg" image on which a shape has been
applied, `mimetypeBeforeConversion` is "image/jpeg", `originalMimetype`
is "image/webp" (since [1]) and `mimetype` is "image/svg+xml".
The `loadImageInfo()` has been adapted to also handle the case of an
image that has already been loaded but that does not have the
`mimetypeBeforeConversion` attribute (for example all the images that
were uploaded on the website before this commit). In this case, the
mimetype attribute is kept and not set to the original one as the user
could have changed it.
[1]: https://github.com/odoo/odoo/commit/0449fe85cb0e1d639a4e1aeba26e90906f79254d
task-3449866
closesodoo/odoo#137424
X-original-commit: 730588b802506844e6ca54df312333bfd8df1d52
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit:
When pasting text from outside odoo, it often includes additional tags
such as <b> and <P>, along with unwanted styles.
After this commit:
When pasting text from outside odoo, those extra tags and styles are now
removed.
task-3378093
closesodoo/odoo#137236
X-original-commit: 5485824654179981cc7562e643123a6decbb02a2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Reproduction:
1. Go to any record with a chatter
2. Open full composer
3. Enter a special case for the text using shortcuts (CTRL+I for italic,
CTRL+B for bold, etc)
4. exit the special case with the same shortcut
5. JS error
Reason:
A selection is not null check is missing in the condition
Related PR: https://github.com/odoo/odoo/pull/136777closesodoo/odoo#137499
X-original-commit: db0325503576d06521ab65a64d3c9cce837e66bc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
Before this commit:
When we inserted a new row or column into a table, a <p> tag was not
inserted within it, resulting in the placeholder not being displayed.
After this commit:
When a new row or column is inserted into the table, a <p> tag is inserted
within the <td>.
task-3344668
closesodoo/odoo#137429
X-original-commit: a3e09ed84451f8a7c5cbc82648a02565ef63072f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Purpose of this commit:
Added a button to the sidebar and the column dropdown menu
for resizing the table's height and width, so that if we
want to reset the modified size of the table, we will be
able to do so
Taskid: 3344668
X-original-commit: 8740310ec845b020db0d31d3be5dfc2969665994
Part-of: odoo/odoo#137429
Before this commit there were two regexes for matching http(s) URLs,
being the only difference between them the presence of a capturing group
for the protocol/scheme. The need for a nearly duplicated version of the
same regex was its use in `_onPaste` as delimiter for String.split(), in
which capturing groups are returned in the resulting array, and the
protocol/scheme was not desired.
This commmit removes the need for two different regexes to match http(s)
URLs, adapting `_onPaste`'s code to work with the presence of the
referred capturing group.
task-3520513
closesodoo/odoo#136497
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
PURPOSE
Slightly modify various apps to improve the user experience. Changes include
notably labels and views fine tuning, roundings, and small css fixes.
SPECIFICATIONS
- Remove the decorator from the event list view as it's a bit confusing
- Ensure mailing KPIs are now shown with 2 decimal places
- Re-order the mailing stat buttons
- Improve the background / font colors of the cover block
- Improve the labels of:
- Title and confirm button of the /button and /link modals
- Confirm button when archiving a record
Task-3204554
closesodoo/odoo#128108
Related: odoo/enterprise#43937
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Prior to this commit, the area of top and bottom handles overlapped the
content according to the size of the overlay border.
This commit changes the way height is calculated to remove this overlap.
task-3368793
Part-of: odoo/odoo#132653
This commit adapts the draggable icon in the overlay button to improve
the readability.
This commit also adapts the "danger" background color of
`oe_snippet_remove` button to maintain consistency with the web editor.
task-3368793
Part-of: odoo/odoo#132653
Steps to reproduce the bug:
- Add a "Text-Image" snippet on the website page.
- Take an "Inner content" snippet from the right panel and drag it from
a dropzone to another. It has to be fast so that the order of the "over"
and "out" dropzone events is "over" > "over" > "out" and not "over" >
"out" > "over" as usual.
-> The exited dropzone is not correctly displayed.
The problem is that since [1], the website is inside of an iframe. Due
to that, the snippets menu does not have a direct access to the
dropzones. To solve the problem, the already defined `$dropZones`
variable is used instead of searching the dropzones inside the DOM. For
the snippet editor, the problematic line has been deleted at it is
already handled by `_outPreviousDropzone()`. This is acceptable since
the commit that introduced `_outPreviousDropzone()` ([2]) and the commit
that introduced the removed line ([3]) were both introduced to handle
the case of an "over" after an "over". In other words, as
`self.droppped` will always be `true` when
`self.dragState.currentDropzoneEl` is set and it will always be `false`
when `self.dragState.currentDropzoneEl` is not set, the problematic line
can be removed as it is already handled in `outPreviousDropzone()`.
[1]: https://github.com/odoo/odoo/commit/31cc10b
[2]: https://github.com/odoo/odoo/commit/c6886410603a16b6a3c5fe459d273dd883c110c7
[3]: https://github.com/odoo/odoo/commit/fed5854e32bcddf8b14b8311b2fe542eed990f77
task-3522552
closesodoo/odoo#137255
X-original-commit: 06fde42d3ba0e8be2128cda8e695c5def917f391
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Reproduction:
1. Install website
2. Change to edit mode and click a link on the main page, for example,
“contact us” at the bottom
3. click "Edit link" in the popover
Fix: use the variable `shouldFocusUrl` for link tool props update
task-3514360
closesodoo/odoo#137246
X-original-commit: af035687c57f8b34261beff121669ee044d9b7df
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Rodolpho Lima <rcdl@odoo.com>
This commit changes the public `parseHTML` utility function's signature,
in order to allow the use of the editor's document to create a document
fragment.
This aims to avoid mismatches in the prototype chain of HTML elements
created by such util and the ones present in the editable when the
editor is mounted in an iframe. This is of particular relevance for the
'insert' command, in which the node to be inserted is tested for
`instanceof` the editor's document global `Node` object.
task-3526134
closesodoo/odoo#136984
Related: odoo/enterprise#48108
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Since [1] when webp support was introduced, pre-converted images
(resizes and jpgs) are automatically created so that the images can be
used in PDF reports.
This only needed to be done for image fields - which can be referenced
in reports.
This commit limits the pre-conversion of images to images that are set
in image fields.
[1]: https://github.com/odoo/odoo/commit/0449fe85cb0e1d639a4e1aeba26e90906f79254d
task-3510621
closesodoo/odoo#137109
X-original-commit: cd0164339e5179177aaaf21b69615a71a8982da8
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
Steps to reproduce:
- In website, paste a URL like "odoo.com" as plain text.
The expected result is a transformed link, just like it happens when
pasting is done in an html field (ex: project.task description), but
a simple text node is inserted instead.
The reason for this is that an element created by the iframe document's
`createElement` method has in its prototype chain the iframe context's
global `Node` constructor, which is a distinct constructor object from the
main window's `Node` constructor.
task-3521152
closesodoo/odoo#136597
X-original-commit: 392d78dab632f67721ec2ba8810d5c8053640b86
Related: odoo/enterprise#48136
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, when the Wysiwyg was used in a html form (like
website_forum), its `savePendingImages` method was not called. This
resulted in keeping pasted or dropped images as base-64 encoded sources
instead of converting them to attachments.
This commit ensures such conversion takes place.
task-3499058
closesodoo/odoo#137073
X-original-commit: 00aad6aa92c8ad476f9f78779b7a24cb5f7af2ff
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
Before this commit:
-Font size does not get applied to selected cells.
-Font style buttons were active when cells are selected.
After this commit:
-Font size can be applied.
-The font styles should not all be toggle by default.
task-3477490
closesodoo/odoo#137080
X-original-commit: 1d20abfbfd9f337f356c5a237edc713fb973b636
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Sanjay Sharma (shsa) <shsa@odoo.com>
By returning the `setSelection` value in the callback returned by the
`preserveCursor`, we allow better control for the caller over the fact that the
selection was effectively restored or if it failed.
task-3383561
closesodoo/odoo#126340
Related: odoo/enterprise#43087
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit makes the rpc call in the `loadImageInfo` method robust to
the case where an image src would be an absolute URL, by only
considering the relative part of the URL.
The images src are generally always relative but commit [1] wrongly put
absolute URLs to images in grid mode with the `_reloadLazyImages`
method. While this behavior was fixed by commit [2], the images that
were saved before this fix was available still have an absolute URL.
Hence the need to make `loadImageInfo` robust.
[1]: https://github.com/odoo/odoo/commit/cc406afcea7bf5846233a9f97a4a8ac5f618f3ec
[2]: https://github.com/odoo/odoo/commit/3528f2c3f9d3b30266f3421672986d202c724a76
task-3514519
closesodoo/odoo#136951
X-original-commit: af5ddabb0285daa9e57bc01cf21628f2f94bc18f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
LinkTools creates http links by default, while OdooEditor creates https
links by default on paste and auto link transformation with SPACE.
This commit standardizes the result of both mechanisms, adopting "http"
as the default protocol.
task-3516854
closesodoo/odoo#136487
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, when an existing link was edited with the LinkTools
or LinkDialog, the URL input field omitted the "mailto:" part of the URL
for email links, but displayed the protocol/scheme for http(s) links and
phone numbers (tel: or tel://).
This commit standardizes the behaviour of the referred input field such
that the protocol/scheme for http(s), mailto and tel URLs are omitted,
in order to have a cleaner UI.
task-3516854
Part-of: odoo/odoo#136487
When creating or editing a link via the LinkTools or LinkDialog, http
and email URLs can be deduced from incomplete user inputted URL (that
is, URLs not containing the http(s):// or mailto: protocol).
This commit extends such URL deduction to telephone numbers, allowing
the user to create a tel:// link without the need to explicitly write
"tel:" or "tel://".
Obs: "tel//:" protocol is preferred over "tel:" for the reasons stated
in [this] commit.
[this]: https://github.com/odoo/odoo/commit/56ce29e71f75a657d4b518d86c1d7084891e898e
task-3516854
Part-of: odoo/odoo#136487
The border radius on an active shape in its menu was making a weird
gap between the element and its border. This commit fixes this gap by
using an outline on the active state.
task-3503975
closesodoo/odoo#136871
X-original-commit: 0c4816e1b4996b6e3048b3061c6e2cff06eeb499
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The negative margin used for the colorpicker was creating a weird
spacing when we use the oval shape image or if we have a button group
without the colorpicker. This commit adapts the margin on the element
itself by overriding it with an !important instead of relying on a
negative margin.
The dropdown caret from the colorpicker dropdown was misaligned, it
happened because the default CSS rule for we-select had priority due
to more specific selector. This is fixed by making the selector more
relevant to take priority over the default rule.
task-3503975
X-original-commit: 2f81c6ae68751d5f93c30aef822730ee04ead391
Part-of: odoo/odoo#136871
Co-authored-by: bvr-odoo <bvr@odoo.com>
Reproduction:
1. Create a link right after some text
2. Remove the whole line by backspace character by character(this should
give the p element a history steps id)
3. Try to create a link again
4. The new link is invisible and actually created in br when inspecting
the page
Reason: this is an edge case on Chrome that the document.getSelection()
returns a selection which has br element as the anchorNode. It may
happen when the parent element of the br has history steps and only has
this br element. However, the same steps done on Firefox return the
correct selection on the parent element.
Fix: we make a special case when the selection is a caret type and the
anchorNode is a br element, we re-select the parent element and collapse
the selection to the start. This is trying to mimic the normal case of
adding a link to an empty p element, e.g selection anchorNode is p,
offset is 0.
task-3181486
closesodoo/odoo#136879
X-original-commit: 084ac2a375224288f182961ff98915dbeb428bd6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
Before this commit:
when performing a shift paste of copied VS Code content, the indentation was
lost.
After this commit:
Now, when you perform a shift paste of copied VS Code content, the indentation
is preserved
Task-2884491
closesodoo/odoo#136867
X-original-commit: 1641bb50aa30ac64340eb261b26d4706944299ba
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
The text moves back to the left side on remove format even if the direction rtl
is applied.
After this commit:
The text will not move to the left side on remove format if the direction rtl is
applied.
task-3482193
closesodoo/odoo#136849
X-original-commit: ff955e2cf74189a7cd4b175e8edfe5cfc8f31821
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Reproduction:
1. Install mass mailing
2. Create a mailing with multiple Cover blocks, and replace each
background image by uploading one. In the inspector, you should find the
`data-bg-src` attribute
3. Send the mailing to a Gmail account (or check the sent email on a
local odoo instance), the email is with the long `data-bg-src` attribute
Fix: The fix is put into the existing flattenBackgroundImages function
because the background images are selected and `data-bg-src` is for the
background images. It simply removes this redundant attribute
task-3484103
closesodoo/odoo#136837
X-original-commit: b43d3c091c7f590bb8128dfc922345ad4dbb13dd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Jinjiu Liu (jili) <jili@odoo.com>
Before this commit, the stale document detection was imprecise and
incomplete.
The stale document could happen in different scenario:
1) Client B save when client A is disconnected (therefore client A
should be notified that the document is stale upon reconnection):
- For that scenario, the code had a heuristic to detect if the
internet connection disconnected and reconnected but was imprecise
as the browser api is not 100% reliable on all browser and
platforms. That made the code under-checking or over-checking with
the server.
2) The user has not yet focused on the element and before this
commit, the stale document was not detected.
3) If there is a partition in the peer to peer network and a member of
another partition that save, all other partition will not be aware
that they are working on a stale document.
4) The stale document happen before 2 peers could be fully connected.
For any of those scenarios, if a stale document was not detected and
the user tried to save changes, only then, a popup would inform that
the version was stale. And if the user closed the tab thinking the
document would automatically save, the change would not be saved
(without warning).
This commit:
1) improve detection of stale document
To detect the document this commit add a message in the odoo bus.bus
for the channel of the record for each write. That will ensure the
message to be received as soon as a user is connected to odoo.
2) improve recovery from stale document
Before this commit, the recovery was only made from the server.
As a detection is now direct (rather than delayed by the previous
heuristic), a document could be detected stale before receiving a step
that would not make it stale. Therefore, we cannot just reset from the
server as a recovery mechanism.
To recover, this commit first tries to reset from missing steps from
all peers. If unsuccessful, it will tries to reset from a snapshot. If
unsuccessful, it will reset from the server.
3) add a mechanism for aborting requests
To prevent unexpected concurrency behavior, this commit add a mechanism
to abort requests.
4) a framework for testing the collaboration of the wysiwyg
As it could be quite tedious and error prone to manually tests
concurrency issues related to the wysiwyg, this commit add a framework
for testing the collaboration of the wysiwyg and test the detection
and recovery of stale document.
task-3217965
Part-of: odoo/odoo#136277
In a subsequent commit, we need to change the content of the method
`_getNewPtp` and to patch it in tests.
To make that commit more readable by understanding which lines
changed, this commit moves the creation _getNewPtp to the Wysiwyg
prototype rather in a closure.
task-3217965
Part-of: odoo/odoo#136277
*: analytic, base_automation, loyalty, mass_mailing, project, web, web_editor, website
This commit adds many new documentation of options and their usage for
fields. This makes them more usable and customizable in Studio, and adds
documentation for developers to know the type of expected option.
Some options that might lead to issues or that are too technical have
been removed, as they are not relevant and not required in most use cases.
task-3469741
closesodoo/odoo#134858
Related: odoo/enterprise#47148
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
This commit removes the files ajax.js and rpc.js then adapts all the
places where their exports were used. For most of the changes, it's a
replace of `this._rpc({...})` by a new `useService("rpc|orm")` like
pattern in the widgets.
closesodoo/odoo#136271
Task: 3439226
Related: odoo/enterprise#47775
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit:
-On selecting fullscreen/description for image toolbar stays.
-On selecting description for image focus in not set on input field.
After this commit:
-Now toolbar is removed when selection changes.
-Now on selecting description for image, focus is set on input field.
task-3468251
closesodoo/odoo#136466
X-original-commit: 210230f972c4468c3f472509adb25dfc87d4c2b2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
-With selection on checklist, on unchecking it toolbar is not updating.
After this commit:
-Now toolbar is updated when list unchecks.
task-3504398
closesodoo/odoo#136541
X-original-commit: 2cf3dd5988914a09bbc2098eccb3c8419995e120
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
Indenting list using tab inside a table used to switch to the next cell.
After this commit:
Indenting list using tab inside a table now indents a list instead of switching
to the next cell.
task-3470092
closesodoo/odoo#136538
X-original-commit: 62c16468e2759eb0a0c3eecf3866b543be3bfabb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit:
when selected cell is clicked, its selection collapses yet toolbar is visible.
After this commit:
Now toolbar is removed when selection collapses.
task-3458048
closesodoo/odoo#136533
X-original-commit: 89116f6f356df0b33ba61f8b2e725ae7530bdceb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Steps:
In a website forum post without any previous scrolling, select some
text. A traceback appears due the fact that there's no .o_action_manager
element in website forum.
This commit uses the document body as a fallback for the scroll
container when the .o_action_manager element is not present.
task-3506312
closesodoo/odoo#136508
X-original-commit: fc6f66f179798a731489a6a3e73af0d37af27f7d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
If somehow there is no selection but the `_handleShortcuts` handler still gets
called with `CTRL+A`, `container` would be a JQUERY object instead of an
element leading to a crash in `selectNodeContents` which expects a `Node`.
task-3506666
closesodoo/odoo#136499
X-original-commit: e6fac045282465960c0e4a7ecbbbb5e5ac8dff92
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
When changing a link's content, its URL (href attribute) might change
(if the new label is a valid URL), due to a mechanism in OdooEditor.
Before this commit, when a change in the link's content leads to a href
change:
- if the LinkTools is opened, the URL input field would become outdated
and display an incorrect URL.
- likewise, if the popover is shown, its content and position would be
outdated (possibly covering the link's new content).
This commit makes sure both the LinkTools URL input field and the
popover stay up-to-date if a link's content or href changes.
task-3284649
X-original-commit: 1b0952f3635f5677ba3ab221a28ceb26920a1862
Part-of: odoo/odoo#136278
Before this commit, any changes made to label input field were lost when
the LinkDialog or LinkTools component was re-rendered.
This commit fixes it without leveraging OWL's reactivity/declarative
approach, because most of the code in these components is imperative and
not yet converted to the OWL paradigm, leaving such refactor to be done
in the master branch.
Part-of: odoo/odoo#136278
If a link's content is equivalent to its URL, two problems can arise
when its URL is changed via the LinkTools:
- The link's content becomes outdated, showing a different URL;
- On LinkTools destroy, the OdooEditor mechanism that updates a link's
href on label(content) change will update the href according to the old
label, effectively reverting the changes in the URL.
This commit avoids such issues by syncing the label with the URL input
field in such cases.
task-3284649
X-original-commit: 8ddcc08c1700151e697ecb3c0c1daec2db9f8fd2
Part-of: odoo/odoo#136278
Before this commit:
- URLs like "domain.com/@/page" were incorrectly detected as an email
URL by Link(Dialog/Tools),
- switching from an email URL to a http URL with the Link(Dialog/Tools)
was not possible (URL remained prepended with "mailto:").
This commit improves email detection from simply looking for a "@" to
something slightly more robust, and makes switching between 'http'
and 'mailto' links possible.
task-3284649
opw-3245501
X-original-commit: e849ff4333355386dfb79bc574c93c76ed3e2d3b
Part-of: odoo/odoo#136278