diff --git a/CHANGELOG.md b/CHANGELOG.md index 43bd6da777..e34523545c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2420.01] + ## [2418.01] ## [2416.01] - 2024-04-18 diff --git a/package.json b/package.json index 8398eb3f3f..063cf6de4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.18.0", + "version": "24.20.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index f70146c58b..e3cb2874ae 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -187,7 +187,7 @@ const columns = computed(() => [ downloadFile( prop.row.id, $props.downloadModel, - null, + undefined, prop.row.download ), }, diff --git a/src/components/ui/VnNotes.vue b/src/components/ui/VnNotes.vue index b9b70fd92a..b0cdd0e15b 100644 --- a/src/components/ui/VnNotes.vue +++ b/src/components/ui/VnNotes.vue @@ -32,7 +32,7 @@ async function insert() { diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 998ee05769..490186e773 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -9,12 +9,9 @@ const arrayDataStore = useArrayDataStore(); export function useArrayData(key, userOptions) { if (!key) throw new Error('ArrayData: A key is required to use this composable'); - if (!arrayDataStore.get(key)) { - arrayDataStore.set(key); - } + if (!arrayDataStore.get(key)) arrayDataStore.set(key); const store = arrayDataStore.get(key); - const hasMoreData = ref(false); const route = useRoute(); let canceller = null; @@ -22,6 +19,7 @@ export function useArrayData(key, userOptions) { onMounted(() => { setOptions(); + store.skip = 0; const query = route.query; if (query.params) { @@ -29,9 +27,7 @@ export function useArrayData(key, userOptions) { } }); - if (key && userOptions) { - setOptions(); - } + if (key && userOptions) setOptions(); function setOptions() { const allowedOptions = [ @@ -96,8 +92,7 @@ export function useArrayData(key, userOptions) { }); const { limit } = filter; - hasMoreData.value = limit && response.data.length >= limit; - store.hasMoreData = hasMoreData.value; + store.hasMoreData = limit && response.data.length >= limit; if (append) { if (!store.data) store.data = []; @@ -169,7 +164,7 @@ export function useArrayData(key, userOptions) { } async function loadMore() { - if (!hasMoreData.value && !store.hasMoreData) return; + if (!store.hasMoreData) return; store.skip = store.limit * page.value; page.value += 1; @@ -211,7 +206,6 @@ export function useArrayData(key, userOptions) { destroy, loadMore, store, - hasMoreData, totalRows, updateStateParams, isLoading, diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index bb4acec698..6f876b8fa7 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -31,7 +31,7 @@ const entityId = computed(() => { }); const worker = ref(); -const filter = { where: { id: route.params.id}}; +const filter = { where: { id: entityId } }; const sip = ref(null); @@ -60,7 +60,7 @@ const setData = (entity) => { { + const dialogInputs = '.q-dialog label input'; describe('Create', () => { const inputLocation = '.q-form .q-card> :nth-child(3) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control'; @@ -39,13 +40,9 @@ describe('VnLocation', () => { cy.get( ':nth-child(6) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(3) > .q-icon' ).click(); - cy.get(' .q-card > h1').should('have.text', 'New postcode'); - cy.get( - '.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input' - ).clear('12'); - cy.get( - '.q-card > :nth-child(4) > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > :nth-child(1) > input' - ).type('1234453'); + cy.get('.q-card > h1').should('have.text', 'New postcode'); + cy.get(dialogInputs).eq(0).clear('12'); + cy.get(dialogInputs).eq(0).type('1234453'); cy.selectOption( '.q-dialog__inner > .column > #formModel > .q-card > :nth-child(4) > :nth-child(2) > .q-field > .q-field__inner > .q-field__control ', 'Valencia' diff --git a/test/cypress/integration/claim/claimPhoto.spec.js b/test/cypress/integration/claim/claimPhoto.spec.js index ec41e92a36..6ea1fd8b7d 100755 --- a/test/cypress/integration/claim/claimPhoto.spec.js +++ b/test/cypress/integration/claim/claimPhoto.spec.js @@ -21,7 +21,8 @@ describe('ClaimPhoto', () => { cy.get('.q-notification__message').should('have.text', 'Data saved'); }); - it('should open first image dialog change to second and close', () => { + /* it.skip('should open first image dialog change to second and close', () => { + skiped fix on https://redmine.verdnatura.es/issues/7113 cy.get( ':nth-child(1) > .q-card > .q-img > .q-img__container > .q-img__image' ).click(); @@ -37,7 +38,7 @@ describe('ClaimPhoto', () => { cy.get('.q-carousel__slide > .q-img > .q-img__container > .q-img__image').should( 'not.be.visible' ); - }); + }); */ it('should remove third and fourth file', () => { cy.get( diff --git a/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js b/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js index ee5ffe08d1..f39c808099 100644 --- a/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInDueDay.spec.js @@ -1,7 +1,6 @@ /// describe('InvoiceInDueDay', () => { const inputs = 'label input'; - const inputBtns = 'label button'; const addBtn = '.q-page-sticky > div > .q-btn > .q-btn__content'; beforeEach(() => { @@ -10,7 +9,6 @@ describe('InvoiceInDueDay', () => { }); it('should update the amount', () => { - cy.get(inputBtns).eq(1).click(); cy.get(inputs).eq(3).type(23); cy.saveCard(); cy.get('.q-notification__message').should('have.text', 'Data saved'); diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js index 2f045f32c9..ff891399b6 100644 --- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js @@ -1,11 +1,11 @@ /// describe('InvoiceInVat', () => { - const inputs = 'label input'; - const inputBtns = 'label button'; const thirdRow = 'tbody > :nth-child(3)'; const firstLineVat = 'tbody > :nth-child(1) > :nth-child(4)'; const dialogInputs = '.q-dialog label input'; const dialogBtns = '.q-dialog button'; + const acrossInput = + ':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon'; const randomInt = Math.floor(Math.random() * 100); beforeEach(() => { @@ -13,11 +13,8 @@ describe('InvoiceInVat', () => { cy.visit(`/#/invoice-in/1/vat`); }); - it('should edit the first line', () => { - cy.get(inputBtns).eq(1).click(); - cy.get(inputs).eq(2).type(23); + it('should edit the sage iva', () => { cy.selectOption(firstLineVat, 'H.P. IVA 21% CEE'); - cy.saveCard(); cy.visit(`/#/invoice-in/1/vat`); @@ -36,16 +33,13 @@ describe('InvoiceInVat', () => { }); it('should throw an error if there are fields undefined', () => { - cy.get(inputBtns).eq(0).click(); - cy.get(':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon').click(); + cy.get(acrossInput).click(); cy.get(dialogBtns).eq(2).click(); cy.get('.q-notification__message').should('have.text', "The code can't be empty"); }); it('should correctly handle expense addition', () => { - cy.get(inputBtns).eq(0).click(); - - cy.get(':nth-child(1) > .q-td.q-table--col-auto-width > .q-field > .q-field__inner > .q-field__control > :nth-child(2) > .default-icon').click(); + cy.get(acrossInput).click(); cy.get(dialogInputs).eq(0).type(randomInt); cy.get(dialogInputs).eq(1).click(); cy.get(dialogInputs).eq(1).type('This is a dummy expense'); diff --git a/test/vitest/__tests__/components/Paginate.spec.js b/test/vitest/__tests__/components/Paginate.spec.js index cf5e5d2ead..345903c1a5 100644 --- a/test/vitest/__tests__/components/Paginate.spec.js +++ b/test/vitest/__tests__/components/Paginate.spec.js @@ -48,7 +48,7 @@ describe('VnPaginate', () => { { id: 3, name: 'Bruce Wayne' }, ], }); - vm.arrayData.hasMoreData.value = true; + vm.store.hasMoreData = true; await vm.$nextTick(); vm.store.data = [