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 @@ + + + + +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 @@ + + + + +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 @@ @@ -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 /> - +