diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf6bdcc3..d15ad787d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,10 +9,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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/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/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/FetchData.vue b/src/components/FetchData.vue index 5b3dcbea7..6d4e79f24 100644 --- a/src/components/FetchData.vue +++ b/src/components/FetchData.vue @@ -60,3 +60,6 @@ async function fetch(fetchFilter = {}) { } } + diff --git a/src/components/FilterItemForm.vue b/src/components/FilterItemForm.vue index 4c329a8e8..cd4fff54c 100644 --- a/src/components/FilterItemForm.vue +++ b/src/components/FilterItemForm.vue @@ -202,7 +202,6 @@ const selectItem = ({ id }) => { { props.item); // eslint-disable-line vue/no-dupe-keys +const itemComputed = computed(() => { + const item = JSON.parse(JSON.stringify(props.item)); + const [, , section] = item.title.split('.'); + + if (!te(item.title)) item.title = t(`globals.pageTitles.${section}`); + return item; +}); diff --git a/src/components/UserPanel.vue b/src/components/UserPanel.vue index 007d595cc..5c143740e 100644 --- a/src/components/UserPanel.vue +++ b/src/components/UserPanel.vue @@ -7,12 +7,16 @@ import axios from 'axios'; import { useState } from 'src/composables/useState'; import { useSession } from 'src/composables/useSession'; import { localeEquivalence } from 'src/i18n/index'; +import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnRow from 'components/ui/VnRow.vue'; +import FetchData from 'components/FetchData.vue'; const state = useState(); const session = useSession(); const router = useRouter(); const { t, locale } = useI18n(); import { useClipboard } from 'src/composables/useClipboard'; +import { ref } from 'vue'; const { copyText } = useClipboard(); const userLocale = computed({ get() { @@ -45,6 +49,9 @@ const darkMode = computed({ const user = state.getUser(); const token = session.getTokenMultimedia(); +const warehousesData = ref(); +const companiesData = ref(); +const accountBankData = ref(); onMounted(async () => { updatePreferences(); @@ -87,10 +94,28 @@ function copyUserToken() { diff --git a/src/pages/Travel/Card/TravelSummary.vue b/src/pages/Travel/Card/TravelSummary.vue index 7ba6101a5..7fc92e7b6 100644 --- a/src/pages/Travel/Card/TravelSummary.vue +++ b/src/pages/Travel/Card/TravelSummary.vue @@ -289,7 +289,6 @@ async function setTravelData(travelData) { @@ -354,7 +353,6 @@ async function setTravelData(travelData) { diff --git a/src/pages/Travel/Card/TravelThermographs.vue b/src/pages/Travel/Card/TravelThermographs.vue index 435d9054f..d2195beb4 100644 --- a/src/pages/Travel/Card/TravelThermographs.vue +++ b/src/pages/Travel/Card/TravelThermographs.vue @@ -145,7 +145,6 @@ const removeThermograph = async (id) => { :rows="rows" :columns="TableColumns" :no-data-label="t('No results')" - :rows-per-page-options="[0]" row-key="id" class="full-width q-mt-md" > diff --git a/src/pages/Travel/ExtraCommunity.vue b/src/pages/Travel/ExtraCommunity.vue index 443a10451..2796d57e8 100644 --- a/src/pages/Travel/ExtraCommunity.vue +++ b/src/pages/Travel/ExtraCommunity.vue @@ -453,9 +453,7 @@ const handleDragScroll = (event) => { {