[FIX] website: review "this page" sub-menus visibility for non-designers

The page properties and optimize seo menu items were not explicitly
marked as not shown for non-designers. An unrelated bug currently hides
those items by chance... but as that bug will be solved in a further
commit of this same PR, it had now to be explicitly hidden in that case.

Note that after this a related bug remains: the "This page" title on
top of those sub menus is left visible if no sub menu is shown and
clicking on it actually crashes. That bug will be solved in another PR.

Also note that it might make sense to show the optimize seo dialog for
restricted editor users when they have the correct rights... but this
would be an improvement to consider in master.

Related to task-3129034

X-original-commit: 26c46ba70bac227c2b6a28a941e5c4f13bfe9029
Part-of: odoo/odoo#111289
This commit is contained in:
qsm-odoo
2023-02-03 05:09:11 +01:00
parent fa854232ff
commit 94e2eefca2
@@ -80,6 +80,7 @@ registry.category('website_custom_menus').add('website.menu_edit_menu', {
registry.category('website_custom_menus').add('website.menu_optimize_seo', {
Component: OptimizeSEODialog,
isDisplayed: (env) => env.services.website.currentWebsite
&& env.services.website.isDesigner
&& !!env.services.website.currentWebsite.metadata.mainObject,
});
registry.category('website_custom_menus').add('website.menu_current_page', {
@@ -95,6 +96,7 @@ registry.category('website_custom_menus').add('website.menu_ace_editor', {
registry.category('website_custom_menus').add('website.menu_page_properties', {
Component: PagePropertiesDialog,
isDisplayed: (env) => env.services.website.currentWebsite
&& env.services.website.isDesigner
&& !!env.services.website.currentWebsite.metadata.mainObject
&& env.services.website.currentWebsite.metadata.mainObject.model === 'website.page',
getProps: (services) => ({