diff --git a/lerna.json b/lerna.json index b6a33ead3d..94018c3177 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.80-alpha.4", + "version": "0.9.80-alpha.7", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index b629ed218e..9af14c6398 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.80-alpha.4", + "version": "0.9.80-alpha.7", "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 c7e1116405..b63c8f734b 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.80-alpha.4", + "version": "0.9.80-alpha.7", "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 6966ffe43c..3219577fc3 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.80-alpha.4", + "version": "0.9.80-alpha.7", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.80-alpha.4", - "@budibase/client": "^0.9.80-alpha.4", + "@budibase/bbui": "^0.9.80-alpha.7", + "@budibase/client": "^0.9.80-alpha.7", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.80-alpha.4", + "@budibase/string-templates": "^0.9.80-alpha.7", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte index feb15d00bb..d1aaeb0240 100644 --- a/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/automate/_layout.svelte @@ -58,5 +58,6 @@ align-items: stretch; gap: var(--spacing-l); background-color: var(--background); + overflow-y: auto; } diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte index 72a0cd3f4e..ebb01bd336 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte @@ -19,7 +19,8 @@ import { fetchData } from "helpers" import { users, auth } from "stores/portal" - import TagsRenderer from "./_components/TagsTableRenderer.svelte" + import TagsRenderer from "./_components/RolesTagsTableRenderer.svelte" + import UpdateRolesModal from "./_components/UpdateRolesModal.svelte" import ForceResetPasswordModal from "./_components/ForceResetPasswordModal.svelte" diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/RolesTagsTableRenderer.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/RolesTagsTableRenderer.svelte new file mode 100644 index 0000000000..7e63045edd --- /dev/null +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/RolesTagsTableRenderer.svelte @@ -0,0 +1,8 @@ + + + diff --git a/packages/builder/src/pages/builder/portal/manage/users/_components/TagsTableRenderer.svelte b/packages/builder/src/pages/builder/portal/manage/users/_components/TagsTableRenderer.svelte index 564abca211..d2b56bbf33 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/_components/TagsTableRenderer.svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/_components/TagsTableRenderer.svelte @@ -4,9 +4,9 @@ const displayLimit = 5 - $: roles = value?.filter(role => role != null).map(role => role.name) ?? [] - $: tags = roles.slice(0, displayLimit) - $: leftover = roles.length - tags.length + $: values = value?.filter(value => value != null) ?? [] + $: tags = values.slice(0, displayLimit) + $: leftover = values.length - tags.length
diff --git a/packages/cli/package.json b/packages/cli/package.json index f784b5b615..a244db13e3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.80-alpha.4", + "version": "0.9.80-alpha.7", "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 a38c69c9ec..3f6ed11457 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.80-alpha.4", + "version": "0.9.80-alpha.7", "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.80-alpha.4", - "@budibase/standard-components": "^0.9.80-alpha.4", - "@budibase/string-templates": "^0.9.80-alpha.4", + "@budibase/bbui": "^0.9.80-alpha.7", + "@budibase/standard-components": "^0.9.80-alpha.7", + "@budibase/string-templates": "^0.9.80-alpha.7", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/client/src/store/app.js b/packages/client/src/store/app.js index eb5a259a25..0cabaec4ab 100644 --- a/packages/client/src/store/app.js +++ b/packages/client/src/store/app.js @@ -6,8 +6,15 @@ const createAppStore = () => { // Fetches the app definition including screens, layouts and theme const fetchAppDefinition = async () => { - const appDefinition = await API.fetchAppPackage(get(store).appId) - store.set(appDefinition) + const appId = get(store)?.appId + if (!appId) { + throw "Cannot fetch app definition without app ID set" + } + const appDefinition = await API.fetchAppPackage(appId) + store.set({ + ...appDefinition, + appId: appDefinition?.application?.appId, + }) } // Sets the initial app ID diff --git a/packages/client/src/store/auth.js b/packages/client/src/store/auth.js index 604da7f9ad..1fa4ae17b0 100644 --- a/packages/client/src/store/auth.js +++ b/packages/client/src/store/auth.js @@ -10,9 +10,14 @@ const createAuthStore = () => { store.set(user) } + const logOut = async () => { + window.document.cookie = `budibase:auth=; budibase:currentapp=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;` + window.location = "/builder/auth/login" + } + return { subscribe: store.subscribe, - actions: { fetchUser }, + actions: { fetchUser, logOut }, } } diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index d7707bfb11..9dd32561d7 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -1,5 +1,10 @@ import { get } from "svelte/store" -import { routeStore, builderStore, confirmationStore } from "../store" +import { + routeStore, + builderStore, + confirmationStore, + authStore, +} from "../store" import { saveRow, deleteRow, executeQuery, triggerAutomation } from "../api" import { ActionTypes } from "../constants" @@ -77,6 +82,10 @@ const refreshDatasourceHandler = async (action, context) => { ) } +const logoutHandler = async () => { + await authStore.actions.logOut() +} + const clearFormHandler = async (action, context) => { return await executeActionHandler( context, @@ -93,6 +102,7 @@ const handlerMap = { ["Trigger Automation"]: triggerAutomationHandler, ["Validate Form"]: validateFormHandler, ["Refresh Datasource"]: refreshDatasourceHandler, + ["Log Out"]: logoutHandler, ["Clear Form"]: clearFormHandler } diff --git a/packages/server/package.json b/packages/server/package.json index 0a8768216a..e60ab04078 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.80-alpha.4", + "version": "0.9.80-alpha.7", "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.80-alpha.4", - "@budibase/client": "^0.9.80-alpha.4", - "@budibase/string-templates": "^0.9.80-alpha.4", + "@budibase/auth": "^0.9.80-alpha.7", + "@budibase/client": "^0.9.80-alpha.7", + "@budibase/string-templates": "^0.9.80-alpha.7", "@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.80-alpha.4", + "@budibase/standard-components": "^0.9.80-alpha.7", "@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 47b2252a23..a8ee83727f 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.80-alpha.4", + "version": "0.9.80-alpha.7", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.80-alpha.4", + "@budibase/bbui": "^0.9.80-alpha.7", "@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 42afe14938..cc76a60cdd 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.80-alpha.4", + "version": "0.9.80-alpha.7", "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 f787559751..03b7be9e20 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.80-alpha.4", + "version": "0.9.80-alpha.7", "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.80-alpha.4", - "@budibase/string-templates": "^0.9.80-alpha.4", + "@budibase/auth": "^0.9.80-alpha.7", + "@budibase/string-templates": "^0.9.80-alpha.7", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0",