[FIX] web: add shortcut to cog menu

This commit adds the "alt+u" shortcut to open the cog menu in order
to match with the behavior of the actions menu.

task-3560446

closes odoo/odoo#140798

X-original-commit: fbf245cb81453e1fedbfd4649a8284546da44ffb
Related: odoo/enterprise#50074
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
This commit is contained in:
Julien Carion (juca)
2023-11-04 04:29:34 +00:00
committed by Mathieu Duckerts-Antoine
parent 221b11e7ac
commit 04a67936d5
2 changed files with 16 additions and 2 deletions
@@ -4,7 +4,7 @@ import { importRecordsItem } from "@base_import/import_records/import_records";
import { registry } from "@web/core/registry";
import { click, getFixture, selectDropdownItem } from "@web/../tests/helpers/utils";
import { click, getFixture, selectDropdownItem, triggerHotkey } from "@web/../tests/helpers/utils";
import { toggleActionMenu } from "@web/../tests/search/helpers";
import { makeView, setupViewRegistries } from "@web/../tests/views/helpers";
import { clearRegistryWithCleanup } from "@web/../tests/helpers/mock_env";
@@ -99,6 +99,20 @@ QUnit.module("Base Import Tests", (hooks) => {
}
);
QUnit.test("cog menu should open with alt+u shortcut", async function (assert) {
await makeView({
type: "list",
resModel: "foo",
serverData,
arch: '<tree/>',
config: {
actionType: "ir.actions.act_window",
},
});
await triggerHotkey("alt+u");
assert.containsOnce(target, ".o_cp_action_menus .o-dropdown--menu");
});
QUnit.test("import in cog menu dropdown in kanban", async function (assert) {
assert.expect(3);
@@ -5,7 +5,7 @@
<div t-if="hasItems" class="o_cp_action_menus d-flex align-items-center pe-2 gap-1">
<Dropdown class="'lh-1'" togglerClass="'d-print-none btn p-0 ms-1 lh-sm border-0'" menuClass="'lh-base'">
<t t-set-slot="toggler">
<i class="fa fa-cog"/>
<i class="fa fa-cog" data-hotkey="u"/>
</t>
<t t-if="printItems.length">