diff --git a/Jenkinsfile b/Jenkinsfile
index 0027e1cbe..7d2957a1c 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -75,16 +75,12 @@ pipeline {
steps {
sh 'pnpm run test:unit:ci'
}
- post {
+ post {
always {
- script {
- try {
- junit 'junitresults.xml'
- junit 'junit.xml'
- } catch (e) {
- echo e.toString()
- }
- }
+ junit(
+ testResults: 'junitresults.xml',
+ allowEmptyResults: true
+ )
}
}
}
diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue
index 9bb05d439..c8fa5809c 100644
--- a/src/components/CrudModel.vue
+++ b/src/components/CrudModel.vue
@@ -176,8 +176,8 @@ async function remove(data) {
.dialog({
component: VnConfirm,
componentProps: {
- title: t('confirmDeletion'),
- message: t('confirmDeletionMessage'),
+ title: t('globals.confirmDeletion'),
+ message: t('globals.confirmDeletionMessage'),
newData,
ids,
},
@@ -317,16 +317,3 @@ watch(formUrl, async () => {
color="primary"
/>
-
-
- {
- "en": {
- "confirmDeletion": "Confirm deletion",
- "confirmDeletionMessage": "Are you sure you want to delete this?"
- },
- "es": {
- "confirmDeletion": "Confirmar eliminación",
- "confirmDeletionMessage": "Seguro que quieres eliminar?"
- }
- }
-
diff --git a/src/components/EditPictureForm.vue b/src/components/EditPictureForm.vue
index 9f69896b5..3d7f3615b 100644
--- a/src/components/EditPictureForm.vue
+++ b/src/components/EditPictureForm.vue
@@ -272,7 +272,7 @@ const makeRequest = async () => {
class="cursor-pointer q-mr-sm"
@click="openInputFile()"
>
-
+
{{
diff --git a/src/components/FetchData.vue b/src/components/FetchData.vue
index 4f5d7a57d..5b3dcbea7 100644
--- a/src/components/FetchData.vue
+++ b/src/components/FetchData.vue
@@ -59,11 +59,4 @@ async function fetch(fetchFilter = {}) {
//
}
}
-
-const render = () => {
- return h('div', []);
-};
-
-
-
diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue
index 9fd16088c..912ce8ea7 100644
--- a/src/components/FormModel.vue
+++ b/src/components/FormModel.vue
@@ -59,6 +59,10 @@ const $props = defineProps({
type: Function,
default: null,
},
+ saveFn: {
+ type: Function,
+ default: null,
+ },
});
const emit = defineEmits(['onFetch', 'onDataSaved']);
@@ -75,9 +79,8 @@ onMounted(async () => {
});
// Podemos enviarle al form la estructura de data inicial sin necesidad de fetchearla
- if ($props.formInitialData && !$props.autoLoad) {
- state.set($props.model, $props.formInitialData);
- } else {
+ state.set($props.model, $props.formInitialData ?? {});
+ if ($props.autoLoad && !$props.formInitialData) {
await fetch();
}
@@ -138,17 +141,20 @@ async function save() {
try {
const body = $props.mapper ? $props.mapper(formData.value) : formData.value;
let response;
- if ($props.urlCreate) {
- response = await axios.post($props.urlCreate, body);
- notify('globals.dataCreated', 'positive');
- } else {
- response = await axios.patch($props.urlUpdate || $props.url, body);
- }
+ if ($props.saveFn) response = await $props.saveFn(body);
+ else
+ response = await axios[$props.urlCreate ? 'post' : 'patch'](
+ $props.urlCreate || $props.urlUpdate || $props.url,
+ body
+ );
+ if ($props.urlCreate) notify('globals.dataCreated', 'positive');
+
emit('onDataSaved', formData.value, response?.data);
originalData.value = JSON.parse(JSON.stringify(formData.value));
hasChanges.value = false;
} catch (err) {
- notify('errors.create', 'negative');
+ console.error(err);
+ notify('errors.writeRequest', 'negative');
}
isLoading.value = false;
}
diff --git a/src/components/common/VnDms.vue b/src/components/common/VnDms.vue
new file mode 100644
index 000000000..d2651f5d8
--- /dev/null
+++ b/src/components/common/VnDms.vue
@@ -0,0 +1,201 @@
+
+
+ (warehouses = data)" auto-load />
+ (companies = data)" auto-load />
+
+ (allowedContentTypes = data.join(','))"
+ auto-load
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ t('globals.selectFile') }}
+
+
+ {{
+ t('contentTypesInfo', { allowedContentTypes })
+ }}
+
+
+
+
+
+
+
+
+
+
+en:
+ contentTypesInfo: Allowed file types {allowedContentTypes}
+ EntryDmsDescription: Reference {reference}
+es:
+ Generate identifier for original file: Generar identificador para archivo original
+ contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
+ EntryDmsDescription: Referencia {reference}
+
+
diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue
new file mode 100644
index 000000000..5057c0790
--- /dev/null
+++ b/src/components/common/VnDmsList.vue
@@ -0,0 +1,316 @@
+
+
+
+
+
+
+
+
+ {{ props.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ col.label }}:
+ {{ col.value }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+en:
+ contentTypesInfo: Allowed file types {allowedContentTypes}
+es:
+ contentTypesInfo: Tipos de archivo permitidos {allowedContentTypes}
+ Generate identifier for original file: Generar identificador para archivo original
+
diff --git a/src/components/ui/VnLv.vue b/src/components/ui/VnLv.vue
index 0e4a055eb..72c05ae6a 100644
--- a/src/components/ui/VnLv.vue
+++ b/src/components/ui/VnLv.vue
@@ -1,8 +1,9 @@
@@ -521,37 +515,50 @@ const selectSalesPersonId = (id) => {
class="full-width q-mt-md"
row-key="id"
:visible-columns="visibleColumns"
+ @row-click="(evt, row, id) => navigateToTravelId(row.id)"
>
-
-
-
+
+ {{ value }}
+
+
+
+
+
-
- {{ dashIfEmpty(col.value) }}
-
-
-
-
-
+
+ {{ props.row.id }}
+
+
+
+
+
+
+
+ {{ props.row.salesPerson }}
+
+ -
+
+
+
+
+
+
diff --git a/src/pages/Entry/Card/EntryBuysImport.vue b/src/pages/Entry/Card/EntryBuysImport.vue
index 21f0beada..3e0ac1410 100644
--- a/src/pages/Entry/Card/EntryBuysImport.vue
+++ b/src/pages/Entry/Card/EntryBuysImport.vue
@@ -44,7 +44,7 @@ const columns = computed(() => [
align: 'left',
},
{
- label: t('entry.buys.description'),
+ label: t('globals.description'),
name: 'description',
field: 'description',
align: 'left',
@@ -214,7 +214,7 @@ const redirectToBuysView = () => {
class="cursor-pointer"
@click="inputFileRef.pickFiles()"
>
- {{ t('Select a file') }}
+ {{ t('globals.selectFile') }}
@@ -292,6 +292,6 @@ const redirectToBuysView = () => {
es:
- Select a file: Selecciona un fichero
+ globals.selectFile: Selecciona un fichero
Some of the imported buys does not have an item: Algunas de las compras importadas no tienen un artículo
diff --git a/src/pages/Entry/Card/EntryDms.vue b/src/pages/Entry/Card/EntryDms.vue
new file mode 100644
index 000000000..bab1ea6c2
--- /dev/null
+++ b/src/pages/Entry/Card/EntryDms.vue
@@ -0,0 +1,11 @@
+
+
+
+
diff --git a/src/pages/Entry/Card/EntryNotes.vue b/src/pages/Entry/Card/EntryNotes.vue
index f56e59253..0d2e5e51a 100644
--- a/src/pages/Entry/Card/EntryNotes.vue
+++ b/src/pages/Entry/Card/EntryNotes.vue
@@ -63,7 +63,7 @@ onMounted(() => {
diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue
index f4a423f3b..09a6a2f27 100644
--- a/src/pages/Entry/EntryLatestBuys.vue
+++ b/src/pages/Entry/EntryLatestBuys.vue
@@ -59,7 +59,7 @@ const columns = computed(() => [
align: 'left',
},
{
- label: t('entry.latestBuys.description'),
+ label: t('globals.description'),
field: 'description',
name: 'description',
align: 'left',
@@ -214,7 +214,7 @@ const editTableCellFormFieldsOptions = [
{ field: 'grouping', label: t('entry.latestBuys.grouping') },
{ field: 'packageValue', label: t('entry.latestBuys.packageValue') },
{ field: 'weight', label: t('entry.latestBuys.weight') },
- { field: 'description', label: t('entry.latestBuys.description') },
+ { field: 'description', label: t('globals.description') },
{ field: 'size', label: t('entry.latestBuys.size') },
{ field: 'weightByPiece', label: t('entry.latestBuys.weightByPiece') },
{ field: 'packingOut', label: t('entry.latestBuys.packingOut') },
diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
index 2a29a3d0e..f557c8ef4 100644
--- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
+++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue
@@ -174,7 +174,12 @@ async function upsert() {
@on-fetch="(data) => (userConfig = data)"
auto-load
/>
-
+
@@ -509,7 +514,7 @@ async function upsert() {
@click="inputFileRef.pickFiles()"
>
- {{ t('Select a file') }}
+ {{ t('globals.selectFile') }}
@@ -618,7 +623,7 @@ async function upsert() {
@click="inputFileRef.pickFiles()"
>
- {{ t('Select a file') }}
+ {{ t('globals.selectFile') }}
@@ -687,7 +692,6 @@ async function upsert() {
Generate identifier for original file: Generar identificador para archivo original
File: Fichero
Create document: Crear documento
- Select a file: Seleccione un fichero
Allowed content types: Tipos de archivo permitidos
The company can't be empty: La empresa no puede estar vacía
The warehouse can't be empty: El almacén no puede estar vacío
diff --git a/src/pages/Order/Card/OrderSummary.vue b/src/pages/Order/Card/OrderSummary.vue
index 9b26891a1..f9704a480 100644
--- a/src/pages/Order/Card/OrderSummary.vue
+++ b/src/pages/Order/Card/OrderSummary.vue
@@ -31,7 +31,7 @@ const detailsColumns = ref([
},
{
name: 'description',
- label: t('order.summary.description'),
+ label: t('globals.description'),
field: (row) => row?.item?.name,
},
{
@@ -167,7 +167,7 @@ const detailsColumns = ref([
{{ t('order.summary.item') }}
- {{ t('order.summary.description') }}
+ {{ t('globals.description') }}
{{ t('order.summary.quantity') }}
{{ t('order.summary.price') }}
{{ t('order.summary.amount') }}
diff --git a/src/pages/Route/Card/RouteSummary.vue b/src/pages/Route/Card/RouteSummary.vue
index a10ca088e..df4495d3a 100644
--- a/src/pages/Route/Card/RouteSummary.vue
+++ b/src/pages/Route/Card/RouteSummary.vue
@@ -199,7 +199,7 @@ const openBuscaman = async (route, ticket) => {
{{ dashIfEmpty(entity?.route?.description) }}
diff --git a/src/pages/Ticket/Card/TicketSummary.vue b/src/pages/Ticket/Card/TicketSummary.vue
index fe7dcee9a..f3e01d06b 100644
--- a/src/pages/Ticket/Card/TicketSummary.vue
+++ b/src/pages/Ticket/Card/TicketSummary.vue
@@ -270,7 +270,7 @@ async function changeState(value) {
{{ t('ticket.summary.visible') }}
{{ t('ticket.summary.available') }}
{{ t('ticket.summary.quantity') }}
- {{ t('ticket.summary.description') }}
+ {{ t('globals.description') }}
{{ t('ticket.summary.price') }}
{{ t('ticket.summary.discount') }}
{{ t('globals.amount') }}
@@ -425,7 +425,7 @@ async function changeState(value) {
{{ t('ticket.summary.quantity') }}
- {{ t('ticket.summary.description') }}
+ {{ t('globals.description') }}
{{ t('ticket.summary.price') }}
{{ t('ticket.summary.taxClass') }}
{{ t('globals.amount') }}
diff --git a/src/pages/Travel/Card/TravelThermographsForm.vue b/src/pages/Travel/Card/TravelThermographsForm.vue
index 6758cb6ff..4462846cb 100644
--- a/src/pages/Travel/Card/TravelThermographsForm.vue
+++ b/src/pages/Travel/Card/TravelThermographsForm.vue
@@ -300,7 +300,7 @@ const onThermographCreated = async (data) => {
import('src/pages/Entry/Card/EntryNotes.vue'),
},
+ {
+ path: 'dms',
+ name: 'EntryDms',
+ meta: {
+ title: 'dms',
+ icon: 'smb_share',
+ },
+ component: () => import('src/pages/Entry/Card/EntryDms.vue'),
+ },
{
path: 'log',
name: 'EntryLog',
diff --git a/test/cypress/integration/claim/claimDevelopment.spec.js b/test/cypress/integration/claim/claimDevelopment.spec.js
index 88ccbfab8..26c7ee196 100755
--- a/test/cypress/integration/claim/claimDevelopment.spec.js
+++ b/test/cypress/integration/claim/claimDevelopment.spec.js
@@ -13,7 +13,7 @@ describe('ClaimDevelopment', () => {
it('should reset line', () => {
cy.selectOption(firstLineReason, 'Novato');
cy.resetCard();
- cy.getValue(firstLineReason).should('have.value', 'Prisas');
+ cy.getValue(firstLineReason).should('equal', 'Prisas');
});
it('should edit line', () => {
@@ -23,7 +23,7 @@ describe('ClaimDevelopment', () => {
cy.login('developer');
cy.visit(`/#/claim/${claimId}/development`);
- cy.getValue(firstLineReason).should('have.value', 'Novato');
+ cy.getValue(firstLineReason).should('equal', 'Novato');
//Restart data
cy.selectOption(firstLineReason, 'Prisas');
diff --git a/test/cypress/integration/entry/entryDms.spec.js b/test/cypress/integration/entry/entryDms.spec.js
new file mode 100644
index 000000000..79a9c5162
--- /dev/null
+++ b/test/cypress/integration/entry/entryDms.spec.js
@@ -0,0 +1,41 @@
+describe('WagonTypeCreate', () => {
+ const entryId = 1;
+
+ beforeEach(() => {
+ cy.viewport(1920, 1080);
+ cy.login('developer');
+ cy.visit(`/#/entry/${entryId}/dms`);
+
+ });
+
+ it('should create edit and remove new dms', () => {
+ cy.addRow();
+ cy.get('.icon-attach').click()
+ cy.get('.q-file').selectFile('test/cypress/fixtures/image.jpg', {
+ force: true,
+ });
+
+ cy.get("tbody > tr").then((value) => {
+ //Create and check if exist new row
+ let newFileTd = Cypress.$(value).length;
+ cy.get('.q-btn--standard > .q-btn__content > .block').click();
+ expect(value).to.have.length(newFileTd++);
+ const newRowSelector = `tbody > :nth-child(${newFileTd})`
+ cy.waitForElement(newRowSelector);
+
+ //Edit new dms
+ const u = undefined;
+ cy.validateRow(newRowSelector, [u,u,u,u,'ENTRADA ID 1'])
+ cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click();
+ })
+ // cy.log('newFileTd', newFileTd)
+
+ // //Create and check if exist new row
+ // cy.log('newFileTd:', newFileTd);
+ // cy.get(`tbody :nth-child(${newFileTd}) > .text-right > .flex > :nth-child(2) > .q-btn > .q-btn__content > .q-icon`).click()
+
+ // cy.get(`tbody :nth-child(${newFileTd}) > :nth-child(5) > .q-tr > :nth-child(1) > span`).then((value) => {
+ // cy.log(value)
+ // });
+ });
+});
diff --git a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
index 5024b2f1c..306c0b8c0 100644
--- a/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInIntrastat.spec.js
@@ -18,7 +18,7 @@ describe('InvoiceInIntrastat', () => {
cy.visit(`/#/invoice-in/1/intrastat`);
cy.getValue(firstLineCode).should(
- 'have.value',
+ 'equal',
'Plantas vivas: Esqueje/injerto, Vid'
);
});
diff --git a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
index 26c7750ad..811374b98 100644
--- a/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
+++ b/test/cypress/integration/invoiceIn/invoiceInVat.spec.js
@@ -21,7 +21,7 @@ describe('InvoiceInVat', () => {
cy.saveCard();
cy.visit(`/#/invoice-in/1/vat`);
- cy.getValue(firstLineVat).should('have.value', 'H.P. IVA 21% CEE');
+ cy.getValue(firstLineVat).should('equal', 'H.P. IVA 21% CEE');
});
it('should add a new row', () => {
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 6d627e631..f075d500f 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -42,7 +42,7 @@ Cypress.Commands.add('login', (user) => {
});
Cypress.Commands.add('waitForElement', (element) => {
- cy.get(element, { timeout: 2000 }).should('be.visible');
+ cy.get(element, { timeout: 5000 }).should('be.visible');
});
Cypress.Commands.add('getValue', (selector) => {
@@ -55,7 +55,13 @@ Cypress.Commands.add('getValue', (selector) => {
return cy.get(
selector +
'> .q-field > .q-field__inner > .q-field__control > .q-field__control-container > .q-field__native > input'
- );
+ ).invoke('val')
+ }
+ // Si es un QSelect
+ if ($el.find('span').length) {
+ return cy.get(
+ selector + ' span'
+ ).then(($span) => { return $span[0].innerText })
}
// Puedes añadir un log o lanzar un error si el elemento no es reconocido
cy.log('Elemento no soportado');
@@ -126,12 +132,13 @@ Cypress.Commands.add('validateRow', (rowSelector, expectedValues) => {
cy.get(rowSelector).within(() => {
for (const [index, value] of expectedValues.entries()) {
cy.log('CHECKING ', index, value);
+ if(value === undefined) continue
if (typeof value == 'boolean') {
const prefix = value ? '' : 'not.';
cy.getValue(`:nth-child(${index + 1})`).should(`${prefix}be.checked`);
continue;
}
- cy.getValue(`:nth-child(${index + 1})`).should('have.value', value);
+ cy.getValue(`:nth-child(${index + 1})`).should('equal', value)
}
});
});