diff --git a/CHANGELOG.md b/CHANGELOG.md index 86ffce3fd..8e1d4c433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,141 @@ +# Version 24.36 - 2024-08-27 + +### Added 🆕 + +- 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 📦 + +- 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 🛠️ + +- 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 🆕 + +- chore: #6900 order params by:jorgep +- chore: refs #6900 drop console log by:jorgep +- chore: refs #6900 drop vnCurrency by:jorgep +- chore: refs #6900 fix e2e tests by:jorgep +- chore: refs #6900 mv rectificative logic by:jorgep +- chore: refs #6900 responsive code by:jorgep +- chore: refs #7283 drop array types by:jorgep +- chore: refs #7283 drop import by:jorgep +- chore: refs #7283 fix e2e logout by:jorgep +- chore: refs #7283 update VnAvatar title handling by:jorgep +- chore: refs #7323 fix test by:jorgep +- chore: refs #7323 remove unused import by:jorgep +- chore: refs #7323drop commented code by:jorgep +- feat(VnCard): use props searchbar by:alexm +- feat(customer): improve basicData to balance by:alexm +- feat(customer_balance): refs #6943 add functionality from salix by:alexm +- feat(customer_balance): refs #6943 translations by:alexm +- feat: refs #6130 husky commitLint config by:pablone +- feat: refs #6130 husky hooks by:pablone +- feat: refs #6900 add InvoiceInSerial by:jorgep +- feat: refs #6900 add locale by:jorgep +- feat: refs #6900 use VnTable & sort filter fields by:jorgep +- feat: refs #7323 add flex-wrap by:jorgep +- feat: refs #7323 add my account" btn & fix models log selectable by:jorgep +- feat: refs #7323 improve test by:jorgep + +### Changed 📦 + +- refactor(customer_log: use VnLog by:alexm +- refactor(customer_recovery): to vnTable by:alexm +- refactor(customer_webAccess): FormModel by:alexm +- refactor: refs #7283 update avatar size and color by:jorgep + +### Fixed 🛠️ + +- chore: refs #6900 fix e2e tests by:jorgep +- chore: refs #7283 fix e2e logout by:jorgep +- chore: refs #7323 fix test by:jorgep +- feat: refs #7323 add my account" btn & fix models log selectable by:jorgep +- fix #7355 fix acls list by:carlossa +- fix(VnFilterPanel): emit userParams better by:alexm +- fix(claim_summary): url links (HEAD -> 7864_testToMaster_2434, origin/test, origin/7864_testToMaster_2434, test) by:alexm +- fix(customer_sms: fix reload by:alexm +- fix(twoFactor): unify code login and twoFactor by:alexm +- fix: VnCard VnSearchbar props by:alexm +- fix: accountMailAlias by:alexm +- fix: refs #6130 add commit lint modules by:pablone +- fix: refs #6130 pnpm-lock.yml by:pablone +- fix: refs #6900 improve loading by:jorgep +- fix: refs #6900 improve logic (origin/6900-addSerial) by:jorgep +- fix: refs #6900 improve logic by:jorgep +- fix: refs #6900 rectificative btn reactivity by:jorgep +- fix: refs #6900 use type number by:jorgep +- fix: refs #6900 vat & dueday by:jorgep +- fix: refs #6900 vat, dueday & intrastat by:jorgep +- fix: refs #6989 show entity name & default time from config table by:jorgep +- fix: refs #7283 basicData locale by:jorgep +- fix: refs #7283 itemLastEntries filter by:jorgep +- fix: refs #7283 itemTags & VnImg by:jorgep +- fix: refs #7283 locale by:jorgep +- fix: refs #7283 min-width vnImg by:jorgep +- fix: refs #7283 use vnAvatar & add optional zoom by:jorgep +- fix: refs #7283 userPanel pic by:jorgep +- fix: refs #7323 add department popup by:jorgep +- fix: refs #7323 add locale by:jorgep +- fix: refs #7323 css righ menu by:jorgep +- fix: refs #7323 data-key & add select by:jorgep +- fix: refs #7323 load all opts by:jorgep +- fix: refs #7323 righ menu bug by:jorgep +- fix: refs #7323 use global locale by:jorgep +- fix: refs #7323 use workerFilter (origin/7323-warmfix-fixErrors) by:jorgep +- fix: refs #7323 vnsubtoolbar css by:jorgep +- fix: refs #7323 wrong css by:jorgep +- refs #7355 fix Rol, alias by:carlossa +- refs #7355 fix accountAlias by:carlossa +- refs #7355 fix alias summary by:carlossa +- refs #7355 fix conflicts by:carlossa +- refs #7355 fix create Rol by:carlossa +- refs #7355 fix list by:carlossa +- 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:carlossa + # Version 24.32 - 2024-08-06 ### Added 🆕 diff --git a/package.json b/package.json index 72bada823..eaffd8d85 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.34.0", + "version": "24.40.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", @@ -62,4 +62,4 @@ "vite": "^5.1.4", "vitest": "^0.31.1" } -} +} \ No newline at end of file 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/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue index c0a421206..1117225c7 100644 --- a/src/components/CreateBankEntityForm.vue +++ b/src/components/CreateBankEntityForm.vue @@ -1,5 +1,5 @@ + + + +es: + New expense: Nuevo gasto + It's a withholding: Es una retención + diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index a426ac2b4..4c44d29e2 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -105,7 +105,7 @@ async function setProvince(id, data) { option-label="name" option-value="id" :rules="validate('postcode.city')" - :roles-allowed-to-create="['deliveryAssistant']" + :acls="[{ model: 'Town', props: '*', accessType: 'WRITE' }]" :emit-value="false" clearable > 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/FetchData.vue b/src/components/FetchData.vue index 2a0864d3e..3038aa88e 100644 --- a/src/components/FetchData.vue +++ b/src/components/FetchData.vue @@ -44,7 +44,7 @@ onMounted(async () => { async function fetch(fetchFilter = {}) { try { - const filter = Object.assign(fetchFilter, $props.filter); // eslint-disable-line vue/no-dupe-keys + const filter = { ...fetchFilter, ...$props.filter }; // eslint-disable-line vue/no-dupe-keys if ($props.where && !fetchFilter.where) filter.where = $props.where; if ($props.sortBy) filter.order = $props.sortBy; if ($props.limit) filter.limit = $props.limit; diff --git a/src/components/FormModelPopup.vue b/src/components/FormModelPopup.vue index 50f9dcbf1..118c8f5f4 100644 --- a/src/components/FormModelPopup.vue +++ b/src/components/FormModelPopup.vue @@ -65,7 +65,6 @@ defineExpose({ { /> + + + - {{ createForm.title }} + {{ createForm?.title }} @@ -739,6 +761,7 @@ es: } .q-table__top { top: 0; + padding: 12px 0; } tbody { .q-checkbox { diff --git a/src/components/common/RightMenu.vue b/src/components/common/RightMenu.vue index 732e5367d..3aa1891f9 100644 --- a/src/components/common/RightMenu.vue +++ b/src/components/common/RightMenu.vue @@ -37,7 +37,7 @@ const stateStore = useStateStore(); @click="stateStore.toggleRightDrawer()" round dense - icon="menu" + icon="dock_to_left" > {{ t('globals.collapseMenu') }} diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index 03a7ce7da..7d29da232 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -1,6 +1,6 @@