[FIX] web: correct small KanbanConfigMenu position

**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) <mcm@odoo.com>
This commit is contained in:
Bruno Boi
2023-06-05 13:31:32 +02:00
parent 4034e5909b
commit 4e3f84f394
2 changed files with 8 additions and 1 deletions
@@ -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);
}
@@ -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"
/>
<t t-if="env.isSmall or !group.isFolded">
<Dropdown class="'o_kanban_config'" togglerClass="'btn px-2'" position="'bottom-end'" container="() => this.rootRef.el">
<Dropdown class="'o_kanban_config'" togglerClass="'btn px-2'" position="'bottom-end'" container="() => this._configDropdownContainer">
<t t-set-slot="toggler">
<i class="fa fa-gear opacity-50 opacity-100-hover" role="img" aria-label="Settings" title="Settings"/>
</t>