Fix view schemas

This commit is contained in:
Adria Navarro 2024-08-29 13:56:42 +02:00
parent 637464e8b0
commit 40021ff602
2 changed files with 13 additions and 9 deletions

View File

@ -202,7 +202,9 @@ export async function enrichSchema(
const viewSchema = view.schema || {}
const anyViewOrder = Object.values(viewSchema).some(ui => ui.order != null)
for (const key of Object.keys(viewSchema)) {
for (const key of Object.keys(tableSchema).filter(
k => tableSchema[k].visible !== false
)) {
// if nothing specified in view, then it is not visible
const ui = viewSchema[key] || { visible: false }
schema[key] = {

View File

@ -297,12 +297,6 @@ describe("table sdk", () => {
relationshipType: RelationshipType.ONE_TO_MANY,
fieldName: "table",
tableId: "otherTableId",
schema: {
title: {
visible: true,
readonly: true,
},
},
},
},
}
@ -334,7 +328,15 @@ describe("table sdk", () => {
tableId,
schema: {
name: { visible: true },
other: { visible: true },
other: {
visible: true,
columns: {
title: {
visible: true,
readonly: true,
},
},
},
},
}
@ -351,7 +353,7 @@ describe("table sdk", () => {
other: {
...table.schema.other,
visible: true,
schema: {
columns: {
title: {
visible: true,
readonly: true,