@@ -319,7 +352,9 @@ async function autofillBic(worker) {
>
bankEntitiesOptions.push(data)"
+ @on-data-saved="
+ (_, resp) => handleNewBankEntity(data, resp)
+ "
/>
diff --git a/src/pages/Worker/locale/en.yml b/src/pages/Worker/locale/en.yml
index 96df37919..8276977fd 100644
--- a/src/pages/Worker/locale/en.yml
+++ b/src/pages/Worker/locale/en.yml
@@ -1,6 +1,12 @@
passwordRequirements: 'The password must have at least { length } length characters, {nAlpha} alphabetic characters, {nUpper} capital letters, {nDigits} digits and {nPunct} symbols (Ex: $%&.)\n'
tableColumns:
id: ID
- name: Name
+ firstName: First name
+ lastName: Last Name
+ userName: User Name
department: Department
email: Email
+ fi: FI
+ SSN: SSN
+ extension: Extension
+queue: Queue
diff --git a/src/pages/Worker/locale/es.yml b/src/pages/Worker/locale/es.yml
index 41812345f..9c7618bc3 100644
--- a/src/pages/Worker/locale/es.yml
+++ b/src/pages/Worker/locale/es.yml
@@ -6,6 +6,12 @@ External: Externo
passwordRequirements: 'La contraseña debe tener al menos { length } caracteres de longitud, {nAlpha} caracteres alfabéticos, {nUpper} letras mayúsculas, {nDigits} dígitos y {nPunct} símbolos (Ej: $%&.)'
tableColumns:
id: ID
- name: Nombre
+ firstName: Nombre
+ lastName: Apellidos
+ userName: Nombre de usuario
department: Departamento
email: Email
+ fi: NIF
+ SSN: NSS
+ extension: Extensión
+queue: Cola
diff --git a/src/pages/Zone/ZoneDeliveryPanel.vue b/src/pages/Zone/ZoneDeliveryPanel.vue
index d6c96b935..423095d6e 100644
--- a/src/pages/Zone/ZoneDeliveryPanel.vue
+++ b/src/pages/Zone/ZoneDeliveryPanel.vue
@@ -96,7 +96,7 @@ watch(
sort-by="code, townFk"
option-value="geoFk"
option-label="code"
- option-filter="code"
+ :filter-options="['code', 'geoFk']"
hide-selected
dense
outlined
diff --git a/src/router/modules/entry.js b/src/router/modules/entry.js
index 4750a4301..3add239df 100644
--- a/src/router/modules/entry.js
+++ b/src/router/modules/entry.js
@@ -12,7 +12,13 @@ export default {
component: RouterView,
redirect: { name: 'EntryMain' },
menus: {
- main: ['EntryList', 'MyEntries', 'EntryLatestBuys', 'EntryStockBought'],
+ main: [
+ 'EntryList',
+ 'MyEntries',
+ 'EntryLatestBuys',
+ 'EntryStockBought',
+ 'EntryWasteRecalc',
+ ],
card: ['EntryBasicData', 'EntryBuys', 'EntryNotes', 'EntryDms', 'EntryLog'],
},
children: [
@@ -67,6 +73,15 @@ export default {
},
component: () => import('src/pages/Entry/EntryStockBought.vue'),
},
+ {
+ path: 'waste-recalc',
+ name: 'EntryWasteRecalc',
+ meta: {
+ title: 'wasteRecalc',
+ icon: 'compost',
+ },
+ component: () => import('src/pages/Entry/EntryWasteRecalc.vue'),
+ },
],
},
{
diff --git a/src/router/modules/worker.js b/src/router/modules/worker.js
index b2716474b..c2a9e668f 100644
--- a/src/router/modules/worker.js
+++ b/src/router/modules/worker.js
@@ -27,6 +27,7 @@ export default {
'WorkerBalance',
'WorkerFormation',
'WorkerMedical',
+ 'WorkerOperator',
],
},
children: [
@@ -168,6 +169,7 @@ export default {
meta: {
title: 'log',
icon: 'vn:History',
+ acls: [{ model: 'WorkerLog', props: 'find', accessType: 'READ' }],
},
component: () => import('src/pages/Worker/Card/WorkerLog.vue'),
},
@@ -207,6 +209,15 @@ export default {
},
component: () => import('src/pages/Worker/Card/WorkerMedical.vue'),
},
+ {
+ name: 'WorkerOperator',
+ path: 'operator',
+ meta: {
+ title: 'operator',
+ icon: 'person',
+ },
+ component: () => import('src/pages/Worker/Card/WorkerOperator.vue'),
+ },
],
},
],
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index 81fc33ecd..eb39f340a 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -33,7 +33,8 @@ describe('ClaimDevelopment', () => {
cy.saveCard();
});
- it('should add and remove new line', () => {
+ // TODO: #8112
+ xit('should add and remove new line', () => {
cy.wait(['@workers', '@workers']);
cy.addCard();
diff --git a/test/cypress/integration/claim/claimNotes.spec.js b/test/cypress/integration/claim/claimNotes.spec.js
index a4a493cda..d7a918db1 100644
--- a/test/cypress/integration/claim/claimNotes.spec.js
+++ b/test/cypress/integration/claim/claimNotes.spec.js
@@ -1,4 +1,6 @@
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(() => {
cy.login('developer');
cy.visit(`/#/claim/${2}/notes`);
@@ -7,7 +9,7 @@ describe('ClaimNotes', () => {
it('should add a new note', () => {
const message = 'This is a new message.';
cy.get('.q-textarea').type(message);
- cy.get('.q-field__append > .q-btn > .q-btn__content > .q-icon').click(); //save
- cy.get(':nth-child(1) > .q-card__section--vert').should('have.text', message);
+ cy.get(saveBtn).click();
+ cy.get(firstNote).should('have.text', message);
});
});
diff --git a/test/cypress/integration/entry/myEntry.spec.js b/test/cypress/integration/entry/myEntry.spec.js
index dca74dec2..4addec1c4 100644
--- a/test/cypress/integration/entry/myEntry.spec.js
+++ b/test/cypress/integration/entry/myEntry.spec.js
@@ -11,7 +11,7 @@ describe('EntryMy when is supplier', () => {
it('should open buyLabel when is supplier', () => {
cy.get(
- '[to="/null/2"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
+ '[to="/null/3"] > .q-card > .column > .q-btn > .q-btn__content > .q-icon'
).click();
cy.get('.q-card__actions > .q-btn').click();
cy.window().its('open').should('be.called');
diff --git a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
index 6d33dbc39..353c5805b 100644
--- a/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
+++ b/test/cypress/integration/route/agency/agencyWorkCenter.spec.js
@@ -4,12 +4,12 @@ describe('AgencyWorkCenter', () => {
cy.login('developer');
cy.visit(`/#/agency/11/workCenter`);
});
+ const createButton = '.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon';
+ const workCenterCombobox = 'input[role="combobox"]';
it('assign workCenter', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('workCenterOne{enter}');
+ cy.get(createButton).click();
+ cy.get(workCenterCombobox).type('workCenterOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
});
@@ -22,12 +22,10 @@ describe('AgencyWorkCenter', () => {
});
it('error on duplicate workCenter', () => {
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
- cy.get(
- '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
- ).type('workCenterOne{enter}');
+ cy.get(createButton).click();
+ cy.get(workCenterCombobox).type('workCenterOne{enter}');
cy.get('.q-notification__message').should('have.text', 'Data created');
- cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.get(createButton).click();
cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('workCenterOne{enter}');
diff --git a/test/cypress/integration/route/routeList.spec.js b/test/cypress/integration/route/routeList.spec.js
index c9d7147c2..8020d3ea9 100644
--- a/test/cypress/integration/route/routeList.spec.js
+++ b/test/cypress/integration/route/routeList.spec.js
@@ -2,7 +2,7 @@ describe('Route', () => {
beforeEach(() => {
cy.viewport(1920, 1080);
cy.login('developer');
- cy.visit(`/#/route/list`);
+ cy.visit(`/#/route/extended-list`);
});
const getVnSelect =
'> :nth-child(1) > .column > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
diff --git a/test/cypress/integration/ticket/ticketDescriptor.spec.js b/test/cypress/integration/ticket/ticketDescriptor.spec.js
index 8192b7c7c..0ba2723a2 100644
--- a/test/cypress/integration/ticket/ticketDescriptor.spec.js
+++ b/test/cypress/integration/ticket/ticketDescriptor.spec.js
@@ -1,7 +1,8 @@
///
describe('Ticket descriptor', () => {
- const toCloneOpt = '[role="menu"] .q-list > :nth-child(5)';
- const setWeightOpt = '[role="menu"] .q-list > :nth-child(6)';
+ const listItem = '[role="menu"] .q-list .q-item';
+ const toCloneOpt = 'To clone ticket';
+ const setWeightOpt = 'Set weight';
const warehouseValue = ':nth-child(1) > :nth-child(6) > .value > span';
const summaryHeader = '.summaryHeader > div';
const weight = 25;
@@ -14,7 +15,7 @@ describe('Ticket descriptor', () => {
it('should clone the ticket without warehouse', () => {
cy.visit('/#/ticket/1/summary');
cy.openActionsDescriptor();
- cy.get(toCloneOpt).click();
+ cy.contains(listItem, toCloneOpt).click();
cy.clickConfirm();
cy.get(warehouseValue).contains('Warehouse One');
cy.get(summaryHeader)
@@ -28,7 +29,7 @@ describe('Ticket descriptor', () => {
it('should set the weight of the ticket', () => {
cy.visit('/#/ticket/10/summary');
cy.openActionsDescriptor();
- cy.get(setWeightOpt).click();
+ cy.contains(listItem, setWeightOpt).click();
cy.intercept('POST', /\/api\/Tickets\/\d+\/setWeight/).as('weight');
cy.get('.q-dialog input').type(weight);
cy.clickConfirm();
diff --git a/test/cypress/integration/vnComponent/vnLocation.spec.js b/test/cypress/integration/vnComponent/vnLocation.spec.js
index 78dc38899..c1b0cf929 100644
--- a/test/cypress/integration/vnComponent/vnLocation.spec.js
+++ b/test/cypress/integration/vnComponent/vnLocation.spec.js
@@ -64,7 +64,7 @@ describe('VnLocation', () => {
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(3) > .q-icon`
).click();
cy.get(
- `#q-portal--dialog--4 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
+ `#q-portal--dialog--5 > .q-dialog > ${createForm.prefix} > .vn-row > .q-select > ${createForm.sufix} > :nth-child(1) input`
).should('have.value', province);
});
});
@@ -133,6 +133,8 @@ describe('VnLocation', () => {
);
cy.get('.q-mt-lg > .q-btn--standard').click();
cy.get(`${createForm.prefix}`).should('not.exist');
+ cy.waitForElement('.q-form');
+
checkVnLocation(postCode, province);
});
it('Create city', () => {
@@ -144,10 +146,12 @@ describe('VnLocation', () => {
cy.get(
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix} > :nth-child(2) > .q-icon`
).click();
- cy.selectOption('#q-portal--dialog--2 .q-select', 'one');
- cy.get('#q-portal--dialog--2 .q-input').type(province);
- cy.get('#q-portal--dialog--2 .q-btn--standard').click();
+ cy.selectOption('#q-portal--dialog--3 .q-select', 'one');
+ cy.get('#q-portal--dialog--3 .q-input').type(province);
+ cy.get('#q-portal--dialog--3 .q-btn--standard').click();
cy.get('#q-portal--dialog--1 .q-btn--standard').click();
+ cy.waitForElement('.q-form');
+
checkVnLocation(postCode, province);
});
diff --git a/test/vitest/__tests__/components/common/VnChangePassword.spec.js b/test/vitest/__tests__/components/common/VnChangePassword.spec.js
new file mode 100644
index 000000000..f5a967bb5
--- /dev/null
+++ b/test/vitest/__tests__/components/common/VnChangePassword.spec.js
@@ -0,0 +1,70 @@
+import { createWrapper, axios } from 'app/test/vitest/helper';
+import VnChangePassword from 'src/components/common/VnChangePassword.vue';
+import { vi, beforeEach, afterEach, beforeAll, describe, expect, it } from 'vitest';
+import { Notify } from 'quasar';
+
+describe('VnSmsDialog', () => {
+ let vm;
+
+ beforeAll(() => {
+ vi.spyOn(axios, 'get').mockResolvedValue({
+ data: [],
+ });
+ vm = createWrapper(VnChangePassword, {
+ propsData: {
+ submitFn: vi.fn(),
+ },
+ }).vm;
+ });
+
+ beforeEach(() => {
+ Notify.create = vi.fn();
+ });
+
+ afterEach(() => {
+ vi.clearAllMocks();
+ });
+
+ it('should notify when new password is empty', async () => {
+ vm.passwords.newPassword = '';
+ vm.passwords.repeatPassword = 'password';
+
+ await vm.validate();
+ expect(Notify.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ message: 'You must enter a new password',
+ type: 'negative',
+ })
+ );
+ });
+
+ it("should notify when passwords don't match", async () => {
+ vm.passwords.newPassword = 'password1';
+ vm.passwords.repeatPassword = 'password2';
+ await vm.validate();
+ expect(Notify.create).toHaveBeenCalledWith(
+ expect.objectContaining({
+ message: `Passwords don't match`,
+ type: 'negative',
+ })
+ );
+ });
+
+ describe('if passwords match', () => {
+ it('should call submitFn and emit password', async () => {
+ vm.passwords.newPassword = 'password';
+ vm.passwords.repeatPassword = 'password';
+ await vm.validate();
+ expect(vm.props.submitFn).toHaveBeenCalledWith('password', undefined);
+ });
+
+ it('should call submitFn and emit password and old password', async () => {
+ vm.passwords.newPassword = 'password';
+ vm.passwords.repeatPassword = 'password';
+ vm.passwords.oldPassword = 'oldPassword';
+
+ await vm.validate();
+ expect(vm.props.submitFn).toHaveBeenCalledWith('password', 'oldPassword');
+ });
+ });
+});