diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a973777a..8e1d4c433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,36 +1,57 @@ -# Version 24.36 - 2024-09-03 +# Version 24.36 - 2024-08-27 ### Added 🆕 -- Cesta → Se añaden notas -- Trabajadore → Se puede modificar la foto -- General → Recuperar y restaurar contraseña +- feat(FormModel): trim data by default by:alexm +- feat(orderBasicData): add notes by:alexm +- feat(orderList): correct create order by:alexm +- feat(orderList): use orderFilter and fixed this by:alexm +- feat: #7323 handle workerPhoto (origin/7323_workerPhoto, 7323_workerPhoto) by:Javier Segarra +- feat: add recover password and reset password by:alexm +- feat: refs #7346 add seriaType option by:jgallego +- feat: refs #7346 elimino === by:jgallego +- feat: refs #7346 formdata uses serialType by:jgallego +- feat: refs #7346 refactor by:jgallego +- feat: refs #7346 sonarLint warnings (origin/7346-invoiceOutMultilple, 7346-invoiceOutMultilple) by:jgallego +- feat: refs #7710 uses cloneAll by:jgallego +- fix: refs #7717 fix OrderList table filters' and summary table style by:Jon ### Changed 📦 -- (General) Modificado filtro lateral +- feat: refs #7346 refactor by:jgallego +- perf: date fields (mindshore/feature/TicketFutureFilter, feature/TicketFutureFilter) by:Javier Segarra +- perf: refs #7717 right menu filter by:Jon +- perf: use ref at component start by:Javier Segarra +- refactor: refs #7717 delete useless function and import by:Jon +- refactor: refs #7717 deleted useless code by:Jon ### Fixed 🛠️ -- Cesta → Mejoras varias -- Reclamaciones → Mejoras varias -- Usuarios → Mejoras varias +- feat(orderList): use orderFilter and fixed this by:alexm +- fix(VnTable): orderBy v-model by:alexm +- fix(account_card): redirection by:carlossa +- fix(orderLines): reload when delete and redirect when confirm by:alexm +- fix: #6336 ClaimListStates by:Javier Segarra +- fix: account subsections cards by:carlossa +- fix: duplicate key by:Jon +- fix: order description to vnTable by:alexm +- fix: orderCatalogFilter order by:alexm +- fix: quasar build warnings (6336_claim_fix_states) by:Javier Segarra +- fix: refs #7717 fix OrderList table filters' and summary table style by:Jon +- fix: refs #7717 fix basic data form & minor errors by:Jon +- fix: refs #7717 fix catalog filter, searchbar redirect and search by:Jon +- fix: refs #7717 fix catalog searchbar and worker tests(refs #7323) by:Jon +- fix: refs #7717 fix order sections by:Jon +- fix: refs #7717 fix volume and lines redirect by:Jon +- fix: refs #7717 fixed searchbar filter with rightmenu filters' applied by:Jon +- fix: test by:alexm +- fix: ticketDescriptorMenu by:Javier Segarra +- refs #7355 account fixes by:carlossa # Version 24.34 - 2024-08-20 ### Added 🆕 -## Changed 📦 - -- General → Trabajadores: Migrado de Salix a Lilium - -## Fixed 🛠️ - -- Artículos → General: Arreglados fallos de interfaz -- Fact. Recibidas → General: Arreglados fallos de interfaz -- Trabajadores → General: Arreglados fallos de interfaz -- Usuarios → General: Arreglados fallos de interfaz - - chore: #6900 order params by:jorgep - chore: refs #6900 drop console log by:jorgep - chore: refs #6900 drop vnCurrency by:jorgep @@ -113,7 +134,7 @@ - refs #7355 fix lists redirects summary by:carlossa - refs #7355 fix roles by:carlossa - refs #7355 fix search exprBuilder by:carlossa -- refs #7355 fix vnTable by:carlos +- refs #7355 fix vnTable by:carlossa # Version 24.32 - 2024-08-06 diff --git a/package.json b/package.json index 72bada823..f25e570a3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.34.0", + "version": "24.36.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/boot/keyShortcut.js b/src/boot/keyShortcut.js new file mode 100644 index 000000000..5afb5b74a --- /dev/null +++ b/src/boot/keyShortcut.js @@ -0,0 +1,34 @@ +export default { + mounted: function (el, binding) { + const shortcut = binding.value ?? '+'; + + const { key, ctrl, alt, callback } = + typeof shortcut === 'string' + ? { + key: shortcut, + ctrl: true, + alt: true, + callback: () => + document + .querySelector(`button[shortcut="${shortcut}"]`) + ?.click(), + } + : binding.value; + + const handleKeydown = (event) => { + if (event.key === key && (!ctrl || event.ctrlKey) && (!alt || event.altKey)) { + callback(); + } + }; + + // Attach the event listener to the window + window.addEventListener('keydown', handleKeydown); + + el._handleKeydown = handleKeydown; + }, + unmounted: function (el) { + if (el._handleKeydown) { + window.removeEventListener('keydown', el._handleKeydown); + } + }, +}; diff --git a/src/boot/mainShortcutMixin.js b/src/boot/mainShortcutMixin.js new file mode 100644 index 000000000..8e5f147db --- /dev/null +++ b/src/boot/mainShortcutMixin.js @@ -0,0 +1,38 @@ +import routes from 'src/router/modules'; +import { useRouter } from 'vue-router'; + +let isNotified = false; + +export default { + created: function () { + const router = useRouter(); + const keyBindingMap = routes + .filter((route) => route.meta.keyBinding) + .reduce((map, route) => { + map['Key' + route.meta.keyBinding.toUpperCase()] = route.path; + return map; + }, {}); + + const handleKeyDown = (event) => { + const { ctrlKey, altKey, code } = event; + + if (ctrlKey && altKey && keyBindingMap[code] && !isNotified) { + event.preventDefault(); + router.push(keyBindingMap[code]); + isNotified = true; + } + }; + + const handleKeyUp = (event) => { + const { ctrlKey, altKey } = event; + + // Resetea la bandera cuando se sueltan las teclas ctrl o alt + if (!ctrlKey || !altKey) { + isNotified = false; + } + }; + + window.addEventListener('keydown', handleKeyDown); + window.addEventListener('keyup', handleKeyUp); + }, +}; diff --git a/src/boot/quasar.js b/src/boot/quasar.js index a8d9b7ad9..e2035c880 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -1,6 +1,10 @@ import { boot } from 'quasar/wrappers'; import qFormMixin from './qformMixin'; +import mainShortcutMixin from './mainShortcutMixin'; +import keyShortcut from './keyShortcut'; export default boot(({ app }) => { app.mixin(qFormMixin); + app.mixin(mainShortcutMixin); + app.directive('shortcut', keyShortcut); }); diff --git a/src/components/CrudModel.vue b/src/components/CrudModel.vue index 33c831e3f..0386e037b 100644 --- a/src/components/CrudModel.vue +++ b/src/components/CrudModel.vue @@ -189,11 +189,11 @@ async function saveChanges(data) { }); } -async function insert() { +async function insert(pushData = $props.dataRequired) { const $index = formData.value.length ? formData.value[formData.value.length - 1].$index + 1 : 0; - formData.value.push(Object.assign({ $index }, $props.dataRequired)); + formData.value.push(Object.assign({ $index }, pushData)); hasChanges.value = true; } diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 22ef1622c..05f947cf3 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -22,7 +22,7 @@ const { t } = useI18n(); const { validate } = useValidator(); const { notify } = useNotify(); const route = useRoute(); - +const myForm = ref(null); const $props = defineProps({ url: { type: String, @@ -109,11 +109,14 @@ const defaultButtons = computed(() => ({ color: 'primary', icon: 'save', label: 'globals.save', + click: () => myForm.value.submit(), + type: 'submit', }, reset: { color: 'primary', icon: 'restart_alt', label: 'globals.reset', + click: () => reset(), }, ...$props.defaultButtons, })); @@ -276,7 +279,14 @@ defineExpose({