[FIX] website: fix page properties dialog buttons

Steps to reproduce:

Go to the website's home page > Site > Properties > The control panel
buttons in the footer of the "Page Properties" dialog are not aligned
correctly.

The "Page Properties" dialog extends the `FormViewDialog` component and
updates its template using `xpath` to add extra buttons on the right
side of the footer (to "duplicate" & "delete" the current page).
But since [1], a `w-100` class has been added to the default button
container (`.o_cp_buttons`) on form view dialogs to get the same result
as the "More Options" button on `Calendar > Quick Create` dialogs (the
difference here is that the extra button was added inside the default
buttons wrapper, while on page properties, the buttons are added next
to it).

The goal of this commit is to "safely" fix this misalignment issue on
stable by simply removing the `w-100` class for the page properties
dialog. On master, we will adapt the page properties buttons to have
the same structure as on the calendar dialog.

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

task-3642712

closes odoo/odoo#146541

Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
This commit is contained in:
Mehdi Outagant (MOU)
2023-12-22 10:36:26 +00:00
parent 00b7bc6d0e
commit da57ad6945
@@ -7,7 +7,7 @@ import {sprintf} from "@web/core/utils/strings";
import {WebsiteDialog} from './dialog';
import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog";
import { renderToFragment } from "@web/core/utils/render";
import { Component, useEffect, useState, xml, useRef } from "@odoo/owl";
import { Component, useEffect, useState, xml, useRef, onMounted } from "@odoo/owl";
export class PageDependencies extends Component {
setup() {
@@ -152,6 +152,14 @@ export class PagePropertiesDialog extends FormViewDialog {
this.website = useService('website');
this.viewProps.resId = this.resId;
// TODO: Remove in master, the `w-100` is causing a button's
// misalignment on the page properties dialog, this should be
// replaced by adding extra buttons to the default container in
// `this.viewProps.buttonTemplate`.
onMounted(() => {
this.modalRef.el?.querySelector(".modal-footer .o_cp_buttons")?.classList.remove("w-100");
});
}
get resId() {