Compare commits
21 Commits
b26028c6a5
...
b4ee19bcde
Author | SHA1 | Date |
---|---|---|
|
b4ee19bcde | |
|
e6f8b87890 | |
|
fdafeee39d | |
|
8fb843a180 | |
|
5f7fd91272 | |
|
38c2f89fba | |
|
14e6b870ac | |
|
8714980595 | |
|
bdae26ba08 | |
|
1b68d3c5ea | |
|
f43e974bbc | |
|
65100fcf25 | |
|
794036b880 | |
|
5515f55bf6 | |
|
ff272ab6c3 | |
|
8a1db719e3 | |
|
1faab668b1 | |
|
38ccf464b7 | |
|
bbb20ec4e6 | |
|
5d58bb0c13 | |
|
e7b431e9ec |
|
@ -326,6 +326,8 @@ function handleOnDataSaved(_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleScroll() {
|
function handleScroll() {
|
||||||
|
if ($props.crudModel.disableInfiniteScroll) return;
|
||||||
|
|
||||||
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
|
const tMiddle = tableRef.value.$el.querySelector('.q-table__middle');
|
||||||
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
|
const { scrollHeight, scrollTop, clientHeight } = tMiddle;
|
||||||
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
|
const isAtBottom = Math.abs(scrollHeight - scrollTop - clientHeight) <= 40;
|
||||||
|
|
|
@ -202,7 +202,10 @@ async function fetchFilter(val) {
|
||||||
if (fields) fetchOptions.fields = fields;
|
if (fields) fetchOptions.fields = fields;
|
||||||
if (sortBy) fetchOptions.order = sortBy;
|
if (sortBy) fetchOptions.order = sortBy;
|
||||||
arrayData.reset(['skip', 'filter.skip', 'page']);
|
arrayData.reset(['skip', 'filter.skip', 'page']);
|
||||||
return (await arrayData.applyFilter({ filter: fetchOptions }))?.data;
|
|
||||||
|
const { data } = await arrayData.applyFilter({ filter: fetchOptions });
|
||||||
|
setOptions(data);
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function filterHandler(val, update) {
|
async function filterHandler(val, update) {
|
||||||
|
|
|
@ -583,15 +583,15 @@ worker:
|
||||||
role: Role
|
role: Role
|
||||||
sipExtension: Extension
|
sipExtension: Extension
|
||||||
locker: Locker
|
locker: Locker
|
||||||
fiDueDate: Fecha de caducidad del DNI
|
fiDueDate: FI due date
|
||||||
sex: Sexo
|
sex: Sex
|
||||||
seniority: Antigüedad
|
seniority: Seniority
|
||||||
fi: DNI/NIE/NIF
|
fi: DNI/NIE/NIF
|
||||||
birth: Fecha de nacimiento
|
birth: Birth
|
||||||
isFreelance: Autónomo
|
isFreelance: Freelance
|
||||||
isSsDiscounted: Bonificación SS
|
isSsDiscounted: Bonificación SS
|
||||||
hasMachineryAuthorized: Autorizado para llevar maquinaria
|
hasMachineryAuthorized: Machinery authorized
|
||||||
isDisable: Trabajador desactivado
|
isDisable: Disable
|
||||||
notificationsManager:
|
notificationsManager:
|
||||||
activeNotifications: Active notifications
|
activeNotifications: Active notifications
|
||||||
availableNotifications: Available notifications
|
availableNotifications: Available notifications
|
||||||
|
@ -707,7 +707,7 @@ supplier:
|
||||||
supplierName: Supplier name
|
supplierName: Supplier name
|
||||||
basicData:
|
basicData:
|
||||||
workerFk: Responsible
|
workerFk: Responsible
|
||||||
isSerious: Verified
|
isReal: Verified
|
||||||
isActive: Active
|
isActive: Active
|
||||||
isPayMethodChecked: PayMethod checked
|
isPayMethodChecked: PayMethod checked
|
||||||
note: Notes
|
note: Notes
|
||||||
|
|
|
@ -579,9 +579,9 @@ worker:
|
||||||
newWorker: Nuevo trabajador
|
newWorker: Nuevo trabajador
|
||||||
summary:
|
summary:
|
||||||
boss: Jefe
|
boss: Jefe
|
||||||
phoneExtension: Extensión de teléfono
|
phoneExtension: Ext. de teléfono
|
||||||
entPhone: Teléfono de empresa
|
entPhone: Tel. de empresa
|
||||||
personalPhone: Teléfono personal
|
personalPhone: Tel. personal
|
||||||
noBoss: Sin jefe
|
noBoss: Sin jefe
|
||||||
userData: Datos de usuario
|
userData: Datos de usuario
|
||||||
userId: ID del usuario
|
userId: ID del usuario
|
||||||
|
@ -702,7 +702,7 @@ supplier:
|
||||||
supplierName: Nombre del proveedor
|
supplierName: Nombre del proveedor
|
||||||
basicData:
|
basicData:
|
||||||
workerFk: Responsable
|
workerFk: Responsable
|
||||||
isSerious: Verificado
|
isReal: Verificado
|
||||||
isActive: Activo
|
isActive: Activo
|
||||||
isPayMethodChecked: Método de pago validado
|
isPayMethodChecked: Método de pago validado
|
||||||
note: Notas
|
note: Notas
|
||||||
|
|
|
@ -440,7 +440,7 @@ function handleOnDataSave({ CrudModelRef }) {
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
:crud-model="{
|
:crud-model="{
|
||||||
paginate: false,
|
disableInfiniteScroll: true,
|
||||||
}"
|
}"
|
||||||
v-model:selected="rowsSelected"
|
v-model:selected="rowsSelected"
|
||||||
:row-click="saveOnRowChange"
|
:row-click="saveOnRowChange"
|
||||||
|
|
|
@ -76,8 +76,8 @@ const companySizes = [
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-model="data.isSerious"
|
v-model="data.isReal"
|
||||||
:label="t('supplier.basicData.isSerious')"
|
:label="t('supplier.basicData.isReal')"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
v-model="data.isActive"
|
v-model="data.isActive"
|
||||||
|
|
|
@ -38,7 +38,7 @@ const filter = {
|
||||||
'payDemFk',
|
'payDemFk',
|
||||||
'payDay',
|
'payDay',
|
||||||
'isActive',
|
'isActive',
|
||||||
'isSerious',
|
'isReal',
|
||||||
'isTrucker',
|
'isTrucker',
|
||||||
'account',
|
'account',
|
||||||
],
|
],
|
||||||
|
@ -137,7 +137,7 @@ const getEntryQueryParams = (supplier) => {
|
||||||
<QTooltip>{{ t('Inactive supplier') }}</QTooltip>
|
<QTooltip>{{ t('Inactive supplier') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="!supplier.isSerious"
|
v-if="!supplier.isReal"
|
||||||
name="vn:supplierfalse"
|
name="vn:supplierfalse"
|
||||||
color="primary"
|
color="primary"
|
||||||
size="xs"
|
size="xs"
|
||||||
|
|
|
@ -83,7 +83,7 @@ const getUrl = (section) => `#/supplier/${entityId.value}/${section}`;
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
:label="t('supplier.summary.verified')"
|
:label="t('supplier.summary.verified')"
|
||||||
v-model="supplier.isSerious"
|
v-model="supplier.isReal"
|
||||||
:disable="true"
|
:disable="true"
|
||||||
/>
|
/>
|
||||||
<QCheckbox
|
<QCheckbox
|
||||||
|
|
|
@ -688,7 +688,7 @@ watch(
|
||||||
}"
|
}"
|
||||||
:create-as-dialog="false"
|
:create-as-dialog="false"
|
||||||
:crud-model="{
|
:crud-model="{
|
||||||
paginate: false,
|
disableInfiniteScroll: true,
|
||||||
}"
|
}"
|
||||||
:default-remove="false"
|
:default-remove="false"
|
||||||
:default-reset="false"
|
:default-reset="false"
|
||||||
|
|
|
@ -75,10 +75,10 @@ onBeforeMount(async () => {
|
||||||
<VnLinkPhone :phone-number="worker.phone" />
|
<VnLinkPhone :phone-number="worker.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
<VnLv :value="worker.client?.phone">
|
<VnLv :value="advancedSummary?.client?.phone">
|
||||||
<template #label>
|
<template #label>
|
||||||
{{ t('worker.summary.personalPhone') }}
|
{{ t('worker.summary.personalPhone') }}
|
||||||
<VnLinkPhone :phone-number="worker.client?.phone" />
|
<VnLinkPhone :phone-number="advancedSummary?.client?.phone" />
|
||||||
</template>
|
</template>
|
||||||
</VnLv>
|
</VnLv>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
@ -86,12 +86,12 @@ onBeforeMount(async () => {
|
||||||
<VnTitle :url="basicDataUrl" :text="t('globals.summary.basicData')" />
|
<VnTitle :url="basicDataUrl" :text="t('globals.summary.basicData')" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('worker.summary.fiDueDate')"
|
:label="t('worker.summary.fiDueDate')"
|
||||||
:value="toDate(worker.fiDueDate)"
|
:value="toDate(advancedSummary.fiDueDate)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('worker.summary.sex')" :value="worker.sex" />
|
<VnLv :label="t('worker.summary.sex')" :value="worker.sex" />
|
||||||
<VnLv
|
<VnLv
|
||||||
:label="t('worker.summary.seniority')"
|
:label="t('worker.summary.seniority')"
|
||||||
:value="toDate(worker.seniority)"
|
:value="toDate(advancedSummary.seniority)"
|
||||||
/>
|
/>
|
||||||
<VnLv :label="t('worker.summary.fi')" :value="advancedSummary.fi" />
|
<VnLv :label="t('worker.summary.fi')" :value="advancedSummary.fi" />
|
||||||
<VnLv
|
<VnLv
|
||||||
|
|
|
@ -306,7 +306,7 @@ async function autofillBic(worker) {
|
||||||
</VnRow>
|
</VnRow>
|
||||||
<VnRow>
|
<VnRow>
|
||||||
<VnInput
|
<VnInput
|
||||||
:label="t('worker.create.street')"
|
:label="t('globals.street')"
|
||||||
:model-value="uppercaseStreetModel(data).get()"
|
:model-value="uppercaseStreetModel(data).get()"
|
||||||
@update:model-value="uppercaseStreetModel(data).set"
|
@update:model-value="uppercaseStreetModel(data).set"
|
||||||
:disable="data.isFreelance"
|
:disable="data.isFreelance"
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
videos/*
|
reports/*
|
||||||
screenshots/*
|
screenshots/*
|
||||||
|
|
|
@ -6,12 +6,16 @@ describe('Client list', () => {
|
||||||
cy.visit('/#/customer/list', {
|
cy.visit('/#/customer/list', {
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
onBeforeLoad(win) {
|
onBeforeLoad(win) {
|
||||||
cy.stub(win, 'open');
|
cy.stub(win, 'open')
|
||||||
|
.callsFake((url) => {
|
||||||
|
return win.open.wrappedMethod.call(win, url, '_self');
|
||||||
|
})
|
||||||
|
.as('Open');
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Client list create new client', () => {
|
it.only('Client list create new client', () => {
|
||||||
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
|
||||||
const data = {
|
const data = {
|
||||||
Name: { val: 'Name 1' },
|
Name: { val: 'Name 1' },
|
||||||
|
@ -20,9 +24,9 @@ describe('Client list', () => {
|
||||||
'Web user': { val: 'user_test_1' },
|
'Web user': { val: 'user_test_1' },
|
||||||
Street: { val: 'C/ STREET 1' },
|
Street: { val: 'C/ STREET 1' },
|
||||||
Email: { val: 'user.test@1.com' },
|
Email: { val: 'user.test@1.com' },
|
||||||
'Business type': { val: 'Otros', type: 'select' },
|
'Sales person': { val: 'employee', type: 'select' },
|
||||||
'Sales person': { val: 'salesboss', type: 'select' },
|
|
||||||
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
|
Location: { val: '46000, Valencia(Province one), España', type: 'select' },
|
||||||
|
'Business type': { val: 'Otros', type: 'select' },
|
||||||
};
|
};
|
||||||
cy.fillInForm(data);
|
cy.fillInForm(data);
|
||||||
|
|
||||||
|
@ -47,17 +51,28 @@ describe('Client list', () => {
|
||||||
it('Client founded create ticket', () => {
|
it('Client founded create ticket', () => {
|
||||||
const search = 'Jessica Jones';
|
const search = 'Jessica Jones';
|
||||||
cy.searchByLabel('Name', search);
|
cy.searchByLabel('Name', search);
|
||||||
cy.clickButtonsDescriptor(2);
|
cy.openActionDescriptor('Create ticket');
|
||||||
cy.waitForElement('#formModel');
|
cy.waitForElement('#formModel');
|
||||||
cy.waitForElement('.q-form');
|
cy.waitForElement('.q-form');
|
||||||
cy.checkValueForm(1, search);
|
cy.checkValueSelectForm(1, search);
|
||||||
|
cy.checkValueSelectForm(2, search);
|
||||||
|
// cy.get('@Open').should('have.been.calledOnceWithExactly', [
|
||||||
|
// '/#/ticket/list?table={"clientFk":1110}&createForm={"addressId":10,"clientId":1110}',
|
||||||
|
// '_blank',
|
||||||
|
// 'noopener,noreferrer',
|
||||||
|
// ]);
|
||||||
});
|
});
|
||||||
it('Client founded create order', () => {
|
it('Client founded create order', () => {
|
||||||
const search = 'Jessica Jones';
|
const search = 'Jessica Jones';
|
||||||
cy.searchByLabel('Name', search);
|
cy.searchByLabel('Name', search);
|
||||||
cy.clickButtonsDescriptor(4);
|
cy.openActionDescriptor('New order');
|
||||||
cy.waitForElement('#formModel');
|
cy.waitForElement('#formModel');
|
||||||
cy.waitForElement('.q-form');
|
cy.waitForElement('.q-form');
|
||||||
|
cy.checkValueForm(1, search);
|
||||||
cy.checkValueForm(2, search);
|
cy.checkValueForm(2, search);
|
||||||
|
// cy.get('@Open').should(
|
||||||
|
// 'have.been.calledOnceWithExactly',
|
||||||
|
// '"/#/order/list?table={"clientFk":1110}&createForm={"addressId":10,"clientFk":1110}", "_blank", "noopener,noreferrer"'
|
||||||
|
// );
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,6 +7,9 @@ describe('VnLocation', () => {
|
||||||
prefix: '.q-dialog__inner > .column > #formModel > .q-card',
|
prefix: '.q-dialog__inner > .column > #formModel > .q-card',
|
||||||
sufix: ' .q-field__inner > .q-field__control',
|
sufix: ' .q-field__inner > .q-field__control',
|
||||||
};
|
};
|
||||||
|
const countrySelector = `${createForm.prefix} > :nth-child(5) > :nth-child(3) > ${createForm.sufix}`;
|
||||||
|
const provinceSelector = `${createForm.prefix} > :nth-child(5) > :nth-child(2) > ${createForm.sufix}`;
|
||||||
|
const citySelector = `${createForm.prefix} > :nth-child(4) > :nth-child(2) > ${createForm.sufix}`;
|
||||||
describe('CreateFormDialog ', () => {
|
describe('CreateFormDialog ', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.viewport(1280, 720);
|
cy.viewport(1280, 720);
|
||||||
|
@ -17,45 +20,29 @@ describe('VnLocation', () => {
|
||||||
});
|
});
|
||||||
it('should filter provinces based on selected country', () => {
|
it('should filter provinces based on selected country', () => {
|
||||||
// Select a country
|
// Select a country
|
||||||
cy.selectOption(
|
cy.selectOption(countrySelector, 'Ecuador');
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
|
|
||||||
'Ecuador'
|
|
||||||
);
|
|
||||||
// Verify that provinces are filtered
|
// Verify that provinces are filtered
|
||||||
cy.get(
|
cy.get(countrySelector).should('have.length', 1);
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
|
|
||||||
).should('have.length', 1);
|
|
||||||
|
|
||||||
// Verify that towns are filtered
|
// Verify that towns are filtered
|
||||||
cy.get(
|
cy.get(citySelector).should('have.length', 1);
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
|
|
||||||
).should('have.length', 1);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should filter towns based on selected province', () => {
|
it('should filter towns based on selected province', () => {
|
||||||
// Select a country
|
// Select a country
|
||||||
cy.selectOption(
|
cy.selectOption(countrySelector, 'Ecuador');
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`,
|
|
||||||
'Ecuador'
|
|
||||||
);
|
|
||||||
// Verify that provinces are filtered
|
// Verify that provinces are filtered
|
||||||
cy.get(
|
cy.get(provinceSelector).should('have.length', 1);
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(3)> ${createForm.sufix}`
|
|
||||||
).should('have.length', 1);
|
|
||||||
|
|
||||||
// Verify that towns are filtered
|
// Verify that towns are filtered
|
||||||
cy.get(
|
cy.get(citySelector).should('have.length', 1);
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-field:nth-child(3)> ${createForm.sufix}`
|
|
||||||
).should('have.length', 1);
|
|
||||||
});
|
});
|
||||||
it('should pass selected country', () => {
|
it('should pass selected country', () => {
|
||||||
// Select a country
|
// Select a country
|
||||||
const country = 'Ecuador';
|
const country = 'Ecuador';
|
||||||
const province = 'Province five';
|
const province = 'Province five';
|
||||||
cy.selectOption(
|
|
||||||
`${createForm.prefix} > :nth-child(5) > .q-field:nth-child(5)> ${createForm.sufix}`,
|
cy.selectOption(countrySelector, country);
|
||||||
country
|
|
||||||
);
|
|
||||||
cy.selectOption(
|
cy.selectOption(
|
||||||
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
`${createForm.prefix} > :nth-child(4) > .q-select > ${createForm.sufix}`,
|
||||||
province
|
province
|
||||||
|
|
|
@ -106,7 +106,6 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
|
||||||
case 'select':
|
case 'select':
|
||||||
cy.wrap(el).type(val);
|
cy.wrap(el).type(val);
|
||||||
cy.get('.q-menu .q-item').contains(val).click();
|
cy.get('.q-menu .q-item').contains(val).click();
|
||||||
cy.get('body').click();
|
|
||||||
break;
|
break;
|
||||||
case 'date':
|
case 'date':
|
||||||
cy.wrap(el).type(val.split('-').join(''));
|
cy.wrap(el).type(val.split('-').join(''));
|
||||||
|
@ -295,16 +294,16 @@ Cypress.Commands.add('checkNotification', (text) => {
|
||||||
throw new Error(`Notification not found: "${text}"`);
|
throw new Error(`Notification not found: "${text}"`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
// :nth-child(2) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container
|
||||||
Cypress.Commands.add('checkValueForm', (id, search) => {
|
Cypress.Commands.add('checkValueForm', (id, search) => {
|
||||||
cy.get(
|
cy.get(
|
||||||
`.grid-create > :nth-child(${id}) > .q-field__inner>.q-field__control> .q-field__control-container>.q-field__native >.q-field__input`
|
`.grid-create > :nth-child(${id}) > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`
|
||||||
).should('have.value', search);
|
).should('have.value', search);
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('checkValueSelectForm', (id, search) => {
|
Cypress.Commands.add('checkValueSelectForm', (id, search) => {
|
||||||
cy.get(
|
cy.get(
|
||||||
`.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container>.q-field__native>.q-field__input`
|
`.grid-create > :nth-child(${id}) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > .q-field__input`
|
||||||
).should('have.value', search);
|
).should('have.value', search);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue