Add URL params for InfoPanel tab and product (infoTab, infoProduct)
All checks were successful
Build Docker Image / build (push) Successful in 3m39s

This commit is contained in:
Ruslan Bakiev
2026-01-26 15:55:25 +07:00
parent 8354102895
commit f973784257
3 changed files with 66 additions and 24 deletions

View File

@@ -73,6 +73,12 @@ export function useCatalogSearch() {
return null
})
// Info panel tab (stored in URL for sharing)
const infoTab = computed(() => route.query.infoTab as string | undefined)
// Info panel selected product (stored in URL for sharing)
const infoProduct = computed(() => route.query.infoProduct as string | undefined)
const productId = computed(() => route.query.product as string | undefined)
const supplierId = computed(() => route.query.supplier as string | undefined)
const hubId = computed(() => route.query.hub as string | undefined)
@@ -232,11 +238,19 @@ export function useCatalogSearch() {
}
const openInfo = (type: InfoEntityType, uuid: string) => {
updateQuery({ info: `${type}:${uuid}`, select: null })
updateQuery({ info: `${type}:${uuid}`, select: null, infoTab: null, infoProduct: null })
}
const closeInfo = () => {
updateQuery({ info: null })
updateQuery({ info: null, infoTab: null, infoProduct: null })
}
const setInfoTab = (tab: string) => {
updateQuery({ infoTab: tab })
}
const setInfoProduct = (productUuid: string | null) => {
updateQuery({ infoProduct: productUuid })
}
const clearAll = () => {
@@ -326,6 +340,8 @@ export function useCatalogSearch() {
// State
selectMode,
infoId,
infoTab,
infoProduct,
displayMode,
catalogMode,
productId,
@@ -359,6 +375,8 @@ export function useCatalogSearch() {
setQuantity,
openInfo,
closeInfo,
setInfoTab,
setInfoProduct,
clearAll,
setLabel,
setMapViewMode,