From 9b0d30a776d573d9fd7f424e4fc4a9ae6b300032 Mon Sep 17 00:00:00 2001 From: carlosfonseca Date: Wed, 29 Nov 2023 09:28:12 -0500 Subject: [PATCH 1/5] Primeras correcciones --- .vscode/settings.json | 2 -- src/pages/InvoiceOut/InvoiceOutList.vue | 15 +++++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index f175e4b82..817977448 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,8 +15,6 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "cSpell.words": ["axios"], - - "editor.tabSize": 2, "files.autoSave": "onFocusChange", "files.trimTrailingWhitespace": true, "editor.hover.enabled": true, diff --git a/src/pages/InvoiceOut/InvoiceOutList.vue b/src/pages/InvoiceOut/InvoiceOutList.vue index fa7af4052..2d2fd5093 100644 --- a/src/pages/InvoiceOut/InvoiceOutList.vue +++ b/src/pages/InvoiceOut/InvoiceOutList.vue @@ -1,5 +1,5 @@ @@ -110,15 +96,21 @@ const emit = defineEmits(['onFetch']); - + {{ t('components.cardDescriptor.moreOptions') }} - - - {{ option }} - + + diff --git a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue index 4271f7f38..d3e38a1fe 100644 --- a/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue +++ b/src/pages/InvoiceOut/Card/InvoiceOutDescriptor.vue @@ -7,6 +7,7 @@ import CardDescriptor from 'components/ui/CardDescriptor.vue'; import CustomerDescriptorProxy from 'pages/Customer/Card/CustomerDescriptorProxy.vue'; import VnLv from 'src/components/ui/VnLv.vue'; import useCardDescription from 'src/composables/useCardDescription'; +import InvoiceOutDescriptorMenu from './InvoiceOutDescriptorMenu.vue'; const $props = defineProps({ id: { @@ -59,6 +60,9 @@ const setData = (entity) => (data.value = useCardDescription(entity.ref, entity. @on-fetch="setData" data-key="invoiceOutData" > + From db81ab8acf99e9b43986d375e2c847b1d36cd6ed Mon Sep 17 00:00:00 2001 From: wbuezas Date: Wed, 29 Nov 2023 14:21:26 -0300 Subject: [PATCH 3/5] Cambios solicitados --- src/composables/inputSelectFilterFn.js | 33 ---- src/composables/useUserConfig.js | 3 + src/i18n/en/index.js | 5 +- src/i18n/es/index.js | 1 + src/pages/InvoiceOut/InvoiceOutGlobal.vue | 24 +-- src/pages/InvoiceOut/InvoiceOutGlobalForm.vue | 127 +++++--------- src/pages/Travel/TravelCreate.vue | 79 +++------ src/pages/Travel/TravelFilter.vue | 156 ++++++------------ src/stores/travel.js | 6 +- 9 files changed, 135 insertions(+), 299 deletions(-) delete mode 100644 src/composables/inputSelectFilterFn.js diff --git a/src/composables/inputSelectFilterFn.js b/src/composables/inputSelectFilterFn.js deleted file mode 100644 index 778d78a2a..000000000 --- a/src/composables/inputSelectFilterFn.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Filtra las opciones basadas en un valor de entrada y actualiza las opciones filtradas. - * - * @param {string} val - El valor de entrada para filtrar las opciones. (la emite el evento @filter del componente QSelect) - * @param {Function} update - Función de actualización que debe ser llamada para actualizar las opciones filtradas.(la provee el evento @filter del componente QSelect) - * @param {Function} abort - Función que puede ser llamada para abortar o cancelar el filtrado actual. (la provee el evento @filter del componente QSelect) - * @param {Object} optionsToFilter - Objeto que contiene las opciones originales y filtradas. - */ - -function normalizeString(text) { - return text - .toLowerCase() - .normalize('NFD') - .replace(/[\u0300-\u036f]/g, ''); -} - -export function inputSelectFilter(val, update, abort, optionsToFilter) { - if (val === '') { - update(() => { - optionsToFilter.filtered = JSON.parse( - JSON.stringify(optionsToFilter.original) - ); - }); - return; - } - - update(() => { - const searchQuery = val.toLowerCase(); - optionsToFilter.filtered = optionsToFilter.original.filter((option) => - normalizeString(option.label).includes(normalizeString(searchQuery)) - ); - }); -} diff --git a/src/composables/useUserConfig.js b/src/composables/useUserConfig.js index 2a22ae339..692943978 100644 --- a/src/composables/useUserConfig.js +++ b/src/composables/useUserConfig.js @@ -1,8 +1,10 @@ import axios from 'axios'; import { useState } from './useState'; +import useNotify from './useNotify'; export function useUserConfig() { const state = useState(); + const { notify } = useNotify(); async function fetch() { try { @@ -14,6 +16,7 @@ export function useUserConfig() { return data; } catch (error) { + notify('globals.errors.userConfig', 'negative'); console.error('Error fetching user config:', error); } } diff --git a/src/i18n/en/index.js b/src/i18n/en/index.js index 743977f42..d92f11789 100644 --- a/src/i18n/en/index.js +++ b/src/i18n/en/index.js @@ -44,6 +44,7 @@ export default { statusInternalServerError: 'An internal server error has ocurred', statusBadGateway: 'It seems that the server has fall down', statusGatewayTimeout: 'Could not contact the server', + userConfig: 'Error fetching user config', }, login: { title: 'Login', @@ -399,9 +400,9 @@ export default { chooseValidCompany: 'Choose a valid company', chooseValidPrinter: 'Choose a valid printer', fillDates: 'Invoice date and the max date should be filled', - invoiceDateLessThanMaxDate: "Invoice date can't be less than max date", + invoiceDateLessThanMaxDate: 'Invoice date can not be less than max date', invoiceWithFutureDate: 'Exists an invoice with a future date', - noTicketsToInvoice: "There aren't clients to invoice", + noTicketsToInvoice: 'There are not clients to invoice', criticalInvoiceError: 'Critical invoicing error, process stopped', }, table: { diff --git a/src/i18n/es/index.js b/src/i18n/es/index.js index 431553d79..3a7d09c3c 100644 --- a/src/i18n/es/index.js +++ b/src/i18n/es/index.js @@ -44,6 +44,7 @@ export default { statusInternalServerError: 'Ha ocurrido un error interno del servidor', statusBadGateway: 'Parece ser que el servidor ha caído', statusGatewayTimeout: 'No se ha podido contactar con el servidor', + userConfig: 'Error al obtener configuración de usuario', }, login: { title: 'Inicio de sesión', diff --git a/src/pages/InvoiceOut/InvoiceOutGlobal.vue b/src/pages/InvoiceOut/InvoiceOutGlobal.vue index 20ed4695a..c4e853219 100644 --- a/src/pages/InvoiceOut/InvoiceOutGlobal.vue +++ b/src/pages/InvoiceOut/InvoiceOutGlobal.vue @@ -74,20 +74,6 @@ const columns = computed(() => { ]; }); -const cardStatusText = computed(() => { - return t(`status.${status.value}`); -}); - -const percentageStatusText = computed(() => { - return `${getPercentage.value}% (${getAddressNumber.value} ${t('of')} ${ - getNAddresses.value - })`; -}); - -const pdfStatusText = computed(() => { - return `${nPdfs.value} ${t('of')} ${totalPdfs.value} PDFs`; -}); - const rows = computed(() => { if (!errors && !errors.length > 0) return []; return errors.value.map((row) => { @@ -110,7 +96,7 @@ onUnmounted(() => {