qdadm 0.52.0 → 0.52.2
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
|
@@ -194,9 +194,11 @@ export function useNavContext(options = {}) {
|
|
|
194
194
|
const label = data && segment.manager ? segment.manager.getEntityLabel(data) : '...'
|
|
195
195
|
const idField = segment.manager?.idField || 'id'
|
|
196
196
|
|
|
197
|
+
// Only create link if we have a valid id
|
|
198
|
+
const canLink = !isLast && segment.id && segment.routeName && routeExists(segment.routeName)
|
|
197
199
|
items.push({
|
|
198
200
|
label,
|
|
199
|
-
to:
|
|
201
|
+
to: canLink ? { name: segment.routeName, params: { [idField]: segment.id } } : null
|
|
200
202
|
})
|
|
201
203
|
} else if (segment.type === 'create') {
|
|
202
204
|
items.push({
|
|
@@ -234,7 +236,9 @@ export function useNavContext(options = {}) {
|
|
|
234
236
|
|
|
235
237
|
const { entity: parentEntity, param, itemRoute } = parentConfig.value
|
|
236
238
|
const parentManager = getManager(parentEntity)
|
|
237
|
-
|
|
239
|
+
|
|
240
|
+
// Guard: need valid manager and parentId to build links
|
|
241
|
+
if (!parentManager || !parentId.value) return []
|
|
238
242
|
|
|
239
243
|
const parentRouteName = itemRoute || getDefaultItemRoute(parentManager)
|
|
240
244
|
const isOnParent = route.name === parentRouteName
|
|
@@ -246,8 +250,10 @@ export function useNavContext(options = {}) {
|
|
|
246
250
|
active: isOnParent
|
|
247
251
|
}]
|
|
248
252
|
|
|
249
|
-
// Sibling routes
|
|
253
|
+
// Sibling routes - only include list routes (not create/edit/show)
|
|
254
|
+
// List routes are navigable tabs, while create/edit/show are accessed via the list
|
|
250
255
|
const siblings = getSiblingRoutes(parentEntity, param)
|
|
256
|
+
.filter(sibling => sibling.meta?.layout === 'list')
|
|
251
257
|
for (const sibling of siblings) {
|
|
252
258
|
const sibManager = sibling.meta?.entity ? getManager(sibling.meta.entity) : null
|
|
253
259
|
links.push({
|