From 4e3f84f394bb154884d2fd1a3839acec652084f5 Mon Sep 17 00:00:00 2001 From: Bruno Boi Date: Thu, 25 May 2023 15:18:01 +0000 Subject: [PATCH] [FIX] web: correct small KanbanConfigMenu position MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Before this commit** Since afbdce664 the kanban group's config menu is not contained into its kanban-group element but in the kanban-header element. This lead to a wrong placement when the dropdown only has one item. As this case is rare, it had not been noticed. **To reproduce** Steps: - Install project_enterprise app. - Share an editable project with Joel Willis - Make sure in the project's settings than its visibility is set to public (selection value: 'portal') - Log in as portal user - Access http://your-odoo-db/my/projects/1 - Open a kanban group's config dropdown menu. Issue: - If it has only one item to display, it will be placed on the left of its toggler instead of the bottom. **After this commit** It is now contained with the same element as originally intended. The menu is now properly placed in the bottom. **Note** Not tested as this was (and still is) a workaround for a stacking context issue. The core Dropdown component is being refactored and its "container" prop will become useless: meaning this piece of code will disappear. task-3293310 closes odoo/odoo#122944 X-original-commit: 1de541db9c6b02830615f078d4d44fd785146d35 Signed-off-by: Michaƫl Mattiello (mcm) --- addons/web/static/src/views/kanban/kanban_header.js | 7 +++++++ addons/web/static/src/views/kanban/kanban_header.xml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/views/kanban/kanban_header.js b/addons/web/static/src/views/kanban/kanban_header.js index db150abf726..597201dbfd7 100644 --- a/addons/web/static/src/views/kanban/kanban_header.js +++ b/addons/web/static/src/views/kanban/kanban_header.js @@ -60,6 +60,13 @@ export class KanbanHeader extends Component { // Getters // ------------------------------------------------------------------------ + get _configDropdownContainer() { + // FIXME: please do not override this getter in other modules. + // The dropdown's container prop is only used here as a workaround of + // a stacking context issue. It should be removed in the next release. + return this.rootRef.el.closest(`.o_kanban_group[data-id="${this.props.group.id}"]`); + } + get progressBar() { return this.props.progressBarState?.getGroupInfo(this.group); } diff --git a/addons/web/static/src/views/kanban/kanban_header.xml b/addons/web/static/src/views/kanban/kanban_header.xml index 0d05f727b62..9ee9a45bd9c 100644 --- a/addons/web/static/src/views/kanban/kanban_header.xml +++ b/addons/web/static/src/views/kanban/kanban_header.xml @@ -13,7 +13,7 @@ class="o_column_title flex-grow-1 d-inline-block mw-100 text-truncate fs-4 fw-bold align-top text-900" /> - +