From fa5c1643a4d1716f246f22c7761e42d8c2cdbaa7 Mon Sep 17 00:00:00 2001 From: jtubau Date: Tue, 4 Mar 2025 12:32:21 +0100 Subject: [PATCH 01/35] test: refs #8717 add integration test for agencyModes --- .../integration/route/agency/agencyModes.spec.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/cypress/integration/route/agency/agencyModes.spec.js diff --git a/test/cypress/integration/route/agency/agencyModes.spec.js b/test/cypress/integration/route/agency/agencyModes.spec.js new file mode 100644 index 000000000..3f5784997 --- /dev/null +++ b/test/cypress/integration/route/agency/agencyModes.spec.js @@ -0,0 +1,15 @@ +describe('Agency modes', () => { + const name = 'inhouse pickup'; + + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/route/agency/1/modes`); + }); + + it('should display the agency modes page', () => { + cy.get('.flex > .title').should('have.text', name); + cy.get('.flex > .q-chip > .q-chip__content').should('have.text', 'ID: 1'); + cy.get('.list-items > :nth-child(1) > .value').should('have.text', name); + }); +}); From 1a0df60e06878c3695a7011016ec705a3b19dbaa Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Fri, 14 Mar 2025 14:21:26 +0100 Subject: [PATCH 02/35] fix: remove reserved ticket functionality from TicketProblems and TicketSaleMoreActions components --- src/components/TicketProblems.vue | 11 ------ .../Ticket/Card/TicketSaleMoreActions.vue | 35 ------------------- 2 files changed, 46 deletions(-) diff --git a/src/components/TicketProblems.vue b/src/components/TicketProblems.vue index c11cc2e7b..aee132fe0 100644 --- a/src/components/TicketProblems.vue +++ b/src/components/TicketProblems.vue @@ -17,17 +17,6 @@ defineProps({ row: { type: Object, required: true } }); - - - {{ t('ticketSale.reserved') }} - - { } return false; }); -const hasReserves = computed(() => props.sales.some((sale) => sale.reserved == true)); const sendSms = async (params) => { await axios.post(`Tickets/${ticket.value.id}/sendSms`, params); @@ -144,14 +143,6 @@ const onCreateClaimAccepted = async () => { push({ name: 'ClaimBasicData', params: { id: data.id } }); }; -const setReserved = async (reserved) => { - const params = { ticketId: ticket.value.id, sales: props.sales, reserved: reserved }; - await axios.post(`Sales/reserve`, params); - props.sales.forEach((sale) => { - sale.reserved = reserved; - }); -}; - const createRefund = async (withWarehouse) => { if (!props.ticket) return; @@ -240,30 +231,6 @@ const createRefund = async (withWarehouse) => { {{ t('Add claim') }} - - - {{ t('Mark as reserved') }} - - - - - {{ t('Unmark as reserved') }} - - {{ t('Refund') }} @@ -309,8 +276,6 @@ es: Recalculate price: Recalcular precio Update discount: Actualizar descuento Add claim: Crear reclamación - Mark as reserved: Marcar como reservado - Unmark as reserved: Desmarcar como reservado Refund: Abono with warehouse: con almacén without warehouse: sin almacén From 5f48c9b887a799bf0ada9e7cc36ae6c86393ca9b Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 24 Mar 2025 08:13:06 +0100 Subject: [PATCH 03/35] refactor: refs #8717 eliminate warnings and add component on children routes --- src/components/VnTable/VnColumn.vue | 14 ++++++++------ src/router/modules/route.js | 6 ++++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/VnTable/VnColumn.vue b/src/components/VnTable/VnColumn.vue index d0e245388..3ce62c5de 100644 --- a/src/components/VnTable/VnColumn.vue +++ b/src/components/VnTable/VnColumn.vue @@ -55,6 +55,8 @@ const $props = defineProps({ }, }); +const label = $props.showLabel && $props.column.label ? $props.column.label : ''; + const defaultSelect = { attrs: { row: $props.row, @@ -62,7 +64,7 @@ const defaultSelect = { class: 'fit', }, forceAttrs: { - label: $props.showLabel && $props.column.label, + label, }, }; @@ -74,7 +76,7 @@ const defaultComponents = { class: 'fit', }, forceAttrs: { - label: $props.showLabel && $props.column.label, + label, }, }, number: { @@ -84,7 +86,7 @@ const defaultComponents = { class: 'fit', }, forceAttrs: { - label: $props.showLabel && $props.column.label, + label, }, }, date: { @@ -96,7 +98,7 @@ const defaultComponents = { class: 'fit', }, forceAttrs: { - label: $props.showLabel && $props.column.label, + label, }, }, time: { @@ -105,7 +107,7 @@ const defaultComponents = { disable: !$props.isEditable, }, forceAttrs: { - label: $props.showLabel && $props.column.label, + label, }, }, checkbox: { @@ -125,7 +127,7 @@ const defaultComponents = { return defaultAttrs; }, forceAttrs: { - label: $props.showLabel && $props.column.label, + label, autofocus: true, }, events: { diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 62765a49c..0bf3a6eff 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -229,6 +229,7 @@ export default { title: 'list', icon: 'view_list', }, + component: () => import('src/pages/Route/RouteList.vue'), }, routeCard, ], @@ -277,6 +278,7 @@ export default { title: 'list', icon: 'view_list', }, + component: () => import('src/pages/Route/RouteRoadmap.vue'), }, roadmapCard, ], @@ -307,6 +309,8 @@ export default { title: 'list', icon: 'view_list', }, + component: () => + import('src/pages/Route/Agency/AgencyList.vue'), }, agencyCard, ], @@ -328,6 +332,8 @@ export default { title: 'vehicleList', icon: 'directions_car', }, + component: () => + import('src/pages/Route/Vehicle/VehicleList.vue'), }, vehicleCard, ], From 26f20440972b8fd42d032e49c580c58bc8b3edb0 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 24 Mar 2025 09:08:18 +0100 Subject: [PATCH 04/35] test: update order creation test and remove reserved ticket tests --- test/cypress/integration/order/orderList.spec.js | 2 +- .../integration/ticket/ticketSale.spec.js | 16 ---------------- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/test/cypress/integration/order/orderList.spec.js b/test/cypress/integration/order/orderList.spec.js index 1c954622f..024517bbf 100644 --- a/test/cypress/integration/order/orderList.spec.js +++ b/test/cypress/integration/order/orderList.spec.js @@ -6,7 +6,7 @@ describe('OrderList', () => { cy.visit('/#/order/list'); }); - it('create order', () => { + it.only('create order', () => { cy.get('[data-cy="vnTableCreateBtn"]').click(); cy.get('[data-cy="Client_select"]').type('1101'); cy.get('.q-menu').contains('Bruce Wayne').click(); diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js index 61ba9fe4f..514c50281 100644 --- a/test/cypress/integration/ticket/ticketSale.spec.js +++ b/test/cypress/integration/ticket/ticketSale.spec.js @@ -152,22 +152,6 @@ describe('TicketSale', () => { cy.checkNotification('Future ticket date not allowed'); }); - it('marks row as reserved', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.waitForElement('[data-cy="markAsReservedItem"]'); - cy.dataCy('markAsReservedItem').click(); - cy.dataCy('ticketSaleReservedIcon').should('exist'); - }); - - it('unmarks row as reserved', () => { - selectFirstRow(); - cy.dataCy('ticketSaleMoreActionsDropdown').click(); - cy.waitForElement('[data-cy="unmarkAsReservedItem"]'); - cy.dataCy('unmarkAsReservedItem').click(); - cy.dataCy('ticketSaleReservedIcon').should('not.exist'); - }); - it('refunds row with warehouse', () => { selectFirstRow(); cy.dataCy('ticketSaleMoreActionsDropdown').click(); From 17b784e4d107711f329a84324be5706b406b0d11 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Mon, 24 Mar 2025 09:46:10 +0100 Subject: [PATCH 05/35] test: rename account descriptor test and enable claim notes test --- .../integration/account/accountDescriptorMenu.spec.js | 5 ++++- test/cypress/integration/claim/claimNotes.spec.js | 2 +- test/cypress/integration/ticket/ticketSale.spec.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/test/cypress/integration/account/accountDescriptorMenu.spec.js b/test/cypress/integration/account/accountDescriptorMenu.spec.js index 67a7d8ef6..04fc57040 100644 --- a/test/cypress/integration/account/accountDescriptorMenu.spec.js +++ b/test/cypress/integration/account/accountDescriptorMenu.spec.js @@ -1,4 +1,4 @@ -describe('ClaimNotes', () => { +describe('Account descriptor', () => { const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list'; const url = '/#/account/1/summary'; @@ -7,6 +7,9 @@ describe('ClaimNotes', () => { cy.visit(url); cy.dataCy('descriptor-more-opts').click(); cy.get(descriptorOptions) + .should('exist') + .should('be.visible') + .find('.q-item') .its('length') .then((count) => { diff --git a/test/cypress/integration/claim/claimNotes.spec.js b/test/cypress/integration/claim/claimNotes.spec.js index ae8b4186c..fa4a214a1 100644 --- a/test/cypress/integration/claim/claimNotes.spec.js +++ b/test/cypress/integration/claim/claimNotes.spec.js @@ -1,4 +1,4 @@ -describe.skip('ClaimNotes', () => { +describe('ClaimNotes', () => { const saveBtn = '.q-field__append > .q-btn > .q-btn__content > .q-icon'; const firstNote = '.q-infinite-scroll :nth-child(1) > .q-card__section--vert'; beforeEach(() => { diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js index 514c50281..6d84f214c 100644 --- a/test/cypress/integration/ticket/ticketSale.spec.js +++ b/test/cypress/integration/ticket/ticketSale.spec.js @@ -23,7 +23,7 @@ describe('TicketSale', () => { cy.get('[data-col-field="price"]') .find('.q-btn > .q-btn__content') - .should('have.text', `€${price}`); + .should('contain.text', `€${price}`); }); it('update discount', () => { const discount = Math.floor(Math.random() * 100) + 1; From fb00824ee38a257669f297b7a9bafdfe0b628ddd Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 24 Mar 2025 09:55:03 +0100 Subject: [PATCH 06/35] refactor: refs #8717 change toModule prop type from String to Object --- src/components/ui/VnDescriptor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/VnDescriptor.vue b/src/components/ui/VnDescriptor.vue index 47da98d74..878adcadc 100644 --- a/src/components/ui/VnDescriptor.vue +++ b/src/components/ui/VnDescriptor.vue @@ -30,7 +30,7 @@ const $props = defineProps({ default: null, }, toModule: { - type: String, + type: Object, default: null, }, }); From feabf9c7be8793f881fd0b7abba8426ce0fe62dd Mon Sep 17 00:00:00 2001 From: jtubau Date: Mon, 24 Mar 2025 11:19:26 +0100 Subject: [PATCH 07/35] refactor: refs #8717 use markRaw for cardDescriptor in VnCard component --- src/components/common/VnCard.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index 21cdc9df5..50b041060 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -1,5 +1,5 @@