diff --git a/lerna.json b/lerna.json index 03dbdb6cf5..83d4eae0ac 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index a5791d69b1..0ce51f147e 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 6838abe2bc..710ed35636 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": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "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": "^1.0.105-alpha.3", + "@budibase/string-templates": "^1.0.105-alpha.5", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/package.json b/packages/builder/package.json index 178721259c..582120c76f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.105-alpha.3", - "@budibase/client": "^1.0.105-alpha.3", - "@budibase/frontend-core": "^1.0.105-alpha.3", - "@budibase/string-templates": "^1.0.105-alpha.3", + "@budibase/bbui": "^1.0.105-alpha.5", + "@budibase/client": "^1.0.105-alpha.5", + "@budibase/frontend-core": "^1.0.105-alpha.5", + "@budibase/string-templates": "^1.0.105-alpha.5", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index c8b4ae8de9..8dff56dd6b 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -7,7 +7,11 @@ import { getComponentSettings, } from "./componentUtils" import { store } from "builderStore" -import { queries as queriesStores, tables as tablesStore } from "stores/backend" +import { + queries as queriesStores, + tables as tablesStore, + roles as rolesStore, +} from "stores/backend" import { makePropSafe, isJSBinding, @@ -33,6 +37,7 @@ export const getBindableProperties = (asset, componentId) => { const deviceBindings = getDeviceBindings() const stateBindings = getStateBindings() const selectedRowsBindings = getSelectedRowsBindings(asset) + const roleBindings = getRoleBindings() return [ ...contextBindings, ...urlBindings, @@ -40,6 +45,7 @@ export const getBindableProperties = (asset, componentId) => { ...userBindings, ...deviceBindings, ...selectedRowsBindings, + ...roleBindings, ] } @@ -391,6 +397,16 @@ const getUrlBindings = asset => { })) } +const getRoleBindings = () => { + return (get(rolesStore) || []).map(role => { + return { + type: "context", + runtimeBinding: `trim "${role._id}"`, + readableBinding: `Role.${role.name}`, + } + }) +} + /** * Gets all bindable properties exposed in a button actions flow up until * the specified action ID, as well as context provided for the action diff --git a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte index c8716352e5..44f88e841a 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableCombobox.svelte @@ -51,7 +51,7 @@ } -
+
diff --git a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte index 073e575869..92e9c2b5a8 100644 --- a/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte +++ b/packages/builder/src/components/common/bindings/DrawerBindableInput.svelte @@ -36,7 +36,7 @@ } -
+
diff --git a/packages/cli/package.json b/packages/cli/package.json index 8091d0247d..c74ccabadf 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "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 f0c369dc2b..c5a17da44f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "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": "^1.0.105-alpha.3", - "@budibase/frontend-core": "^1.0.105-alpha.3", - "@budibase/string-templates": "^1.0.105-alpha.3", + "@budibase/bbui": "^1.0.105-alpha.5", + "@budibase/frontend-core": "^1.0.105-alpha.5", + "@budibase/string-templates": "^1.0.105-alpha.5", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index 0d96ec9739..c287793f9d 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.105-alpha.3", + "@budibase/bbui": "^1.0.105-alpha.5", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index c52acb5354..6cbbcce867 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,9 +68,9 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.105-alpha.3", - "@budibase/client": "^1.0.105-alpha.3", - "@budibase/string-templates": "^1.0.105-alpha.3", + "@budibase/backend-core": "^1.0.105-alpha.5", + "@budibase/client": "^1.0.105-alpha.5", + "@budibase/string-templates": "^1.0.105-alpha.5", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2746842c37..1fbd58b007 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "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 9483dd5979..6c36405b3e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.105-alpha.3", + "version": "1.0.105-alpha.5", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,8 +31,8 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.105-alpha.3", - "@budibase/string-templates": "^1.0.105-alpha.3", + "@budibase/backend-core": "^1.0.105-alpha.5", + "@budibase/string-templates": "^1.0.105-alpha.5", "@koa/router": "^8.0.0", "@sentry/node": "^6.0.0", "@techpass/passport-openidconnect": "^0.3.0",