diff --git a/package.json b/package.json index e2e75f253..04b75a0b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.44.0", + "version": "24.50.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -64,4 +64,4 @@ "vite": "^5.1.4", "vitest": "^0.31.1" } -} +} \ No newline at end of file diff --git a/src/components/CreateManualInvoiceForm.vue b/src/components/CreateManualInvoiceForm.vue deleted file mode 100644 index da006e024..000000000 --- a/src/components/CreateManualInvoiceForm.vue +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - -es: - Create manual invoice: Crear factura manual - Ticket: Ticket - Client: Cliente - Max date: Fecha límite - Serial: Serie - Area: Area - Reference: Referencia - Or: O - Invoicing in progress...: Facturación en progreso... - diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index a4cb55a2c..0de5d3aa2 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -77,7 +77,7 @@ const isLoading = ref(false); const hasChanges = ref(false); const originalData = ref(); const vnPaginateRef = ref(); -const formData = ref(); +const formData = ref([]); const saveButtonRef = ref(null); const watchChanges = ref(); const formUrl = computed(() => $props.url); diff --git a/src/components/LeftMenu.vue b/src/components/LeftMenu.vue index 6e0ae5907..ab2931dfd 100644 --- a/src/components/LeftMenu.vue +++ b/src/components/LeftMenu.vue @@ -22,7 +22,7 @@ const props = defineProps({ default: 'main', }, }); - +const initialized = ref(false); const items = ref([]); const expansionItemElements = reactive({}); const pinnedModules = computed(() => { @@ -34,18 +34,26 @@ const search = ref(null); const filteredItems = computed(() => { if (!search.value) return items.value; + const normalizedSearch = normalize(search.value); return items.value.filter((item) => { - const locale = t(item.title).toLowerCase(); - return locale.includes(search.value.toLowerCase()); + const locale = normalize(t(item.title)); + return locale.includes(normalizedSearch); }); }); const filteredPinnedModules = computed(() => { if (!search.value) return pinnedModules.value; + const normalizedSearch = search.value + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase(); const map = new Map(); for (const [key, pinnedModule] of pinnedModules.value) { - const locale = t(pinnedModule.title).toLowerCase(); - if (locale.includes(search.value.toLowerCase())) map.set(key, pinnedModule); + const locale = t(pinnedModule.title) + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase(); + if (locale.includes(normalizedSearch)) map.set(key, pinnedModule); } return map; }); @@ -53,11 +61,13 @@ const filteredPinnedModules = computed(() => { onMounted(async () => { await navigation.fetchPinned(); getRoutes(); + initialized.value = true; }); watch( () => route.matched, () => { + if (!initialized.value) return; items.value = []; getRoutes(); }, @@ -147,6 +157,13 @@ async function togglePinned(item, event) { const handleItemExpansion = (itemName) => { expansionItemElements[itemName].scrollToLastElement(); }; + +function normalize(text) { + return text + .normalize('NFD') + .replace(/[\u0300-\u036f]/g, '') + .toLowerCase(); +}