qdadm 0.49.0 → 0.49.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -177,9 +177,12 @@ function setBreadcrumbEntity(data, level = 1) {
|
|
|
177
177
|
provide('qdadmSetBreadcrumbEntity', setBreadcrumbEntity)
|
|
178
178
|
provide('qdadmBreadcrumbEntities', breadcrumbEntities)
|
|
179
179
|
|
|
180
|
-
// Clear entity data on route change (before new page mounts)
|
|
180
|
+
// Clear entity data and overrides on route change (before new page mounts)
|
|
181
|
+
// This ensures list pages get default breadcrumb, detail pages can override via PageNav
|
|
181
182
|
watch(() => route.fullPath, () => {
|
|
182
183
|
breadcrumbEntities.value = new Map()
|
|
184
|
+
breadcrumbOverride.value = null
|
|
185
|
+
navlinksOverride.value = null
|
|
183
186
|
})
|
|
184
187
|
|
|
185
188
|
// Navigation context (breadcrumb + navlinks from route config)
|
|
@@ -26,6 +26,8 @@ import { useOrchestrator } from '../../orchestrator/useOrchestrator.js'
|
|
|
26
26
|
const breadcrumbOverride = inject('qdadmBreadcrumbOverride', null)
|
|
27
27
|
const navlinksOverride = inject('qdadmNavlinksOverride', null)
|
|
28
28
|
const homeRouteName = inject('qdadmHomeRoute', null)
|
|
29
|
+
// Entity data set by useEntityItemPage via setBreadcrumbEntity
|
|
30
|
+
const breadcrumbEntities = inject('qdadmBreadcrumbEntities', null)
|
|
29
31
|
|
|
30
32
|
const props = defineProps({
|
|
31
33
|
entity: { type: Object, default: null },
|
|
@@ -85,10 +87,22 @@ const breadcrumbItems = computed(() => {
|
|
|
85
87
|
if (entityName) {
|
|
86
88
|
const manager = getManager(entityName)
|
|
87
89
|
if (manager) {
|
|
90
|
+
// Entity list link
|
|
88
91
|
items.push({
|
|
89
92
|
label: manager.labelPlural || manager.name,
|
|
90
93
|
to: { name: manager.routePrefix }
|
|
91
94
|
})
|
|
95
|
+
|
|
96
|
+
// If on detail page (has :id param), add current entity item
|
|
97
|
+
const entityId = route.params.id
|
|
98
|
+
if (entityId) {
|
|
99
|
+
// Get entity data from props or from breadcrumbEntities (set by useEntityItemPage)
|
|
100
|
+
const entityData = props.entity || breadcrumbEntities?.value?.get(1)
|
|
101
|
+
const entityLabel = entityData
|
|
102
|
+
? manager.getEntityLabel(entityData)
|
|
103
|
+
: '...'
|
|
104
|
+
items.push({ label: entityLabel })
|
|
105
|
+
}
|
|
92
106
|
}
|
|
93
107
|
}
|
|
94
108
|
return items
|
|
@@ -216,12 +230,12 @@ const allNavlinks = computed(() => {
|
|
|
216
230
|
})
|
|
217
231
|
|
|
218
232
|
// Sync breadcrumb and navlinks to AppLayout via provide/inject
|
|
219
|
-
// Watch computed values + route changes to ensure updates
|
|
220
|
-
watch([breadcrumbItems, () => route.fullPath], ([items]) => {
|
|
233
|
+
// Watch computed values + route changes + entity data to ensure updates
|
|
234
|
+
watch([breadcrumbItems, () => route.fullPath, breadcrumbEntities], ([items]) => {
|
|
221
235
|
if (breadcrumbOverride) {
|
|
222
236
|
breadcrumbOverride.value = items
|
|
223
237
|
}
|
|
224
|
-
}, { immediate: true })
|
|
238
|
+
}, { immediate: true, deep: true })
|
|
225
239
|
|
|
226
240
|
watch([allNavlinks, () => route.fullPath], ([links]) => {
|
|
227
241
|
if (navlinksOverride) {
|