From 9d166691fa4b9652e7b43abb29a94dadcb2b268a Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Wed, 16 Apr 2025 21:32:58 +0200 Subject: [PATCH 1/5] fix: update route parameter from 'id' to 'itemFk' in TicketLack components --- src/pages/Ticket/Negative/TicketLackDetail.vue | 2 +- src/pages/Ticket/Negative/TicketLackList.vue | 8 ++++---- src/pages/Ticket/Negative/TicketLackTable.vue | 2 +- src/router/modules/ticket.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pages/Ticket/Negative/TicketLackDetail.vue b/src/pages/Ticket/Negative/TicketLackDetail.vue index 9fb0f48ac..64694ef97 100644 --- a/src/pages/Ticket/Negative/TicketLackDetail.vue +++ b/src/pages/Ticket/Negative/TicketLackDetail.vue @@ -33,7 +33,7 @@ onUnmounted(() => { stateStore.rightDrawer = true; }); -const entityId = computed(() => route.params.id); +const entityId = computed(() => route.params.itemFk); const item = ref({}); const itemProposalSelected = ref(null); diff --git a/src/pages/Ticket/Negative/TicketLackList.vue b/src/pages/Ticket/Negative/TicketLackList.vue index 1e11515f9..f63f268a6 100644 --- a/src/pages/Ticket/Negative/TicketLackList.vue +++ b/src/pages/Ticket/Negative/TicketLackList.vue @@ -7,7 +7,6 @@ import { onBeforeMount } from 'vue'; import { dashIfEmpty, toDate, toHour } from 'src/filters'; import { useRouter } from 'vue-router'; import { useState } from 'src/composables/useState'; -import { useRole } from 'src/composables/useRole'; import ItemDescriptorProxy from 'src/pages/Item/Card/ItemDescriptorProxy.vue'; import RightMenu from 'src/components/common/RightMenu.vue'; import TicketLackFilter from './TicketLackFilter.vue'; @@ -25,10 +24,11 @@ const negativeParams = reactive({ availabled: Date.getCurrentDateTimeFormatted(), }); const redirectToCreateView = ({ itemFk }) => { - router.push({ + const route = { name: 'NegativeDetail', - params: { id: itemFk }, - }); + params: { itemFk }, + }; + router.push(route); }; const columns = computed(() => [ { diff --git a/src/pages/Ticket/Negative/TicketLackTable.vue b/src/pages/Ticket/Negative/TicketLackTable.vue index 2afe3af72..bf3c07a10 100644 --- a/src/pages/Ticket/Negative/TicketLackTable.vue +++ b/src/pages/Ticket/Negative/TicketLackTable.vue @@ -38,7 +38,7 @@ const filterLack = ref({ const selectedRows = ref([]); const { t } = useI18n(); const { notify } = useNotify(); -const entityId = computed(() => route.params.id); +const entityId = computed(() => route.params.itemFk); const item = ref({}); const route = useRoute(); const columns = computed(() => [ diff --git a/src/router/modules/ticket.js b/src/router/modules/ticket.js index bfcb78787..a9e871f04 100644 --- a/src/router/modules/ticket.js +++ b/src/router/modules/ticket.js @@ -251,7 +251,7 @@ export default { }, { name: 'NegativeDetail', - path: ':id', + path: ':itemFk', meta: { title: 'summary', icon: 'launch', From e3adbefc4101b50a11f55b01e4e92c67f9423c15 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 17 Apr 2025 08:23:18 +0200 Subject: [PATCH 2/5] test: enable invoiceOutList, invoiceOutSummary and ticketSale skipped --- test/cypress/integration/invoiceOut/invoiceOutList.spec.js | 2 +- test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js | 4 ++-- test/cypress/integration/ticket/ticketSale.spec.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js index ba6f3e122..b8b42fa4b 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutList.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutList.spec.js @@ -28,7 +28,7 @@ describe('InvoiceOut list', () => { cy.dataCy('InvoiceOutDownloadPdfBtn').click(); }); - it.skip('should open the invoice descriptor from table icon', () => { + it('should open the invoice descriptor from table icon', () => { cy.get(firstSummaryIcon).click(); cy.get('.cardSummary').should('be.visible'); cy.get('.summaryHeader > div').should('include.text', 'A1111111'); diff --git a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js index 029165bb8..49eed32c7 100644 --- a/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js +++ b/test/cypress/integration/invoiceOut/invoiceOutSummary.spec.js @@ -15,7 +15,7 @@ describe('InvoiceOut summary', () => { cy.login('developer'); cy.visit(`/#/invoice-out/1/summary`); }); - it.skip('open the descriptors', () => { + it('open the descriptors', () => { cy.get(firstRowDescriptors(1)).click(); cy.get('.descriptor').should('be.visible'); cy.get('.q-item > .q-item__label').should('include.text', '1'); @@ -30,7 +30,7 @@ describe('InvoiceOut summary', () => { cy.get('.q-item > .q-item__label').should('include.text', '1101'); }); - it.skip('should open the ticket list', () => { + it('should open the ticket list', () => { cy.get(toTicketList).click(); cy.get('[data-col-field="stateFk"]').each(($el) => { cy.wrap($el).contains('T1111111'); diff --git a/test/cypress/integration/ticket/ticketSale.spec.js b/test/cypress/integration/ticket/ticketSale.spec.js index 1e43d8a7d..6d84f214c 100644 --- a/test/cypress/integration/ticket/ticketSale.spec.js +++ b/test/cypress/integration/ticket/ticketSale.spec.js @@ -2,7 +2,7 @@ const firstRow = 'tbody > :nth-child(1)'; describe('TicketSale', () => { - describe.skip('Ticket #23', () => { + describe('Ticket #23', () => { beforeEach(() => { cy.login('developer'); cy.viewport(1920, 1080); From 6336cf9e242b7a0142b57739eceb5d61b24c66e2 Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 17 Apr 2025 10:44:07 +0200 Subject: [PATCH 3/5] test: fix warning --- src/components/common/VnSelect.vue | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 8c70cbef7..10e50d8a9 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -152,6 +152,16 @@ const value = computed({ }, }); +const arrayDataKey = + $props.dataKey ?? + ($props.url?.length > 0 ? $props.url : ($attrs.name ?? $attrs.label)); + +const arrayData = useArrayData(arrayDataKey, { + url: $props.url, + searchUrl: false, + mapKey: $attrs['map-key'], +}); + const computedSortBy = computed(() => { return $props.sortBy || $props.optionLabel + ' ASC'; }); @@ -174,16 +184,7 @@ onMounted(() => { if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300); }); -const arrayDataKey = - $props.dataKey ?? - ($props.url?.length > 0 ? $props.url : ($attrs.name ?? $attrs.label)); - -const arrayData = useArrayData(arrayDataKey, { - url: $props.url, - searchUrl: false, - mapKey: $attrs['map-key'], -}); -const someIsLoading = computed(() => isLoading.value || arrayData.isLoading); +const someIsLoading = computed(() => isLoading.value || !!arrayData?.isLoading); function findKeyInOptions() { if (!$props.options) return; return filter($props.modelValue, $props.options)?.length; From c5fb889b7516e949dc2988978aca2819b49ba67f Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 17 Apr 2025 10:49:50 +0200 Subject: [PATCH 4/5] fix: simplify loading state check in VnSelect component --- src/components/common/VnSelect.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 10e50d8a9..8d598e7ec 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -184,7 +184,7 @@ onMounted(() => { if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300); }); -const someIsLoading = computed(() => isLoading.value || !!arrayData?.isLoading); +const someIsLoading = computed(() => isLoading.value || arrayData.isLoading); function findKeyInOptions() { if (!$props.options) return; return filter($props.modelValue, $props.options)?.length; From 99bc6d3b75cfaf438deec8400db3ea9cfe0ed9fe Mon Sep 17 00:00:00 2001 From: alexm Date: Thu, 17 Apr 2025 10:59:57 +0200 Subject: [PATCH 5/5] fix: add optional chaining to loading state check in VnSelect component --- src/components/common/VnSelect.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/VnSelect.vue b/src/components/common/VnSelect.vue index 8d598e7ec..edbee94b2 100644 --- a/src/components/common/VnSelect.vue +++ b/src/components/common/VnSelect.vue @@ -184,7 +184,7 @@ onMounted(() => { if ($props.focusOnMount) setTimeout(() => vnSelectRef.value.showPopup(), 300); }); -const someIsLoading = computed(() => isLoading.value || arrayData.isLoading); +const someIsLoading = computed(() => isLoading.value || arrayData?.isLoading?.value); function findKeyInOptions() { if (!$props.options) return; return filter($props.modelValue, $props.options)?.length;