qdadm 0.52.0 → 0.52.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
|
@@ -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
|