Fix view schemas
This commit is contained in:
parent
637464e8b0
commit
40021ff602
|
@ -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] = {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue