1
0
Fork 0
mirror of synced 2024-09-09 06:01:08 +12:00

Merge branch 'develop' into cypress-testing

This commit is contained in:
Mitch-Budibase 2022-06-21 12:55:45 +01:00
commit 58aae66a03
17 changed files with 65 additions and 41 deletions

View file

@ -1,5 +1,5 @@
{ {
"version": "1.0.207-alpha.4", "version": "1.0.207-alpha.5",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View file

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

View file

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

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "1.0.207-alpha.4", "version": "1.0.207-alpha.5",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -69,10 +69,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.0.207-alpha.4", "@budibase/bbui": "^1.0.207-alpha.5",
"@budibase/client": "^1.0.207-alpha.4", "@budibase/client": "^1.0.207-alpha.5",
"@budibase/frontend-core": "^1.0.207-alpha.4", "@budibase/frontend-core": "^1.0.207-alpha.5",
"@budibase/string-templates": "^1.0.207-alpha.4", "@budibase/string-templates": "^1.0.207-alpha.5",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1", "@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",

View file

@ -54,8 +54,9 @@
} }
const onFieldChange = (expression, field) => { const onFieldChange = (expression, field) => {
// Update the field type // Update the field types
expression.type = enrichedSchemaFields.find(x => x.name === field)?.type expression.type = enrichedSchemaFields.find(x => x.name === field)?.type
expression.externalType = getSchema(expression)?.externalType
// Ensure a valid operator is set // Ensure a valid operator is set
const validOperators = LuceneUtils.getValidOperatorsForType( const validOperators = LuceneUtils.getValidOperatorsForType(

View file

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "1.0.207-alpha.4", "version": "1.0.207-alpha.5",
"description": "Budibase CLI, for developers, self hosting and migrations.", "description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js", "main": "src/index.js",
"bin": { "bin": {

View file

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

View file

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

View file

@ -63,3 +63,25 @@ export const TableNames = {
* - Coerce types for search endpoint * - Coerce types for search endpoint
*/ */
export const ApiVersion = "1" export const ApiVersion = "1"
/**
* Maximum minimum range for SQL number values
*/
export const SqlNumberTypeRangeMap = {
integer: {
max: 2147483647,
min: -2147483648,
},
int: {
max: 2147483647,
min: -2147483648,
},
smallint: {
max: 32767,
min: -32768,
},
mediumint: {
max: 8388607,
min: -8388608,
},
}

View file

@ -1,5 +1,5 @@
import { Helpers } from "@budibase/bbui" import { Helpers } from "@budibase/bbui"
import { OperatorOptions } from "../constants" import { OperatorOptions, SqlNumberTypeRangeMap } from "../constants"
/** /**
* Returns the valid operator options for a certain data type * Returns the valid operator options for a certain data type
@ -94,7 +94,7 @@ export const buildLuceneQuery = filter => {
} }
if (Array.isArray(filter)) { if (Array.isArray(filter)) {
filter.forEach(expression => { filter.forEach(expression => {
let { operator, field, type, value } = expression let { operator, field, type, value, externalType } = expression
// Parse all values into correct types // Parse all values into correct types
if (type === "datetime" && value) { if (type === "datetime" && value) {
value = new Date(value).toISOString() value = new Date(value).toISOString()
@ -106,16 +106,14 @@ export const buildLuceneQuery = filter => {
value = `${value}`?.toLowerCase() === "true" value = `${value}`?.toLowerCase() === "true"
} }
if (operator.startsWith("range")) { if (operator.startsWith("range")) {
const minint =
SqlNumberTypeRangeMap[externalType]?.min || Number.MIN_SAFE_INTEGER
const maxint =
SqlNumberTypeRangeMap[externalType]?.max || Number.MAX_SAFE_INTEGER
if (!query.range[field]) { if (!query.range[field]) {
query.range[field] = { query.range[field] = {
low: low: type === "number" ? minint : "0000-00-00T00:00:00.000Z",
type === "number" high: type === "number" ? maxint : "9999-00-00T00:00:00.000Z",
? Number.MIN_SAFE_INTEGER
: "0000-00-00T00:00:00.000Z",
high:
type === "number"
? Number.MAX_SAFE_INTEGER
: "9999-00-00T00:00:00.000Z",
} }
} }
if (operator === "rangeLow" && value != null && value !== "") { if (operator === "rangeLow" && value != null && value !== "") {

View file

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

View file

@ -246,6 +246,7 @@ module MSSQLModule {
autocolumn: !!autoColumns.find((col: string) => col === name), autocolumn: !!autoColumns.find((col: string) => col === name),
name: name, name: name,
...convertSqlType(def.DATA_TYPE), ...convertSqlType(def.DATA_TYPE),
externalType: def.DATA_TYPE,
} }
} }
tables[tableName] = { tables[tableName] = {

View file

@ -232,6 +232,7 @@ module MySQLModule {
autocolumn: isAuto, autocolumn: isAuto,
constraints, constraints,
...convertSqlType(column.Type), ...convertSqlType(column.Type),
externalType: column.Type,
} }
} }
if (!tables[tableName]) { if (!tables[tableName]) {

View file

@ -271,6 +271,7 @@ module PostgresModule {
autocolumn: isAuto, autocolumn: isAuto,
name: columnName, name: columnName,
...convertSqlType(column.data_type), ...convertSqlType(column.data_type),
externalType: column.data_type,
} }
} }

View file

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

View file

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

View file

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