diff --git a/src/components/FilterItemForm.vue b/src/components/FilterItemForm.vue index cacfde1b3..cca8d80c3 100644 --- a/src/components/FilterItemForm.vue +++ b/src/components/FilterItemForm.vue @@ -188,7 +188,7 @@ const selectItem = ({ id }) => { > diff --git a/src/components/FilterTravelForm.vue b/src/components/FilterTravelForm.vue index c522d0269..4aad327b2 100644 --- a/src/components/FilterTravelForm.vue +++ b/src/components/FilterTravelForm.vue @@ -196,7 +196,7 @@ const selectTravel = ({ id }) => { > diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 9a9949499..8e83bf579 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -77,6 +77,7 @@ watch( function findMatches(search, item) { const matches = []; function findRoute(search, item) { + if (!item?.children) return; for (const child of item.children) { if (search?.indexOf(child.name) > -1) { matches.push(child); @@ -92,7 +93,7 @@ function findMatches(search, item) { } function addChildren(module, route, parent) { - const menus = route?.meta?.menu ?? route?.menus?.[props.source]; //backwards compatible + const menus = route?.meta?.menu; if (!menus) return; const matches = findMatches(menus, route); @@ -107,11 +108,7 @@ function getRoutes() { main: getMainRoutes, card: getCardRoutes, }; - try { - handleRoutes[props.source](); - } catch (error) { - throw new Error(`Method is not defined`); - } + handleRoutes[props.source](); } function getMainRoutes() { const modules = Object.assign([], navigation.getModules().value); @@ -122,7 +119,6 @@ function getMainRoutes() { ); if (!moduleDef) continue; item.children = []; - addChildren(item.module, moduleDef, item.children); } @@ -132,21 +128,16 @@ function getMainRoutes() { function getCardRoutes() { const currentRoute = route.matched[1]; const currentModule = toLowerCamel(currentRoute.name); - let moduleDef = routes.find((route) => toLowerCamel(route.name) === currentModule); + let moduleDef; - if (!moduleDef) return; - if (!moduleDef?.menus) moduleDef = betaGetRoutes(); - addChildren(currentModule, moduleDef, items.value); -} - -function betaGetRoutes() { - let menuRoute; let index = route.matched.length - 1; - while (!menuRoute && index > 0) { - if (route.matched[index]?.meta?.menu) menuRoute = route.matched[index]; + while (!moduleDef && index > 0) { + if (route.matched[index]?.meta?.menu) moduleDef = route.matched[index]; index--; } - return menuRoute; + + if (!moduleDef) return; + addChildren(currentModule, moduleDef, items.value); } async function togglePinned(item, event) { diff --git a/src/components/__tests__/Leftmenu.spec.js b/src/components/__tests__/Leftmenu.spec.js index 4ab8b527f..ef82cf9ad 100644 --- a/src/components/__tests__/Leftmenu.spec.js +++ b/src/components/__tests__/Leftmenu.spec.js @@ -15,10 +15,7 @@ vi.mock('src/router/modules', () => ({ meta: { title: 'customers', icon: 'vn:client', - }, - menus: { - main: ['CustomerList', 'CustomerCreate'], - card: ['CustomerBasicData'], + menu: ['CustomerList', 'CustomerCreate'], }, children: [ { @@ -98,7 +95,7 @@ vi.spyOn(vueRouter, 'useRoute').mockReturnValue({ icon: 'vn:client', moduleName: 'Customer', keyBinding: 'c', - menu: 'customer', + menu: ['customer'], }, }, ], @@ -260,15 +257,6 @@ describe('Leftmenu as main', () => { }); }); - it('should handle a single matched route with a menu', () => { - const route = { - matched: [{ meta: { menu: 'customer' } }], - }; - - const result = vm.betaGetRoutes(); - - expect(result.meta.menu).toEqual(route.matched[0].meta.menu); - }); it('should get routes for main source', () => { vm.props.source = 'main'; vm.getRoutes(); @@ -351,8 +339,9 @@ describe('addChildren', () => { it('should handle routes with no meta menu', () => { const route = { - meta: {}, - menus: {}, + meta: { + menu: [], + }, }; const parent = []; diff --git a/src/css/app.scss b/src/css/app.scss index b8b53a929..5befd150b 100644 --- a/src/css/app.scss +++ b/src/css/app.scss @@ -15,6 +15,7 @@ body.body--light { --vn-empty-tag: #acacac; --vn-black-text-color: black; --vn-text-color-contrast: white; + --vn-link-color: #1e90ff; background-color: var(--vn-page-color); @@ -38,6 +39,7 @@ body.body--dark { --vn-empty-tag: #2d2d2d; --vn-black-text-color: black; --vn-text-color-contrast: black; + --vn-link-color: #66bfff; background-color: var(--vn-page-color); @@ -49,7 +51,7 @@ a { } .link { - color: $color-link; + color: var(--vn-link-color); cursor: pointer; &--white { @@ -58,14 +60,14 @@ a { } .tx-color-link { - color: $color-link !important; + color: var(--vn-link-color) !important; } .tx-color-font { - color: $color-link !important; + color: var(--vn-link-color) !important; } .header-link { - color: $color-link !important; + color: var(--vn-link-color) !important; cursor: pointer; border-bottom: solid $primary; border-width: 2px; diff --git a/src/css/quasar.variables.scss b/src/css/quasar.variables.scss index 22c6d2b56..45d18af7e 100644 --- a/src/css/quasar.variables.scss +++ b/src/css/quasar.variables.scss @@ -24,7 +24,6 @@ $alert: $negative; $white: #fff; $dark: #3d3d3d; // custom -$color-link: #66bfff; $color-spacer-light: #a3a3a31f; $color-spacer: #7979794d; $border-thin-light: 1px solid $color-spacer-light; diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 462472d54..2087fd4e7 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -532,6 +532,7 @@ ticket: customerCard: Customer card ticketList: Ticket List newOrder: New Order + ticketClaimed: Claimed ticket boxing: expedition: Expedition created: Created diff --git a/src/i18n/locale/es.yml b/src/i18n/locale/es.yml index 96838344d..3956b2e4c 100644 --- a/src/i18n/locale/es.yml +++ b/src/i18n/locale/es.yml @@ -539,6 +539,7 @@ ticket: customerCard: Ficha del cliente ticketList: Listado de tickets newOrder: Nuevo pedido + ticketClaimed: Ticket reclamado boxing: expedition: Expedición created: Creado diff --git a/src/pages/Account/Alias/Card/AliasSummary.vue b/src/pages/Account/Alias/Card/AliasSummary.vue index b4b9abd25..cfd33ec82 100644 --- a/src/pages/Account/Alias/Card/AliasSummary.vue +++ b/src/pages/Account/Alias/Card/AliasSummary.vue @@ -5,6 +5,7 @@ import { useI18n } from 'vue-i18n'; import CardSummary from 'components/ui/CardSummary.vue'; import VnLv from 'src/components/ui/VnLv.vue'; +import VnTitle from 'src/components/common/VnTitle.vue'; const route = useRoute(); const { t } = useI18n(); @@ -27,13 +28,10 @@ const entityId = computed(() => $props.id || route.params.id);