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/src/components/common/RightMenu.vue b/src/components/common/RightMenu.vue new file mode 100644 index 000000000..e288fbc87 --- /dev/null +++ b/src/components/common/RightMenu.vue @@ -0,0 +1,55 @@ + + 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/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 @@