WIP - add contct and contact details
This commit is contained in:
@@ -98,10 +98,20 @@ const visibleRelatedLists = computed<RelatedListConfig[]>(() => {
|
||||
|
||||
const layoutRelatedLists = pageLayout.value?.relatedLists
|
||||
if (!layoutRelatedLists || layoutRelatedLists.length === 0) {
|
||||
return []
|
||||
// Page layout has no related list selections; show all by default
|
||||
return relatedLists
|
||||
}
|
||||
|
||||
return relatedLists.filter(list => layoutRelatedLists.includes(list.relationName))
|
||||
const normalize = (name: string) => name?.toLowerCase().replace(/[^a-z0-9]/g, '')
|
||||
const layoutNormalized = layoutRelatedLists.map(normalize)
|
||||
|
||||
const filtered = relatedLists.filter(list => {
|
||||
const name = list.relationName
|
||||
return layoutRelatedLists.includes(name) || layoutNormalized.includes(normalize(name))
|
||||
})
|
||||
|
||||
// If nothing matched (e.g., relationName changed), fall back to showing all
|
||||
return filtered.length > 0 ? filtered : relatedLists
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user