From 257ec7926e2be3074b5c36a42ef880ce59289e00 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 8 Oct 2024 12:18:18 +0200 Subject: [PATCH 01/14] refs #7917 fix routeCard --- src/pages/Route/Card/RouteCard.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/Route/Card/RouteCard.vue b/src/pages/Route/Card/RouteCard.vue index 461f2d95e..fccf0cda6 100644 --- a/src/pages/Route/Card/RouteCard.vue +++ b/src/pages/Route/Card/RouteCard.vue @@ -7,10 +7,12 @@ import RouteSearchbar from 'pages/Route/Card/RouteSearchbar.vue'; diff --git a/src/pages/Item/locale/en.yml b/src/pages/Item/locale/en.yml index 52722198b..69014222f 100644 --- a/src/pages/Item/locale/en.yml +++ b/src/pages/Item/locale/en.yml @@ -76,13 +76,6 @@ itemTags: searchbar: label: Search item info: Search by item id -itemType: - shared: - code: Code - name: Name - worker: Worker - category: Category - temperature: Temperature item: params: daysOnward: Days onward diff --git a/src/pages/Item/locale/es.yml b/src/pages/Item/locale/es.yml index 29af8dc5c..48858f2a5 100644 --- a/src/pages/Item/locale/es.yml +++ b/src/pages/Item/locale/es.yml @@ -76,13 +76,6 @@ itemTags: searchbar: label: Buscar artículo info: Buscar por id de artículo -itemType: - shared: - code: Código - name: Nombre - worker: Trabajador - category: Reino - temperature: Temperatura params: state: asfsdf item: From c4dcac8c00906ad3f2a48078f69888546f426b3d Mon Sep 17 00:00:00 2001 From: jtubau Date: Tue, 28 Jan 2025 10:22:22 +0100 Subject: [PATCH 07/14] fix: refs #8420 ensure search bar is visible before typing and enable details test --- test/cypress/integration/invoiceIn/invoiceInList.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index 0eb495419..4e2b8f9cc 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -9,7 +9,7 @@ describe('InvoiceInList', () => { cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/invoice-in/list`); - cy.get('#searchbar input').type('{enter}'); + cy.get('#searchbar input').should('be.visible').type('{enter}'); }); it('should redirect on clicking a invoice', () => { @@ -22,7 +22,7 @@ describe('InvoiceInList', () => { }); }); // https://redmine.verdnatura.es/issues/8420 - it.skip('should open the details', () => { + it('should open the details', () => { cy.get(firstDetailBtn).click(); cy.get(summaryHeaders).eq(1).contains('Basic data'); cy.get(summaryHeaders).eq(4).contains('Vat'); From 879373209ee2f878c0d2f61c4e7fb88ba1978de0 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 Jan 2025 10:54:59 +0100 Subject: [PATCH 08/14] refactor: entriesTotals --- src/pages/Travel/Card/TravelSummary.vue | 60 ++++++++++++------------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 689711a74..9c5ce8e74 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -179,33 +179,31 @@ const entriesTableRows = computed(() => { return entries.value; }); -const entriesTotalHb = computed(() => - entriesTableRows.value.reduce((acc, { hb }) => acc + hb, 0) -); +const entriesTotals = computed(() => { + const totals = { + hb: 0, + freightValue: 0, + packageValue: 0, + cc: 0, + pallet: 0, + m3: 0, + }; -const entriesTotalFreight = computed(() => - toCurrency( - entriesTableRows.value.reduce((acc, { freightValue }) => acc + freightValue, 0) - ) -); + entriesTableRows.value.forEach((row) => { + for (const key in totals) { + totals[key] += row[key] || 0; + } + }); -const entriesTotalPackageValue = computed(() => - toCurrency( - entriesTableRows.value.reduce((acc, { packageValue }) => acc + packageValue, 0) - ) -); - -const entriesTotalCc = computed(() => - entriesTableRows.value.reduce((acc, { cc }) => acc + cc, 0) -); - -const entriesTotalPallet = computed(() => - entriesTableRows.value.reduce((acc, { pallet }) => acc + pallet, 0) -); - -const entriesTotalM3 = computed(() => - entriesTableRows.value.reduce((acc, { m3 }) => acc + m3, 0) -); + return { + hb: totals.hb.toFixed(2), + freight: toCurrency(totals.freightValue), + packageValue: toCurrency(totals.packageValue), + cc: totals.cc.toFixed(2), + pallet: totals.pallet.toFixed(2), + m3: totals.m3.toFixed(2), + }; +}); const getTravelEntries = async (id) => { const { data } = await axios.get(`Travels/${id}/getEntries`); @@ -368,12 +366,12 @@ const getLink = (param) => `#/travel/${entityId.value}/${param}`; - {{ entriesTotalHb }} - {{ entriesTotalFreight }} - {{ entriesTotalPackageValue }} - {{ entriesTotalCc }} - {{ entriesTotalPallet }} - {{ entriesTotalM3 }} + {{ entriesTotals.hb }} + {{ entriesTotals.freight }} + {{ entriesTotals.packageValue }} + {{ entriesTotals.cc }} + {{ entriesTotals.pallet }} + {{ entriesTotals.m3 }} From 9991c4a46231a1530d48d0df37a00a1d6715ff5d Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 28 Jan 2025 11:48:20 +0100 Subject: [PATCH 09/14] fix: added witdth when opening summary --- src/pages/Customer/components/CustomerSummaryTable.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/Customer/components/CustomerSummaryTable.vue b/src/pages/Customer/components/CustomerSummaryTable.vue index c1ba506fd..bb6f4442b 100644 --- a/src/pages/Customer/components/CustomerSummaryTable.vue +++ b/src/pages/Customer/components/CustomerSummaryTable.vue @@ -114,7 +114,7 @@ const columns = computed(() => [ action: ({ id }) => window.open( router.resolve({ params: { id }, name: 'TicketSale' }).href, - '_blank' + '_blank', ), isPrimary: true, }, @@ -122,7 +122,7 @@ const columns = computed(() => [ title: t('components.smartCard.viewSummary'), icon: 'preview', isPrimary: true, - action: (row) => viewSummary(row.id, TicketSummary), + action: (row) => viewSummary(row.id, TicketSummary, 'lg-width'), }, ], }, From 5c761ca11103b07dc25da1504c4755e3daf48b1b Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 28 Jan 2025 12:12:00 +0100 Subject: [PATCH 10/14] fix: scroll --- src/components/ui/VnPaginate.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ui/VnPaginate.vue b/src/components/ui/VnPaginate.vue index 0111366f5..965f4d5e9 100644 --- a/src/components/ui/VnPaginate.vue +++ b/src/components/ui/VnPaginate.vue @@ -166,7 +166,7 @@ function emitStoreData() { async function paginate() { const { page, rowsPerPage, sortBy, descending } = pagination.value; - if (!props.url) return; + if (!arrayData.store.url) return; isLoading.value = true; await arrayData.loadMore(); From 4132bb2b468ec29e1242c73b9a3d4f1bd5172bea Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 Jan 2025 12:37:03 +0100 Subject: [PATCH 11/14] fix: refs #8352 fix datacy --- src/components/common/RightMenu.vue | 1 + test/cypress/support/commands.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/common/RightMenu.vue b/src/components/common/RightMenu.vue index 1eded089e..9fb2b0070 100644 --- a/src/components/common/RightMenu.vue +++ b/src/components/common/RightMenu.vue @@ -26,6 +26,7 @@ onMounted(() => { round dense icon="dock_to_left" + data-cy="toggle-left-drawer" > {{ t('globals.collapseMenu') }} diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index dad434ecd..4b8ca0332 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -264,7 +264,7 @@ Cypress.Commands.add('openListSummary', (row) => { Cypress.Commands.add('openRightMenu', (element) => { if (element) cy.waitForElement(element); - cy.get('.q-gutter-x-sm > .q-btn > .q-btn__content > .q-icon').click(); + cy.get('[data-cy="toggle-left-drawer"]').click(); }); Cypress.Commands.add('openLeftMenu', (element) => { From 39d31ec330316136ea0345dd80e06d53c0aec3e9 Mon Sep 17 00:00:00 2001 From: carlossa Date: Tue, 28 Jan 2025 12:40:50 +0100 Subject: [PATCH 12/14] fix: refs #8352 fix right --- src/components/common/RightMenu.vue | 2 +- test/cypress/support/commands.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/RightMenu.vue b/src/components/common/RightMenu.vue index 9fb2b0070..196815df1 100644 --- a/src/components/common/RightMenu.vue +++ b/src/components/common/RightMenu.vue @@ -26,7 +26,7 @@ onMounted(() => { round dense icon="dock_to_left" - data-cy="toggle-left-drawer" + data-cy="toggle-right-drawer" > {{ t('globals.collapseMenu') }} diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js index 4b8ca0332..6a436c1eb 100755 --- a/test/cypress/support/commands.js +++ b/test/cypress/support/commands.js @@ -264,7 +264,7 @@ Cypress.Commands.add('openListSummary', (row) => { Cypress.Commands.add('openRightMenu', (element) => { if (element) cy.waitForElement(element); - cy.get('[data-cy="toggle-left-drawer"]').click(); + cy.get('[data-cy="toggle-right-drawer"]').click(); }); Cypress.Commands.add('openLeftMenu', (element) => { From 63fc09ad1ccbc4da3dfb6a87b7a76145a01ab083 Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 29 Jan 2025 07:35:04 +0100 Subject: [PATCH 13/14] fix: update setupNodeEvents to use async/await for plugin import --- cypress.config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cypress.config.js b/cypress.config.js index 500dda5c5..1924144f6 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -30,9 +30,11 @@ export default defineConfig({ testFiles: '**/*.spec.js', supportFile: 'test/cypress/support/unit.js', }, - setupNodeEvents(on, config) { - import('cypress-mochawesome-reporter/plugin').then((plugin) => plugin.default(on)); - // implement node event listeners here + setupNodeEvents: async (on, config) => { + const plugin = await import('cypress-mochawesome-reporter/plugin'); + plugin.default(on); + + return config; }, viewportWidth: 1280, viewportHeight: 720, From c30070f2125b43d692727d40971de3ba26ef170e Mon Sep 17 00:00:00 2001 From: jgallego Date: Wed, 29 Jan 2025 07:38:33 +0100 Subject: [PATCH 14/14] Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix-front into dev --- test/cypress/integration/invoiceIn/invoiceInList.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/cypress/integration/invoiceIn/invoiceInList.spec.js b/test/cypress/integration/invoiceIn/invoiceInList.spec.js index 0eb495419..4e2b8f9cc 100644 --- a/test/cypress/integration/invoiceIn/invoiceInList.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInList.spec.js @@ -9,7 +9,7 @@ describe('InvoiceInList', () => { cy.viewport(1920, 1080); cy.login('developer'); cy.visit(`/#/invoice-in/list`); - cy.get('#searchbar input').type('{enter}'); + cy.get('#searchbar input').should('be.visible').type('{enter}'); }); it('should redirect on clicking a invoice', () => { @@ -22,7 +22,7 @@ describe('InvoiceInList', () => { }); }); // https://redmine.verdnatura.es/issues/8420 - it.skip('should open the details', () => { + it('should open the details', () => { cy.get(firstDetailBtn).click(); cy.get(summaryHeaders).eq(1).contains('Basic data'); cy.get(summaryHeaders).eq(4).contains('Vat');