[IMP] website: support all menus edition from a mobile device

Commit [1] (later refactored by [2]) hid the buttons which allow to
edit the main website menu and custom website menus (as the ones in
event pages), when using Odoo on a mobile device. Reading the code and
related commits, this seemed to have been done for no apparent reason.
After testing 16.0, it appears that menu edition from mobile devices was
actually not working: the re-ordering UI was strangely hidden.

After investigation, it appears that this was solved by chance, thanks
to the unrelated commit [3] in 16.2. That commit indeed removes legacy
CSS which was hiding all jQuery.ui.sortable UI elements by mistake.

In 17.0, this was further improved anyway by not using jQuery.ui anymore
(with [4]) and thus editing website menus from a mobile device works now
perfectly... except that the buttons to open the menus edition dialogs
were still hidden. This commit enables them. It was chosen to do it in
17.0 and not 16.2 as it is more an improvement than a fix in the end.

[1]: https://github.com/odoo/odoo/commit/78c59afd133de8308f4eeb6e1a2a930d870878e7
[2]: https://github.com/odoo/odoo/commit/2dc82504e08cc370b67cdf1d580f26705870a085
[3]: https://github.com/odoo/odoo/commit/ee3e28987eb1ec23b8bacc7c4043d9690aada144
[4]: https://github.com/odoo/odoo/commit/a4b1c268131ed771dd68616a26a9f1ce50a189f0

Related to task-3645985

closes odoo/odoo#150530

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
qsm-odoo
2024-01-23 22:52:00 +00:00
parent 3789a944ac
commit 941f63aa2a
@@ -80,7 +80,6 @@ registry.category('website_custom_menus').add('website.menu_edit_menu', {
Component: EditMenuDialog,
isDisplayed: (env) => !!env.services.website.currentWebsite
&& env.services.website.isDesigner
&& !env.services.ui.isSmall
&& !env.services.website.currentWebsite.metadata.translatable,
});
registry.category('website_custom_menus').add('website.menu_optimize_seo', {
@@ -116,6 +115,5 @@ registry.category('website_custom_menus').add('website.custom_menu_edit_menu', {
// the 'EditMenuDialog' component.
isDisplayed: (env) => env.services.website.currentWebsite
&& env.services.website.currentWebsite.metadata.contentMenus
&& env.services.website.currentWebsite.metadata.contentMenus.length
&& !env.services.ui.isSmall,
&& env.services.website.currentWebsite.metadata.contentMenus.length,
});