0
0
Fork 0

refactor: refs #7889 deleted subtitle attr and use keyBinding instead

This commit is contained in:
Jon Elias 2024-09-06 10:00:07 +02:00
parent 585919a4d9
commit 5d78f564dd
14 changed files with 16 additions and 15 deletions

View File

@ -15,6 +15,7 @@ export default {
const handleKeyDown = (event) => { const handleKeyDown = (event) => {
const { ctrlKey, altKey, key } = event; const { ctrlKey, altKey, key } = event;
if (ctrlKey && altKey && keyBindingMap[key] && !isNotified) { if (ctrlKey && altKey && keyBindingMap[key] && !isNotified) {
event.preventDefault(); event.preventDefault();
router.push(keyBindingMap[key]); router.push(keyBindingMap[key]);

View File

@ -55,10 +55,21 @@ const pinnedModules = computed(() => navigation.getPinnedModules());
> >
<div class="text-center text-primary button-text"> <div class="text-center text-primary button-text">
{{ t(item.title) }} {{ t(item.title) }}
<div v-if="item.subtitle"> <div v-if="item.keyBinding">
{{ '(' + item.subtitle + ')' }} {{
'(' +
(item.keyBinding == '€'
? 'E'
: item.keyBinding) +
')'
}}
<QTooltip> <QTooltip>
{{ 'Ctrl + Alt + ' + item.subtitle }} {{
'Ctrl + Alt + ' +
(item.keyBinding == '€'
? 'E'
: item.keyBinding.toUpperCase())
}}
</QTooltip> </QTooltip>
</div> </div>
</div> </div>

View File

@ -5,7 +5,6 @@ export default {
name: 'Supplier', name: 'Supplier',
meta: { meta: {
title: 'suppliers', title: 'suppliers',
subtitle: 'P',
icon: 'vn:supplier', icon: 'vn:supplier',
moduleName: 'Supplier', moduleName: 'Supplier',
keyBinding: 'p', keyBinding: 'p',

View File

@ -5,7 +5,6 @@ export default {
name: 'Account', name: 'Account',
meta: { meta: {
title: 'users', title: 'users',
subtitle: 'U',
icon: 'face', icon: 'face',
moduleName: 'Account', moduleName: 'Account',
keyBinding: 'u', keyBinding: 'u',

View File

@ -5,7 +5,6 @@ export default {
path: '/claim', path: '/claim',
meta: { meta: {
title: 'claims', title: 'claims',
subtitle: 'R',
icon: 'vn:claims', icon: 'vn:claims',
moduleName: 'Claim', moduleName: 'Claim',
keyBinding: 'r', keyBinding: 'r',

View File

@ -5,7 +5,6 @@ export default {
name: 'Customer', name: 'Customer',
meta: { meta: {
title: 'customers', title: 'customers',
subtitle: 'C',
icon: 'vn:client', icon: 'vn:client',
moduleName: 'Customer', moduleName: 'Customer',
keyBinding: 'c', keyBinding: 'c',

View File

@ -5,7 +5,6 @@ export default {
name: 'Entry', name: 'Entry',
meta: { meta: {
title: 'entries', title: 'entries',
subtitle: 'E',
icon: 'vn:entry', icon: 'vn:entry',
moduleName: 'Entry', moduleName: 'Entry',
keyBinding: '€', keyBinding: '€',

View File

@ -5,7 +5,6 @@ export default {
name: 'Item', name: 'Item',
meta: { meta: {
title: 'items', title: 'items',
subtitle: 'A',
icon: 'vn:item', icon: 'vn:item',
moduleName: 'Item', moduleName: 'Item',
keyBinding: 'a', keyBinding: 'a',

View File

@ -5,7 +5,6 @@ export default {
name: 'Monitor', name: 'Monitor',
meta: { meta: {
title: 'monitors', title: 'monitors',
subtitle: 'M',
icon: 'grid_view', icon: 'grid_view',
moduleName: 'Monitor', moduleName: 'Monitor',
keyBinding: 'm', keyBinding: 'm',

View File

@ -5,7 +5,6 @@ export default {
name: 'Order', name: 'Order',
meta: { meta: {
title: 'order', title: 'order',
subtitle: 'O',
icon: 'vn:basket', icon: 'vn:basket',
moduleName: 'Order', moduleName: 'Order',
keyBinding: 'o', keyBinding: 'o',

View File

@ -5,7 +5,6 @@ export default {
path: '/ticket', path: '/ticket',
meta: { meta: {
title: 'tickets', title: 'tickets',
subtitle: 'T',
icon: 'vn:ticket', icon: 'vn:ticket',
moduleName: 'Ticket', moduleName: 'Ticket',
keyBinding: 't', keyBinding: 't',

View File

@ -5,7 +5,6 @@ export default {
name: 'Worker', name: 'Worker',
meta: { meta: {
title: 'workers', title: 'workers',
subtitle: 'W',
icon: 'vn:worker', icon: 'vn:worker',
moduleName: 'Worker', moduleName: 'Worker',
keyBinding: 'w', keyBinding: 'w',

View File

@ -5,7 +5,6 @@ export default {
name: 'Zone', name: 'Zone',
meta: { meta: {
title: 'zones', title: 'zones',
subtitle: 'Z',
icon: 'vn:zone', icon: 'vn:zone',
moduleName: 'Zone', moduleName: 'Zone',
keyBinding: 'z', keyBinding: 'z',

View File

@ -72,7 +72,7 @@ export const useNavigationStore = defineStore('navigationStore', () => {
if (meta) { if (meta) {
item.title = `globals.pageTitles.${meta.title}`; item.title = `globals.pageTitles.${meta.title}`;
item.icon = meta.icon; item.icon = meta.icon;
item.subtitle = meta.subtitle; item.keyBinding = meta.keyBinding;
} }
parent.push(item); parent.push(item);