Merge branch 'master' of github.com:Budibase/budibase into develop

This commit is contained in:
Michael Drury 2022-11-29 11:13:54 +00:00
commit 1f0570907a
20 changed files with 106 additions and 40 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/backend-core",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
@ -20,7 +20,7 @@
"test:watch": "jest --watchAll"
},
"dependencies": {
"@budibase/types": "2.1.32-alpha.11",
"@budibase/types": "^2.1.39",
"@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"license": "MPL-2.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
],
"dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.2.1",
"@budibase/string-templates": "2.1.32-alpha.11",
"@budibase/string-templates": "^2.1.39",
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2",

View File

@ -197,6 +197,7 @@
</svg>
{/if}
<input
{disabled}
data-input
type="text"
class="spectrum-Textfield-input spectrum-InputGroup-input"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"license": "GPL-3.0",
"private": true,
"scripts": {
@ -71,10 +71,10 @@
}
},
"dependencies": {
"@budibase/bbui": "2.1.32-alpha.11",
"@budibase/client": "2.1.32-alpha.11",
"@budibase/frontend-core": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@budibase/bbui": "^2.1.39",
"@budibase/client": "^2.1.39",
"@budibase/frontend-core": "^2.1.39",
"@budibase/string-templates": "^2.1.39",
"@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",
@ -82,7 +82,7 @@
"dayjs": "^1.11.2",
"downloadjs": "1.4.7",
"lodash": "4.17.21",
"posthog-js": "1.4.5",
"posthog-js": "^1.36.0",
"remixicon": "2.5.0",
"shortid": "2.2.15",
"svelte-dnd-action": "^0.9.8",

View File

@ -374,7 +374,7 @@ export const getFrontendStore = () => {
s._id !== screen._id
)
})
if (otherHomeScreens.length) {
if (otherHomeScreens.length && updatedScreen.routing.homeScreen) {
const patch = screen => {
screen.routing.homeScreen = false
}

View File

@ -7,9 +7,9 @@
let name = ""
let submitted = false
$: valid = name && name.length > 0 && !datasource?.entities[name]
$: valid = name && name.length > 0 && !datasource?.entities?.[name]
$: error =
!submitted && name && datasource?.entities[name]
!submitted && name && datasource?.entities?.[name]
? "Table name already in use."
: null

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js",
"bin": {
@ -26,9 +26,9 @@
"outputPath": "build"
},
"dependencies": {
"@budibase/backend-core": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@budibase/types": "2.1.32-alpha.11",
"@budibase/backend-core": "^2.1.39",
"@budibase/string-templates": "^2.1.39",
"@budibase/types": "^2.1.39",
"axios": "0.21.2",
"chalk": "4.1.0",
"cli-progress": "3.11.2",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
"@budibase/bbui": "2.1.32-alpha.11",
"@budibase/frontend-core": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@budibase/bbui": "^2.1.39",
"@budibase/frontend-core": "^2.1.39",
"@budibase/string-templates": "^2.1.39",
"@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3",

View File

@ -1,12 +1,12 @@
{
"name": "@budibase/frontend-core",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase",
"license": "MPL-2.0",
"svelte": "src/index.js",
"dependencies": {
"@budibase/bbui": "2.1.32-alpha.11",
"@budibase/bbui": "^2.1.39",
"lodash": "^4.17.21",
"svelte": "^3.46.2"
}

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/sdk",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Budibase Public API SDK",
"author": "Budibase",
"license": "MPL-2.0",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Budibase Web Server",
"main": "src/index.ts",
"repository": {
@ -43,11 +43,11 @@
"license": "GPL-3.0",
"dependencies": {
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "2.1.32-alpha.11",
"@budibase/client": "2.1.32-alpha.11",
"@budibase/pro": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@budibase/types": "2.1.32-alpha.11",
"@budibase/backend-core": "^2.1.39",
"@budibase/client": "^2.1.39",
"@budibase/pro": "2.1.39",
"@budibase/string-templates": "^2.1.39",
"@budibase/types": "^2.1.39",
"@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0",

View File

@ -220,6 +220,9 @@ export async function save(ctx: BBContext) {
const db = context.getAppDB()
const datasource = await db.get(datasourceId)
if (!datasource.entities) {
datasource.entities = {}
}
const oldTables = cloneDeep(datasource.entities)
const tables: Record<string, Table> = datasource.entities

View File

@ -106,7 +106,11 @@ function bindingTypeCoerce(bindings: any[]) {
}
// if not a number, see if it is a date - important to do in this order as any
// integer will be considered a valid date
else if (/^\d/.test(binding) && dayjs(binding).isValid()) {
else if (
/^\d/.test(binding) &&
dayjs(binding).isValid() &&
!binding.includes(",")
) {
bindings[i] = dayjs(binding).toDate()
}
}

View File

@ -73,4 +73,61 @@ describe("MySQL Integration", () => {
expect(response).toEqual([{ deleted: true }])
})
})
describe("binding type coerce", () => {
it("ignores non-string types ", async () => {
const sql = "select * from users;"
const date = new Date()
await config.integration.read({
sql,
bindings: [11, date, ["a", "b", "c"], { id: 1 }],
})
expect(config.integration.client.query).toHaveBeenCalledWith(sql, [
11,
date,
["a", "b", "c"],
{ id: 1 },
])
})
it("parses strings matching a number regex", async () => {
const sql = "select * from users;"
await config.integration.read({
sql,
bindings: ["101", "3.14"],
})
expect(config.integration.client.query).toHaveBeenCalledWith(
sql,
[101, 3.14]
)
})
it("parses strings matching a valid date format", async () => {
const sql = "select * from users;"
await config.integration.read({
sql,
bindings: [
"2001-10-30",
"2010-09-01T13:30:59.123Z",
"2021-02-05 12:01 PM",
],
})
expect(config.integration.client.query).toHaveBeenCalledWith(sql, [
new Date("2001-10-30T00:00:00.000Z"),
new Date("2010-09-01T13:30:59.123Z"),
new Date("2021-02-05T12:01:00.000Z"),
])
})
it("does not parse string matching a valid array of numbers as date", async () => {
const sql = "select * from users;"
await config.integration.read({
sql,
bindings: ["1,2,2017"],
})
expect(config.integration.client.query).toHaveBeenCalledWith(sql, [
"1,2,2017",
])
})
})
})

View File

@ -53,7 +53,6 @@ class QueryRunner {
async execute(): Promise<any> {
let { datasource, fields, queryVerb, transformer } = this
let datasourceClone = cloneDeep(datasource)
let fieldsClone = cloneDeep(fields)
@ -176,6 +175,7 @@ class QueryRunner {
parameters,
transformer: query.transformer,
queryId,
ctx: this.ctx,
},
{ noRecursiveQuery: true }
).execute()

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs",
"module": "dist/bundle.mjs",

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/types",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Budibase types",
"main": "dist/index.js",
"types": "dist/index.d.ts",

View File

@ -23,4 +23,5 @@ export interface Price {
duration: PriceDuration
priceId: string
dayPasses: number
isPerUser: boolean
}

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/worker",
"email": "hi@budibase.com",
"version": "2.1.32-alpha.11",
"version": "2.1.39",
"description": "Budibase background service",
"main": "src/index.ts",
"repository": {
@ -36,10 +36,10 @@
"author": "Budibase",
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "2.1.32-alpha.11",
"@budibase/pro": "2.1.32-alpha.11",
"@budibase/string-templates": "2.1.32-alpha.11",
"@budibase/types": "2.1.32-alpha.11",
"@budibase/backend-core": "^2.1.39",
"@budibase/pro": "2.1.39",
"@budibase/string-templates": "^2.1.39",
"@budibase/types": "^2.1.39",
"@koa/router": "8.0.8",
"@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2",