Commit Graph
151590 Commits
Author SHA1 Message Date
Younn Olivier 28a78fb4e4 [REF] web_editor, website: refactor dialogs to new API
After the core Dialog API was refactored in [1], the web_editor and
website dialogs had to be reworked.

These dialogs are using a base WebsiteDialog component, that allows for
a default footer and adds the o_website_dialog content class.

[1]: https://github.com/odoo/odoo/commit/7c4f200b8edf0bc695c623c7afc62288f838db36

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
Younn Olivier 66af6664c1 [FIX] website, web: fix opening configurator after installing website module
Before that commit, opening the client action was not possible directly
after installing the website module (the client action javscript class
was not yet added to the actions registry).

An action_id param is added to the reload action, so that it can open
the website configurator after reloading the webclient.

See merge commit for more information.

task-2687506
2022-06-24 10:28:07 +02:00
xO-Tx 0db19449d0 [IMP] website: add options on page list view
The goal of this commit is to add options to manage website pages as in
frontend page manager using list view.

- The click on list view item will redirect iframe to the targeted page.
- The Page Properties dialogs (DuplicatePageDialog, DeletePageDialog)
  are used to clone/remove pages.
- The pages listView is loaded using the current website domain.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx a8ca8372b6 [IMP] website: move track to technical view
The goal of this commit is to move the "Track Visitor" option from
CustomizeMenu to technical view.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx 2ef7e78826 [IMP] website: add page properties dialog
The goal of this commit is to add the 'Page Properties' dialog using
the 'website.page' form view.

The PagePropertiesDialogWrapper was updated to work on pages listView
(to clone/remove pages).

A boolean field 'is_in_menu' was added to control if page is in menu on
page properties dialog. This should be refactored later as a wizard.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx 8765325987 [FIX] website: fix CSS for AceEditor
The use of AceEditor's CSS on "assets_backend" affects the editor widget
on fields.

The goal of this commit is to fix this behaviour by excluding form
fields.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx a7a96d44c9 [FIX] website: fix AceEditor on full screen mode
See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx 55f1680c74 [IMP] website, web_editor: add website navbar AceEditor
The goal of this commit is to adapt the website HTML/CSS/JS editor using
a 'ComponentAdapter' to website backend.

Since we reload the iframe only after editing resources, the
'_updateEditor' method was added to update UI (toggle 'resetButton'
visibility,...) and get the same behaviour (on save/reset) as before
using iframe.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
xO-Tx 265cacce21 [IMP] website: move WebsiteAceEditor to components
See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 00080f4b73 [IMP] website, web_editor: add "translate" systray item
This commit adds a Translator component, that replaces the
TranslatePageMenu.
It has not been completely adapted to owl: instead, it only extends the
Editor component (that instantiates the Wysiwyg widget) and passes
callback props that are using the legacy code from the
TranslatePageMenu.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 8fb0aeadcf [FIX] web_tour, website: do not query test anchors in iframe fallback
Before this commit, when using 'iframe ...' as a selector for a trigger
in a tour, the first iframe found was used to query and find the
trigger. In the context of this PR, the iframe fallback was used to find
the triggers in the website tours.

This commit adds a o_ignore_in_tour class, used to filter out those
elements in tours.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 6aac2bec6f [IMP] website_links: add link tracker menu item
See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier b16d3bc576 [IMP] website: adapt configurator css to backend assets
Before, the configurator was using the frontend assets. When converting
it to a backend client action, it lost some styles. Some rules are added
to the configurator scss file to keep the structure that is had before.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier caefcb8590 [IMP] website: convert configurator to client action
Before this commit, the configurator was its own frontend application.

With the website edition UI moved to the backend, it makes also sense to
move the configurator to the backend, as a client action, so that it is
easy to trigger it after installing a website (or the website module),
and returning to the website_preview client action after having
completed it.

This commit adds a new color_palettes.scss file, added in the
assets_backend, that will print the values of the color palettes (so
that some js can handle it). For now, it is needed for the configurator
and the editor. It will probably need to be reviewed later to not put
everything in backend assets.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 9df44ecade [FIX] test_website, web_editor: adapt tests to new dialog
See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 8599076859 [IMP] web_editor, website, *: use new media dialog
*: mass_mailing

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 7fd0698cf7 [IMP] web_editor, web_unsplash, website: add media dialog
The media dialog was refactored using owl.
It can be displayed via the dialogs service.

The (Image/Document/Icon/Video)Selector components are controlled by the
state of their parent, the MediaDialog: this.selectedMedia.

Some things differ from the original implementation: the dialog still
takes (optionally) a media as a parameter, but it does not directly
modify it anymore.
It will pass the selected media as a parameter to a callback, save, that
it gets as a prop. That save prop should be responsible to make the
appropriate modification to the original media, given the new selected
media.

The code opens up for an easy multiSelect of other tabs than the images
(multiIcons, multiDocuments), but that use case is not currently tackled
and maybe it would be better to simplify the code.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Arthur Detroux (ard) b173bb161e [IMP] web_editor, website: use master's loading spinner
Use a BlockIframe component when the iframe is being reloaded,
use the new loading spinner in the web_editor.
Scroll the snippet into view when reloading the editor.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 457e655ff7 [FIX] web, web_editor: adapt drag and drop to iframe snippets
SmoothScrollOnDrag and jquery-ui, the libraries used to handle the drag
and drop of the snippets, are using the HTMLElement
getBoundingClientRect method on the draggable/droppable elements to get
their position, listen to mouseover events and trigger scroll while
dragging.

With the WebsiteEditorClientAction's iframe, the getBoundingClientRect
method of elements inside the iframe was not taking into account a
possible offset of the iframe. For example, in the "mobile preview"
edition mode, the iframe was reduced in size and centered in the screen.

This commit adds this offset to these libraries:
- in SmoothScrollOnDrag, when the drag is started, to correctly trigger
the scroll inside the iframe.
- the insertion zones' getBoundingClientRect (used for the jquery-ui
droppable) is patched.
- the SnippetEditor.cover method is adapted to correctly display the
handles over the snippets.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Younn Olivier 3588155534 [IMP] website, web_editor: add mobile preview
See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Arthur Detroux (ard) 212a8bfdd2 [IMP] web_editor, website: working color palette with previews
On website, the edition is done in an iframe while the SnippetsMenu
resides outside of said iframe. This means that the SnippetsMenu no
longer has frontend styles. Therefore, colors aren't accurate.

This commit aims at patching web_editor widgets, such as color_palette,
so that the color displayed is always accurate. To do so, it computes
the color inside the iframe and adds style attributes to color_palette
preview elements.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Arthur Detroux (ard) f1e5f377f8 [IMP] website: redirect to backend in edit mode with an url param
The redirect helper js script can now redirect directly to the backend
in edit mode if it has the ?enable_editor.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Arthur Detroux (ard) e5b094b683 [IMP] website, *: remove unused assets
*: website_blog, website_event, website_forum, website_links,
   website_livechat, website_slides, survey, web_editor

This commit removes the website navbar root widget, as the edition is
now handled in the backend through the client action and custom menus.

It removes associated widgets and their css.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Arthur Detroux (ard) 03c552690b [IMP] website, *: adapt code so that it may work with an external editor
*: mass_mailing, web, web_editor, website_blog, website_event,
   website_event_meet, website_livechat, website_sale, website_twitter,
   base

This commit does 3 things:

- Adapt existing code so that the editor can be run outside of its
  editing element. Prior to this commit, it was expected that the
  editor would be attached to the element it was currently editing.
  This needs to change however as the editable is now inside an
  iframe for the website edition. mass_mailing already had a similar
  approach but the editor was started within the iframe.
  With these changes, the editor is alongside the iframe, editing
  the content that's inside it. This allows multiple features
  such as reloading the iframe while keeping the editor visible and
  resizing the iframe for a mobile preview.

- Adds logic to the wysiwyg_adapter so that it can undertake
  the duty of the previous widget sytem. The wysiwyg existed not only
  in the legacy widget system, but most importantly in the frontend.
  One of the duties of this adapter is to send events inside the
  iframe when it is necessary to reach the frontend public widget
  (i.e. widgets_start_request)

- Removes existing SCSS that is no longer used.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Arthur Detroux (ard) d9076d0976 [IMP] website, web_editor: move code for backend edition
This commit takes previously existing code and moves it to the new
location where it will be currently used by the new website editor.

Some SCSS rules were now necessary in both the frontend and the backend
(i.e SCSS for o_we_shapes). Optimizations about assets will follow this
merge.

Some code were moved to new components (i.e reloadBundle moved from
snippets.options to wysiwyg_adapter)

And some code was taken away from widgets that will be removed
(i.e edit.js).

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Arthur Detroux (ard) a3e34512bf [IMP] website, web_editor: add WebsiteEditor components
This commit adds 2 components essential to website edition.

- WysiwygAdapterComponent: Allows the legacy @web_editor/wysiwyg widget
  to work in an OWL context. It will be further expanded in the next
  commit to fully replace the previous edit.js which was the initial
  widget that started the edition prior to this commit / branch.

- WebsiteEditorComponent: This component is in between WebsitePreview
  and the adapter. It allows some tricks described below.

The reason this is split in two component is because, for now, when
the page needs reloading, the editor component will clone the content
of the widget, destroy the Wysiwyg, and restart it. This ensure that
every event is properly bound and gives the illusion that the wysiwyg is
never destroyed.

See merge commit for more information.

task-2687506
2022-06-24 10:28:06 +02:00
Benjamin Vray 84d867dbac [IMP] website, web_editor: add customize_show views to editor panel
After this commit, the customize_show views are automatically added in
the editor panel as page options in the "customize" tab.

Most of the customize_show views have been replaced by snippets options
but for some it was better to keep an auto population system so as not
to have to create too many bridge modules when it's not worth it
(e.g. My Portal page).

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 22bc9e142d [IMP] website_sale: stop showing variant option when not active
Since this commit [1], we don't want to display the "List View of
Variants" option on the product page if option "Variants" in settings
was disabled. Now that the customize show menu options have become
snippet options in edit mode, the code to do this has been adapted.

[1]: https://github.com/odoo/odoo/commit/1cd63d81908511ee136f0ca2600d85eab48f258f

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 823d46fc6f [IMP] website, *: adapt customize show options in website pages
*: website_crm, website_crm_partner_assign, website_customer,
   website_forum, website_hr_recruitment, website_membership,
   website_slides, website_slides_forum

This commit adapts "customize show" options from several website modules
by creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 208612b173 [IMP] website_event, *: move specific options to edit mode
*: website_event_meet

This commit adapts "customize show" options from website event modules
by creating new options available in edit mode. These "customize show"
options used custo JS code which was adapted to work with the global
options system.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
qsm-odoo d8db21f947 [MOV] website_event_meet: move editor option file
As the first commit of the merge of this work at [1], this moves files
without modifying them to preserve code history and ease forward-ports.

As this was about static XML being converted into python XML, it was
not done in the first commit but just before the relevant commit.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Benjamin Vray 92287ef450 [IMP] website_event, *: adapt customize show options in event pages
*: website_event_exhibitor, website_event_track

This commit adapts "customize show" options from website event modules
by creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 59e01b7a76 [IMP] website_blog: adapt customize show options in blog pages
This commit adapts "customize show" options from the website blog module
by creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 17a8a37e9b [IMP] website_sale, *: adapt customize show options in shop pages
*: website, website_sale_comparison, website_sale_loyalty,
   website_sale_slides, website_sale_wishlist

This commit adapts "customize show" options from website sale modules by
creating new options available in edit mode.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 9b1f4a84e3 [IMP] website: remove _cache_customize_show_views method
Remove _cache_customize_show_views method added by [1].
As the customize show options have been moved to edit mode. The
"customize_show" attributes will be less used.

[1]: https://github.com/odoo/odoo/commit/697f6007847e0cf209610acd533c5cd4d2c83296

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray dab8827e3b [IMP] web_editor: page options activated on click on the customize tab
With this commit, clicking on the "customize" tab automatically
activates the page options (if there are any). This commit also replaces
the name of the "style" tab by naming it "customize".

task-2710582
2022-06-24 10:28:05 +02:00
Benjamin Vray 1216cea321 [IMP] web_editor: add a new string attribute on snippet option
This commit introduces a new way to set the title of an option section
in the customize panel. The title can now be filled in a new "string"
attribute in the template of an option.

See merge commit for more information.

task-2710582
2022-06-24 10:28:05 +02:00
Younn Olivier 2eef2b5430 [FIX] website: return to the correct url after editing in backend
Before this commit, clicking on the breadcrumb item "Website Editor"
after an "Edit in backend" systray item click would not redirect to the
edited object path. It would redo the website_editor action with the
initial params (most often path is undefined, and the component will by
default redirect to '/').

Now, when clicking on the "Edit in backend" systray, the frontend path
of the edited object is saved in the service. The client action
component takes it as the default path for the iframe if there is one.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 3326281e1a [FIX] web, website: correct items order on website systray
Before that commit, after the OWL2 rebase, the website systray items
were shuffled following those steps:
- Install website_blog
- Go to the posts list
- Click on a post
-> Until now, the systray items are correctly sorted
- Go back to the posts list, clicking on the blog navbar menu
-> Items are shuffled

For now, a temporary fix is to add an empty div with the index of the
item as the data-attribute to somehow force the rerender of the systray
items. That bug should be investigated further.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
xO-Tx 8925df7e75 [IMP] website, *: add new content dialogs
*: website_blog, website_event, website_forum, website_livechat,
   website_sale, website_sale_slides, website_slides,
   website_slides_forum

The goal of this commit is to add dialogs to create new website content
using a 'target:new' action on the form view and an overridable
"website" form controller.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
qsm-odoo 2f6aa250eb [MOV] *: move some static XML to view definitions
*: website_event, website_forum, website_slides

As the first commit of the merge of this work at [1], this moves files
without modifying them to preserve code history and ease forward-ports.

This part is about moving static XML to non-static files where the
XML will be changed into view definitions (as some UI now become normal
backend views). This cannot be a standalone working move of course.
So it was not done in the first commit but here, just before the
relevant commits of the merge.

[1]: https://github.com/odoo/odoo/pull/89223

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier ac55f2bb11 [IMP] website, website_links: add Promote menu and SEO dialog
The media dialog is added in a later commit.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier f260e3c144 [IMP] website, *: add edit in backend systray dropdown
*: website_blog, website_customer, website_event_exhibitor,
   website_event_track, website_hr_recruitment, website_sale,
   website_slides

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 751f522d62 [FIX] web: fix NavBar currentAppSections getter patch
After OWL next was merged, an error popped up while patching the Navbar
currentAppSections getter, coming from the Enterprise NavBar render.
A setter was added on the Navbar component to allow for the patch.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 2c77b90eee [IMP] web_editor, website: add edit menu
This commit also suggests a way to conditionnaly display menus. Here the
website edit menu should only be visible when the website is displayed.

There may be a better way to filter out some menus. That feature will
be reviewed anyway as part of a `patch` the framework team would like to
avoid.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier c4a8f86265 [IMP] website, *: implement some "add new content" actions
*: website_sale, website_hr_recruitment

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn OlivierandArthur Detroux d2ed93f780 [IMP] website: switch to fullscreen when pressing esc
See merge commit for more information.

task-2687506

Co-authored-by: Arthur Detroux <ard@odoo.com>
2022-06-24 10:28:05 +02:00
Younn Olivier 028efcbffe [IMP] website: add publish systray item
See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier fbfe4d1fcb [IMP] website: allow to add a website page from the new content menu
See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00
Younn Olivier 3db77ce975 [IMP] website: add dialog component
This commit adds a generic Dialog component, for the website.
It has a default footer with two buttons.

See merge commit for more information.

task-2687506
2022-06-24 10:28:05 +02:00