This commit completes [1] by further reviewing the drag and drop
technical flow order:
- The content_changed event should be triggered before starting snippets
as well as it is only useful to signal the snippet modifications made
by onBuilt.
- The undroppable snippets update which was done first could probably be
done anywhere -> best to put it at the end when everything in the DOM
is done, and it is also the last thing the user expects to be done.
Note: in the new editor the role of 'content_changed' became however
unclear and should be further reviewed. This commit fixes problems with
the old flow in master though (problems around removing items in a
snippet during its onBuilt call).
[1]: https://github.com/odoo/odoo/commit/60d7bf6d7daea83db9332b4fc47a4ac6892d21d7closesodoo/odoo#75596
X-original-commit: efdfe261afd933972869305fd3358c764f7c18c3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit clicking between the buttons of the link popover
widget did deselect the link. When this happened, if edit was clicked
and the edited link was one within the popover widget instead of the one
on the page.
After this commit clicking on the popover between the buttons has no
effect anymore.
task-2630257
closesodoo/odoo#75544
X-original-commit: 536f72333297ea70cd06c83d92ab0d8f25c0142e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso-odoo@users.noreply.github.com>
Somehow, trying to forward-port the work done at [1] makes it impossible
for the link popover tour test to pass (although that test already
existed in the version where that original work was merged). It's
unclear why the test did not fail before but hopefully it did here: this
reveals a race condition in the editor code where the link popover is
fully shown to the user while clicking on some of its button would have
no effect... because those rely on clicking in the editor panel which is
potentially not up-to-date yet.
This commit fixes the problem in a hacky way, waiting for the editor
panel to be updated before showing the popover but it should not be
necessary in a better refactored codebase.
[1]: https://github.com/odoo/odoo/pull/74861
Part of https://github.com/odoo/odoo/pull/74959
Add an option in the masonry snippet's allowing to choose among multiple
templates for the snippet layout. The usability of the snippet also has
been reviewed (restrict the ability to control background on deeper
boxes). Also reviewed the bg-200 use on boxes and replaced them with
a preset as otherwise it seems buggy to not be able to remove the
bg-200 by selecting a preset (other than hitting the trash icon in the
colorpicker).
Part of https://github.com/odoo/odoo/pull/67361
task-2463033
closesodoo/odoo#67361
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: smottet <oms@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
As nicely pointed by @kig-odoo at [1], the new feature of snippet
visibility conditions introduced in [2] has some issues. This fixes
the fact that condition identifiers were built by combining IDs without
a separator. A condition targeting a lang with ID:4 and another one with
ID:5 could thus produce the same condition identifier as another
condition targeting a lang with ID:45 (as 4 and 5 side-by-side makes
45...). Now, all parts of the identifiers are separated with '_'.
[1]: https://github.com/odoo/odoo/pull/67140#issuecomment-902531321
[2]: https://github.com/odoo/odoo/commit/1c442782f887a8c16bae05a43fae13a310ac05dfclosesodoo/odoo#75386
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, the newsletter popup was using its own mechanism instead of
the popup snippet, making a lot of extra code.
Now, the newsletter popup snippet just use the behavior of both the popup
snippet and the newsletter snippet.
Community: https://github.com/odoo/odoo/pull/74667
Upgrade: https://github.com/odoo/upgrade/pull/2742
task-2246975
The algorithm extracting primary and secondary colors from
an image automatically mitigates too bright colors. A color
component is considered as too bright if its value is above
an arbitrary value. We re-use this algorithm in the website
configurator to extract colors from logo and to generate a
palette. In this particular case we don't want the mitigation
to be applied. We therefore added the mitigation threshold as
a parameter of 'extract_image_primary_secondary_colors' and
avoided any mitigation by setting it to 255 in our case.
task-2602521
closesodoo/odoo#75255
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web
After this commit pre-configured gradients can be used as snippet
backgrounds, snippet filters or as text effects / highlight effects.
The background colors (and now gradients) are now possible to add
*alongside* a color combination class (editing one does not remove the
other). Background colors and gradients are mutually exclusive.
Part of https://github.com/odoo/odoo/pull/73611
task-2599770
closesodoo/odoo#73611
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
Previous implementation always updated *current website*, which is not
always the same as the value from `res.config.settings`.
---
opw-2623007
X-original-commit: d66d44db031be76403ce7c01616e334ef196fd03
When a color combination was used as "color" (base case) for the menu,
the menu background in the boxed template, the footer or the copyright
section, it was not properly marked as selected in the color palette
widget of the editor panel.
Related to task-2599770
closesodoo/odoo#75157
X-original-commit: 04c476a11a084c825725cae89e104e9f205c685b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: tools
The app received many fixes and its code was improved and cleaned. It
was about time to include it directly into the website features.
task-2215118
closesodoo/odoo#74697
Related: odoo/design-themes#478
Related: odoo/upgrade#2709
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Previously, the debug manager was rewritten with the new webclient
architecture, however, because the frontend did not have access to the
new infrastructure (env and services), the old debug manager was kept
and used only in the frontend.
Since odoo/odoo#72675 the new env and services are now available, this
commit simply uses the new debug manager in the frontend and removes the
legacy code.
closesodoo/odoo#74609
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Edit a website menu label with:
& < > " ` '
This is what is shown after saving:
& < > " ` '
This is happening since ea4dbcd240: characters &, <, >, ", `, and ' are
now always escaped. Before that commit, only < and > where escaped and
only when an image was inside the label.
With this change, we unescape the label when we are editing a menu.
opw-2609413
closesodoo/odoo#74558
X-original-commit: ab77054987287444c5f6141b047a63bab4b67baa
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
*: web, website_livechat, website_sale_comparison
Before this commit, bottom fixed elements (e.g. the livechat button)
hid the buttons to go to the next step in website sale when these
buttons are located at the bottom of the page, on some screen sizes.
After this commit,
- A bottom fixed element is hidden if this element hides a button at
the bottom of the page.
- Bottom fixed elements are hidden if a modal is open
to prevent it to hide buttons or any important part of the modal.
task-2501400
closesodoo/odoo#74515
X-original-commit: a851db9495fe9d8c1951f218a71e4d4a427cf96d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Image gallery snippet when dropped is throwing a traceback.
This lead to the editor not usable anymore, as any JS error will prevent any
further action (no JS will work anymore).
This introduce a test that will drag and drop every snippet in a page and click
on it to load its settings in the right panel.
Note that it will remove the snippet before drag & dropping the next one, as
having too many snippet will impact the perf, even killing the browser entirely
if there is a lot.
task-2604383
closesodoo/odoo#74135
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: web_editor
Provide the user with an option to hide or display a section tag
depending on the visitor's location (if geoip enabled), language,
utm_medium, utm_source and utm_campaign.
Users can use a M2M widget to select different records. These will be
used to create a CSS selector on save that will hide the section tag
depending on the various options they selected.
This CSS selectors will be applied, as well as various data attributes
when the page loads to hide the targeted tag. All of these operations
are handled client side.
The geoip country had to be added to the session for the feature to work
with countries.
Part of https://github.com/odoo/odoo/pull/67140
task-2381049
closesodoo/odoo#67140
Related: odoo/enterprise#19907
Related: odoo/upgrade#2658
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Issue: traceback when website editor is entered and theme options are
clicked on themes using an unknown-to-the-editor font family (see for
the theme repo fix for such an example).
opw-2559735
closesodoo/odoo#74423
X-original-commit: c664cf1a1fb4b6781fe2802e66c993cfa1a4a028
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
On the 'Contact us' form of the 'website' module, the client can
auto-fill the fields with the 'false' text string when the logged
partner has some missing values. This happens because the server
set the missing values to 'false' and the client directly uses those
values to update the form fields.
To solve the issue, the client will replace the falsy values set by
the server with an empty string before updating the form fields. That
way, the form fields will no longer be filled with the 'false' text
string.
task-2610948
Fixes 116d55d62fd411d3be5d9f0885dadac530839b99
closesodoo/odoo#74256
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, anchor select on link dialig was never shown
-> xpath done on attribute class but t-attf-class is used
Now we show the anchor input.
This commit also avoid useless anchor detection for empty url and external url.
Or in case of the selected url is the same than the last one loaded.
E.g. type /contactus -> load anchor -> choose one identicalfrom list
before -> reload anchor
now -> we don't refresh anchor screen
X-original-commit: 8e11a0b
closes odoo#74164
closesodoo/odoo#74272
X-original-commit: 6c930e72b7d00f7beb4c43024c52a3e6c44a35f4
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Currently, when you add a link in any of the buttons on the website with
non HTML/XML page, it will raise the traceback as we fetch the content to find
id to propose as a list of anchors.
Reproduction Steps:
1) Add a button on the website using the editor.
2) Add link in URL (i.e. /robots.txt)
3) Traceback
With this commit, When you add the non HTML/XML page to any of the link
will not raise the traceback.
task-2596392
closesodoo/odoo#74194
X-original-commit: 5f78c19995cc6d1fe480b982176e0701bd4d3e86
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Mark the fragments as markup-safe after fetching them.
Also make _render private (don't see any reason for it to be publicly
accessible), and avoid unnecessary intermediate enc/dec in it.
Update `_deletePage` to mark `.text` as markup-safe, and modernize the
code base: the outer promise seems useless, and so does the
`cancel_callback` of the dialog.
Need to check and mark legit uses of HTML as Markup. Also fix some
title formattings which are not great (mostly around translations) and
de-escape titles which don't need to be escaped anymore.
Requires markup every markup-using tip content as Markup. Would be a
nice occasion to migrate everything to a markup-safe markdown I think,
especially if we could migrate the translations so we don't lose them.
Since odoo/odoo#72675 the core services are now available in the
frontend, this includes the scroller service that will call
preventDefault on click events when the clicked link has an empty anchor
as this is usually used to change the cursor appearance, but we don't
want to mess with the hash which contains the webclient state.
In the configurator, the file input for logo upload is inside such an
anchor with an empty href, and so preventDefault is called, preventing
the file picker from opening. While in the configurator, we don't have
any state stored in the hash, not calling preventDefault on anchor
clicks may still cause scrolling issues among other things.
Since there is no reason other than styling for this node to be an
anchor tag, this commit replaces it with a div, and appropriate CSS to
style it.
closesodoo/odoo#73936
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
- fixed xml data files order, otherwise form field would not be whitelisted,
including `email_to`, so the mail would not be send.
- add the same data-for behavior from website_crm to website, to be able to
prefill a field with an URL param
- removed the fallback data-for in website_crm, the JS in now in charge of
doing that. Plus it was creating a misheavior -> you could have prefill set
to false but still, it would prefill the user info
- fixed the form option so the field.name is not used as field.string if there
is already an explicitely set field.string..
- adapt field name in /contactus form (xml view), form snippet (registry) and
crm form (registry) for more consistence
- added the prefill option set to true by default on /contactus (to fit what
we had before). This came with a change in the test as we don't need to
enable it anymore.
- added also the prefill option to true by default on form snippet
Part of #69888
task-2462993
*: website_crm, website_form_project, website_hr_recruitment,
website_sale
Replace website_crm specific behavior by another option for all website
forms.
Part of https://github.com/odoo/odoo/pull/69888
task-2462993
*: crm_iap_lead_website, website_crm, website_form_project,
website_hr_recruitment, website_sale
Part of https://github.com/odoo/odoo/pull/69888
task-2462993
When using drag&drop for adding elements to a product's page through
the website edit mode, users sometimes find the feature confusing to
use. Two examples of said confusion can be seen here:
- https://dashboard.userbrain.net/shared/qwl65bqlk6jg?t=404
- https://dashboard.userbrain.net/shared/k796mnj95pow?t=258
The suggestion for improvement was to reduce height and opacity for
the top and bottom droppable zones (available on all products), and
make any element not explicitly dropped in those zones go to the
zone below the product, available only on the product's own page.
This behaviour is extended to be more generic and is applied when
a dropzone has the class oe_structure_not_nearest, which excludes
it from the nearest search, unless the element is dropped explicitly
in a zone that has the class oe_structure_not_nearest.
task-2581641
closesodoo/odoo#73580
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
*: http_routing
When rewriting the webclient, a new environment was created, as well as
a new type of service and a new mechanism to start those services. This
environment and the services that go with it were not made available in
the frontend however.
This commit adapts the setup code for the frontend's root widget (and
the website specific equivalent, WebsiteRoot) so that the new
environment exists, and some of the calls to the legacy services are
redirected to the new services. The point is to allow removing some
legacy services whose code is currently only needed by the frontent
because of the lack of availability of this new env and services
Part of #72675
With the introduction of the new webclient, we introduced a new way to
create and interact with registry using categories. This alleviates the
need to explicitly export and import registries.
This commit converts the public root widget's custom registry to use the
new registry to avoid code duplication and having multiple diverging
implementations
Part of #72675
With [1], not all overlays are displayed anymore but we rather show the
parent one in some cases. The timeline cards were considered as one of
those cases while it should not, as it prevents to use the overlay
buttons allowing to switch the cards order.
[1]: https://github.com/odoo/odoo/commit/9bbe5be3fb0d995374a369851df3641979d8e553
Discovered while working on task-2431484
closesodoo/odoo#73515
X-original-commit: 26708e168c717ae7e3a29c7705c80679b8e45f7d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor
The goal of this commit is make the whole we-collapse elements
clickable for theme color palettes.
Part of https://github.com/odoo/odoo/pull/68061
task-2431484
In this commit, the following changes have been made:
- Add the "Add Year" option to be able to add new item in timeline.
- Add option to change line color.
Part of https://github.com/odoo/odoo/pull/68061
task-2431484
In this commit, the following changes have been made:
- Set the "Add Item" button to add new blocks in 'Accordion' snippet.
- Make the scroll animation optional on block reordering and disable it
for 'Accordion' blocks.
Part of https://github.com/odoo/odoo/pull/68061
task-2431484
*: web_editor
The goal of this commit is to add the "MultipleItems" option
to be able to add new elements in snippets with a list of items.
In this commit, the option is used for "Media List" & "Tabs".
Part of https://github.com/odoo/odoo/pull/68061
task-2431484
In this commit, the following changes have been made:
- Add "Add Slide" button for carousel snippet.
- Add tooltips and update style for slide-related buttons.
Part of https://github.com/odoo/odoo/pull/68061
task-2431484
Purpose
=======
This snippets was originally in the "Website Mail Channel" module,
but it has been removed.
The snippet allow the user to subscribe to a specific mailing list.
If the current user has no access to the mailing list (because of ACL
rule) the widget will be invisible for him.
Links
=====
Task-2510267
See odoo/pull/71599
See odoo/enterprise/pull/19296
See odoo/upgrade/pull/2600
The first element is now selected once the snippet is visible at the
bottom of screen.
task-2431484
closesodoo/odoo#73499
X-original-commit: e2cfaf8e58c3f267503fc7ec81d78f728e75b506
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>