From b5a8c188b5f386adc2f356c23a5271260bb9644b Mon Sep 17 00:00:00 2001 From: Michael Drury Date: Tue, 29 Jun 2021 14:15:07 +0100 Subject: [PATCH 01/13] Update CONTRIBUTING.md --- .github/CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6d39d2844..2214d8b39 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -152,7 +152,7 @@ The HTML and CSS for your apps runtime pages, as well as the budibase client lib #### Backend -The backend schema, tables and rows are stored using PouchDB when developing locally, and in [CouchDB](https://pouchdb.com/) when running in production. +For the backend we run [Redis](https://redis.io/), [CouchDB](https://couchdb.apache.org/), [MinIO](https://min.io/) and [Envoy](https://www.envoyproxy.io/) in Docker compose. This means that to develop Budibase you will need Docker and Docker compose installed. The backend services are then ran separately as Node services with nodemon so that they can be debugged outside of Docker. ### Publishing Budibase to NPM From e80e2c6a7b7a85be37d3a6db04a52f74d780ed5a Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 29 Jun 2021 13:24:30 +0000 Subject: [PATCH 02/13] v0.9.66 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index a4f97adab..a65d5d4fc 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.65", + "version": "0.9.66", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 9db590c8d..8dc48facd 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.65", + "version": "0.9.66", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 1b3105f72..2e87bb560 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": "0.9.65", + "version": "0.9.66", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 3f88efb50..2dc701da6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.65", + "version": "0.9.66", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.65", - "@budibase/client": "^0.9.65", + "@budibase/bbui": "^0.9.66", + "@budibase/client": "^0.9.66", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.65", + "@budibase/string-templates": "^0.9.66", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 36c004644..853af961d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.65", + "version": "0.9.66", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 6e065ff8c..e54ae5bda 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.65", + "version": "0.9.66", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.65", - "@budibase/standard-components": "^0.9.65", - "@budibase/string-templates": "^0.9.65", + "@budibase/bbui": "^0.9.66", + "@budibase/standard-components": "^0.9.66", + "@budibase/string-templates": "^0.9.66", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 5be221857..1553c860f 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.65", + "version": "0.9.66", "description": "Budibase Web Server", "main": "src/electron.js", "repository": { @@ -55,9 +55,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.65", - "@budibase/client": "^0.9.65", - "@budibase/string-templates": "^0.9.65", + "@budibase/auth": "^0.9.66", + "@budibase/client": "^0.9.66", + "@budibase/string-templates": "^0.9.66", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -110,7 +110,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.65", + "@budibase/standard-components": "^0.9.66", "@jest/test-sequencer": "^24.8.0", "babel-jest": "^27.0.2", "docker-compose": "^0.23.6", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 986f6d94c..4044923c7 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.65", + "version": "0.9.66", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.65", + "@budibase/bbui": "^0.9.66", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5a0d72887..a7b496b90 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.65", + "version": "0.9.66", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index c070ba366..5448ee0dd 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.65", + "version": "0.9.66", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.65", - "@budibase/string-templates": "^0.9.65", + "@budibase/auth": "^0.9.66", + "@budibase/string-templates": "^0.9.66", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From 2e4116d40aaeaba5b022fc4defbbd18acb76a5b0 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 29 Jun 2021 17:15:13 +0100 Subject: [PATCH 03/13] pin eslint parser to fix build --- packages/server/package.json | 2 +- packages/server/yarn.lock | 50 ++++++++++++++++++------------------ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index cdbb5af5a..f890b6825 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -121,7 +121,7 @@ "@types/koa": "^2.13.3", "@types/koa-router": "^7.4.2", "@types/node": "^15.12.4", - "@typescript-eslint/parser": "^4.28.0", + "@typescript-eslint/parser": "4.28.0", "babel-jest": "^27.0.2", "copyfiles": "^2.4.1", "docker-compose": "^0.23.6", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index a3cf9d629..0939a1add 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1146,10 +1146,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/auth@^0.9.65": - version "0.9.65" - resolved "https://registry.yarnpkg.com/@budibase/auth/-/auth-0.9.65.tgz#3ba3ae9dd04781674682bc3b612fba0c16c92a1a" - integrity sha512-WVNT69uLgpQYKrHclPApYnL0Jfg7gct1oCbziJWoNEisRgSLe+SjtduQDhn5R8SZcPdmP4xdhISwlrvI+tYJsw== +"@budibase/auth@^0.9.66": + version "0.9.66" + resolved "https://registry.yarnpkg.com/@budibase/auth/-/auth-0.9.66.tgz#543eb6e0cbc0072d8567fdb5ce0f60a601e84f9f" + integrity sha512-hLVCzSmXk7X6oYpNQz06wYyXeN/eJP1AWKtfJfvUOCyE1zLDAxxkvk6UTnAZJ6Mj013QNjWfI9ohlncvY1vsmQ== dependencies: aws-sdk "^2.901.0" bcryptjs "^2.4.3" @@ -1167,10 +1167,10 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/bbui@^0.9.65": - version "0.9.65" - resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-0.9.65.tgz#cdcfa418b79b27c10195b65a90c10f571b32ae70" - integrity sha512-DHhBe3e6kO5GiVpkOwjFReiBiXeIuOxFgKKxI6X5TIUGbnVzsM032ehcyH9QRxwMlwIIGjEA6CSKjxMreJ7sPA== +"@budibase/bbui@^0.9.66": + version "0.9.66" + resolved "https://registry.yarnpkg.com/@budibase/bbui/-/bbui-0.9.66.tgz#aba79def0d90c2fcb322ae787c06b47f6c1c3814" + integrity sha512-2P7SFbrw5/E8g4eSZ4OBuJOMDQPyjZBTcZkGtMIP2BlGH3Pn6OilYrH9OmHhn0zebzFA4hGoRgrT2TOiMBRCrg== dependencies: "@adobe/spectrum-css-workflow-icons" "^1.2.1" "@spectrum-css/actionbutton" "^1.0.1" @@ -1215,14 +1215,14 @@ svelte-flatpickr "^3.1.0" svelte-portal "^1.0.0" -"@budibase/client@^0.9.65": - version "0.9.65" - resolved "https://registry.yarnpkg.com/@budibase/client/-/client-0.9.65.tgz#8ad5fb1400ddc620955d6bb12aad181ff56498a6" - integrity sha512-9Eo0xdCxqGxnn8s0RJq/Nx+WFK8SM+GWd0vKi55TuKC/Oj4X8qnRprpL5la83cQrRb2aGCk5/41IdETnwtTNGw== +"@budibase/client@^0.9.66": + version "0.9.66" + resolved "https://registry.yarnpkg.com/@budibase/client/-/client-0.9.66.tgz#04a0838352169607fc005f9910e7c2d485fdbe06" + integrity sha512-2SJWAZjqi5DUdAJBYmyfKuCw1pHmgzdjEHgU0kP5MZpHxcllKcyQCTELRVFRebz74PR9GibjvNNUIexQQElEVQ== dependencies: - "@budibase/bbui" "^0.9.65" - "@budibase/standard-components" "^0.9.65" - "@budibase/string-templates" "^0.9.65" + "@budibase/bbui" "^0.9.66" + "@budibase/standard-components" "^0.9.66" + "@budibase/string-templates" "^0.9.66" regexparam "^1.3.0" shortid "^2.2.15" svelte-spa-router "^3.0.5" @@ -1259,12 +1259,12 @@ to-gfm-code-block "^0.1.1" year "^0.2.1" -"@budibase/standard-components@^0.9.65": - version "0.9.65" - resolved "https://registry.yarnpkg.com/@budibase/standard-components/-/standard-components-0.9.65.tgz#6c6b82160952ca1413777f303a915289c759e3f2" - integrity sha512-MIGQFmckV5KC3kurZTAHPrpw/dNXwd0sTzfva3f1NwpkZUVN/dovBnyrU3xmMULq2Aj2DfomUR/mCbTlKRBSMA== +"@budibase/standard-components@^0.9.66": + version "0.9.66" + resolved "https://registry.yarnpkg.com/@budibase/standard-components/-/standard-components-0.9.66.tgz#79ee98e0b5b71801360594b59966f203197eb6ae" + integrity sha512-iq+ninGbe5GqNRk8qxlgXXH7hgCFJ90+Xw1zhYRtIE//BmeGYHxEJjDTjG+7qSHPvp2ZB4KkLiD/y7/H0zwuEA== dependencies: - "@budibase/bbui" "^0.9.65" + "@budibase/bbui" "^0.9.66" "@spectrum-css/link" "^3.1.3" "@spectrum-css/page" "^3.0.1" "@spectrum-css/vars" "^3.0.1" @@ -1273,10 +1273,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/string-templates@^0.9.65": - version "0.9.65" - resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-0.9.65.tgz#63c9461284ee5f20be35a246082835b00e95672c" - integrity sha512-hD/NN1h+AQzNlr+OukwUAN9qqbFyH7EBLYNPD507ZAy0fiP+Z5+GgnjGeIkP8tZk8LDtVCcM2uSjyjG+X3UX7Q== +"@budibase/string-templates@^0.9.66": + version "0.9.66" + resolved "https://registry.yarnpkg.com/@budibase/string-templates/-/string-templates-0.9.66.tgz#700145549f1636cb46f88b94ef23b3a064058b75" + integrity sha512-eFFBTTKlRpzNSNwKGOclRkXlrKr5UxV3sCU2QfskPXai4hx9RtD/LyKKSlLshVU1ZjwfTCor9cm7f/hhxRzuRA== dependencies: "@budibase/handlebars-helpers" "^0.11.4" dayjs "^1.10.4" @@ -2613,7 +2613,7 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/parser@^4.28.0": +"@typescript-eslint/parser@4.28.0": version "4.28.0" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.28.0.tgz#2404c16751a28616ef3abab77c8e51d680a12caa" integrity sha512-7x4D22oPY8fDaOCvkuXtYYTQ6mTMmkivwEzS+7iml9F9VkHGbbZ3x4fHRwxAb5KeuSkLqfnYjs46tGx2Nour4A== From 3be016a3b8ce23897c3f9de18d3c929c922c93a5 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 29 Jun 2021 17:37:58 +0100 Subject: [PATCH 04/13] Bootstrap before lint in release CI job --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edfb7baa7..4e76626d2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,8 +20,8 @@ jobs: with: node-version: 12.x - run: yarn - - run: yarn lint - run: yarn bootstrap + - run: yarn lint - run: yarn build - run: yarn test From 4abd23f6ff31b14973fe222e927cb4c3e498fea2 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Tue, 29 Jun 2021 16:46:33 +0000 Subject: [PATCH 05/13] v0.9.67 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index a65d5d4fc..4699ef377 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.66", + "version": "0.9.67", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 8dc48facd..a7e856248 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.66", + "version": "0.9.67", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 2e87bb560..013d95fc9 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": "0.9.66", + "version": "0.9.67", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 2dc701da6..bd10c48c9 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.66", + "version": "0.9.67", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.66", - "@budibase/client": "^0.9.66", + "@budibase/bbui": "^0.9.67", + "@budibase/client": "^0.9.67", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.66", + "@budibase/string-templates": "^0.9.67", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 853af961d..8774cf83b 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.66", + "version": "0.9.67", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index e54ae5bda..92a2d9d49 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.66", + "version": "0.9.67", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.66", - "@budibase/standard-components": "^0.9.66", - "@budibase/string-templates": "^0.9.66", + "@budibase/bbui": "^0.9.67", + "@budibase/standard-components": "^0.9.67", + "@budibase/string-templates": "^0.9.67", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index f890b6825..e88b57f05 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.66", + "version": "0.9.67", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -59,9 +59,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.66", - "@budibase/client": "^0.9.66", - "@budibase/string-templates": "^0.9.66", + "@budibase/auth": "^0.9.67", + "@budibase/client": "^0.9.67", + "@budibase/string-templates": "^0.9.67", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -114,7 +114,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.66", + "@budibase/standard-components": "^0.9.67", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 4044923c7..b27616df2 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.66", + "version": "0.9.67", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.66", + "@budibase/bbui": "^0.9.67", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a7b496b90..d4662bcc7 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.66", + "version": "0.9.67", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 5448ee0dd..570f52c82 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.66", + "version": "0.9.67", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.66", - "@budibase/string-templates": "^0.9.66", + "@budibase/auth": "^0.9.67", + "@budibase/string-templates": "^0.9.67", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From 1d2b306574d1af0b1e897d3e7f2bb36b8d5b6568 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 1 Jul 2021 00:40:16 +0100 Subject: [PATCH 06/13] Add border style as an explicit option to prevent issues with dynamically adding it via the styleable helper --- .../design/PropertiesPanel/componentStyles.js | 20 ++++++++++++++++--- packages/client/src/utils/styleable.js | 5 ----- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/componentStyles.js b/packages/builder/src/components/design/PropertiesPanel/componentStyles.js index 95ca1e52d..4b30b65fc 100644 --- a/packages/builder/src/components/design/PropertiesPanel/componentStyles.js +++ b/packages/builder/src/components/design/PropertiesPanel/componentStyles.js @@ -284,7 +284,7 @@ export const background = { export const border = { label: "Border", - columns: "auto 1fr", + columns: "1fr 1fr", settings: [ { label: "Color", @@ -295,17 +295,31 @@ export const border = { label: "Width", key: "border-width", control: Select, + column: "1 / 2", + placeholder: "None", options: [ { label: "Small", value: "1px" }, { label: "Medium", value: "2px" }, { label: "Large", value: "4px" }, ], }, + { + label: "Style", + key: "border-style", + control: Select, + column: "2 / 3", + placeholder: "None", + options: [ + { label: "Solid", value: "solid" }, + { label: "Dotted", value: "dotted" }, + { label: "Dashed", value: "dashed" }, + ], + }, { label: "Radius", key: "border-radius", control: Select, - column: "1 / 3", + placeholder: "None", options: [ { label: "Small", value: "0.25rem" }, { label: "Medium", value: "0.5rem" }, @@ -317,7 +331,7 @@ export const border = { label: "Shadow", key: "box-shadow", control: Select, - column: "1 / 3", + placeholder: "None", options: [ { label: "Small", diff --git a/packages/client/src/utils/styleable.js b/packages/client/src/utils/styleable.js index 62688e5c0..3f02b3660 100644 --- a/packages/client/src/utils/styleable.js +++ b/packages/client/src/utils/styleable.js @@ -34,11 +34,6 @@ export const styleable = (node, styles = {}) => { baseStyles.overflow = "hidden" } - // Append border-style css if border-width is specified - if (newStyles.normal?.["border-width"]) { - baseStyles["border-style"] = "solid" - } - const componentId = newStyles.id const customStyles = newStyles.custom || "" const normalStyles = { ...baseStyles, ...newStyles.normal } From 26ed9da4de377753f2edc63536671a14b54a28e6 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 1 Jul 2021 00:47:38 +0100 Subject: [PATCH 07/13] Only override existing color style if a color setting exists for Headings --- .../standard-components/src/Heading.svelte | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/standard-components/src/Heading.svelte b/packages/standard-components/src/Heading.svelte index 7cb7ed79d..96df7ce40 100644 --- a/packages/standard-components/src/Heading.svelte +++ b/packages/standard-components/src/Heading.svelte @@ -19,12 +19,19 @@ // Add color styles to main styles object, otherwise the styleable helper // overrides the color when it's passed as inline style. - $: styles = { - ...$component.styles, - normal: { - ...$component.styles?.normal, - color, - }, + $: styles = enrichStyles($component.styles, color) + + const enrichStyles = (styles, color) => { + if (!color) { + return styles + } + return { + ...styles, + normal: { + ...styles?.normal, + color, + }, + } } From 7e8bdae875c68d90a0431581786558676e43a768 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 1 Jul 2021 00:48:05 +0100 Subject: [PATCH 08/13] Only override color style on paragraphs if a color setting exists --- packages/standard-components/src/Text.svelte | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/standard-components/src/Text.svelte b/packages/standard-components/src/Text.svelte index 2e3b2954f..cc962b572 100644 --- a/packages/standard-components/src/Text.svelte +++ b/packages/standard-components/src/Text.svelte @@ -19,12 +19,19 @@ // Add color styles to main styles object, otherwise the styleable helper // overrides the color when it's passed as inline style. - $: styles = { - ...$component.styles, - normal: { - ...$component.styles?.normal, - color, - }, + $: styles = enrichStyles($component.styles, color) + + const enrichStyles = (styles, color) => { + if (!color) { + return styles + } + return { + ...styles, + normal: { + ...styles?.normal, + color, + }, + } } From 96d803fd93163c402ed380c7b556bf4013dd8077 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 1 Jul 2021 00:48:40 +0100 Subject: [PATCH 09/13] Only override color style on links if a color setting exists --- packages/standard-components/src/Link.svelte | 21 ++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/packages/standard-components/src/Link.svelte b/packages/standard-components/src/Link.svelte index 93cac2e30..d58d75f5c 100644 --- a/packages/standard-components/src/Link.svelte +++ b/packages/standard-components/src/Link.svelte @@ -23,12 +23,21 @@ // Add color styles to main styles object, otherwise the styleable helper // overrides the color when it's passed as inline style. - $: styles = { - ...$component.styles, - normal: { - ...$component.styles?.normal, - color, - }, + // Add color styles to main styles object, otherwise the styleable helper + // overrides the color when it's passed as inline style. + $: styles = enrichStyles($component.styles, color) + + const enrichStyles = (styles, color) => { + if (!color) { + return styles + } + return { + ...styles, + normal: { + ...styles?.normal, + color, + }, + } } From ae84345d2739c08d3e36c898ad706ad08cc0c8d1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 1 Jul 2021 11:29:27 +0100 Subject: [PATCH 10/13] Fixing issue with full list of apps not appearing in user administration, meaning couldn't update roles. --- packages/worker/src/api/controllers/admin/roles.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/worker/src/api/controllers/admin/roles.js b/packages/worker/src/api/controllers/admin/roles.js index 17207be6f..3cd99f8c4 100644 --- a/packages/worker/src/api/controllers/admin/roles.js +++ b/packages/worker/src/api/controllers/admin/roles.js @@ -8,7 +8,7 @@ const CouchDB = require("../../../db") exports.fetch = async ctx => { // always use the dev apps as they'll be most up to date (true) - const apps = await getAllApps({ CouchDB, dev: true }) + const apps = await getAllApps({ CouchDB, all: true }) const promises = [] for (let app of apps) { // use dev app IDs From 9b1530ff874967ff552eaa094450402dfe272eb0 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 1 Jul 2021 10:41:50 +0000 Subject: [PATCH 11/13] v0.9.68 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 4699ef377..55262a53c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.67", + "version": "0.9.68", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index a7e856248..70b9e470f 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.67", + "version": "0.9.68", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 013d95fc9..350816c7b 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": "0.9.67", + "version": "0.9.68", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index bd10c48c9..59b13f616 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.67", + "version": "0.9.68", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.67", - "@budibase/client": "^0.9.67", + "@budibase/bbui": "^0.9.68", + "@budibase/client": "^0.9.68", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.67", + "@budibase/string-templates": "^0.9.68", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 8774cf83b..e3b88b8ba 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.67", + "version": "0.9.68", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 92a2d9d49..16e565fd9 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.67", + "version": "0.9.68", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.67", - "@budibase/standard-components": "^0.9.67", - "@budibase/string-templates": "^0.9.67", + "@budibase/bbui": "^0.9.68", + "@budibase/standard-components": "^0.9.68", + "@budibase/string-templates": "^0.9.68", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index e88b57f05..7fe15ad08 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.67", + "version": "0.9.68", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -59,9 +59,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.67", - "@budibase/client": "^0.9.67", - "@budibase/string-templates": "^0.9.67", + "@budibase/auth": "^0.9.68", + "@budibase/client": "^0.9.68", + "@budibase/string-templates": "^0.9.68", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -114,7 +114,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.67", + "@budibase/standard-components": "^0.9.68", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index b27616df2..9185d9dcb 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.67", + "version": "0.9.68", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.67", + "@budibase/bbui": "^0.9.68", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index d4662bcc7..b09e873e1 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.67", + "version": "0.9.68", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 570f52c82..ad7985ddb 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.67", + "version": "0.9.68", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.67", - "@budibase/string-templates": "^0.9.67", + "@budibase/auth": "^0.9.68", + "@budibase/string-templates": "^0.9.68", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From b4c2e3cd31d6ea28dd4cfa2555b8326d01afead2 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 1 Jul 2021 10:51:59 +0000 Subject: [PATCH 12/13] v0.9.69 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 55262a53c..f5c82b9cb 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.68", + "version": "0.9.69", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 70b9e470f..9581a4ce1 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.68", + "version": "0.9.69", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 350816c7b..f7bb01980 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": "0.9.68", + "version": "0.9.69", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 59b13f616..e2712c6be 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.68", + "version": "0.9.69", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.68", - "@budibase/client": "^0.9.68", + "@budibase/bbui": "^0.9.69", + "@budibase/client": "^0.9.69", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.68", + "@budibase/string-templates": "^0.9.69", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index e3b88b8ba..b80607af4 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.68", + "version": "0.9.69", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 16e565fd9..2ac54c9b7 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.68", + "version": "0.9.69", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.68", - "@budibase/standard-components": "^0.9.68", - "@budibase/string-templates": "^0.9.68", + "@budibase/bbui": "^0.9.69", + "@budibase/standard-components": "^0.9.69", + "@budibase/string-templates": "^0.9.69", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 7fe15ad08..95df6cca2 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.68", + "version": "0.9.69", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -59,9 +59,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.68", - "@budibase/client": "^0.9.68", - "@budibase/string-templates": "^0.9.68", + "@budibase/auth": "^0.9.69", + "@budibase/client": "^0.9.69", + "@budibase/string-templates": "^0.9.69", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -114,7 +114,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.68", + "@budibase/standard-components": "^0.9.69", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 9185d9dcb..239525c76 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.68", + "version": "0.9.69", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.68", + "@budibase/bbui": "^0.9.69", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b09e873e1..fcfb2ff9b 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.68", + "version": "0.9.69", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index ad7985ddb..e7f6cc5a5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.68", + "version": "0.9.69", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.68", - "@budibase/string-templates": "^0.9.68", + "@budibase/auth": "^0.9.69", + "@budibase/string-templates": "^0.9.69", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", From bb396ebff070a0d356e9442b224070c8abb8337d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 1 Jul 2021 14:10:44 +0100 Subject: [PATCH 13/13] First version of enrichment. --- .../src/api/controllers/row/external.js | 45 +++++++++++++++---- .../src/api/controllers/row/externalUtils.js | 22 ++++----- .../server/src/api/controllers/table/utils.js | 2 + packages/server/src/definitions/datasource.ts | 3 ++ packages/server/src/integrations/base/sql.ts | 6 +++ 5 files changed, 56 insertions(+), 22 deletions(-) diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index e3e46ae52..143aa8a6b 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -1,5 +1,5 @@ const { makeExternalQuery } = require("./utils") -const { DataSourceOperation, SortDirection } = require("../../../constants") +const { DataSourceOperation, SortDirection, FieldTypes } = require("../../../constants") const { getAllExternalTables } = require("../table/utils") const { breakExternalTableId, @@ -19,10 +19,12 @@ async function handleRequest( appId, operation, tableId, - { id, row, filters, sort, paginate, fullDocs } = {} + { id, row, filters, sort, paginate, tables } = {} ) { let { datasourceId, tableName } = breakExternalTableId(tableId) - const tables = await getAllExternalTables(appId, datasourceId) + if (!tables) { + tables = await getAllExternalTables(appId, datasourceId) + } const table = tables[tableName] if (!table) { throw `Unable to process query, table "${tableName}" not defined.` @@ -83,8 +85,7 @@ async function handleRequest( response, table, relationships, - tables, - fullDocs + tables ) // if reading it'll just be an array of rows, return whole thing return operation === DataSourceOperation.READ && Array.isArray(response) @@ -239,15 +240,43 @@ exports.fetchEnrichedRow = async ctx => { const appId = ctx.appId const id = ctx.params.rowId const tableId = ctx.params.tableId - // TODO: this only enriches the full docs 1 layer deep, need to join those as well + const { datasourceId, tableName } = breakExternalTableId(tableId) + const tables = await getAllExternalTables(appId, datasourceId) const response = await handleRequest( appId, DataSourceOperation.READ, tableId, { id, - fullDocs: true, + tables, } ) - return response ? response[0] : response + const table = tables[tableName] + const row = response[0] + // this seems like a lot of work, but basically we need to dig deeper for the enrich + // for a single row, there is probably a better way to do this with some smart multi-layer joins + for (let [fieldName, field] of Object.entries(table.schema)) { + if (field.type !== FieldTypes.LINK || !row[fieldName] || row[fieldName].length === 0) { + continue + } + const links = row[fieldName] + const linkedTableId = field.tableId + const linkedTable = tables[breakExternalTableId(linkedTableId).tableName] + // don't support composite keys right now + const linkedIds = links.map(link => breakRowIdField(link._id)[0]) + row[fieldName] = await handleRequest( + appId, + DataSourceOperation.READ, + linkedTableId, + { + tables, + filters: { + oneOf: { + [linkedTable.primary]: linkedIds, + }, + }, + }, + ) + } + return row } diff --git a/packages/server/src/api/controllers/row/externalUtils.js b/packages/server/src/api/controllers/row/externalUtils.js index 6074bdb42..85cc11b60 100644 --- a/packages/server/src/api/controllers/row/externalUtils.js +++ b/packages/server/src/api/controllers/row/externalUtils.js @@ -80,8 +80,7 @@ exports.updateRelationshipColumns = ( row, rows, relationships, - allTables, - fullDocs + allTables ) => { const columns = {} for (let relationship of relationships) { @@ -91,12 +90,10 @@ exports.updateRelationshipColumns = ( } let linked = basicProcessing(row, linkedTable) // if not returning full docs then get the minimal links out - if (!fullDocs) { - const display = linkedTable.primaryDisplay - linked = { - primaryDisplay: display ? linked[display] : undefined, - _id: linked._id, - } + const display = linkedTable.primaryDisplay + linked = { + primaryDisplay: display ? linked[display] : undefined, + _id: linked._id, } columns[relationship.column] = linked } @@ -116,8 +113,7 @@ exports.outputProcessing = ( rows, table, relationships, - allTables, - fullDocs + allTables ) => { // if no rows this is what is returned? Might be PG only if (rows[0].read === true) { @@ -132,8 +128,7 @@ exports.outputProcessing = ( row, finalRows, relationships, - allTables, - fullDocs + allTables ) continue } @@ -144,8 +139,7 @@ exports.outputProcessing = ( row, finalRows, relationships, - allTables, - fullDocs + allTables ) } return Object.values(finalRows) diff --git a/packages/server/src/api/controllers/table/utils.js b/packages/server/src/api/controllers/table/utils.js index 78dae60ab..760cc54b3 100644 --- a/packages/server/src/api/controllers/table/utils.js +++ b/packages/server/src/api/controllers/table/utils.js @@ -1,3 +1,5 @@ +import {breakExternalTableId} from "../../../integrations/utils" + const CouchDB = require("../../../db") const csvParser = require("../../../utilities/csvParser") const { diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 733ad679c..b7a3d47ff 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -72,6 +72,9 @@ export interface SearchFilters { notEmpty?: { [key: string]: any } + oneOf?: { + [key: string]: any[] + } } export interface RelationshipsJson { diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index 83631b4b9..e1c065dd2 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -30,6 +30,12 @@ function addFilters( } // if all or specified in filters, then everything is an or const allOr = filters.allOr + if (filters.oneOf) { + iterate(filters.oneOf, (key, array) => { + const fnc = allOr ? "orWhereIn" : "whereIn" + query = query[fnc](key, array) + }) + } if (filters.string) { iterate(filters.string, (key, value) => { const fnc = allOr ? "orWhere" : "where"