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

This commit is contained in:
mike12345567 2022-11-03 17:59:58 +00:00
commit 5c88d16cfb
19 changed files with 87 additions and 69 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "2.1.11", "version": "2.1.13",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/backend-core", "name": "@budibase/backend-core",
"version": "2.1.11", "version": "2.1.13",
"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": "^2.1.11", "@budibase/types": "^2.1.13",
"@shopify/jest-koa-mocks": "5.0.1", "@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2", "@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0", "aws-sdk": "2.1030.0",

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": "2.1.11", "version": "2.1.13",
"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": "^2.1.11", "@budibase/string-templates": "^2.1.13",
"@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

@ -41,7 +41,7 @@
time_24hr: time24hr || false, time_24hr: time24hr || false,
altFormat: timeOnly ? "H:i" : enableTime ? "F j Y, H:i" : "F j, Y", altFormat: timeOnly ? "H:i" : enableTime ? "F j Y, H:i" : "F j, Y",
wrap: true, wrap: true,
mode: range ? "range" : null, mode: range ? "range" : "single",
appendTo, appendTo,
disableMobile: "true", disableMobile: "true",
onReady: () => { onReady: () => {

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "2.1.11", "version": "2.1.13",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -71,10 +71,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^2.1.11", "@budibase/bbui": "^2.1.13",
"@budibase/client": "^2.1.11", "@budibase/client": "^2.1.13",
"@budibase/frontend-core": "^2.1.11", "@budibase/frontend-core": "^2.1.13",
"@budibase/string-templates": "^2.1.11", "@budibase/string-templates": "^2.1.13",
"@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

@ -245,7 +245,10 @@ export const getFrontendStore = () => {
} }
}, },
save: async screen => { save: async screen => {
store.actions.screens.validate(screen) /*
Temporarily disabled to accomodate migration issues.
store.actions.screens.validate(screen)
*/
const state = get(store) const state = get(store)
const creatingNewScreen = screen._id === undefined const creatingNewScreen = screen._id === undefined
const savedScreen = await API.saveScreen(screen) const savedScreen = await API.saveScreen(screen)

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "2.1.11", "version": "2.1.13",
"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": {
@ -26,9 +26,9 @@
"outputPath": "build" "outputPath": "build"
}, },
"dependencies": { "dependencies": {
"@budibase/backend-core": "^2.1.11", "@budibase/backend-core": "^2.1.13",
"@budibase/string-templates": "^2.1.11", "@budibase/string-templates": "^2.1.13",
"@budibase/types": "^2.1.11", "@budibase/types": "^2.1.13",
"axios": "0.21.2", "axios": "0.21.2",
"chalk": "4.1.0", "chalk": "4.1.0",
"cli-progress": "3.11.2", "cli-progress": "3.11.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "2.1.11", "version": "2.1.13",
"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": "^2.1.11", "@budibase/bbui": "^2.1.13",
"@budibase/frontend-core": "^2.1.11", "@budibase/frontend-core": "^2.1.13",
"@budibase/string-templates": "^2.1.11", "@budibase/string-templates": "^2.1.13",
"@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

@ -225,7 +225,10 @@ const changeFormStepHandler = async (action, context) => {
} }
const closeScreenModalHandler = action => { const closeScreenModalHandler = action => {
let { url } = action.parameters let url
if (action?.parameters) {
url = action.parameters.url
}
// Emit this as a window event, so parent screens which are iframing us in // Emit this as a window event, so parent screens which are iframing us in
// can close the modal // can close the modal
window.parent.postMessage({ type: "close-screen-modal", url }) window.parent.postMessage({ type: "close-screen-modal", url })

View File

@ -1,12 +1,12 @@
{ {
"name": "@budibase/frontend-core", "name": "@budibase/frontend-core",
"version": "2.1.11", "version": "2.1.13",
"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": "^2.1.11", "@budibase/bbui": "^2.1.13",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"svelte": "^3.46.2" "svelte": "^3.46.2"
} }

View File

@ -158,7 +158,7 @@ export const buildUserEndpoints = API => ({
userInfo: { userInfo: {
admin: user.admin ? { global: true } : undefined, admin: user.admin ? { global: true } : undefined,
builder: user.admin || user.builder ? { global: true } : undefined, builder: user.admin || user.builder ? { global: true } : undefined,
groups: user.groups, userGroups: user.groups,
}, },
})), })),
}) })

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/sdk", "name": "@budibase/sdk",
"version": "2.1.11", "version": "2.1.13",
"description": "Budibase Public API SDK", "description": "Budibase Public API SDK",
"author": "Budibase", "author": "Budibase",
"license": "MPL-2.0", "license": "MPL-2.0",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "2.1.11", "version": "2.1.13",
"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": "^2.1.11", "@budibase/backend-core": "^2.1.13",
"@budibase/client": "^2.1.11", "@budibase/client": "^2.1.13",
"@budibase/pro": "2.1.11", "@budibase/pro": "2.1.13",
"@budibase/string-templates": "^2.1.11", "@budibase/string-templates": "^2.1.13",
"@budibase/types": "^2.1.11", "@budibase/types": "^2.1.13",
"@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

@ -1094,12 +1094,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.0.40-alpha.4": "@budibase/backend-core@2.1.13":
version "2.0.40-alpha.4" version "2.1.13"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.40-alpha.4.tgz#732264961ae4a19949bd318150a0afcd068d37bc" resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.13.tgz#d0c4b126c87aa7e48864821bd40ba6523cfcca1f"
integrity sha512-3XtI8kl7laMHjmW6M9kIj+Eb8fa1gwG3pn0wyojydmUDZOGnnirPT2nvsr4m2icD7KYKhjmiwTI+101Z8QvRfw== integrity sha512-6dxl1tdndO+Zj3uacTY33cXbfve90q5AvOjyZihkkh4e/MEZwLU81BD8Be7rAwaPM94hHu7VvHYkGqs9QnGG9Q==
dependencies: dependencies:
"@budibase/types" "2.0.40-alpha.4" "@budibase/types" "^2.1.13"
"@shopify/jest-koa-mocks" "5.0.1" "@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2" "@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0" aws-sdk "2.1030.0"
@ -1181,13 +1181,13 @@
svelte-flatpickr "^3.2.3" svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0" svelte-portal "^1.0.0"
"@budibase/pro@2.0.40-alpha.4": "@budibase/pro@2.1.13":
version "2.0.40-alpha.4" version "2.1.13"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.40-alpha.4.tgz#3edef22748da6ae9086c9d55b864979657f58afc" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.13.tgz#c1f6264493652fa7372a97d0c034104ccec25f23"
integrity sha512-AaruTMmUBuqi3q5wRxL4Yr9SCqENsuoFxJBLfqXIl9DB0LuowfRklf5yehjGjxxHwZpqkIuMgJf/+jYbAvL44g== integrity sha512-/1Niv6ywTG3W6zC6cWFqvb5Mup8UR7YKqVCMVzFaQwV2eR+QBSlsTZKHneFpJuFFA/tlQsOpnVYKvpVZCYbViA==
dependencies: dependencies:
"@budibase/backend-core" "2.0.40-alpha.4" "@budibase/backend-core" "2.1.13"
"@budibase/types" "2.0.40-alpha.4" "@budibase/types" "2.1.13"
"@koa/router" "8.0.8" "@koa/router" "8.0.8"
bull "4.10.1" bull "4.10.1"
joi "17.6.0" joi "17.6.0"
@ -1211,10 +1211,10 @@
svelte-apexcharts "^1.0.2" svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0" svelte-flatpickr "^3.1.0"
"@budibase/types@2.0.40-alpha.4": "@budibase/types@2.1.13", "@budibase/types@^2.1.13":
version "2.0.40-alpha.4" version "2.1.13"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.40-alpha.4.tgz#25268ef370e680a1401ca04d5fa6a96cd3a03d9e" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.13.tgz#d65adfe0e9fb645701be63bc9b728d5e2b7bb726"
integrity sha512-E/4WJpEyP4djElEzwHwehawGXwgcFPWGoeeU/FwgyqiIhJF07tKABjo56MC2aqiYDegYknZtx3OU73pFo/Z4LA== integrity sha512-kBUoUxPaVh7YW+0OS5pJ56Rar35n6uct1sEsA14uXErOQ33VssHJjIiYZL1DnlE+4PT5xpmW8fAUQiTz4PYBnw==
"@bull-board/api@3.7.0": "@bull-board/api@3.7.0":
version "3.7.0" version "3.7.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "2.1.11", "version": "2.1.13",
"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": "2.1.11", "version": "2.1.13",
"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": "2.1.11", "version": "2.1.13",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -36,10 +36,10 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/backend-core": "^2.1.11", "@budibase/backend-core": "^2.1.13",
"@budibase/pro": "2.1.11", "@budibase/pro": "2.1.13",
"@budibase/string-templates": "^2.1.11", "@budibase/string-templates": "^2.1.13",
"@budibase/types": "^2.1.11", "@budibase/types": "^2.1.13",
"@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",

View File

@ -177,7 +177,9 @@ export const save = async (
): Promise<CreateUserResponse> => { ): Promise<CreateUserResponse> => {
const tenantId = tenancy.getTenantId() const tenantId = tenancy.getTenantId()
const db = tenancy.getGlobalDB() const db = tenancy.getGlobalDB()
let { email, _id } = user
let { email, _id, userGroups = [] } = user
if (!email && !_id) { if (!email && !_id) {
throw new Error("_id or email is required") throw new Error("_id or email is required")
} }
@ -213,8 +215,16 @@ export const save = async (
let builtUser = await buildUser(user, opts, tenantId, dbUser) let builtUser = await buildUser(user, opts, tenantId, dbUser)
// make sure we set the _id field for a new user // make sure we set the _id field for a new user
// Also if this is a new user, associate groups with them
let groupPromises = []
if (!_id) { if (!_id) {
_id = builtUser._id! _id = builtUser._id!
if (userGroups.length > 0) {
for (let groupId of userGroups) {
groupPromises.push(groupsSdk.addUsers(groupId, [_id]))
}
}
} }
try { try {
@ -228,6 +238,8 @@ export const save = async (
// let server know to sync user // let server know to sync user
await apps.syncUserInApps(_id) await apps.syncUserInApps(_id)
await Promise.all(groupPromises)
return { return {
_id: response.id, _id: response.id,
_rev: response.rev, _rev: response.rev,

View File

@ -291,12 +291,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.0.40-alpha.4": "@budibase/backend-core@2.1.13":
version "2.0.40-alpha.4" version "2.1.13"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.0.40-alpha.4.tgz#732264961ae4a19949bd318150a0afcd068d37bc" resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.13.tgz#d0c4b126c87aa7e48864821bd40ba6523cfcca1f"
integrity sha512-3XtI8kl7laMHjmW6M9kIj+Eb8fa1gwG3pn0wyojydmUDZOGnnirPT2nvsr4m2icD7KYKhjmiwTI+101Z8QvRfw== integrity sha512-6dxl1tdndO+Zj3uacTY33cXbfve90q5AvOjyZihkkh4e/MEZwLU81BD8Be7rAwaPM94hHu7VvHYkGqs9QnGG9Q==
dependencies: dependencies:
"@budibase/types" "2.0.40-alpha.4" "@budibase/types" "^2.1.13"
"@shopify/jest-koa-mocks" "5.0.1" "@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2" "@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0" aws-sdk "2.1030.0"
@ -328,22 +328,22 @@
uuid "8.3.2" uuid "8.3.2"
zlib "1.0.5" zlib "1.0.5"
"@budibase/pro@2.0.40-alpha.4": "@budibase/pro@2.1.13":
version "2.0.40-alpha.4" version "2.1.13"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.0.40-alpha.4.tgz#3edef22748da6ae9086c9d55b864979657f58afc" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.13.tgz#c1f6264493652fa7372a97d0c034104ccec25f23"
integrity sha512-AaruTMmUBuqi3q5wRxL4Yr9SCqENsuoFxJBLfqXIl9DB0LuowfRklf5yehjGjxxHwZpqkIuMgJf/+jYbAvL44g== integrity sha512-/1Niv6ywTG3W6zC6cWFqvb5Mup8UR7YKqVCMVzFaQwV2eR+QBSlsTZKHneFpJuFFA/tlQsOpnVYKvpVZCYbViA==
dependencies: dependencies:
"@budibase/backend-core" "2.0.40-alpha.4" "@budibase/backend-core" "2.1.13"
"@budibase/types" "2.0.40-alpha.4" "@budibase/types" "2.1.13"
"@koa/router" "8.0.8" "@koa/router" "8.0.8"
bull "4.10.1" bull "4.10.1"
joi "17.6.0" joi "17.6.0"
node-fetch "^2.6.1" node-fetch "^2.6.1"
"@budibase/types@2.0.40-alpha.4": "@budibase/types@2.1.13", "@budibase/types@^2.1.13":
version "2.0.40-alpha.4" version "2.1.13"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.0.40-alpha.4.tgz#25268ef370e680a1401ca04d5fa6a96cd3a03d9e" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.13.tgz#d65adfe0e9fb645701be63bc9b728d5e2b7bb726"
integrity sha512-E/4WJpEyP4djElEzwHwehawGXwgcFPWGoeeU/FwgyqiIhJF07tKABjo56MC2aqiYDegYknZtx3OU73pFo/Z4LA== integrity sha512-kBUoUxPaVh7YW+0OS5pJ56Rar35n6uct1sEsA14uXErOQ33VssHJjIiYZL1DnlE+4PT5xpmW8fAUQiTz4PYBnw==
"@cspotcode/source-map-consumer@0.8.0": "@cspotcode/source-map-consumer@0.8.0":
version "0.8.0" version "0.8.0"