diff --git a/CHANGELOG.md b/CHANGELOG.md index 88abb9ae0..e110e4cd6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,273 @@ +# Version 24.50 - 2024-12-10 + +### Added 🆕 + +- feat: add reportFileName option by:Javier Segarra +- feat: all clients just with global series by:jgallego +- feat: improve Merge branch 'test' into dev by:Javier Segarra +- feat: manual invoice in two lines by:jgallego +- feat: manualInvoice with address by:jgallego +- feat: randomize functions and example by:Javier Segarra +- feat: refs #6999 added search when user tabs on a filter with value by:Jon +- feat: refs #6999 added tab to search in VnTable filter by:Jon +- feat: refs #7346 #7346 improve form by:Javier Segarra +- feat: refs #7346 address ordered by:jgallego +- feat: refs #7346 radioButton by:jgallego +- feat: refs #7346 style radioButton by:jgallego +- feat: refs #7346 traducciones en cammelCase (7346-manualInvoice) by:jgallego +- feat: refs #8038 added new functionality in VnSelect and refactor styles by:Jon +- feat: refs #8061 #8061 updates by:Javier Segarra +- feat: refs #8087 reactive data by:jorgep +- feat: refs #8087 refs#8087 Redadas en travel by:Carlos Andrés +- feat: refs #8138 add component ticket problems by:pablone +- feat: refs #8163 add max length and more tests by:wbuezas +- feat: refs #8163 add prop by:wbuezas +- feat: refs #8163 add VnInput insert functionality and e2e test by:wbuezas +- feat: refs #8163 limit with maxLength by:Javier Segarra +- feat: refs #8163 maxLength SupplierFD account by:Javier Segarra +- feat: refs #8163 maxLengthVnInput by:Javier Segarra +- feat: refs #8163 use VnAccountNumber in VnAccountNumber by:Javier Segarra +- feat: refs #8166 show notification by:jorgep + +### Changed 📦 + +- feat: refs #8038 added new functionality in VnSelect and refactor styles by:Jon +- perf: add dataCy by:Javier Segarra +- perf: refs #7346 #7346 Imrpove interface dialog by:Javier Segarra +- perf: refs #7346 #7346 use v-show instead v-if by:Javier Segarra +- perf: refs #8036 currentFilter by:alexm +- perf: refs #8061 filter autonomy by:Javier Segarra +- perf: refs #8061 solve conflicts and random posCode it by:Javier Segarra +- perf: refs #8061 use opts from VnSelect by:Javier Segarra +- perf: refs #8163 #8061 createNewPostCodeForm by:Javier Segarra +- perf: remove console by:Javier Segarra +- perf: remove timeout by:Javier Segarra +- perf: test command fillInForm by:Javier Segarra +- refactor: refs #8162 remove comment by:wbuezas +- refactor: remove unnecesary things by:wbuezas + +### Fixed 🛠️ + +- fix: #8016 fetching data by:Javier Segarra +- fix: icons by:jgallego +- fix: refs #7229 download file by:jorgep +- fix: refs #7229 remove catch by:jorgep +- fix: refs #7229 set url by:jorgep +- fix: refs #7229 test by:jorgep +- fix: refs #7229 url by:jorgep +- fix: refs #7229 url + test by:jorgep +- fix: refs #7304 7304 clean warning by:carlossa +- fix: refs #7304 fix list by:carlossa +- fix: refs #7304 fix warning by:carlossa +- fix: refs #7346 traslations by:jgallego +- fix: refs #7529 add save by:carlossa +- fix: refs #7529 fix e2e by:carlossa +- fix: refs #7529 fix front by:carlossa +- fix: refs #7529 fix scss by:carlossa +- fix: refs #7529 fix te2e by:carlossa +- fix: refs #7529 fix workerPit e2e by:carlossa +- fix: refs #7529 front by:carlossa +- fix: refs #8036 apply exprBuilder after save filters by:alexm +- fix: refs #8036 only add where when required by:alexm +- fix: refs #8038 solve conflicts by:Jon +- fix: refs #8061 improve code dependencies (origin/8061_improve_newCP) by:Javier Segarra +- fix: refs #8138 move component from ui folder by:pablone +- fix: refs #8138 sme minor issues by:pablone +- fix: refs #8163 #8061 createNewPostCodeForm by:Javier Segarra +- fix: refs #8163 minor problem when keypress by:Javier Segarra +- fix: refs #8166 show zone error by:jorgep +- fix: removed selectedClient by:jgallego +- refs #7529 fix workerPit by:carlossa +- revert: refs #8061 test #8061 updates by:Javier Segarra +- test: fix own test by:Javier Segarra +- test: refs #8162 #8162 fix TicketList spec by:Javier Segarra + +# Version 24.48 - 2024-11-25 + +### Added 🆕 + +- chore: correct checkNotification (fix_customer_issues) by:alexm +- chore: perf (warmFix_order_equalSalix) by:alexm +- chore: refs #6818 add spaces by:jorgep +- chore: refs #6818 drop useless code & comment by:jorgep +- chore: refs #7273 sticky add btn & refactor by:jorgep +- chore: refs #7524 fix test by:jorgep +- chore: refs #8039 not required by:alexm +- chore: refs #8078 fiz tests by:jorgep +- chore: refs #8078 rollback ref by:jorgep +- chore: remove console.log (warmFix_invoiceOut_Global) by:alexm +- chore: typo (fix_itemType-redirection) by:alexm +- feat: #6943 use openURL quasar by:Javier Segarra +- feat: #7782 add cypress report by:Javier Segarra +- feat: #7782 cypress.config watchForFileChanges by:Javier Segarra +- feat: #7782 npm run resetDatabase by:Javier Segarra +- feat: #7782 waitUntil domContentLoad by:Javier Segarra +- feat: added composable to confirm orders by:Jon +- feat: add /reports in gitignore (warmFix_reports_in_gitignore) by:alexm +- feat: apply changes for customerModule by:Javier Segarra +- feat: disabled buttons by:Javier Segarra +- feat: move buttons to DescriptorMenu by:Javier Segarra +- feat: refs #6818 add icon by:jorgep +- feat: refs #6818 fetch url & default channel by:jorgep +- feat: refs #6818 saysimple integration by:jorgep +- feat: refs #6839 module searching (6839-addSearchMenu) by:jorgep +- feat: refs #6839 normalize search by:jorgep +- feat: refs #6919 sync entry data by:jorgep +- feat: refs #7006 itemType basic data new inputs by:guillermo +- feat: refs #7006 itemTypeLog added by:guillermo +- feat: refs #7193 modified parking to use the scope and corrected small errors by:Jon +- feat: refs #7206 added inactive label and corrected minor errors by:Jon +- feat: refs #7308 #7308 remove warnings related to useSession by:Javier Segarra +- feat: refs #7349 usa back con permisos by:jgallego +- feat: refs #7524 add front test by:jorgep +- feat: refs #7874 improve vn-notes ui by:jorgep +- feat: refs #7970 notify changes by:Jon +- feat(): refs #8039 canceledError not notify by:alexm +- feat: refs #8039 notify error unify by:alexm +- feat: refs #8039 show duplicate request in local by:alexm +- feat: refs #8078 add shortcut multi selection by:jorgep +- feat: refs #8078 add tests by:jorgep +- feat: refs#8087 Redadas en travel by:Carlos Andrés +- feat: refs #8087 Traspasar redadas a travels by:Carlos Andrés +- feat: remove comments by:Javier Segarra +- feat(Supplier): add companySize by:alexm +- feat: use composable to unify logic by:Javier Segarra +- feat(VnInput): empty to null by:alexm +- feat(VnSelect): order data equal salix by:alexm +- feat(VnSelect): refs #7136 add scroll (7136-vnSelect_paginate_simplify_2) by:alexm + +### Changed 📦 + +- chore: perf (warmFix_order_equalSalix) by:alexm +- chore: refs #7273 sticky add btn & refactor by:jorgep +- fix: better performance (warmFix_accountAcls) by:alexm +- perf: minor bugs detected by:Javier Segarra +- perf: refs #6943 #6943 merge command by:Javier Segarra +- perf: refs #7283 #7283 declare composable inst4ead code duplicated by:Javier Segarra +- perf: refs #7283 #7283 handle composable i18n by:Javier Segarra +- perf: refs #7283 #7283 handle i18n by:Javier Segarra +- perf: refs #7283 #7283 i18n params by:Javier Segarra +- perf: refs #7308 #7308 remove comments by:Javier Segarra +- perf: remove appendParams by:Javier Segarra +- perf: use const in VnLocation by:Javier Segarra +- perf: use required instead :required="true" by:Javier Segarra +- refactor: apply QPopupProxy by:wbuezas +- refactor: changed confirmOrder directory by:Jon +- refactor: change keyup.enter for update:model-value by:wbuezas +- refactor(InvoiceInBasicData): use VnDms by:alexm +- refactor: modified composable by:Jon +- refactor: refs #6818 change channel source by:jorgep +- refactor: refs #6818 channel logic by:jorgep +- refactor: refs #6919 export filter by:jorgep +- refactor: refs #7132 1st wave of changes in global translations files by:Jon +- refactor: refs #7132 account's module translations by:Jon +- refactor: refs #7132 customer's module translations by:Jon +- refactor: refs #7132 deleted pageTitles repeated by:Jon +- refactor: refs #7132 delete duplicate translations' keys by:Jon +- refactor: refs #7132 deleted useless code by:Jon +- refactor: refs #7132 global translations files changed by:Jon +- refactor: refs #7266 Changed method name by:guillermo +- refactor: refs #7950 Created cmr model by:guillermo +- refactor: refs #7970 added emit by:Jon +- refactor: refs #7970 refactored VnConfirm to emit events by:Jon +- refactor: refs #8185 modified LeftMenu to avoid duplicates by:Jon +- refactor: remove unused variable by:wbuezas +- refactor: revert catalog changes by:Jon +- refactor: small change by:wbuezas +- test: refactor e2e by:alexm +- test: refs #8039 add hasNotify and, refactor: agencyWorkCenter test by:alexm + +### Fixed 🛠️ + +- chore: refs #7524 fix test by:jorgep +- fix: better performance (warmFix_accountAcls) by:alexm +- fix: catalog view category and type filter by:wbuezas +- fix: category and tags filters by:Jon +- fix: changed route.query by:Jon +- fix: change type vnput by:Javier Segarra +- fix(ClaimList): stateCode orderBy priority by:alexm +- fix: entryFilters by:carlossa +- fix: filter panel by:Jon +- fix(InvoiceOutGlobal): parallelism by:alexm +- fix: itemBotanical by:Javier Segarra +- fix: itemType redirection and fix filters by:alexm +- fix: logout spec (warmFix_logout.spec) by:alexm +- fix: merge errors by:alexm +- fix: order catalog by:wbuezas +- fix: order catalog fixes by:wbuezas +- fix: refs #6818 use right icon by:jorgep +- fix: refs #6896 fixed module problems by:Jon +- fix: refs #7193 fixed e2e test by:Jon +- fix: refs #7206 deleted duplicate code by:Jon +- fix: refs #7273 use same filter by:jorgep +- fix: refs #7283 #7283 bugs by:Javier Segarra +- fix: refs #7283 #7283 ItemDiary subToolbar by:Javier Segarra +- fix: refs #7283 #7283 ItemSummary bugs by:Javier Segarra +- fix: refs #7283 Account image resolution by:guillermo +- fix: refs #7283 css by:jorgep +- fix: refs #7283 filter by:carlossa +- fix: refs #7283 fix image by:carlossa +- fix: refs #7283 fix pr by:carlossa +- fix: refs #7283 fix preview by:carlossa +- fix: refs #7283 fix required by:carlossa +- fix: refs #7283 item filters by:carlossa +- fix: refs #7283 itemtype fix by:carlossa +- fix: refs #7283 order translation by:carlossa +- fix: refs #7283 preview by:carlossa +- fix: refs #7283 tooltips !Item by:Javier Segarra +- fix: refs #7306 clean warning by:carlossa +- fix: refs #7310 clean warning by:carlossa +- fix: refs #7323 locale #7396 by:jorgep +- fix: refs #7323 show advanced fields by:jorgep +- fix: refs #7349 dependencia no usada by:jgallego +- fix: refs #7524 e2e & worker module by:jorgep +- fix: refs #7874 add title by:jorgep +- fix: refs #7874 show name by:jorgep +- fix: refs #7943 use correct data-key by:jorgep +- fix: refs #7943 use summary by:jorgep +- fix: refs #8039 bad tests by:alexm +- fix: refs #8039 o not handle unnecessary errors by:alexm +- fix: refs #8078 e2e #7970 by:jorgep +- fix: refs #8078 handleSelection by:jorgep +- fix: refs #8078 improve cy command (8078-enableMultiSelection) by:jorgep +- fix: refs #8078 improve handleSelection by:jorgep +- fix: reset category by:wbuezas +- fix: tag chips by:Jon +- fix: vnSearchbar spec (warmFix_vnSearchBar.spec) by:alexm +- fix(VnSelect): setOptions when applyFilter by:alexm +- fix: worker test e2e by:Jon +- Merge branch 'dev' into fix_customer_issues by:Javier Segarra +- refactor: revert catalog changes by:Jon +- refs #7283 fix conflicts by:carlossa +- refs #7283 fix descriptorproxy by:carlossa +- refs #7283 fixedPrice by:carlossa +- refs #7283 fixedPrices by:carlossa +- refs #7283 fix itemFixed by:carlossa +- refs #7283 fix itemFixedPrice by:carlossa +- refs #7283 fix itemMigration by:carlossa +- refs #7283 fix itemMigration list filters by:carlossa +- refs #7283 fix items by:carlossa +- refs #7283 fix items error get images by:carlossa +- refs #7283 fix items images by:carlossa +- refs #7283 fix request by:carlossa +- refs #7283 fix searchbar by:carlossa +- refs #7283 fix viewSummary by:carlossa +- refs #7283 fix yml list basicData by:carlossa +- refs #7283 itemRequest fix by:carlossa +- refs #7283 itemRequest fix deny by:carlossa +- refs #7283 itemRequest fix reload by:carlossa +- refs #72983 fix filters by:carlossa +- revert: commit by:Javier Segarra +- revert e57a253c6f649382da187d1129449d265fb26d3b by:Javier Segarra +- test: #8162 fix clientList spec by:Javier Segarra +- test: #8162 fix vnLocation spec by:Javier Segarra +- test: fix arrayData by:Javier Segarra +- test: fix e2e by:alexm +- test: fix e2e by:Javier Segarra +- test: refs #8039 fix WorkerNotification e2e by:alexm +- test: refs #8039 fix ZoneWarehouse e2e by:alexm +- warmfix: ItemLastEntries to date (origin/warmfix_itemLastEntriesFilter) by:Javier Segarra + # Version 24.40 - 2024-10-02 ### Added 🆕 diff --git a/Jenkinsfile b/Jenkinsfile index 1766e3aea..c20da8ab2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -4,7 +4,8 @@ def PROTECTED_BRANCH def BRANCH_ENV = [ test: 'test', - master: 'production' + master: 'production', + beta: 'production' ] node { @@ -15,7 +16,8 @@ node { PROTECTED_BRANCH = [ 'dev', 'test', - 'master' + 'master', + 'beta' ].contains(env.BRANCH_NAME) // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables diff --git a/cypress.config.js b/cypress.config.js index f8e771093..e9aeb547a 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -1,4 +1,7 @@ const { defineConfig } = require('cypress'); +// https://docs.cypress.io/app/tooling/reporters +// https://docs.cypress.io/app/references/configuration +// https://www.npmjs.com/package/cypress-mochawesome-reporter module.exports = defineConfig({ e2e: { @@ -16,6 +19,7 @@ module.exports = defineConfig({ reporterOptions: { charts: true, reportPageTitle: 'Cypress Inline Reporter', + reportFilename: '[status]_[datetime]-report', embeddedScreenshots: true, reportDir: 'test/cypress/reports', inlineAssets: true, diff --git a/package.json b/package.json index e2e75f253..39d49519b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "salix-front", - "version": "24.44.0", + "version": "24.52.0", "description": "Salix frontend", "productName": "Salix", "author": "Verdnatura", diff --git a/src/boot/mainShortcutMixin.js b/src/boot/mainShortcutMixin.js new file mode 100644 index 000000000..481077e37 --- /dev/null +++ b/src/boot/mainShortcutMixin.js @@ -0,0 +1,36 @@ +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; + if (!ctrlKey || !altKey) { + isNotified = false; + } + }; + + window.addEventListener('keydown', handleKeyDown); + window.addEventListener('keyup', handleKeyUp); + }, +}; diff --git a/src/boot/qformMixin.js b/src/boot/qformMixin.js index fc7852369..187ca6dbc 100644 --- a/src/boot/qformMixin.js +++ b/src/boot/qformMixin.js @@ -1,30 +1,51 @@ -import { getCurrentInstance } from 'vue'; - +function focusFirstInput(input) { + input.focus(); +} export default { mounted: function () { - const vm = getCurrentInstance(); - if (vm.type.name === 'QForm') { - if (!['searchbarForm', 'filterPanelForm'].includes(this.$el?.id)) { - // TODO: AUTOFOCUS IS NOT FOCUSING - const that = this; - this.$el.addEventListener('keyup', function (evt) { - if (evt.key === 'Enter') { - const input = evt.target; - if (input.type == 'textarea' && evt.shiftKey) { - evt.preventDefault(); - let { selectionStart, selectionEnd } = input; - input.value = - input.value.substring(0, selectionStart) + - '\n' + - input.value.substring(selectionEnd); - selectionStart = selectionEnd = selectionStart + 1; - return; - } - evt.preventDefault(); - that.onSubmit(); - } - }); + const that = this; + + const form = document.querySelector('.q-form#formModel'); + if (!form) return; + try { + const inputsFormCard = form.querySelectorAll( + `input:not([disabled]):not([type="checkbox"])` + ); + if (inputsFormCard.length) { + focusFirstInput(inputsFormCard[0]); } + const textareas = document.querySelectorAll( + 'textarea:not([disabled]), [contenteditable]:not([disabled])' + ); + if (textareas.length) { + focusFirstInput(textareas[textareas.length - 1]); + } + const inputs = document.querySelectorAll( + 'form#formModel input:not([disabled]):not([type="checkbox"])' + ); + const input = inputs[0]; + if (!input) return; + + focusFirstInput(input); + } catch (error) { + console.error(error); } + form.addEventListener('keyup', function (evt) { + if (evt.key === 'Enter') { + const input = evt.target; + if (input.type == 'textarea' && evt.shiftKey) { + evt.preventDefault(); + let { selectionStart, selectionEnd } = input; + input.value = + input.value.substring(0, selectionStart) + + '\n' + + input.value.substring(selectionEnd); + selectionStart = selectionEnd = selectionStart + 1; + return; + } + evt.preventDefault(); + that.onSubmit(); + } + }); }, }; diff --git a/src/boot/quasar.js b/src/boot/quasar.js index 01fe68d8b..547517682 100644 --- a/src/boot/quasar.js +++ b/src/boot/quasar.js @@ -1,15 +1,18 @@ +import axios from 'axios'; import { boot } from 'quasar/wrappers'; import qFormMixin from './qformMixin'; import keyShortcut from './keyShortcut'; -import useNotify from 'src/composables/useNotify.js'; -import { CanceledError } from 'axios'; - -const { notify } = useNotify(); +import { QForm } from 'quasar'; +import { QLayout } from 'quasar'; +import mainShortcutMixin from './mainShortcutMixin'; +import { useCau } from 'src/composables/useCau'; export default boot(({ app }) => { - app.mixin(qFormMixin); + QForm.mixins = [qFormMixin]; + QLayout.mixins = [mainShortcutMixin]; + app.directive('shortcut', keyShortcut); - app.config.errorHandler = (error) => { + app.config.errorHandler = async (error) => { let message; const response = error.response; const responseData = response?.data; @@ -40,12 +43,12 @@ export default boot(({ app }) => { } console.error(error); - if (error instanceof CanceledError) { + if (error instanceof axios.CanceledError) { const env = process.env.NODE_ENV; if (env && env !== 'development') return; message = 'Duplicate request'; } - notify(message ?? 'globals.error', 'negative', 'error'); + await useCau(response, message); }; }); diff --git a/src/components/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue index a42be6ef8..2da3aa994 100644 --- a/src/components/CreateBankEntityForm.vue +++ b/src/components/CreateBankEntityForm.vue @@ -9,8 +9,6 @@ import VnRow from 'components/ui/VnRow.vue'; import FormModelPopup from './FormModelPopup.vue'; import { useState } from 'src/composables/useState'; -defineProps({ showEntityField: { type: Boolean, default: true } }); - const emit = defineEmits(['onDataSaved']); const { t } = useI18n(); const bicInputRef = ref(null); @@ -18,17 +16,16 @@ const state = useState(); const customer = computed(() => state.get('customer')); +const countriesFilter = { + fields: ['id', 'name', 'code'], +}; + const bankEntityFormData = reactive({ name: null, bic: null, countryFk: customer.value?.countryFk, - id: null, }); -const countriesFilter = { - fields: ['id', 'name', 'code'], -}; - const countriesOptions = ref([]); const onDataSaved = (...args) => { @@ -44,7 +41,6 @@ onMounted(async () => {