From 8c6460ddb1a68f5251b0f046a65b1c7ad8b7375c Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 10 Aug 2021 13:00:15 +0100 Subject: [PATCH 1/7] ensure user metadata is created before link documents are created --- packages/server/src/db/linkedRows/LinkController.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/server/src/db/linkedRows/LinkController.js b/packages/server/src/db/linkedRows/LinkController.js index d526bf159b..27b230f30a 100644 --- a/packages/server/src/db/linkedRows/LinkController.js +++ b/packages/server/src/db/linkedRows/LinkController.js @@ -1,6 +1,6 @@ const CouchDB = require("../index") const { IncludeDocs, getLinkDocuments } = require("./linkUtils") -const { generateLinkID } = require("../utils") +const { generateLinkID, InternalTables, generateUserMetadataID, getUserMetadataParams } = require("../utils") const Sentry = require("@sentry/node") const { FieldTypes, RelationshipTypes } = require("../../constants") @@ -208,6 +208,15 @@ class LinkController { const linkedTable = await this._db.get(field.tableId) const linkedSchema = linkedTable.schema[field.fieldName] + // We need to map the global users to metadata in each app for relationships + if (field.tableId === InternalTables.USER_METADATA) { + const users = await this._db.allDocs(getUserMetadataParams(null, {})) + const metadataRequired = rowField.filter(userId => !users.rows.some(user => user.id === userId)) + + // ensure non-existing user metadata is created in the app DB + await this._db.bulkDocs(metadataRequired.map(userId => ({ _id: userId }))) + } + // iterate through the link IDs in the row field, see if any don't exist already for (let linkId of rowField) { if (linkedSchema.relationshipType === RelationshipTypes.ONE_TO_MANY) { From 7d49634c6d6124c99b516134b38f6f2663e6060e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 10 Aug 2021 17:41:01 +0100 Subject: [PATCH 2/7] fix date sorting --- packages/bbui/src/Form/DatePicker.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/bbui/src/Form/DatePicker.svelte b/packages/bbui/src/Form/DatePicker.svelte index cc2ed50ead..14548bed67 100644 --- a/packages/bbui/src/Form/DatePicker.svelte +++ b/packages/bbui/src/Form/DatePicker.svelte @@ -14,6 +14,7 @@ const dispatch = createEventDispatcher() const onChange = e => { value = e.detail + console.log(value.toISOString()) dispatch("change", e.detail) } From 962e940aab4bb7e6dfd87bd62507c569b1b7abf0 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 10 Aug 2021 17:41:11 +0100 Subject: [PATCH 3/7] fix date sorting --- packages/bbui/src/Form/DatePicker.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bbui/src/Form/DatePicker.svelte b/packages/bbui/src/Form/DatePicker.svelte index 14548bed67..9e0c40b11d 100644 --- a/packages/bbui/src/Form/DatePicker.svelte +++ b/packages/bbui/src/Form/DatePicker.svelte @@ -13,9 +13,9 @@ const dispatch = createEventDispatcher() const onChange = e => { - value = e.detail - console.log(value.toISOString()) - dispatch("change", e.detail) + const isoString = e.detail.toISOString() + value = isoString + dispatch("change", isoString) } From da67de5c8b01b844ee0e3822bec54425f6e23644 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Tue, 10 Aug 2021 17:46:28 +0100 Subject: [PATCH 4/7] lint --- packages/server/src/db/linkedRows/LinkController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/db/linkedRows/LinkController.js b/packages/server/src/db/linkedRows/LinkController.js index 27b230f30a..5420c99300 100644 --- a/packages/server/src/db/linkedRows/LinkController.js +++ b/packages/server/src/db/linkedRows/LinkController.js @@ -1,6 +1,6 @@ const CouchDB = require("../index") const { IncludeDocs, getLinkDocuments } = require("./linkUtils") -const { generateLinkID, InternalTables, generateUserMetadataID, getUserMetadataParams } = require("../utils") +const { generateLinkID, InternalTables, getUserMetadataParams } = require("../utils") const Sentry = require("@sentry/node") const { FieldTypes, RelationshipTypes } = require("../../constants") From e6019bf3c7e301f15499cd947f23e0503820df2e Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Wed, 11 Aug 2021 20:34:45 +0100 Subject: [PATCH 5/7] linting :sparkles: --- .../server/src/db/linkedRows/LinkController.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/server/src/db/linkedRows/LinkController.js b/packages/server/src/db/linkedRows/LinkController.js index 5420c99300..b66e2debb5 100644 --- a/packages/server/src/db/linkedRows/LinkController.js +++ b/packages/server/src/db/linkedRows/LinkController.js @@ -1,6 +1,10 @@ const CouchDB = require("../index") const { IncludeDocs, getLinkDocuments } = require("./linkUtils") -const { generateLinkID, InternalTables, getUserMetadataParams } = require("../utils") +const { + generateLinkID, + InternalTables, + getUserMetadataParams, +} = require("../utils") const Sentry = require("@sentry/node") const { FieldTypes, RelationshipTypes } = require("../../constants") @@ -211,10 +215,14 @@ class LinkController { // We need to map the global users to metadata in each app for relationships if (field.tableId === InternalTables.USER_METADATA) { const users = await this._db.allDocs(getUserMetadataParams(null, {})) - const metadataRequired = rowField.filter(userId => !users.rows.some(user => user.id === userId)) + const metadataRequired = rowField.filter( + userId => !users.rows.some(user => user.id === userId) + ) // ensure non-existing user metadata is created in the app DB - await this._db.bulkDocs(metadataRequired.map(userId => ({ _id: userId }))) + await this._db.bulkDocs( + metadataRequired.map(userId => ({ _id: userId })) + ) } // iterate through the link IDs in the row field, see if any don't exist already From c664e130231e72f8d13814a94eb37f41710202d3 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 13 Aug 2021 08:08:23 +0000 Subject: [PATCH 6/7] v0.9.105 --- 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 42072fe0a2..825ab2f1f1 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.104", + "version": "0.9.105", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index c51a6c727a..ea638f859f 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.104", + "version": "0.9.105", "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 42033cff38..c8f93c9dfb 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.104", + "version": "0.9.105", "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 d085ca67f2..a7ed98b639 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.104", + "version": "0.9.105", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.104", - "@budibase/client": "^0.9.104", + "@budibase/bbui": "^0.9.105", + "@budibase/client": "^0.9.105", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.104", + "@budibase/string-templates": "^0.9.105", "@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 cf27d9808e..0dc653a296 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.104", + "version": "0.9.105", "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 87c6987b51..6fe0e6b3bf 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.104", + "version": "0.9.105", "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.104", - "@budibase/standard-components": "^0.9.104", - "@budibase/string-templates": "^0.9.104", + "@budibase/bbui": "^0.9.105", + "@budibase/standard-components": "^0.9.105", + "@budibase/string-templates": "^0.9.105", "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 891e04e499..7ca5437433 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.104", + "version": "0.9.105", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -60,9 +60,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.104", - "@budibase/client": "^0.9.104", - "@budibase/string-templates": "^0.9.104", + "@budibase/auth": "^0.9.105", + "@budibase/client": "^0.9.105", + "@budibase/string-templates": "^0.9.105", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -115,7 +115,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.104", + "@budibase/standard-components": "^0.9.105", "@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 9960fdb77a..a9bdbf6428 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.104", + "version": "0.9.105", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.104", + "@budibase/bbui": "^0.9.105", "@spectrum-css/card": "^3.0.3", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 709a254aee..d980f2b361 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.104", + "version": "0.9.105", "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 6348387e1d..9e33e6ac64 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.104", + "version": "0.9.105", "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.104", - "@budibase/string-templates": "^0.9.104", + "@budibase/auth": "^0.9.105", + "@budibase/string-templates": "^0.9.105", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 2c8b5edea4e7a26dc776a7c3cc896e1df1a1c1fe Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 13 Aug 2021 12:49:38 +0000 Subject: [PATCH 7/7] v0.9.105-alpha.8 --- 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 51d6b5caea..1f2ddaab37 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.105-alpha.7", + "version": "0.9.105-alpha.8", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index bd4a0a500f..b5844111c6 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.105-alpha.7", + "version": "0.9.105-alpha.8", "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 2040d38611..1e6a4434d9 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.105-alpha.7", + "version": "0.9.105-alpha.8", "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 1831cf2e78..095fb128b9 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.105-alpha.7", + "version": "0.9.105-alpha.8", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.105-alpha.7", - "@budibase/client": "^0.9.105-alpha.7", + "@budibase/bbui": "^0.9.105-alpha.8", + "@budibase/client": "^0.9.105-alpha.8", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.105-alpha.7", + "@budibase/string-templates": "^0.9.105-alpha.8", "@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 25350e4f7d..f036721912 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.105-alpha.7", + "version": "0.9.105-alpha.8", "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 4b8c52f00e..3cc85e99c2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.105-alpha.7", + "version": "0.9.105-alpha.8", "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.105-alpha.7", - "@budibase/standard-components": "^0.9.105-alpha.7", - "@budibase/string-templates": "^0.9.105-alpha.7", + "@budibase/bbui": "^0.9.105-alpha.8", + "@budibase/standard-components": "^0.9.105-alpha.8", + "@budibase/string-templates": "^0.9.105-alpha.8", "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 811cf99430..8dc080c1fd 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.105-alpha.7", + "version": "0.9.105-alpha.8", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -62,9 +62,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.105-alpha.7", - "@budibase/client": "^0.9.105-alpha.7", - "@budibase/string-templates": "^0.9.105-alpha.7", + "@budibase/auth": "^0.9.105-alpha.8", + "@budibase/client": "^0.9.105-alpha.8", + "@budibase/string-templates": "^0.9.105-alpha.8", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -117,7 +117,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.105-alpha.7", + "@budibase/standard-components": "^0.9.105-alpha.8", "@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 c201591e5b..335a7a8caa 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.105-alpha.7", + "version": "0.9.105-alpha.8", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.105-alpha.7", + "@budibase/bbui": "^0.9.105-alpha.8", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", "@spectrum-css/link": "^3.1.3", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index b7def2b1a0..4c2005486b 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.105-alpha.7", + "version": "0.9.105-alpha.8", "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 b69e31d3d0..90eae29daf 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.105-alpha.7", + "version": "0.9.105-alpha.8", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -23,8 +23,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.105-alpha.7", - "@budibase/string-templates": "^0.9.105-alpha.7", + "@budibase/auth": "^0.9.105-alpha.8", + "@budibase/string-templates": "^0.9.105-alpha.8", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0",