From 5d78f564ddc3f4a64e2627c6108e32fc388005e2 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 6 Sep 2024 10:00:07 +0200 Subject: [PATCH] refactor: refs #7889 deleted subtitle attr and use keyBinding instead --- src/boot/mainShortcutMixin.js | 1 + src/pages/Dashboard/DashboardMain.vue | 17 ++++++++++++++--- src/router/modules/Supplier.js | 1 - src/router/modules/account.js | 1 - src/router/modules/claim.js | 1 - src/router/modules/customer.js | 1 - src/router/modules/entry.js | 1 - src/router/modules/item.js | 1 - src/router/modules/monitor.js | 1 - src/router/modules/order.js | 1 - src/router/modules/ticket.js | 1 - src/router/modules/worker.js | 1 - src/router/modules/zone.js | 1 - src/stores/useNavigationStore.js | 2 +- 14 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/boot/mainShortcutMixin.js b/src/boot/mainShortcutMixin.js index c684fc924..3b5c604b7 100644 --- a/src/boot/mainShortcutMixin.js +++ b/src/boot/mainShortcutMixin.js @@ -15,6 +15,7 @@ export default { const handleKeyDown = (event) => { const { ctrlKey, altKey, key } = event; + if (ctrlKey && altKey && keyBindingMap[key] && !isNotified) { event.preventDefault(); router.push(keyBindingMap[key]); diff --git a/src/pages/Dashboard/DashboardMain.vue b/src/pages/Dashboard/DashboardMain.vue index eaeddb682..22073c6d8 100644 --- a/src/pages/Dashboard/DashboardMain.vue +++ b/src/pages/Dashboard/DashboardMain.vue @@ -55,10 +55,21 @@ const pinnedModules = computed(() => navigation.getPinnedModules()); >
{{ t(item.title) }} -
- {{ '(' + item.subtitle + ')' }} +
+ {{ + '(' + + (item.keyBinding == '€' + ? 'E' + : item.keyBinding) + + ')' + }} - {{ 'Ctrl + Alt + ' + item.subtitle }} + {{ + 'Ctrl + Alt + ' + + (item.keyBinding == '€' + ? 'E' + : item.keyBinding.toUpperCase()) + }}
diff --git a/src/router/modules/Supplier.js b/src/router/modules/Supplier.js index e620e485c..143d7c824 100644 --- a/src/router/modules/Supplier.js +++ b/src/router/modules/Supplier.js @@ -5,7 +5,6 @@ export default { name: 'Supplier', meta: { title: 'suppliers', - subtitle: 'P', icon: 'vn:supplier', moduleName: 'Supplier', keyBinding: 'p', diff --git a/src/router/modules/account.js b/src/router/modules/account.js index dbf641c4a..34f804b18 100644 --- a/src/router/modules/account.js +++ b/src/router/modules/account.js @@ -5,7 +5,6 @@ export default { name: 'Account', meta: { title: 'users', - subtitle: 'U', icon: 'face', moduleName: 'Account', keyBinding: 'u', diff --git a/src/router/modules/claim.js b/src/router/modules/claim.js index eb7a348fe..d597267b2 100644 --- a/src/router/modules/claim.js +++ b/src/router/modules/claim.js @@ -5,7 +5,6 @@ export default { path: '/claim', meta: { title: 'claims', - subtitle: 'R', icon: 'vn:claims', moduleName: 'Claim', keyBinding: 'r', diff --git a/src/router/modules/customer.js b/src/router/modules/customer.js index 1e74b77bd..5b73ddc84 100644 --- a/src/router/modules/customer.js +++ b/src/router/modules/customer.js @@ -5,7 +5,6 @@ export default { name: 'Customer', meta: { title: 'customers', - subtitle: 'C', icon: 'vn:client', moduleName: 'Customer', keyBinding: 'c', diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js index d3639e2f1..3dd97a7a6 100644 --- a/src/router/modules/entry.js +++ b/src/router/modules/entry.js @@ -5,7 +5,6 @@ export default { name: 'Entry', meta: { title: 'entries', - subtitle: 'E', icon: 'vn:entry', moduleName: 'Entry', keyBinding: '€', diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 80dcf4ae0..48e19dd54 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -5,7 +5,6 @@ export default { name: 'Item', meta: { title: 'items', - subtitle: 'A', icon: 'vn:item', moduleName: 'Item', keyBinding: 'a', diff --git a/src/router/modules/monitor.js b/src/router/modules/monitor.js index 74a2826e2..7342a5904 100644 --- a/src/router/modules/monitor.js +++ b/src/router/modules/monitor.js @@ -5,7 +5,6 @@ export default { name: 'Monitor', meta: { title: 'monitors', - subtitle: 'M', icon: 'grid_view', moduleName: 'Monitor', keyBinding: 'm', diff --git a/src/router/modules/order.js b/src/router/modules/order.js index 861eb7938..bfa37fce5 100644 --- a/src/router/modules/order.js +++ b/src/router/modules/order.js @@ -5,7 +5,6 @@ export default { name: 'Order', meta: { title: 'order', - subtitle: 'O', icon: 'vn:basket', moduleName: 'Order', keyBinding: 'o', diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index 9c9b2cbf3..0f6fc9b22 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -5,7 +5,6 @@ export default { path: '/ticket', meta: { title: 'tickets', - subtitle: 'T', icon: 'vn:ticket', moduleName: 'Ticket', keyBinding: 't', diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js index 4395319bf..b2716474b 100644 --- a/src/router/modules/worker.js +++ b/src/router/modules/worker.js @@ -5,7 +5,6 @@ export default { name: 'Worker', meta: { title: 'workers', - subtitle: 'W', icon: 'vn:worker', moduleName: 'Worker', keyBinding: 'w', diff --git a/src/router/modules/zone.js b/src/router/modules/zone.js index c82616286..1f27cc76f 100644 --- a/src/router/modules/zone.js +++ b/src/router/modules/zone.js @@ -5,7 +5,6 @@ export default { name: 'Zone', meta: { title: 'zones', - subtitle: 'Z', icon: 'vn:zone', moduleName: 'Zone', keyBinding: 'z', diff --git a/src/stores/useNavigationStore.js b/src/stores/useNavigationStore.js index 67b632b00..4589426f8 100644 --- a/src/stores/useNavigationStore.js +++ b/src/stores/useNavigationStore.js @@ -72,7 +72,7 @@ export const useNavigationStore = defineStore('navigationStore', () => { if (meta) { item.title = `globals.pageTitles.${meta.title}`; item.icon = meta.icon; - item.subtitle = meta.subtitle; + item.keyBinding = meta.keyBinding; } parent.push(item);