diff --git a/package.json b/package.json index 017412ef2..366e4bd36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "25.14.0", + "version": "25.16.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -76,4 +76,4 @@ "vite": "^6.0.11", "vitest": "^0.31.1" } -} \ No newline at end of file +} diff --git a/src/components/TicketProblems.vue b/src/components/TicketProblems.vue index 59be95035..c15e31d80 100644 --- a/src/components/TicketProblems.vue +++ b/src/components/TicketProblems.vue @@ -17,17 +17,6 @@ defineProps({ row: { type: Object, required: true } }); - - - {{ t('ticketSale.reserved') }} - - {{ label }} -
+
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 @@ - - - {{ t('travel.summary.thermographs') }} - - + + - acl.hasAny([{ model: 'Worker', props: '__get__business', accessType: 'READ' }]), -); +const canSeeNotes = computed(() => acl.hasAcl('Worker', '__get__business', 'READ')); const workerIsFreelance = ref(); const WorkerFreelanceRef = ref(); const workerCalendarFilterRef = ref(null); diff --git a/src/pages/Worker/Card/WorkerLocker.vue b/src/pages/Worker/Card/WorkerLocker.vue index 015bced35..62891070d 100644 --- a/src/pages/Worker/Card/WorkerLocker.vue +++ b/src/pages/Worker/Card/WorkerLocker.vue @@ -9,7 +9,7 @@ import VnSelect from 'src/components/common/VnSelect.vue'; import { useArrayData } from 'src/composables/useArrayData'; import FetchData from 'components/FetchData.vue'; -const { hasAny } = useAcl(); +const { hasAcl } = useAcl(); const { t } = useI18n(); const fetchData = ref(); const originaLockerId = ref(); @@ -58,11 +58,7 @@ const init = async (data) => { option-label="code" option-value="id" hide-selected - :readonly=" - !hasAny([ - { model: 'Worker', props: '__get__locker', accessType: 'READ' }, - ]) - " + :readonly="!hasAcl('Worker', '__get__locker', 'READ')" /> diff --git a/src/pages/Worker/Card/WorkerTimeControl.vue b/src/pages/Worker/Card/WorkerTimeControl.vue index 9c0fa6758..b64166c7d 100644 --- a/src/pages/Worker/Card/WorkerTimeControl.vue +++ b/src/pages/Worker/Card/WorkerTimeControl.vue @@ -68,13 +68,9 @@ const arrayData = useArrayData('Worker'); const acl = useAcl(); const selectedDateYear = computed(() => moment(selectedDate.value).isoWeekYear()); const worker = computed(() => arrayData.store?.data); -const canSend = computed(() => - acl.hasAny([{ model: 'WorkerTimeControl', props: 'sendMail', accessType: 'WRITE' }]), -); +const canSend = computed(() => acl.hasAcl('WorkerTimeControl', 'sendMail', 'WRITE')); const canUpdate = computed(() => - acl.hasAny([ - { model: 'WorkerTimeControl', props: 'updateMailState', accessType: 'WRITE' }, - ]), + acl.hasAcl('WorkerTimeControl', 'updateMailState', 'WRITE'), ); const isHimself = computed(() => user.value.id === Number(route.params.id)); diff --git a/src/pages/Worker/WorkerFilter.vue b/src/pages/Worker/WorkerFilter.vue index 44dfd32b4..c40afe57e 100644 --- a/src/pages/Worker/WorkerFilter.vue +++ b/src/pages/Worker/WorkerFilter.vue @@ -102,8 +102,11 @@ en: lastName: Last name userName: User extension: Extension + departmentFk: Department es: + params: + departmentFk: Departamento search: Contiene firstName: Nombre lastName: Apellidos diff --git a/src/router/modules/route.js b/src/router/modules/route.js index 11133c50a..0dd41c86e 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -238,6 +238,7 @@ export default { title: 'list', icon: 'view_list', }, + component: () => import('src/pages/Route/RouteList.vue'), }, routeCard, ], @@ -286,6 +287,7 @@ export default { title: 'list', icon: 'view_list', }, + component: () => import('src/pages/Route/RouteRoadmap.vue'), }, roadmapCard, ], @@ -316,6 +318,8 @@ export default { title: 'list', icon: 'view_list', }, + component: () => + import('src/pages/Route/Agency/AgencyList.vue'), }, agencyCard, ], @@ -337,6 +341,8 @@ export default { title: 'vehicleList', icon: 'directions_car', }, + component: () => + import('src/pages/Route/Vehicle/VehicleList.vue'), }, vehicleCard, ], 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/invoiceIn/invoiceInDescriptor.spec.js b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js index 7058e154c..fdaa01876 100644 --- a/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js +++ b/test/cypress/integration/invoiceIn/invoiceInDescriptor.spec.js @@ -13,7 +13,7 @@ describe('InvoiceInDescriptor', () => { cy.validateCheckbox(checkbox, false); }); - it('should delete the invoice properly', () => { + it.skip('should delete the invoice properly', () => { cy.visit('/#/invoice-in/2/summary'); cy.selectDescriptorOption(2); cy.clickConfirm(); diff --git a/test/cypress/integration/order/orderList.spec.js b/test/cypress/integration/order/orderList.spec.js index 34cd2bffc..ee011ea05 100644 --- a/test/cypress/integration/order/orderList.spec.js +++ b/test/cypress/integration/order/orderList.spec.js @@ -30,9 +30,11 @@ describe('OrderList', () => { cy.url().should('include', `/order`); }); - it.skip('filter list and create order', () => { + it('filter list and create order', () => { cy.dataCy('Customer ID_input').type('1101{enter}'); + cy.intercept('GET', /\/api\/Clients/).as('clientFilter'); cy.dataCy('vnTableCreateBtn').click(); + cy.wait('@clientFilter'); cy.dataCy('landedDate').find('input').type('06/01/2001'); cy.selectOption(agencyCreateSelect, 1); 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); + }); +}); diff --git a/test/cypress/integration/route/routeAutonomous.spec.js b/test/cypress/integration/route/routeAutonomous.spec.js index 08fd7d7ea..d77584c04 100644 --- a/test/cypress/integration/route/routeAutonomous.spec.js +++ b/test/cypress/integration/route/routeAutonomous.spec.js @@ -49,12 +49,12 @@ describe.skip('RouteAutonomous', () => { cy.get(selectors.firstRowCheckbox).click(); cy.get(selectors.createInvoiceBtn).click(); cy.dataCy(selectors.reference).type(data.reference); + cy.dataCy('attachFile').click(); cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', { force: true, }); - cy.dataCy(selectors.saveFormBtn).click(); + cy.dataCy(selectors.saveFormBtn).should('be.visible').click(); cy.checkNotification(dataSaved); - cy.typeSearchbar('{enter}'); }); it('Should display the total price of the selected rows', () => { diff --git a/test/cypress/integration/route/routeExtendedList.spec.js b/test/cypress/integration/route/routeExtendedList.spec.js index a183c08cb..e6c873d5e 100644 --- a/test/cypress/integration/route/routeExtendedList.spec.js +++ b/test/cypress/integration/route/routeExtendedList.spec.js @@ -53,17 +53,20 @@ describe('Route extended list', () => { function fillField(selector, type, value) { switch (type) { case 'select': - cy.get(selector).should('be.visible').click(); - cy.dataCy('null_select').clear().type(value); + cy.get(selector).should('be.visible').click().clear().type(value); cy.get('.q-item').contains(value).click(); break; case 'input': - cy.get(selector).should('be.visible').click(); - cy.dataCy('null_input').clear().type(`${value}`); + cy.get(selector) + .should('be.visible') + .click() + .type(`{selectall}{backspace}${value}`); break; case 'date': - cy.get(selector).should('be.visible').click(); - cy.dataCy('null_inputDate').clear().type(`${value}`); + cy.get(selector) + .should('be.visible') + .click() + .type(`{selectall}{backspace}${value}`); break; case 'checkbox': cy.get(selector).should('be.visible').click().click(); @@ -103,8 +106,8 @@ describe('Route extended list', () => { cy.fillInForm(data); cy.dataCy(selectors.saveFormBtn).click(); - cy.checkNotification(dataCreated); cy.url().should('include', '/summary'); + cy.checkNotification(dataCreated); }); it('Should reset changed values when click reset button', () => { @@ -140,7 +143,7 @@ describe('Route extended list', () => { const downloadsFolder = Cypress.config('downloadsFolder'); cy.get(selectors.lastRowSelectCheckBox).click(); cy.get(selectors.downloadBtn).click(); - cy.wait(5000); + cy.wait(3000); const fileName = 'download.zip'; cy.readFile(`${downloadsFolder}/${fileName}`).should('exist'); @@ -177,7 +180,7 @@ describe('Route extended list', () => { const [month, day, year] = value.split('/'); value = `${day}/${month}/${year}`; } - cy.validateContent(selector, value); + cy.get(selector).should('contain', value); }); }); diff --git a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js b/test/cypress/integration/vnComponent/VnAccountNumber.spec.js deleted file mode 100644 index 053902f35..000000000 --- a/test/cypress/integration/vnComponent/VnAccountNumber.spec.js +++ /dev/null @@ -1,37 +0,0 @@ -describe('VnAccountNumber', () => { - const accountInput = 'input[data-cy="supplierFiscalDataAccount_input"]'; - beforeEach(() => { - cy.login('developer'); - cy.viewport(1920, 1080); - cy.visit('/#/supplier/1/fiscal-data'); - }); - - describe('VnInput handleInsertMode()', () => { - it('should replace character at cursor position in insert mode', () => { - cy.get(accountInput).type('{selectall}4100000001'); - cy.get(accountInput).type('{movetostart}'); - cy.get(accountInput).type('999'); - cy.get(accountInput).should('have.value', '9990000001'); - }); - - it('should replace character at cursor position in insert mode', () => { - cy.get(accountInput).clear(); - cy.get(accountInput).type('4100000001'); - cy.get(accountInput).type('{movetostart}'); - cy.get(accountInput).type('999'); - cy.get(accountInput).should('have.value', '9990000001'); - }); - - it('should respect maxlength prop', () => { - cy.get(accountInput).clear(); - cy.get(accountInput).type('123456789012345'); - cy.get(accountInput).should('have.value', '1234567890'); - }); - }); - - it('should convert short account number to standard format', () => { - cy.get(accountInput).clear(); - cy.get(accountInput).type('123.'); - cy.get(accountInput).should('have.value', '1230000000'); - }); -}); diff --git a/test/cypress/integration/vnComponent/VnShortcut.spec.js b/test/cypress/integration/vnComponent/VnShortcut.spec.js index e08c44635..fa05e2e3d 100644 --- a/test/cypress/integration/vnComponent/VnShortcut.spec.js +++ b/test/cypress/integration/vnComponent/VnShortcut.spec.js @@ -27,12 +27,15 @@ describe('VnShortcuts', () => { code: `Key${shortcut.toUpperCase()}`, }); + cy.waitSpinner(); cy.url().should('include', module); if (['monitor', 'claim'].includes(module)) { return; } cy.waitForElement('.q-page').should('exist'); cy.dataCy('vnTableCreateBtn').should('exist'); + cy.waitSpinner(); + cy.get('.q-page').trigger('keydown', { ctrlKey: true, altKey: true,