Merge branch 'master' of github.com:budibase/budibase into feature-flag-helper
This commit is contained in:
commit
635d268eea
|
@ -371,15 +371,21 @@ export class DatabaseImpl implements Database {
|
||||||
return this.performCall(() => {
|
return this.performCall(() => {
|
||||||
return async () => {
|
return async () => {
|
||||||
const response = await directCouchUrlCall(args)
|
const response = await directCouchUrlCall(args)
|
||||||
if (response.status >= 300) {
|
|
||||||
const text = await response.text()
|
const text = await response.text()
|
||||||
|
if (response.status > 300) {
|
||||||
|
let json
|
||||||
|
try {
|
||||||
|
json = JSON.parse(text)
|
||||||
|
} catch (err) {
|
||||||
console.error(`SQS error: ${text}`)
|
console.error(`SQS error: ${text}`)
|
||||||
throw new CouchDBError(
|
throw new CouchDBError(
|
||||||
"error while running SQS query, please try again later",
|
"error while running SQS query, please try again later",
|
||||||
{ name: "sqs_error", status: response.status }
|
{ name: "sqs_error", status: response.status }
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return (await response.json()) as T
|
throw json
|
||||||
|
}
|
||||||
|
return JSON.parse(text) as T
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1067,6 +1067,26 @@ describe.each([
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("can add a new group by field that is invisible, even if required on the table", async () => {
|
||||||
|
view.schema!.name = { visible: false }
|
||||||
|
await config.api.viewV2.update(view)
|
||||||
|
|
||||||
|
const { rows } = await config.api.row.search(view.id)
|
||||||
|
expect(rows).toHaveLength(2)
|
||||||
|
expect(rows).toEqual(
|
||||||
|
expect.arrayContaining([
|
||||||
|
{
|
||||||
|
country: "USA",
|
||||||
|
age: 65,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
country: "UK",
|
||||||
|
age: 61,
|
||||||
|
},
|
||||||
|
])
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
it("can add a new calculation field", async () => {
|
it("can add a new calculation field", async () => {
|
||||||
view.schema!.count = {
|
view.schema!.count = {
|
||||||
visible: true,
|
visible: true,
|
||||||
|
|
|
@ -122,7 +122,11 @@ async function guardViewSchema(
|
||||||
}
|
}
|
||||||
|
|
||||||
await checkReadonlyFields(table, view)
|
await checkReadonlyFields(table, view)
|
||||||
|
|
||||||
|
if (!helpers.views.isCalculationView(view)) {
|
||||||
checkRequiredFields(table, view)
|
checkRequiredFields(table, view)
|
||||||
|
}
|
||||||
|
|
||||||
checkDisplayField(view)
|
checkDisplayField(view)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue