diff --git a/packages/server/src/sdk/app/views/index.ts b/packages/server/src/sdk/app/views/index.ts index d52bdc65d6..9cd11712ed 100644 --- a/packages/server/src/sdk/app/views/index.ts +++ b/packages/server/src/sdk/app/views/index.ts @@ -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] = { diff --git a/packages/server/src/sdk/app/views/tests/views.spec.ts b/packages/server/src/sdk/app/views/tests/views.spec.ts index 03411cae7d..5a86702ab6 100644 --- a/packages/server/src/sdk/app/views/tests/views.spec.ts +++ b/packages/server/src/sdk/app/views/tests/views.spec.ts @@ -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,