diff --git a/CHANGELOG.md b/CHANGELOG.md index fd8a900b6..b72bc2c8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - (Worker) => Se crea la sección Taquilla +- (General) => Se mantiene el filtro lateral en cualquier parte de la seccíon. ### Fixed diff --git a/quasar.config.js b/quasar.config.js index dd7a91002..b59c62eeb 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.defaults'], + boot: ['i18n', 'axios', 'vnDate', 'validations', 'quasar', 'quasar.defaults'], // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css css: ['app.scss'], diff --git a/src/components/CreateNewPostcodeForm.vue b/src/components/CreateNewPostcodeForm.vue index fd8570176..064ad1631 100644 --- a/src/components/CreateNewPostcodeForm.vue +++ b/src/components/CreateNewPostcodeForm.vue @@ -127,9 +127,10 @@ const onProvinceCreated = async ({ name }, formData) => { - - - + +import { ref, onMounted, useSlots } from 'vue'; +import { useI18n } from 'vue-i18n'; +import { useStateStore } from 'stores/useStateStore'; + +const slots = useSlots(); +const hasContent = ref(false); +const rightPanel = ref(null); + +onMounted(() => { + rightPanel.value = document.querySelector('#right-panel'); + if (rightPanel.value.childNodes.length) hasContent.value = true; + + // Check if there's content to display + const observer = new MutationObserver(() => { + hasContent.value = rightPanel.value.childNodes.length; + }); + + if (rightPanel.value) + observer.observe(rightPanel.value, { + subtree: true, + childList: true, + attributes: true, + }); + + if (!slots['right-panel'] && !hasContent.value) stateStore.rightDrawer = false; +}); + +const { t } = useI18n(); +const stateStore = useStateStore(); + + diff --git a/src/components/common/VnCard.vue b/src/components/common/VnCard.vue index a062e4d80..58cb12708 100644 --- a/src/components/common/VnCard.vue +++ b/src/components/common/VnCard.vue @@ -1,13 +1,13 @@ diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js index 525cf6e6b..326ddff5d 100644 --- a/src/composables/useArrayData.js +++ b/src/composables/useArrayData.js @@ -47,7 +47,10 @@ export function useArrayData(key, userOptions) { if (isEmpty || !allowedOptions.includes(option)) continue; if (Object.prototype.hasOwnProperty.call(store, option)) { - store[option] = userOptions[option]; + const defaultOpts = userOptions[option]; + store[option] = userOptions.keepOpts?.includes(option) + ? Object.assign(defaultOpts, store[option]) + : defaultOpts; } } } diff --git a/src/composables/useRedirect.js b/src/composables/useRedirect.js new file mode 100644 index 000000000..c1470718b --- /dev/null +++ b/src/composables/useRedirect.js @@ -0,0 +1,25 @@ +import { useRouter } from 'vue-router'; + +export default function useRedirect() { + const router = useRouter(); + + const navigate = (data, { customRouteRedirectName, searchText }) => { + if (customRouteRedirectName) + return router.push({ + name: customRouteRedirectName, + params: { id: searchText }, + }); + + const { matched: matches } = router.currentRoute.value; + const { path } = matches.at(-1); + + const to = + data.length === 1 + ? path.replace(/\/(list|:id)|-list/, `/${data[0].id}`) + : path.replace(/:id.*/, ''); + + router.push({ path: to }); + }; + + return { navigate }; +} diff --git a/src/i18n/locale/en.yml b/src/i18n/locale/en.yml index 05241747b..7dc5777bf 100644 --- a/src/i18n/locale/en.yml +++ b/src/i18n/locale/en.yml @@ -1236,16 +1236,10 @@ item/itemType: itemType: Item type basicData: Basic data summary: Summary -zone: - pageTitles: - zones: Zone - zonesList: Zones - deliveryList: Delivery days - upcomingList: Upcoming deliveries monitor: pageTitles: - monitors: Monitores - list: Listado + monitors: Monitors + list: List components: topbar: {} itemsFilterPanel: diff --git a/src/pages/Agency/Card/AgencyCard.vue b/src/pages/Agency/Card/AgencyCard.vue index e78d1cc55..6b2296df3 100644 --- a/src/pages/Agency/Card/AgencyCard.vue +++ b/src/pages/Agency/Card/AgencyCard.vue @@ -1,34 +1,14 @@