From eca68b76a00a46b28182886b4e65f9e21a7d8580 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 3 Sep 2024 10:31:01 +0200 Subject: [PATCH 1/3] perf: improve mainShrotcutMixin --- src/boot/mainShortcutMixin.js | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/boot/mainShortcutMixin.js b/src/boot/mainShortcutMixin.js index c4d37fd73..3b5c604b7 100644 --- a/src/boot/mainShortcutMixin.js +++ b/src/boot/mainShortcutMixin.js @@ -1,8 +1,10 @@ import routes from 'src/router/modules'; - import { useRouter } from 'vue-router'; + +let isNotified = false; + export default { - mounted: function () { + created: function () { const router = useRouter(); const keyBindingMap = routes .filter((route) => route.meta.keyBinding) @@ -10,14 +12,27 @@ export default { map[route.meta.keyBinding.toLowerCase()] = route.path; return map; }, {}); + const handleKeyDown = (event) => { const { ctrlKey, altKey, key } = event; - event.preventDefault(); - if (ctrlKey && altKey && keyBindingMap[key]) { + + if (ctrlKey && altKey && keyBindingMap[key] && !isNotified) { + event.preventDefault(); router.push(keyBindingMap[key]); + isNotified = true; + } + }; + + const handleKeyUp = (event) => { + const { ctrlKey, altKey } = event; + + // Resetea la bandera cuando se sueltan las teclas ctrl o alt + if (!ctrlKey || !altKey) { + isNotified = false; } }; window.addEventListener('keydown', handleKeyDown); + window.addEventListener('keyup', handleKeyUp); }, }; From 4e73e74c2c5c7be8545b1be9a845227cb8bd5998 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 3 Sep 2024 10:31:24 +0200 Subject: [PATCH 2/3] fix: add border-top --- src/css/app.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/src/css/app.scss b/src/css/app.scss index 41d3df795..357c9ecdb 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -253,6 +253,7 @@ input::-webkit-inner-spin-button { } td { font-size: 11pt; + border-top: 1px solid var(--vn-page-color); border-collapse: collapse; } } From 397a2606f16065f8c8ee95548c89cd186c3faf0d Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 3 Sep 2024 10:31:37 +0200 Subject: [PATCH 3/3] fix: cli warnings --- src/pages/Claim/Card/ClaimSummary.vue | 3 +-- src/pages/Entry/EntryList.vue | 3 --- src/pages/InvoiceOut/InvoiceOutList.vue | 1 - src/pages/Item/Card/ItemBotanical.vue | 2 -- src/pages/Item/ItemRequest.vue | 1 - src/pages/Worker/Card/WorkerSummary.vue | 1 - src/pages/Zone/Card/ZoneCard.vue | 12 +----------- 7 files changed, 2 insertions(+), 21 deletions(-) diff --git a/src/pages/Claim/Card/ClaimSummary.vue b/src/pages/Claim/Card/ClaimSummary.vue index 9538e753f..244eb5936 100644 --- a/src/pages/Claim/Card/ClaimSummary.vue +++ b/src/pages/Claim/Card/ClaimSummary.vue @@ -1,11 +1,10 @@