Don't include primary display columns by default
This commit is contained in:
parent
ca0ea3faf8
commit
84bab434bf
|
@ -157,6 +157,8 @@ export async function enrichRelationshipSchema(
|
||||||
}
|
}
|
||||||
const relTable = tableCache[field.tableId]
|
const relTable = tableCache[field.tableId]
|
||||||
|
|
||||||
|
const fieldSchema = field.schema || {}
|
||||||
|
|
||||||
const resultSchema: Record<string, RelationSchemaField> = {}
|
const resultSchema: Record<string, RelationSchemaField> = {}
|
||||||
|
|
||||||
for (const relTableFieldName of Object.keys(relTable.schema)) {
|
for (const relTableFieldName of Object.keys(relTable.schema)) {
|
||||||
|
@ -169,10 +171,7 @@ export async function enrichRelationshipSchema(
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
const isPrimaryDisplay = relTableFieldName === relTable.primaryDisplay
|
const isReadonly = !!fieldSchema[relTableFieldName]?.readonly
|
||||||
const isReadonly =
|
|
||||||
isPrimaryDisplay ||
|
|
||||||
!!(field.schema && field.schema[relTableFieldName]?.readonly)
|
|
||||||
resultSchema[relTableFieldName] = {
|
resultSchema[relTableFieldName] = {
|
||||||
visible: isReadonly,
|
visible: isReadonly,
|
||||||
readonly: isReadonly,
|
readonly: isReadonly,
|
||||||
|
|
Loading…
Reference in New Issue