diff --git a/hosting/docker-compose.dev.yaml b/hosting/docker-compose.dev.yaml index a9eedac375..7d8198db73 100644 --- a/hosting/docker-compose.dev.yaml +++ b/hosting/docker-compose.dev.yaml @@ -69,4 +69,4 @@ volumes: minio_data: driver: local redis_data: - driver: local + driver: local \ No newline at end of file diff --git a/lerna.json b/lerna.json index 9b156b326d..1106160923 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 17b581ca0b..705e4b1114 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -24,7 +24,7 @@ "dependencies": { "@budibase/nano": "10.1.1", "@budibase/pouchdb-replication-stream": "1.2.10", - "@budibase/types": "2.3.11-alpha.0", + "@budibase/types": "2.3.14-alpha.0", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 63c48f9ed0..07a915a728 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "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.3.11-alpha.0", + "@budibase/string-templates": "2.3.14-alpha.0", "@spectrum-css/accordion": "3.0.24", "@spectrum-css/actionbutton": "1.0.1", "@spectrum-css/actiongroup": "1.0.1", diff --git a/packages/builder/package.json b/packages/builder/package.json index 7af5726b8f..46d58b5ccd 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "license": "GPL-3.0", "private": true, "scripts": { @@ -58,10 +58,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.3.11-alpha.0", - "@budibase/client": "2.3.11-alpha.0", - "@budibase/frontend-core": "2.3.11-alpha.0", - "@budibase/string-templates": "2.3.11-alpha.0", + "@budibase/bbui": "2.3.14-alpha.0", + "@budibase/client": "2.3.14-alpha.0", + "@budibase/frontend-core": "2.3.14-alpha.0", + "@budibase/string-templates": "2.3.14-alpha.0", "@fortawesome/fontawesome-svg-core": "^6.2.1", "@fortawesome/free-brands-svg-icons": "^6.2.1", "@fortawesome/free-solid-svg-icons": "^6.2.1", diff --git a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte index 4a3c4f6c60..1413cd157e 100644 --- a/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte +++ b/packages/builder/src/components/backend/Datasources/CreateEditRelationship.svelte @@ -152,7 +152,7 @@ fromTable, throughTable, fromTable.primary[0], - throughFromKey + throughToKey ), throughToKey: errorChecker.manyForeignKeySet(throughToKey) || @@ -160,7 +160,7 @@ toTable, throughTable, toTable.primary[0], - throughToKey + throughFromKey ), fromForeign: errorChecker.foreignKeySet(fromForeign) || @@ -391,24 +391,14 @@ options={Object.keys(getTable(throughId)?.schema)} bind:value={throughToKey} bind:error={errors.throughToKey} - on:change={e => - changed(() => { - if (throughFromKey === e.detail) { - throughFromKey = null - } - })} + on:change={changed} /> { let entries = Object.entries(schema ?? {}) let types = [] - if (type === "field/options") { - // allow options to be used on both options and string fields + if (type === "field/options" || type === "field/longform") { + // allow options and longform to be used on string fields as well types = [type, "field/string"] } else { types = [type] diff --git a/packages/cli/package.json b/packages/cli/package.json index db519cc1c3..adb3c09ec8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "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.3.11-alpha.0", - "@budibase/string-templates": "2.3.11-alpha.0", - "@budibase/types": "2.3.11-alpha.0", + "@budibase/backend-core": "2.3.14-alpha.0", + "@budibase/string-templates": "2.3.14-alpha.0", + "@budibase/types": "2.3.14-alpha.0", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index ca9ca128f4..82e2f97f7f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "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.3.11-alpha.0", - "@budibase/frontend-core": "2.3.11-alpha.0", - "@budibase/string-templates": "2.3.11-alpha.0", + "@budibase/bbui": "2.3.14-alpha.0", + "@budibase/frontend-core": "2.3.14-alpha.0", + "@budibase/string-templates": "2.3.14-alpha.0", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/client/src/components/app/forms/Field.svelte b/packages/client/src/components/app/forms/Field.svelte index a14c6ac9c8..435805cee8 100644 --- a/packages/client/src/components/app/forms/Field.svelte +++ b/packages/client/src/components/app/forms/Field.svelte @@ -85,7 +85,7 @@ {:else if !fieldState} - {:else if schemaType && schemaType !== type && type !== "options"} + {:else if schemaType && schemaType !== type && !["options", "longform"].includes(type)} diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 5f03a5c7b0..3259b718ee 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.3.11-alpha.0", + "@budibase/bbui": "2.3.14-alpha.0", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 4b67c8ca01..b48ba7dbf1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 909369165f..a367f65aed 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "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.3.11-alpha.0", - "@budibase/client": "2.3.11-alpha.0", - "@budibase/pro": "2.3.11-alpha.0", - "@budibase/string-templates": "2.3.11-alpha.0", - "@budibase/types": "2.3.11-alpha.0", + "@budibase/backend-core": "2.3.14-alpha.0", + "@budibase/client": "2.3.14-alpha.0", + "@budibase/pro": "2.3.14-alpha.0", + "@budibase/string-templates": "2.3.14-alpha.0", + "@budibase/types": "2.3.14-alpha.0", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/server/scripts/integrations/postgres/emp-territory.sql b/packages/server/scripts/integrations/postgres/emp-territory.sql new file mode 100644 index 0000000000..f258dbf46a --- /dev/null +++ b/packages/server/scripts/integrations/postgres/emp-territory.sql @@ -0,0 +1,32 @@ +SELECT 'CREATE DATABASE main' +WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'main')\gexec +CREATE SCHEMA test; +CREATE TABLE territories ( + territory_id character varying(20) PRIMARY KEY, + territory_description character varying(60) NOT NULL +); +CREATE TABLE employees ( + employee_id smallint PRIMARY KEY, + last_name character varying(20) NOT NULL, + first_name character varying(10) NOT NULL, + title character varying(30), + title_of_courtesy character varying(25), + birth_date date, + hire_date date, + address character varying(60), + city character varying(15), + region character varying(15), + postal_code character varying(10), + country character varying(15), + home_phone character varying(24), + extension character varying(4), + photo bytea, + notes text, + reports_to smallint REFERENCES employees(employee_id), + photo_path character varying(255) +); +CREATE TABLE employee_territories ( + employee_id smallint REFERENCES employees(employee_id), + territory_id character varying(20) REFERENCES territories(territory_id), + CONSTRAINT pk_employee_territories PRIMARY KEY (employee_id, territory_id) +); diff --git a/packages/server/src/app.ts b/packages/server/src/app.ts index 6855880a27..be0c63f06a 100644 --- a/packages/server/src/app.ts +++ b/packages/server/src/app.ts @@ -27,13 +27,17 @@ const destroyable = require("server-destroy") const app = new Koa() +let mbNumber = parseInt(env.HTTP_MB_LIMIT || "10") +if (!mbNumber || isNaN(mbNumber)) { + mbNumber = 10 +} // set up top level koa middleware app.use( koaBody({ multipart: true, - formLimit: "10mb", - jsonLimit: "10mb", - textLimit: "10mb", + formLimit: `${mbNumber}mb`, + jsonLimit: `${mbNumber}mb`, + textLimit: `${mbNumber}mb`, // @ts-ignore enableTypes: ["json", "form", "text"], parsedMethods: ["POST", "PUT", "PATCH", "DELETE"], diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index 6272e0e462..256d8d10c3 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -83,6 +83,7 @@ const environment = { MULTI_TENANCY: process.env.MULTI_TENANCY, ENABLE_ANALYTICS: process.env.ENABLE_ANALYTICS, SELF_HOSTED: process.env.SELF_HOSTED, + HTTP_MB_LIMIT: process.env.HTTP_MB_LIMIT, // old CLIENT_ID: process.env.CLIENT_ID, _set(key: string, value: any) { diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index c01c5c3ca4..16c86dd298 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1278,14 +1278,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.3.11-alpha.0": - version "2.3.11-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.11-alpha.0.tgz#361e30139a1a26d023902c6bdb4fdcac2610b69f" - integrity sha512-hlaeTkYsSJJYIwwqL3LJ7Pxzq0tOgSjQ38+nFiBPIzjkDSaV0UPwi0rZAZq/kPvaT7AKdTEcf8tn1wiui/VkYA== +"@budibase/backend-core@2.3.14-alpha.0": + version "2.3.14-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.14-alpha.0.tgz#8d60c93e9861301296907f61e770bdf1881b560c" + integrity sha512-lvRl6o9CCUx1VQ6ftu4FYuTp5mGgvbshNYoeaH0DbWFfhLNbibEHxx+pR+6M1ufhbu/EO6jKEr7DDeNiRBBMTw== dependencies: "@budibase/nano" "10.1.1" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.3.11-alpha.0" + "@budibase/types" "2.3.14-alpha.0" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1392,13 +1392,13 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.3.11-alpha.0": - version "2.3.11-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.11-alpha.0.tgz#b59edba2c04e2a490f3d9246cd328d8dd3213295" - integrity sha512-z7tLgRKYKm1psNZGdRErQT8tV+vSj9hXJkD/H/uFxsJ3IQkjWbcFP5FUBPads5RnvCtqOfYu8OpRHCJfNNBoCA== +"@budibase/pro@2.3.14-alpha.0": + version "2.3.14-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.14-alpha.0.tgz#db8ac1d0cacea21240c59458c4143e3e55663a4d" + integrity sha512-RJqXlvZmYrKCLxe7uVnc2KmDwE5OmoUZCA9M6b5Ne7ZHqrhtaNB/4Xlr1ESG79///epEWLv+Fde7mpHPzCvsZw== dependencies: - "@budibase/backend-core" "2.3.11-alpha.0" - "@budibase/types" "2.3.11-alpha.0" + "@budibase/backend-core" "2.3.14-alpha.0" + "@budibase/types" "2.3.14-alpha.0" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1424,10 +1424,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.3.11-alpha.0": - version "2.3.11-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.11-alpha.0.tgz#55cdcef6fb30c79e9d7d90ae8789e4f0cc6a2b63" - integrity sha512-SFW9vManFRJ45bgMW7wkDiNxiQQfAME8HOmSqCHKDC0OPzsDydygIl7BNeF/domFvCXxDD3NPu7HC2JXMlV6cw== +"@budibase/types@2.3.14-alpha.0": + version "2.3.14-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.14-alpha.0.tgz#03072a669c016c616278dc01c577119dd710e4fe" + integrity sha512-D5qOD7YJhHUrPy81C9OpTlVzsXBmZwbF9WdoxYo/M8JYmhTJfj7Fu5dGTyDpipPQVqknFpTsig5kQqG3r08ZZw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2c3ea9ca94..b04876e19b 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 7a0ce71f1c..26d6c53a3a 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 7a36f18d87..d8b6919b4b 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.3.11-alpha.0", + "version": "2.3.14-alpha.0", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.3.11-alpha.0", - "@budibase/pro": "2.3.11-alpha.0", - "@budibase/string-templates": "2.3.11-alpha.0", - "@budibase/types": "2.3.11-alpha.0", + "@budibase/backend-core": "2.3.14-alpha.0", + "@budibase/pro": "2.3.14-alpha.0", + "@budibase/string-templates": "2.3.14-alpha.0", + "@budibase/types": "2.3.14-alpha.0", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 7074ec8e3d..cdff3b0a12 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -475,14 +475,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.3.11-alpha.0": - version "2.3.11-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.11-alpha.0.tgz#361e30139a1a26d023902c6bdb4fdcac2610b69f" - integrity sha512-hlaeTkYsSJJYIwwqL3LJ7Pxzq0tOgSjQ38+nFiBPIzjkDSaV0UPwi0rZAZq/kPvaT7AKdTEcf8tn1wiui/VkYA== +"@budibase/backend-core@2.3.14-alpha.0": + version "2.3.14-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.3.14-alpha.0.tgz#8d60c93e9861301296907f61e770bdf1881b560c" + integrity sha512-lvRl6o9CCUx1VQ6ftu4FYuTp5mGgvbshNYoeaH0DbWFfhLNbibEHxx+pR+6M1ufhbu/EO6jKEr7DDeNiRBBMTw== dependencies: "@budibase/nano" "10.1.1" "@budibase/pouchdb-replication-stream" "1.2.10" - "@budibase/types" "2.3.11-alpha.0" + "@budibase/types" "2.3.14-alpha.0" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -539,13 +539,13 @@ pouchdb-promise "^6.0.4" through2 "^2.0.0" -"@budibase/pro@2.3.11-alpha.0": - version "2.3.11-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.11-alpha.0.tgz#b59edba2c04e2a490f3d9246cd328d8dd3213295" - integrity sha512-z7tLgRKYKm1psNZGdRErQT8tV+vSj9hXJkD/H/uFxsJ3IQkjWbcFP5FUBPads5RnvCtqOfYu8OpRHCJfNNBoCA== +"@budibase/pro@2.3.14-alpha.0": + version "2.3.14-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.3.14-alpha.0.tgz#db8ac1d0cacea21240c59458c4143e3e55663a4d" + integrity sha512-RJqXlvZmYrKCLxe7uVnc2KmDwE5OmoUZCA9M6b5Ne7ZHqrhtaNB/4Xlr1ESG79///epEWLv+Fde7mpHPzCvsZw== dependencies: - "@budibase/backend-core" "2.3.11-alpha.0" - "@budibase/types" "2.3.11-alpha.0" + "@budibase/backend-core" "2.3.14-alpha.0" + "@budibase/types" "2.3.14-alpha.0" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -553,10 +553,10 @@ lru-cache "^7.14.1" node-fetch "^2.6.1" -"@budibase/types@2.3.11-alpha.0": - version "2.3.11-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.11-alpha.0.tgz#55cdcef6fb30c79e9d7d90ae8789e4f0cc6a2b63" - integrity sha512-SFW9vManFRJ45bgMW7wkDiNxiQQfAME8HOmSqCHKDC0OPzsDydygIl7BNeF/domFvCXxDD3NPu7HC2JXMlV6cw== +"@budibase/types@2.3.14-alpha.0": + version "2.3.14-alpha.0" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.3.14-alpha.0.tgz#03072a669c016c616278dc01c577119dd710e4fe" + integrity sha512-D5qOD7YJhHUrPy81C9OpTlVzsXBmZwbF9WdoxYo/M8JYmhTJfj7Fu5dGTyDpipPQVqknFpTsig5kQqG3r08ZZw== "@cspotcode/source-map-support@^0.8.0": version "0.8.1"