diff --git a/CHANGELOG.md b/CHANGELOG.md index 51dd2010c..d15ad787d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,11 +10,14 @@ 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 80ddc3759..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', 'quasar'], + 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/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/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/common/VnBreadcrumbs.vue b/src/components/common/VnBreadcrumbs.vue index 09bc198f7..337507233 100644 --- a/src/components/common/VnBreadcrumbs.vue +++ b/src/components/common/VnBreadcrumbs.vue @@ -5,16 +5,16 @@ import { useQuasar } from 'quasar'; import { useI18n } from 'vue-i18n'; import { useCamelCase } from 'src/composables/useCamelCase'; -const router = useRouter(); -const quasar = useQuasar(); -const { t } = useI18n(); +const { currentRoute } = useRouter(); +const { screen } = useQuasar(); +const { t, te } = useI18n(); let matched = ref([]); let breadcrumbs = ref([]); let root = ref(null); watchEffect(() => { - matched.value = router.currentRoute.value.matched.filter( + matched.value = currentRoute.value.matched.filter( (matched) => Object.keys(matched.meta).length ); breadcrumbs.value.length = 0; @@ -34,13 +34,17 @@ function getBreadcrumb(param) { icon: param.meta.icon, path: param.path, root: root.value, + locale: t(`globals.pageTitles.${param.meta.title}`), }; - if (quasar.screen.gt.sm) { + if (screen.gt.sm) { breadcrumb.name = param.name; breadcrumb.title = useCamelCase(param.meta.title); } + const moduleLocale = `${breadcrumb.root}.pageTitles.${breadcrumb.title}`; + if (te(moduleLocale)) breadcrumb.locale = t(moduleLocale); + return breadcrumb; } @@ -50,7 +54,7 @@ function getBreadcrumb(param) { v-for="(breadcrumb, index) of breadcrumbs" :key="index" :icon="breadcrumb.icon" - :label="t(`${breadcrumb.root}.pageTitles.${breadcrumb.title}`)" + :label="breadcrumb.locale" :to="breadcrumb.path" /> diff --git a/src/components/common/VnDmsList.vue b/src/components/common/VnDmsList.vue index 07940274e..23e00f5d9 100644 --- a/src/components/common/VnDmsList.vue +++ b/src/components/common/VnDmsList.vue @@ -218,7 +218,6 @@ function parseDms(data) { />
diff --git a/src/components/ui/CardDescriptor.vue b/src/components/ui/CardDescriptor.vue index 85e0a7857..97aa91728 100644 --- a/src/components/ui/CardDescriptor.vue +++ b/src/components/ui/CardDescriptor.vue @@ -1,5 +1,5 @@