diff --git a/src/components/NavBar.vue b/src/components/NavBar.vue index 7d09b09b8..6102dca55 100644 --- a/src/components/NavBar.vue +++ b/src/components/NavBar.vue @@ -7,6 +7,7 @@ import { useStateStore } from 'stores/useStateStore'; import { useQuasar } from 'quasar'; import PinnedModules from './PinnedModules.vue'; import UserPanel from 'components/UserPanel.vue'; +import VnBreadCrumbs from './common/VnBreadCrumbs.vue'; const { t } = useI18n(); const session = useSession(); @@ -61,6 +62,7 @@ const pinnedModulesRef = ref(); {{ appName }} + @@ -112,6 +114,7 @@ const pinnedModulesRef = ref();
+ diff --git a/src/components/common/VnBreadCrumbs.vue b/src/components/common/VnBreadCrumbs.vue new file mode 100644 index 000000000..64c01ae28 --- /dev/null +++ b/src/components/common/VnBreadCrumbs.vue @@ -0,0 +1,100 @@ + + + diff --git a/src/components/ui/VnSearchbar.vue b/src/components/ui/VnSearchbar.vue index af6999b5b..693d6fce2 100644 --- a/src/components/ui/VnSearchbar.vue +++ b/src/components/ui/VnSearchbar.vue @@ -105,7 +105,11 @@ async function search() { class="cursor-pointer" /> - + {{ props.info }} diff --git a/src/composables/useCamelCase.js b/src/composables/useCamelCase.js new file mode 100644 index 000000000..5285b022a --- /dev/null +++ b/src/composables/useCamelCase.js @@ -0,0 +1,3 @@ +export function useCamelCase(value) { + return value.replace(/[-_](.)/g, (_, char) => char.toUpperCase()); +} diff --git a/src/composables/useFirstUpper.js b/src/composables/useFirstUpper.js new file mode 100644 index 000000000..36378c05f --- /dev/null +++ b/src/composables/useFirstUpper.js @@ -0,0 +1,3 @@ +export function useFirstUpper(str) { + return str && str.charAt(0).toUpperCase() + str.substr(1); +} diff --git a/src/pages/Wagon/Card/WagonCard.vue b/src/pages/Wagon/Card/WagonCard.vue new file mode 100644 index 000000000..18ec121e3 --- /dev/null +++ b/src/pages/Wagon/Card/WagonCard.vue @@ -0,0 +1,29 @@ + + + + +es: + Search customer: Buscar cliente + You can search by customer id or name: Puedes buscar por id o nombre del cliente + diff --git a/src/pages/Wagon/Type/Card/WagonTypeCard.vue b/src/pages/Wagon/Type/Card/WagonTypeCard.vue new file mode 100644 index 000000000..a23122947 --- /dev/null +++ b/src/pages/Wagon/Type/Card/WagonTypeCard.vue @@ -0,0 +1,26 @@ + + + + +es: + Search customer: Buscar cliente + You can search by customer id or name: Puedes buscar por id o nombre del cliente + diff --git a/src/router/modules/route.js b/src/router/modules/route.js index a3550885c..acda898de 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -21,13 +21,13 @@ export default { redirect: { name: 'CmrList' }, children: [ { - path: 'cmr/list', + path: 'cmr', name: 'CmrList', meta: { title: 'cmrsList', icon: 'fact_check', }, - component: () => import('src/pages/Route/Cmr/CmrList.vue') + component: () => import('src/pages/Route/Cmr/CmrList.vue'), }, ], }, diff --git a/src/router/modules/wagon.js b/src/router/modules/wagon.js index 02513d5a8..5a491cf1e 100644 --- a/src/router/modules/wagon.js +++ b/src/router/modules/wagon.js @@ -11,11 +11,11 @@ export default { redirect: { name: 'WagonMain' }, menus: { main: ['WagonList', 'WagonTypeList'], - card: [], + card: ['WagonEdit'], }, children: [ { - path: '/wagon', + path: '', name: 'WagonMain', component: () => import('src/pages/Wagon/WagonMain.vue'), redirect: { name: 'WagonList' }, @@ -27,7 +27,7 @@ export default { title: 'wagonsList', icon: 'vn:trolley', }, - component: () => import('src/pages/Wagon/WagonList.vue') + component: () => import('src/pages/Wagon/WagonList.vue'), }, { path: 'create', @@ -36,53 +36,78 @@ export default { title: 'wagonCreate', icon: 'create', }, - component: () => import('src/pages/Wagon/WagonCreate.vue') + component: () => import('src/pages/Wagon/WagonCreate.vue'), }, { - path: ':id/edit', + path: 'type', + name: 'WagonTypeMain', + meta: { + title: 'typesList', + icon: 'view_list', + }, + redirect: { name: 'WagonTypeList' }, + children: [ + { + path: 'list', + name: 'WagonTypeList', + meta: { + title: 'typesList', + icon: 'view_list', + }, + component: () => + import('src/pages/Wagon/Type/WagonTypeList.vue'), + }, + { + path: 'create', + name: 'WagonTypeCreate', + meta: { + title: 'typeCreate', + icon: 'create', + }, + component: () => + import('src/pages/Wagon/Type/WagonTypeCreate.vue'), + }, + { + path: ':id', + name: 'WagonTypeCard', + component: () => + import('src/pages/Wagon/Type/Card/WagonTypeCard.vue'), + redirect: { name: 'WagonTypeEdit' }, + children: [ + { + path: 'edit', + name: 'WagonTypeEdit', + meta: { + title: 'typeEdit', + icon: 'edit', + }, + component: () => + import( + 'src/pages/Wagon/Type/WagonTypeCreate.vue' + ), + }, + ], + }, + ], + }, + ], + }, + { + name: 'WagonCard', + path: ':id', + component: () => import('src/pages/Wagon/Card/WagonCard.vue'), + redirect: { name: 'WagonEdit' }, + children: [ + { + path: 'edit', name: 'WagonEdit', meta: { title: 'wagonEdit', icon: 'edit', }, - component: () => import('src/pages/Wagon/WagonCreate.vue') + component: () => import('src/pages/Wagon/WagonCreate.vue'), }, ], }, - { - path: '/wagon/type', - name: 'WagonTypeMain', - component: () => import('src/pages/Wagon/WagonMain.vue'), - redirect: { name: 'WagonTypeList' }, - children: [ - { - path: 'list', - name: 'WagonTypeList', - meta: { - title: 'typesList', - icon: 'view_list', - }, - component: () => import('src/pages/Wagon/Type/WagonTypeList.vue') - }, - { - path: 'create', - name: 'WagonTypeCreate', - meta: { - title: 'typeCreate', - icon: 'create', - }, - component: () => import('src/pages/Wagon/Type/WagonTypeCreate.vue') - }, - { - path: ':id/edit', - name: 'WagonTypeEdit', - meta: { - title: 'typeEdit', - icon: 'edit', - }, - component: () => import('src/pages/Wagon/Type/WagonTypeCreate.vue') - }, - ], - } ], }; diff --git a/test/cypress/integration/vnBreadCrumbs.spec.js b/test/cypress/integration/vnBreadCrumbs.spec.js new file mode 100644 index 000000000..9e17b6b80 --- /dev/null +++ b/test/cypress/integration/vnBreadCrumbs.spec.js @@ -0,0 +1,19 @@ +/// +describe('VnBreadCrumbs', () => { + beforeEach(() => { + cy.login('developer'); + cy.visit('/'); + }); + + it('should not be breadcrumbs', () => { + cy.get('.q-breadcrumbs').should('not.exist'); + }); + it('should get the correct breadcrumbs', () => { + cy.get('[href="#/customer"]').click(); + cy.get('.q-breadcrumbs .q-breadcrumbs--last').should('have.length', 1); + cy.get('.q-breadcrumbs .q-breadcrumbs--last').contains('Clientes'); + cy.get('.q-infinite-scroll > :nth-child(1)').click(); + cy.get('.q-breadcrumbs .q-breadcrumbs__el').should('have.length', 2); + cy.get('.q-breadcrumbs .q-breadcrumbs__el').eq(1).contains('Resumen'); + }); +}); diff --git a/test/cypress/integration/workerList.spec.js b/test/cypress/integration/workerList.spec.js index d76958367..8d4dd770d 100644 --- a/test/cypress/integration/workerList.spec.js +++ b/test/cypress/integration/workerList.spec.js @@ -8,17 +8,17 @@ describe('WorkerList', () => { it('should load workers', () => { cy.get('.card-list-body > .list-items > :nth-child(2) > .value > span') .eq(0) - .should('have.text', 'victorvd'); - cy.get('.card-list-body > .list-items > :nth-child(2) > .value > span') - .eq(1) .should('have.text', 'JessicaJones'); cy.get('.card-list-body > .list-items > :nth-child(2) > .value > span') - .eq(2) + .eq(1) .should('have.text', 'BruceBanner'); + cy.get('.card-list-body > .list-items > :nth-child(2) > .value > span') + .eq(2) + .should('have.text', 'CharlesXavier'); }); it('should open the worker summary', () => { - cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(1).click(); + cy.get('.card-list-body .actions .q-btn:nth-child(2)').eq(0).click(); cy.get('.summaryHeader div').should('have.text', '1110 - Jessica Jones'); cy.get('.summary .header').eq(0).invoke('text').should('include', 'Basic data'); cy.get('.summary .header').eq(1).should('have.text', 'User data');