diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf6bdcc3..c97c4181f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,14 +5,29 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2418.01] + +## [2416.01] - 2024-04-18 + +### Added + +### Fixed + +- (General) => Se vuelven a mostrar los parámetros en la url al aplicar un filtro + ## [2414.01] - 2024-04-04 ### Added +- (Tickets) => Se añade la opción de clonar ticket. #6951 +- (Parking) => Se añade la sección Parking. #5186 + ### Changed ### Fixed +- (General) => Se corrige la redirección cuando hay 1 solo registro y cuando se aplica un filtro diferente al id al hacer una búsqueda general. #6893 + ## [2400.01] - 2024-01-04 ### Added diff --git a/cypress.config.js b/cypress.config.js index 1934f833e..e2046d6c4 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -3,6 +3,7 @@ const { defineConfig } = require('cypress'); module.exports = defineConfig({ e2e: { baseUrl: 'http://localhost:9000/', + experimentalStudio: true, fixturesFolder: 'test/cypress/fixtures', screenshotsFolder: 'test/cypress/screenshots', supportFile: 'test/cypress/support/index.js', diff --git a/package.json b/package.json index a35020b66..88f430d7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.14.0", + "version": "24.18.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/quasar.config.js b/quasar.config.js index 2d8289508..5ce46667c 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -29,7 +29,7 @@ module.exports = configure(function (/* ctx */) { // app boot file (/src/boot) // --> boot files are part of "main.js" // https://v2.quasar.dev/quasar-cli/boot-files - boot: ['i18n', 'axios', 'vnDate', 'validations'], + boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar.defaults'], // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css css: ['app.scss'], @@ -117,6 +117,7 @@ module.exports = configure(function (/* ctx */) { secure: false, }, }, + open: false, }, // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework diff --git a/src/App.vue b/src/App.vue index d0d8c9358..27cc34c38 100644 --- a/src/App.vue +++ b/src/App.vue @@ -16,7 +16,7 @@ onMounted(() => { if (availableLocales.includes(userLang)) { locale.value = userLang; } else { - locale.value = fallbackLocale; + locale.value = fallbackLocale.value; } }); diff --git a/src/boot/defaults/qTable.js b/src/boot/defaults/qTable.js new file mode 100644 index 000000000..8902d4266 --- /dev/null +++ b/src/boot/defaults/qTable.js @@ -0,0 +1,5 @@ +import { QTable } from 'quasar'; +import setDefault from './setDefault'; + +setDefault(QTable, 'pagination', { rowsPerPage: 0 }); +setDefault(QTable, 'hidePagination', true); diff --git a/src/boot/defaults/setDefault.js b/src/boot/defaults/setDefault.js new file mode 100644 index 000000000..7d56a1a3e --- /dev/null +++ b/src/boot/defaults/setDefault.js @@ -0,0 +1,18 @@ +export default function (component, key, value) { + const prop = component.props[key]; + switch (typeof prop) { + case 'object': + prop.default = value; + break; + case 'function': + component.props[key] = { + type: prop, + default: value, + }; + break; + case 'undefined': + throw new Error('unknown prop: ' + key); + default: + throw new Error('unhandled type: ' + typeof prop); + } +} diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js new file mode 100644 index 000000000..8c89c9202 --- /dev/null +++ b/src/boot/qformMixin.js @@ -0,0 +1,21 @@ +import { getCurrentInstance } from 'vue'; + +const filterAvailableInput = element => element.classList.contains('q-field__native') && !element.disabled +const filterAvailableText = element => element.__vueParentComponent.type.name === 'QInput' && element.__vueParentComponent?.attrs?.class !== 'vn-input-date'; + + +export default { + mounted: function () { + const vm = getCurrentInstance(); + if (vm.type.name === 'QForm') + if (!['searchbarForm','filterPanelForm'].includes(this.$el?.id)) { + // AUTOFOCUS + const elementsArray = Array.from(this.$el.elements); + const firstInputElement = elementsArray.filter(filterAvailableInput).find(filterAvailableText); + + if (firstInputElement) { + firstInputElement.focus(); + } + } + }, +}; diff --git a/src/boot/quasar.defaults.js b/src/boot/quasar.defaults.js new file mode 100644 index 000000000..c792100d7 --- /dev/null +++ b/src/boot/quasar.defaults.js @@ -0,0 +1 @@ +export * from './defaults/qTable'; diff --git a/src/boot/quasar.js b/src/boot/quasar.js new file mode 100644 index 000000000..a8d9b7ad9 --- /dev/null +++ b/src/boot/quasar.js @@ -0,0 +1,6 @@ +import { boot } from 'quasar/wrappers'; +import qFormMixin from './qformMixin'; + +export default boot(({ app }) => { + app.mixin(qFormMixin); +}); diff --git a/src/components/CreateManualInvoiceForm.vue b/src/components/CreateManualInvoiceForm.vue new file mode 100644 index 000000000..f03afbf35 --- /dev/null +++ b/src/components/CreateManualInvoiceForm.vue @@ -0,0 +1,174 @@ + + + + + + + +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/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index 47836c05b..02e84849c 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -28,8 +28,23 @@ const countriesOptions = ref([]); const provincesOptions = ref([]); const townsLocationOptions = ref([]); -const onDataSaved = (dataSaved) => { - emit('onDataSaved', dataSaved); +const onDataSaved = (formData) => { + const newPostcode = { + ...formData + }; + const townObject = townsLocationOptions.value.find( + ({id}) => id === formData.townFk + ); + newPostcode.town = townObject?.name; + const provinceObject = provincesOptions.value.find( + ({id}) => id === formData.provinceFk + ); + newPostcode.province = provinceObject?.name; + const countryObject = countriesOptions.value.find( + ({id}) => id === formData.countryFk + ); + newPostcode.country = countryObject?.country; + emit('onDataSaved', newPostcode); }; const onCityCreated = async ({ name, provinceFk }, formData) => { @@ -73,7 +88,7 @@ const onProvinceCreated = async ({ name }, formData) => { :title="t('New postcode')" :subtitle="t('Please, ensure you put the correct data!')" :form-initial-data="postcodeFormData" - @on-data-saved="onDataSaved($event)" + @on-data-saved="onDataSaved" >