Default state of view is no data returned.
This commit is contained in:
parent
9e0964a5e3
commit
672e370904
2 changed files with 14 additions and 16 deletions
|
@ -82,7 +82,6 @@ export function enrichSchema(view: View | ViewV2, tableSchema: TableSchema) {
|
|||
const anyViewOrder = Object.values(view.schema || {}).some(
|
||||
ui => ui.order != null
|
||||
)
|
||||
if (Object.keys(view.schema || {}).length > 0) {
|
||||
for (const key of Object.keys(schema)) {
|
||||
// if nothing specified in view, then it is not visible
|
||||
const ui = view.schema?.[key] || { visible: false }
|
||||
|
@ -96,7 +95,6 @@ export function enrichSchema(view: View | ViewV2, tableSchema: TableSchema) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...view,
|
||||
|
|
|
@ -49,7 +49,7 @@ describe("table sdk", () => {
|
|||
}
|
||||
|
||||
describe("enrichViewSchemas", () => {
|
||||
it("should fetch the default schema if not overriden", async () => {
|
||||
it("should fetch the default schema if not overridden", async () => {
|
||||
const tableId = basicTable._id!
|
||||
const view: ViewV2 = {
|
||||
version: 2,
|
||||
|
@ -66,7 +66,7 @@ describe("table sdk", () => {
|
|||
name: {
|
||||
type: "string",
|
||||
name: "name",
|
||||
visible: true,
|
||||
visible: false,
|
||||
order: 2,
|
||||
width: 80,
|
||||
constraints: {
|
||||
|
@ -76,7 +76,7 @@ describe("table sdk", () => {
|
|||
description: {
|
||||
type: "string",
|
||||
name: "description",
|
||||
visible: true,
|
||||
visible: false,
|
||||
width: 200,
|
||||
constraints: {
|
||||
type: "string",
|
||||
|
@ -85,7 +85,7 @@ describe("table sdk", () => {
|
|||
id: {
|
||||
type: "number",
|
||||
name: "id",
|
||||
visible: true,
|
||||
visible: false,
|
||||
order: 1,
|
||||
constraints: {
|
||||
type: "number",
|
||||
|
|
Loading…
Reference in a new issue