From cb2b861032ffbe6da489cf1973ee484da898a8f6 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Tue, 22 Nov 2022 16:52:56 +0000 Subject: [PATCH 001/236] Add User endpoints --- .../internal-api/TestConfiguration/index.ts | 3 + .../TestConfiguration/userManagement.ts | 43 ++++++++++++ .../internal-api/fixtures/userManagement.ts | 67 +++++++++++++++++++ .../userManagement/userManagement.spec.ts | 24 +++++++ 4 files changed, 137 insertions(+) create mode 100644 qa-core/src/config/internal-api/TestConfiguration/userManagement.ts create mode 100644 qa-core/src/config/internal-api/fixtures/userManagement.ts create mode 100644 qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts diff --git a/qa-core/src/config/internal-api/TestConfiguration/index.ts b/qa-core/src/config/internal-api/TestConfiguration/index.ts index ab996f7144..8ce5e94bc3 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/index.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/index.ts @@ -4,6 +4,7 @@ import InternalAPIClient from "./InternalAPIClient" import TablesApi from "./tables" import RowApi from "./rows" import ScreenApi from "./screens" +import UserManagementApi from "./userManagement" export default class TestConfiguration { applications: ApplicationApi @@ -12,6 +13,7 @@ export default class TestConfiguration { context: T tables: TablesApi rows: RowApi + userManagement: UserManagementApi constructor(apiClient: InternalAPIClient) { this.applications = new ApplicationApi(apiClient) @@ -19,6 +21,7 @@ export default class TestConfiguration { this.rows = new RowApi(apiClient) this.auth = new AuthApi(apiClient) this.screen = new ScreenApi(apiClient) + this.userManagement = new UserManagementApi(apiClient) this.context = {} } diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts new file mode 100644 index 0000000000..3a66049fd0 --- /dev/null +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -0,0 +1,43 @@ +import { Response } from "node-fetch" +import { User } from "@budibase/types" +import InternalAPIClient from "./InternalAPIClient" +import { responseMessage } from "../fixtures/types/responseMessage" + +export default class UserManagementApi { + api: InternalAPIClient + + constructor(apiClient: InternalAPIClient) { + this.api = apiClient + } + + async searchUsers(): Promise<[Response, User[]]> { + const response = await this.api.post(`/global/users/search`, {}) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.length).toBeGreaterThan(0) + return [response, json] + } + + async getSelf(): Promise<[Response, User]> { + const response = await this.api.get(`/global/self`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } + + async getAllUsers(): Promise<[Response, User]> { + const response = await this.api.get(`/global/users`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } + + async inviteUsers(body: User[]): Promise<[Response, responseMessage]> { + const response = await this.api.post(`/global/users/multi/invite`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.successful.length).toEqual(body.length) + expect(json.unsuccessful.length).toEqual(0) + return [response, json] + } +} diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts new file mode 100644 index 0000000000..ce15eb08e8 --- /dev/null +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -0,0 +1,67 @@ +import generator from "../../generator"; + +const randomId = generator.guid; +export const generateDeveloper = (): any => ({ + create: { + users: [{ + email: `pedro+${randomId()}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + builder: { + global: true + } + }], + groups: [] + } +}) + +export const generateAdmin = (): any => ({ + create: { + users: [{ + email: `pedro+${randomId()}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: true + }, + builder: { + global: true + } + }], + groups: [] + } +}) +export const generateAppUser = (): any => ({ + create: { + users: [{ + email: `pedro+${randomId()}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: false + }, + builder: { + global: false + } + }], + groups: [] + } +}) + +export const generateInviteUser = (): any => ( + [{ + email: `pedro+${randomId()}@budibase.com`, + userInfo: { + admin: { + global: true + }, + builder: { + global: true + }, + userGroups: [] + } + }] +) \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts new file mode 100644 index 0000000000..67fee8e53d --- /dev/null +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -0,0 +1,24 @@ +import TestConfiguration from "../../../config/internal-api/TestConfiguration" +import { Application } from "@budibase/server/api/controllers/public/mapping/types" +import { db } from "@budibase/backend-core" +import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" +import generateApp from "../../../config/internal-api/fixtures/applications" +import generator from "../../../config/generator" +import generateScreen from "../../../config/internal-api/fixtures/screens" + +describe("Internal API - User Management", () => { + const api = new InternalAPIClient() + const config = new TestConfiguration(api) + + beforeAll(async () => { + await config.beforeAll() + }) + + afterAll(async () => { + await config.afterAll() + }) + + it("Get all users", async () => { + await config.userManagement.searchUsers() + }) +}) From 7f8e093a52727ff8273335bf2131ee094441e7b1 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Mon, 28 Nov 2022 22:13:07 +0000 Subject: [PATCH 002/236] Add verification --- .../TestConfiguration/userManagement.ts | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 3a66049fd0..2ff9450939 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -1,5 +1,5 @@ import { Response } from "node-fetch" -import { User } from "@budibase/types" +import { User, UserDeletedEvent } from "@budibase/types" import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" @@ -14,7 +14,8 @@ export default class UserManagementApi { const response = await this.api.post(`/global/users/search`, {}) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.length).toBeGreaterThan(0) + expect(json.data.length).toBeGreaterThan(0) + expect(json.hasNextPage).toBe(false) return [response, json] } @@ -40,4 +41,21 @@ export default class UserManagementApi { expect(json.unsuccessful.length).toEqual(0) return [response, json] } + + async deleteUser(userId: string): Promise<[Response, responseMessage]> { + const body = { + delete: { + userIds: [ + userId + ] + } + } + const response = await this.api.post(`/global/users/bulk`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.deleted.successful.length).toEqual(1) + expect(json.deleted.unsuccessful.length).toEqual(0) + expect(json.deleted.successful[0].userId).toEqual(userId) + return [response, json] + } } From 57cda93bf57121680208386abd69c1a8301f0736 Mon Sep 17 00:00:00 2001 From: Dean Date: Wed, 30 Nov 2022 09:53:18 +0000 Subject: [PATCH 003/236] Fix for table and view editing. Mutation was causing several issues in the builder --- .../popovers/EditTablePopover.svelte | 21 ++++++++++++++----- .../popovers/EditViewPopover.svelte | 18 ++++++++++++---- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte index c23dcc1235..4757b37bc7 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditTablePopover.svelte @@ -1,6 +1,7 @@ {#if allowDeletion} @@ -84,17 +95,17 @@ {/if} - + diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte index 6eba5070fc..f543b34ddc 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte @@ -1,6 +1,7 @@ @@ -46,9 +56,9 @@ Edit Delete - + - + Date: Wed, 30 Nov 2022 11:02:11 +0000 Subject: [PATCH 004/236] Add tests for user management --- .../TestConfiguration/userManagement.ts | 31 +++-- .../internal-api/fixtures/userManagement.ts | 115 ++++++++++-------- .../userManagement/userManagement.spec.ts | 19 ++- 3 files changed, 103 insertions(+), 62 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index 2ff9450939..17fe5e0b0f 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -1,5 +1,5 @@ import { Response } from "node-fetch" -import { User, UserDeletedEvent } from "@budibase/types" +import { Role, User, UserDeletedEvent } from "@budibase/types" import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" @@ -15,7 +15,6 @@ export default class UserManagementApi { const json = await response.json() expect(response).toHaveStatusCode(200) expect(json.data.length).toBeGreaterThan(0) - expect(json.hasNextPage).toBe(false) return [response, json] } @@ -26,19 +25,20 @@ export default class UserManagementApi { return [response, json] } - async getAllUsers(): Promise<[Response, User]> { + async getAllUsers(): Promise<[Response, User[]]> { const response = await this.api.get(`/global/users`) const json = await response.json() expect(response).toHaveStatusCode(200) + expect(json.length).toBeGreaterThan(0) return [response, json] } - async inviteUsers(body: User[]): Promise<[Response, responseMessage]> { - const response = await this.api.post(`/global/users/multi/invite`, { body }) + async addUsers(body: any): Promise<[Response, responseMessage]> { + const response = await this.api.post(`/global/users/bulk`, { body }) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.successful.length).toEqual(body.length) - expect(json.unsuccessful.length).toEqual(0) + expect(json.created.unsuccessful.length).toEqual(0) + expect(json.created.successful.length).toEqual(body.create.users.length) return [response, json] } @@ -58,4 +58,21 @@ export default class UserManagementApi { expect(json.deleted.successful[0].userId).toEqual(userId) return [response, json] } + + async inviteUser(body: any): Promise<[Response, responseMessage]> { + const response = await this.api.post(`/global/users/multi/invite`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.created.successful.length).toEqual(body.length) + expect(json.created.unsuccessful.length).toEqual(0) + return [response, json] + } + + async getRoles(): Promise<[Response, Role[]]> { + const response = await this.api.get(`/roles`) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json.length).toEqual(4) + return [response, json] + } } diff --git a/qa-core/src/config/internal-api/fixtures/userManagement.ts b/qa-core/src/config/internal-api/fixtures/userManagement.ts index ce15eb08e8..6ada85bb49 100644 --- a/qa-core/src/config/internal-api/fixtures/userManagement.ts +++ b/qa-core/src/config/internal-api/fixtures/userManagement.ts @@ -1,59 +1,69 @@ import generator from "../../generator"; -const randomId = generator.guid; -export const generateDeveloper = (): any => ({ - create: { - users: [{ - email: `pedro+${randomId()}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - builder: { - global: true - } - }], - groups: [] - } -}) +export const generateDeveloper = (): Object => { + const randomId = generator.guid(); + return ({ + create: { + users: [{ + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + builder: { + global: true + } + }], + groups: [] + } + }) +} -export const generateAdmin = (): any => ({ - create: { - users: [{ - email: `pedro+${randomId()}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: true - }, - builder: { - global: true - } - }], - groups: [] +export const generateAdmin = (): Object => { + const randomId = generator.guid(); + return ({ + create: { + users: [{ + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: true + }, + builder: { + global: true + } + }], + groups: [] + } + }) +} +export const generateAppUser = (): Object => { + const randomId = generator.guid(); + const user = { + create: { + users: [{ + email: `pedro+${randomId}@budibase.com`, + password: randomId, + roles: {}, + forceResetPassword: true, + admin: { + global: false + }, + builder: { + global: false + } + }], + groups: [] + } } -}) -export const generateAppUser = (): any => ({ - create: { - users: [{ - email: `pedro+${randomId()}@budibase.com`, - password: randomId, - roles: {}, - forceResetPassword: true, - admin: { - global: false - }, - builder: { - global: false - } - }], - groups: [] - } -}) + return user +} -export const generateInviteUser = (): any => ( - [{ - email: `pedro+${randomId()}@budibase.com`, +export const generateInviteUser = (): Object[] => { + const randomId = generator.guid(); + return [{ + email: `pedro+${randomId}@budibase.com`, userInfo: { admin: { global: true @@ -64,4 +74,5 @@ export const generateInviteUser = (): any => ( userGroups: [] } }] -) \ No newline at end of file + +} \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts index 67fee8e53d..62d27ec2a4 100644 --- a/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/userManagement.spec.ts @@ -4,9 +4,9 @@ import { db } from "@budibase/backend-core" import InternalAPIClient from "../../../config/internal-api/TestConfiguration/InternalAPIClient" import generateApp from "../../../config/internal-api/fixtures/applications" import generator from "../../../config/generator" -import generateScreen from "../../../config/internal-api/fixtures/screens" +import { generateAdmin, generateAppUser, generateDeveloper, generateInviteUser } from "../../../config/internal-api/fixtures/userManagement" -describe("Internal API - User Management", () => { +describe("Internal API - User Management & Permissions", () => { const api = new InternalAPIClient() const config = new TestConfiguration(api) @@ -18,7 +18,20 @@ describe("Internal API - User Management", () => { await config.afterAll() }) - it("Get all users", async () => { + it("Add Users with different roles", async () => { await config.userManagement.searchUsers() + await config.userManagement.getRoles() + + const [adminResponse, adminData] = await config.userManagement.addUsers(generateAdmin()) + const [devResponse, devData] = await config.userManagement.addUsers(generateDeveloper()) + const [userResponse, userData] = await config.userManagement.addUsers(generateAppUser()) + + const [invitedUserResponse, invitedUserData] = await config.userManagement.addUsers(generateInviteUser()) + + const [allUsersResponse, allUsersData] = await config.userManagement.getAllUsers() + expect(allUsersData.length).toEqual(4) + }) + + }) From 32285a2a1ffcd36d55b572d5ecbc2a4dc56ee5ad Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 2 Dec 2022 15:10:43 +0000 Subject: [PATCH 005/236] Update value with new query --- .../design/settings/controls/DataSourceSelect.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/builder/src/components/design/settings/controls/DataSourceSelect.svelte b/packages/builder/src/components/design/settings/controls/DataSourceSelect.svelte index 55a9a30eb3..6269599f40 100644 --- a/packages/builder/src/components/design/settings/controls/DataSourceSelect.svelte +++ b/packages/builder/src/components/design/settings/controls/DataSourceSelect.svelte @@ -144,6 +144,11 @@ drawer.show() } + const getQueryValue = queries => { + value = queries.find(q => q._id === value._id) || value + return value + } + const saveQueryParams = () => { handleSelected({ ...value, @@ -175,7 +180,7 @@ {/if} Date: Fri, 2 Dec 2022 15:53:05 +0000 Subject: [PATCH 006/236] Disable MongoDB pipeline in QueryBindingView --- packages/builder/src/components/integration/index.svelte | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/builder/src/components/integration/index.svelte b/packages/builder/src/components/integration/index.svelte index d320cc30c2..e503406aaa 100644 --- a/packages/builder/src/components/integration/index.svelte +++ b/packages/builder/src/components/integration/index.svelte @@ -105,6 +105,7 @@ {#if !query.fields.steps?.length}
{ updateEditorsOnDelete(index) query.fields.steps.splice(index, 1) @@ -169,6 +173,7 @@
onOperatorChange(filter)} placeholder={null} diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte index af3afd8bcc..1d4b629f2e 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte @@ -17,8 +17,8 @@ let drawer $: tempValue = value - $: dataSource = getDatasourceForProvider($currentAsset, componentInstance) - $: schema = getSchemaForDatasource($currentAsset, dataSource)?.schema + $: datasource = getDatasourceForProvider($currentAsset, componentInstance) + $: schema = getSchemaForDatasource($currentAsset, datasource)?.schema $: schemaFields = Object.values(schema || {}) async function saveFilter() { @@ -36,7 +36,7 @@ filters={value} {bindings} {schemaFields} - tableId={dataSource.tableId} + {datasource} on:change={e => (tempValue = e.detail)} /> diff --git a/packages/builder/src/helpers/searchFields.js b/packages/builder/src/helpers/searchFields.js index 1a2d3b17e7..a9c837d570 100644 --- a/packages/builder/src/helpers/searchFields.js +++ b/packages/builder/src/helpers/searchFields.js @@ -16,11 +16,7 @@ export function getTableFields(linkField) { })) } -export function getFields( - fields, - { allowLinks } = { allowLinks: true }, - tableId -) { +export function getFields(fields, { allowLinks } = { allowLinks: true }) { let filteredFields = fields.filter( field => !BannedSearchTypes.includes(field.type) ) @@ -34,9 +30,5 @@ export function getFields( const staticFormulaFields = fields.filter( field => field.type === "formula" && field.formulaType === "static" ) - const table = get(tables).list.find(table => table._id === tableId) - if (table?.type === "external" && table?.sql) { - filteredFields = filteredFields.filter(field => field.name !== "_id") - } return filteredFields.concat(staticFormulaFields) } diff --git a/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte b/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte index df06979f48..199a6122ab 100644 --- a/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte +++ b/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte @@ -21,6 +21,7 @@ schema $: dataProviderId = dataProvider?.id + $: datasource = dataProvider?.datasource $: addExtension = getAction( dataProviderId, ActionTypes.AddDataProviderQueryExtension @@ -29,7 +30,7 @@ dataProviderId, ActionTypes.RemoveDataProviderQueryExtension ) - $: fetchSchema(dataProvider || {}) + $: fetchSchema(datasource) $: schemaFields = getSchemaFields(schema, allowedFields) // Add query extension to data provider @@ -42,8 +43,7 @@ } } - async function fetchSchema(dataProvider) { - const datasource = dataProvider?.datasource + async function fetchSchema(datasource) { if (datasource) { schema = await fetchDatasourceSchema(datasource, { enrichRelationships: true, @@ -102,7 +102,7 @@ - + {/if} diff --git a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte index 8d89d3a6ff..5bc3e500a1 100644 --- a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte +++ b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte @@ -15,6 +15,7 @@ export let schemaFields export let filters = [] + export let datasource const context = getContext("context") const BannedTypes = ["link", "attachment", "json"] @@ -59,7 +60,9 @@ // Ensure a valid operator is set const validOperators = LuceneUtils.getValidOperatorsForType( - expression.type + expression.type, + expression.field, + datasource ).map(x => x.value) if (!validOperators.includes(expression.operator)) { expression.operator = @@ -118,7 +121,11 @@ /> onOperatorChange(filter)} placeholder={null} diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte index af3afd8bcc..1d4b629f2e 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte @@ -17,8 +17,8 @@ let drawer $: tempValue = value - $: dataSource = getDatasourceForProvider($currentAsset, componentInstance) - $: schema = getSchemaForDatasource($currentAsset, dataSource)?.schema + $: datasource = getDatasourceForProvider($currentAsset, componentInstance) + $: schema = getSchemaForDatasource($currentAsset, datasource)?.schema $: schemaFields = Object.values(schema || {}) async function saveFilter() { @@ -36,7 +36,7 @@ filters={value} {bindings} {schemaFields} - tableId={dataSource.tableId} + {datasource} on:change={e => (tempValue = e.detail)} /> diff --git a/packages/builder/src/helpers/searchFields.js b/packages/builder/src/helpers/searchFields.js index 1a2d3b17e7..a9c837d570 100644 --- a/packages/builder/src/helpers/searchFields.js +++ b/packages/builder/src/helpers/searchFields.js @@ -16,11 +16,7 @@ export function getTableFields(linkField) { })) } -export function getFields( - fields, - { allowLinks } = { allowLinks: true }, - tableId -) { +export function getFields(fields, { allowLinks } = { allowLinks: true }) { let filteredFields = fields.filter( field => !BannedSearchTypes.includes(field.type) ) @@ -34,9 +30,5 @@ export function getFields( const staticFormulaFields = fields.filter( field => field.type === "formula" && field.formulaType === "static" ) - const table = get(tables).list.find(table => table._id === tableId) - if (table?.type === "external" && table?.sql) { - filteredFields = filteredFields.filter(field => field.name !== "_id") - } return filteredFields.concat(staticFormulaFields) } diff --git a/packages/cli/package.json b/packages/cli/package.json index cd8cb8138e..8a5b69f5ce 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.1.46-alpha.14", + "version": "2.2.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.1.46-alpha.14", - "@budibase/string-templates": "2.1.46-alpha.14", - "@budibase/types": "2.1.46-alpha.14", + "@budibase/backend-core": "^2.2.3", + "@budibase/string-templates": "^2.2.3", + "@budibase/types": "^2.2.3", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 9ecfe0aa60..d524e60c64 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.1.46-alpha.14", + "version": "2.2.3", "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": "2.1.46-alpha.14", - "@budibase/frontend-core": "2.1.46-alpha.14", - "@budibase/string-templates": "2.1.46-alpha.14", + "@budibase/bbui": "^2.2.3", + "@budibase/frontend-core": "^2.2.3", + "@budibase/string-templates": "^2.2.3", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/client/src/components/app/Layout.svelte b/packages/client/src/components/app/Layout.svelte index 6582384569..1f0bed214a 100644 --- a/packages/client/src/components/app/Layout.svelte +++ b/packages/client/src/components/app/Layout.svelte @@ -275,7 +275,6 @@ justify-content: center; align-items: stretch; z-index: 1; - border-top: 1px solid var(--spectrum-global-color-gray-300); overflow: hidden; position: relative; } @@ -316,6 +315,12 @@ top: 0; left: 0; } + .layout--top .nav-wrapper { + border-bottom: 1px solid var(--spectrum-global-color-gray-300); + } + .layout--left .nav-wrapper { + border-right: 1px solid var(--spectrum-global-color-gray-300); + } .nav { display: flex; @@ -390,10 +395,6 @@ align-items: stretch; flex: 1 1 auto; z-index: 1; - border-top: 1px solid var(--spectrum-global-color-gray-300); - } - .layout--none .main-wrapper { - border-top: none; } .main { display: flex; @@ -487,7 +488,7 @@ } /* Desktop nav overrides */ - .desktop.layout--left { + .desktop.layout--left .layout-body { flex-direction: row; overflow: hidden; } @@ -523,6 +524,8 @@ top: 0; left: 0; box-shadow: 0 0 8px -1px rgba(0, 0, 0, 0.075); + border-bottom: 1px solid var(--spectrum-global-color-gray-300); + border-right: none; } /* Show close button in drawer */ diff --git a/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte b/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte index df06979f48..199a6122ab 100644 --- a/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte +++ b/packages/client/src/components/app/dynamic-filter/DynamicFilter.svelte @@ -21,6 +21,7 @@ schema $: dataProviderId = dataProvider?.id + $: datasource = dataProvider?.datasource $: addExtension = getAction( dataProviderId, ActionTypes.AddDataProviderQueryExtension @@ -29,7 +30,7 @@ dataProviderId, ActionTypes.RemoveDataProviderQueryExtension ) - $: fetchSchema(dataProvider || {}) + $: fetchSchema(datasource) $: schemaFields = getSchemaFields(schema, allowedFields) // Add query extension to data provider @@ -42,8 +43,7 @@ } } - async function fetchSchema(dataProvider) { - const datasource = dataProvider?.datasource + async function fetchSchema(datasource) { if (datasource) { schema = await fetchDatasourceSchema(datasource, { enrichRelationships: true, @@ -102,7 +102,7 @@ - + {/if} diff --git a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte index 8d89d3a6ff..5bc3e500a1 100644 --- a/packages/client/src/components/app/dynamic-filter/FilterModal.svelte +++ b/packages/client/src/components/app/dynamic-filter/FilterModal.svelte @@ -15,6 +15,7 @@ export let schemaFields export let filters = [] + export let datasource const context = getContext("context") const BannedTypes = ["link", "attachment", "json"] @@ -59,7 +60,9 @@ // Ensure a valid operator is set const validOperators = LuceneUtils.getValidOperatorsForType( - expression.type + expression.type, + expression.field, + datasource ).map(x => x.value) if (!validOperators.includes(expression.operator)) { expression.operator = @@ -118,7 +121,11 @@ /> + + +
+
+ + diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js index 4a9640312d..90ce1607e4 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/actions/index.js @@ -16,5 +16,6 @@ export { default as ExportData } from "./ExportData.svelte" export { default as ContinueIf } from "./ContinueIf.svelte" export { default as UpdateFieldValue } from "./UpdateFieldValue.svelte" export { default as ShowNotification } from "./ShowNotification.svelte" +export { default as PromptUser } from "./PromptUser.svelte" export { default as OpenSidePanel } from "./OpenSidePanel.svelte" export { default as CloseSidePanel } from "./CloseSidePanel.svelte" diff --git a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json index 521ad85f0a..7497990304 100644 --- a/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json +++ b/packages/builder/src/components/design/settings/controls/ButtonActionEditor/manifest.json @@ -117,6 +117,11 @@ "component": "ShowNotification", "dependsOnFeature": "showNotificationAction" }, + { + "name": "Prompt User", + "type": "application", + "component": "PromptUser" + }, { "name": "Open Side Panel", "type": "application", diff --git a/packages/client/src/utils/buttonActions.js b/packages/client/src/utils/buttonActions.js index e471518285..06bc6f356a 100644 --- a/packages/client/src/utils/buttonActions.js +++ b/packages/client/src/utils/buttonActions.js @@ -327,6 +327,8 @@ const showNotificationHandler = action => { notificationStore.actions[type]?.(message, autoDismiss) } +const promptUserHandler = () => {} + const OpenSidePanelHandler = action => { const { id } = action.parameters if (id) { @@ -357,6 +359,7 @@ const handlerMap = { ["Export Data"]: exportDataHandler, ["Continue if / Stop if"]: continueIfHandler, ["Show Notification"]: showNotificationHandler, + ["Prompt User"]: promptUserHandler, ["Open Side Panel"]: OpenSidePanelHandler, ["Close Side Panel"]: CloseSidePanelHandler, } @@ -366,6 +369,7 @@ const confirmTextMap = { ["Save Row"]: "Are you sure you want to save this row?", ["Execute Query"]: "Are you sure you want to execute this query?", ["Trigger Automation"]: "Are you sure you want to trigger this automation?", + ["Prompt User"]: "Are you sure you want to contiune?", } /** @@ -417,8 +421,12 @@ export const enrichButtonActions = (actions, context) => { return new Promise(resolve => { const defaultText = confirmTextMap[action["##eventHandlerType"]] const confirmText = action.parameters?.confirmText || defaultText + + const defaultTitleText = action["##eventHandlerType"] + const customTitleText = + action.parameters?.customTitleText || defaultTitleText confirmationStore.actions.showConfirmation( - action["##eventHandlerType"], + customTitleText, confirmText, async () => { // When confirmed, execute this action immediately, @@ -429,7 +437,7 @@ export const enrichButtonActions = (actions, context) => { buttonContext.push(result) const newContext = { ...context, actions: buttonContext } - // Enrich and call the next button action + // Enrich and call the next button action if there is more than one action remaining const next = enrichButtonActions( actions.slice(i + 1), newContext From 03b8d7b439fd17307f76f440e024c9a1bac5dc31 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 15 Dec 2022 16:38:10 +0000 Subject: [PATCH 098/236] v2.2.4-alpha.3 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 439190499e..f61ae22758 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index dd36746391..b432264fab 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "2.2.4-alpha.2", + "@budibase/types": "2.2.4-alpha.3", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 20e727f0c6..3864ba41da 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": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "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": "2.2.4-alpha.2", + "@budibase/string-templates": "2.2.4-alpha.3", "@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 b1d31891c7..8c344a1e8f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.2.4-alpha.2", - "@budibase/client": "2.2.4-alpha.2", - "@budibase/frontend-core": "2.2.4-alpha.2", - "@budibase/string-templates": "2.2.4-alpha.2", + "@budibase/bbui": "2.2.4-alpha.3", + "@budibase/client": "2.2.4-alpha.3", + "@budibase/frontend-core": "2.2.4-alpha.3", + "@budibase/string-templates": "2.2.4-alpha.3", "@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 b4ec4dc6fb..04ce554cd7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.2.4-alpha.2", - "@budibase/string-templates": "2.2.4-alpha.2", - "@budibase/types": "2.2.4-alpha.2", + "@budibase/backend-core": "2.2.4-alpha.3", + "@budibase/string-templates": "2.2.4-alpha.3", + "@budibase/types": "2.2.4-alpha.3", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 56ac723814..79599b1805 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "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": "2.2.4-alpha.2", - "@budibase/frontend-core": "2.2.4-alpha.2", - "@budibase/string-templates": "2.2.4-alpha.2", + "@budibase/bbui": "2.2.4-alpha.3", + "@budibase/frontend-core": "2.2.4-alpha.3", + "@budibase/string-templates": "2.2.4-alpha.3", "@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 caad86f712..b07847be2b 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.2.4-alpha.2", + "@budibase/bbui": "2.2.4-alpha.3", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 06e58c1448..d42a4b0db1 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 5a1a0a0d9f..72de0d3434 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.2.4-alpha.2", - "@budibase/client": "2.2.4-alpha.2", + "@budibase/backend-core": "2.2.4-alpha.3", + "@budibase/client": "2.2.4-alpha.3", "@budibase/pro": "2.2.4-alpha.2", - "@budibase/string-templates": "2.2.4-alpha.2", - "@budibase/types": "2.2.4-alpha.2", + "@budibase/string-templates": "2.2.4-alpha.3", + "@budibase/types": "2.2.4-alpha.3", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 00875c759d..2486e1bb63 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 523df6b045..5acd23a83f 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 185b90eb7e..bdbd96fd29 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.4-alpha.2", + "version": "2.2.4-alpha.3", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.2.4-alpha.2", + "@budibase/backend-core": "2.2.4-alpha.3", "@budibase/pro": "2.2.4-alpha.2", - "@budibase/string-templates": "2.2.4-alpha.2", - "@budibase/types": "2.2.4-alpha.2", + "@budibase/string-templates": "2.2.4-alpha.3", + "@budibase/types": "2.2.4-alpha.3", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 0e8dd810346ebbc0dcd5f4423cbf5a7fdeecf4eb Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 15 Dec 2022 16:42:29 +0000 Subject: [PATCH 099/236] Update pro version to 2.2.4-alpha.3 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 72de0d3434..4067c96490 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "2.2.4-alpha.3", "@budibase/client": "2.2.4-alpha.3", - "@budibase/pro": "2.2.4-alpha.2", + "@budibase/pro": "2.2.4-alpha.3", "@budibase/string-templates": "2.2.4-alpha.3", "@budibase/types": "2.2.4-alpha.3", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index c04560642a..94cdc996c8 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.4-alpha.2": - version "2.2.4-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.2.tgz#7942695880cd5677d91dd1fc85deb0f13769bed1" - integrity sha512-2VMZjKeojP9S0aDKeK8y/I1xY5XoIWHmioqwydppG9R0hIRk2MsxNAg6XxcPMHFEwV2AJc9TX9byDo+qXKyvlw== +"@budibase/backend-core@2.2.4-alpha.3": + version "2.2.4-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.3.tgz#9651f883f94a8ad2f16078851a8d564ef05a2d0a" + integrity sha512-aJ5qLauH4wk6zFVjlpuy7+qpOgCDH+K5IaGQBMFBTswV/cZGmX5j6VkZin57CTZ/6RfaujvifAcDy90UDl8PRA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.4-alpha.2" + "@budibase/types" "2.2.4-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1373,13 +1373,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.4-alpha.2": - version "2.2.4-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.2.tgz#1e1a26b9194669aed1737d1245be45b448a6e889" - integrity sha512-jqOuLIUqFyphG9K0Ovly2ipVdAMZ7yvqLo74S3KwVu74Rk5Ab7rBw4DecOdKvGbu/r0ssNdXDXv8bns/P6I2ng== +"@budibase/pro@2.2.4-alpha.3": + version "2.2.4-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.3.tgz#e872bc5db00716b3a3f180d2588c0cea5e3fb550" + integrity sha512-qHGgYdK1ny7gt73Qn3heAzadp3jqNQsJHuk9HEkmTIp5frvreya7J7FcA1thi6w2isUMxydk0bKegalDyT3fnA== dependencies: - "@budibase/backend-core" "2.2.4-alpha.2" - "@budibase/types" "2.2.4-alpha.2" + "@budibase/backend-core" "2.2.4-alpha.3" + "@budibase/types" "2.2.4-alpha.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1404,10 +1404,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.4-alpha.2": - version "2.2.4-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.2.tgz#56503aee0e1294ca5b27338f229290dc4739c79a" - integrity sha512-Z8VcC/TjuBz0SoFPRD+Kj1B0w5w4lNpSXQWecsHp9ne72vG788LrMeoepBnXMw/icNof1cG/vu7J/sr4ONzQTg== +"@budibase/types@2.2.4-alpha.3": + version "2.2.4-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.3.tgz#23009c111ecc46aa99b29f97176c68c39bce5180" + integrity sha512-w0UxNeea1wV3DChKHNckxkAYfnirKXyWJLyLCyq1U4z5p2XADmHKmL7LTdFCWZPJzbH+JmtXgNYm7+Nt9h6ogw== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index bdbd96fd29..f5ec959871 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "2.2.4-alpha.3", - "@budibase/pro": "2.2.4-alpha.2", + "@budibase/pro": "2.2.4-alpha.3", "@budibase/string-templates": "2.2.4-alpha.3", "@budibase/types": "2.2.4-alpha.3", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index e3eb4f73d7..a5c6e6c627 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.4-alpha.2": - version "2.2.4-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.2.tgz#7942695880cd5677d91dd1fc85deb0f13769bed1" - integrity sha512-2VMZjKeojP9S0aDKeK8y/I1xY5XoIWHmioqwydppG9R0hIRk2MsxNAg6XxcPMHFEwV2AJc9TX9byDo+qXKyvlw== +"@budibase/backend-core@2.2.4-alpha.3": + version "2.2.4-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.3.tgz#9651f883f94a8ad2f16078851a8d564ef05a2d0a" + integrity sha512-aJ5qLauH4wk6zFVjlpuy7+qpOgCDH+K5IaGQBMFBTswV/cZGmX5j6VkZin57CTZ/6RfaujvifAcDy90UDl8PRA== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.4-alpha.2" + "@budibase/types" "2.2.4-alpha.3" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -520,23 +520,23 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.4-alpha.2": - version "2.2.4-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.2.tgz#1e1a26b9194669aed1737d1245be45b448a6e889" - integrity sha512-jqOuLIUqFyphG9K0Ovly2ipVdAMZ7yvqLo74S3KwVu74Rk5Ab7rBw4DecOdKvGbu/r0ssNdXDXv8bns/P6I2ng== +"@budibase/pro@2.2.4-alpha.3": + version "2.2.4-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.3.tgz#e872bc5db00716b3a3f180d2588c0cea5e3fb550" + integrity sha512-qHGgYdK1ny7gt73Qn3heAzadp3jqNQsJHuk9HEkmTIp5frvreya7J7FcA1thi6w2isUMxydk0bKegalDyT3fnA== dependencies: - "@budibase/backend-core" "2.2.4-alpha.2" - "@budibase/types" "2.2.4-alpha.2" + "@budibase/backend-core" "2.2.4-alpha.3" + "@budibase/types" "2.2.4-alpha.3" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" jsonwebtoken "8.5.1" node-fetch "^2.6.1" -"@budibase/types@2.2.4-alpha.2": - version "2.2.4-alpha.2" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.2.tgz#56503aee0e1294ca5b27338f229290dc4739c79a" - integrity sha512-Z8VcC/TjuBz0SoFPRD+Kj1B0w5w4lNpSXQWecsHp9ne72vG788LrMeoepBnXMw/icNof1cG/vu7J/sr4ONzQTg== +"@budibase/types@2.2.4-alpha.3": + version "2.2.4-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.3.tgz#23009c111ecc46aa99b29f97176c68c39bce5180" + integrity sha512-w0UxNeea1wV3DChKHNckxkAYfnirKXyWJLyLCyq1U4z5p2XADmHKmL7LTdFCWZPJzbH+JmtXgNYm7+Nt9h6ogw== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 2264f83ebd2c4d9c321fb189c0491d292d00eb51 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 16 Dec 2022 10:22:48 +0000 Subject: [PATCH 100/236] Types/attaching license to account (#9065) * adding license type to account * removing planDuration --- packages/types/src/documents/account/account.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/types/src/documents/account/account.ts b/packages/types/src/documents/account/account.ts index cf92002744..a8684f8427 100644 --- a/packages/types/src/documents/account/account.ts +++ b/packages/types/src/documents/account/account.ts @@ -1,6 +1,7 @@ import { Feature, Hosting, + License, MonthlyQuotaName, PlanType, PriceDuration, @@ -47,7 +48,7 @@ export interface Account extends CreateAccount { tier: string // deprecated planType?: PlanType planTier?: number - planDuration?: PriceDuration + license?: License stripeCustomerId?: string licenseKey?: string licenseKeyActivatedAt?: number From 80d06fbad86675117ce37431ebe1135282f0a100 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 10:41:13 +0000 Subject: [PATCH 101/236] v2.2.7 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index 4e50e75925..e47dc50106 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.6", + "version": "2.2.7", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 4c0ae9f1b5..1db36e07cd 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.6", + "@budibase/types": "^2.2.7", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 15ac33bc4e..8bc8d7edac 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": "2.2.6", + "version": "2.2.7", "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": "^2.2.6", + "@budibase/string-templates": "^2.2.7", "@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 c039a28c8d..8d7ec2c469 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.6", + "version": "2.2.7", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.6", - "@budibase/client": "^2.2.6", - "@budibase/frontend-core": "^2.2.6", - "@budibase/string-templates": "^2.2.6", + "@budibase/bbui": "^2.2.7", + "@budibase/client": "^2.2.7", + "@budibase/frontend-core": "^2.2.7", + "@budibase/string-templates": "^2.2.7", "@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 6f2a6f7357..974a1ad264 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.6", - "@budibase/string-templates": "^2.2.6", - "@budibase/types": "^2.2.6", + "@budibase/backend-core": "^2.2.7", + "@budibase/string-templates": "^2.2.7", + "@budibase/types": "^2.2.7", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 87eaedbe6a..08e8f5e684 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.6", + "version": "2.2.7", "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": "^2.2.6", - "@budibase/frontend-core": "^2.2.6", - "@budibase/string-templates": "^2.2.6", + "@budibase/bbui": "^2.2.7", + "@budibase/frontend-core": "^2.2.7", + "@budibase/string-templates": "^2.2.7", "@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 af9e5c1143..476ed0e445 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.6", + "@budibase/bbui": "^2.2.7", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 15e672610e..620efaec08 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index a47b52b2b8..77e4a334d8 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.6", - "@budibase/client": "^2.2.6", + "@budibase/backend-core": "^2.2.7", + "@budibase/client": "^2.2.7", "@budibase/pro": "2.2.6", - "@budibase/string-templates": "^2.2.6", - "@budibase/types": "^2.2.6", + "@budibase/string-templates": "^2.2.7", + "@budibase/types": "^2.2.7", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 6a0c162bf3..95d0c5a918 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.6", + "version": "2.2.7", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index f9e8098459..36d723c796 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 0faa9adf53..01d5a518d5 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.6", + "version": "2.2.7", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.6", + "@budibase/backend-core": "^2.2.7", "@budibase/pro": "2.2.6", - "@budibase/string-templates": "^2.2.6", - "@budibase/types": "^2.2.6", + "@budibase/string-templates": "^2.2.7", + "@budibase/types": "^2.2.7", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 5c2d37620993e5e732aab0393f0cc2585d1eec61 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 10:45:37 +0000 Subject: [PATCH 102/236] Update pro version to 2.2.7 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 77e4a334d8..c8cad9d95b 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.7", "@budibase/client": "^2.2.7", - "@budibase/pro": "2.2.6", + "@budibase/pro": "2.2.7", "@budibase/string-templates": "^2.2.7", "@budibase/types": "^2.2.7", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index e72decdb65..8365a19d0f 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.6.tgz#9ee5a54176f90614b36d8b4fa5887d50674cc5f2" - integrity sha512-HdWcZAvO4tnr0nj6oBLf0EQe1MT1C25vYZwJk4IepzgZhl9thIeTWOiRvgHlLCNEn84pmE6/jzJGVPohPbpjqg== +"@budibase/backend-core@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" + integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.6" + "@budibase/types" "^2.2.7" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1372,13 +1372,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.6.tgz#9ae77dc2e2cf963f6b1cfaa7dbf6f6062db616d9" - integrity sha512-FsYcEW/334i7uEI4G8338APEF7pSIamdV1Ro3aTjPuuFSetUeeJMtLFUhVExBjEPGbnB4M5RYl2JX5yU3HgrBw== +"@budibase/pro@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" + integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== dependencies: - "@budibase/backend-core" "2.2.6" - "@budibase/types" "2.2.6" + "@budibase/backend-core" "2.2.7" + "@budibase/types" "2.2.7" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1402,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.6", "@budibase/types@^2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.6.tgz#308a7a5538035425d99611c78e5953b800450d9e" - integrity sha512-BYYKdyt//w3ZA05abYNwIDsFNQ+mFodXoI8d89xMe4YqfSbwF6mwMgKffhyAlLxPqAePBi1ncyl7KP5aPFdgVQ== +"@budibase/types@2.2.7", "@budibase/types@^2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" + integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index 01d5a518d5..397651eacc 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.7", - "@budibase/pro": "2.2.6", + "@budibase/pro": "2.2.7", "@budibase/string-templates": "^2.2.7", "@budibase/types": "^2.2.7", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 2e85eae1c2..75a713bdf2 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.6.tgz#9ee5a54176f90614b36d8b4fa5887d50674cc5f2" - integrity sha512-HdWcZAvO4tnr0nj6oBLf0EQe1MT1C25vYZwJk4IepzgZhl9thIeTWOiRvgHlLCNEn84pmE6/jzJGVPohPbpjqg== +"@budibase/backend-core@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" + integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.6" + "@budibase/types" "^2.2.7" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -519,22 +519,22 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.6.tgz#9ae77dc2e2cf963f6b1cfaa7dbf6f6062db616d9" - integrity sha512-FsYcEW/334i7uEI4G8338APEF7pSIamdV1Ro3aTjPuuFSetUeeJMtLFUhVExBjEPGbnB4M5RYl2JX5yU3HgrBw== +"@budibase/pro@2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" + integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== dependencies: - "@budibase/backend-core" "2.2.6" - "@budibase/types" "2.2.6" + "@budibase/backend-core" "2.2.7" + "@budibase/types" "2.2.7" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.6", "@budibase/types@^2.2.6": - version "2.2.6" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.6.tgz#308a7a5538035425d99611c78e5953b800450d9e" - integrity sha512-BYYKdyt//w3ZA05abYNwIDsFNQ+mFodXoI8d89xMe4YqfSbwF6mwMgKffhyAlLxPqAePBi1ncyl7KP5aPFdgVQ== +"@budibase/types@2.2.7", "@budibase/types@^2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" + integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From f4a39080dee3176d91f3f26a0e4b55b4b13a04e3 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 16 Dec 2022 11:14:31 +0000 Subject: [PATCH 103/236] Minio and local licensing fixes (#9071) --- packages/backend-core/src/objectStore/objectStore.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend-core/src/objectStore/objectStore.ts b/packages/backend-core/src/objectStore/objectStore.ts index 89e1c88e10..1cc8ad3add 100644 --- a/packages/backend-core/src/objectStore/objectStore.ts +++ b/packages/backend-core/src/objectStore/objectStore.ts @@ -86,7 +86,7 @@ export const ObjectStore = ( // custom S3 is in use i.e. minio if (env.MINIO_URL) { - if (opts.presigning && !env.MINIO_ENABLED) { + if (opts.presigning && env.MINIO_ENABLED) { // IMPORTANT: Signed urls will inspect the host header of the request. // Normally a signed url will need to be generated with a specified host in mind. // To support dynamic hosts, e.g. some unknown self-hosted installation url, From 0fa1e7b97bb3949d2fbd091d866321dee7e11f7b Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 16 Dec 2022 11:24:16 +0000 Subject: [PATCH 104/236] Add tests for app specific roles --- .../internal-api/TestConfiguration/auth.ts | 1 + .../TestConfiguration/userManagement.ts | 9 +++++ .../userManagement/appSpecificRoles.spec.ts | 33 +++++++++++++++++++ 3 files changed, 43 insertions(+) diff --git a/qa-core/src/config/internal-api/TestConfiguration/auth.ts b/qa-core/src/config/internal-api/TestConfiguration/auth.ts index d72502b417..3fe57c50be 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/auth.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/auth.ts @@ -27,6 +27,7 @@ export default class AuthApi { password: password, }, }) + expect(response).toHaveStatusCode(200) const cookie = response.headers.get("set-cookie") this.api.cookie = cookie as any return [response, cookie] diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index e602c37c8a..b10eafa217 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -115,4 +115,13 @@ export default class UserManagementApi { expect(response).toHaveStatusCode(200) return [response, json] } + + async changeSelfPassword(body: Partial): Promise<[Response, User]> { + const response = await this.api.post(`/global/self`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + expect(json._id).toEqual(body._id) + expect(json._rev).not.toEqual(body._rev) + return [response, json] + } } \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index cfdd75f82e..f375cf3158 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -226,8 +226,26 @@ describe("Internal API - App Specific Roles & Permissions", () => { expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) + const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) + const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + await config.login(appUser[0].email, appUser[0].password) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + //Update password + const userWithNewPassword = { + ...selfInfoJson, + password: appUser[0].password + } + await config.users.changeSelfPassword(userWithNewPassword) + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") }) it("Check Screen access for POWER role", async () => { @@ -251,6 +269,21 @@ describe("Internal API - App Specific Roles & Permissions", () => { const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + + const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) + const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) + const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + await config.login(appUser[0].email, appUser[0].password) + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(2) + expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") }) it("Check Screen access for ADMIN role", async () => { From 4760a76978fd017651000c7254ff06ab0a9c0663 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 16 Dec 2022 11:33:20 +0000 Subject: [PATCH 105/236] v2.2.4-alpha.4 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index f61ae22758..6073b88ae5 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index b432264fab..1f4af2ad63 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "2.2.4-alpha.3", + "@budibase/types": "2.2.4-alpha.4", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-cloudfront-sign": "2.2.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 3864ba41da..1243cc5b4b 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": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "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": "2.2.4-alpha.3", + "@budibase/string-templates": "2.2.4-alpha.4", "@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 8c344a1e8f..4926ce4107 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "2.2.4-alpha.3", - "@budibase/client": "2.2.4-alpha.3", - "@budibase/frontend-core": "2.2.4-alpha.3", - "@budibase/string-templates": "2.2.4-alpha.3", + "@budibase/bbui": "2.2.4-alpha.4", + "@budibase/client": "2.2.4-alpha.4", + "@budibase/frontend-core": "2.2.4-alpha.4", + "@budibase/string-templates": "2.2.4-alpha.4", "@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 04ce554cd7..2a8ab02ced 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "2.2.4-alpha.3", - "@budibase/string-templates": "2.2.4-alpha.3", - "@budibase/types": "2.2.4-alpha.3", + "@budibase/backend-core": "2.2.4-alpha.4", + "@budibase/string-templates": "2.2.4-alpha.4", + "@budibase/types": "2.2.4-alpha.4", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 79599b1805..b1bc035062 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "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": "2.2.4-alpha.3", - "@budibase/frontend-core": "2.2.4-alpha.3", - "@budibase/string-templates": "2.2.4-alpha.3", + "@budibase/bbui": "2.2.4-alpha.4", + "@budibase/frontend-core": "2.2.4-alpha.4", + "@budibase/string-templates": "2.2.4-alpha.4", "@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 b07847be2b..df0bd1df5f 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "2.2.4-alpha.3", + "@budibase/bbui": "2.2.4-alpha.4", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index d42a4b0db1..c9d2887d80 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index 4067c96490..37850606e4 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "2.2.4-alpha.3", - "@budibase/client": "2.2.4-alpha.3", + "@budibase/backend-core": "2.2.4-alpha.4", + "@budibase/client": "2.2.4-alpha.4", "@budibase/pro": "2.2.4-alpha.3", - "@budibase/string-templates": "2.2.4-alpha.3", - "@budibase/types": "2.2.4-alpha.3", + "@budibase/string-templates": "2.2.4-alpha.4", + "@budibase/types": "2.2.4-alpha.4", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2486e1bb63..e31c2f0f84 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 5acd23a83f..8fd504a244 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index f5ec959871..bc3f509286 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.4-alpha.3", + "version": "2.2.4-alpha.4", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "2.2.4-alpha.3", + "@budibase/backend-core": "2.2.4-alpha.4", "@budibase/pro": "2.2.4-alpha.3", - "@budibase/string-templates": "2.2.4-alpha.3", - "@budibase/types": "2.2.4-alpha.3", + "@budibase/string-templates": "2.2.4-alpha.4", + "@budibase/types": "2.2.4-alpha.4", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From cf0bc606e43569084f1b383d0182d87ea88fdfd3 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 16 Dec 2022 11:37:35 +0000 Subject: [PATCH 106/236] Update pro version to 2.2.4-alpha.4 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 37850606e4..d2e5770612 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "2.2.4-alpha.4", "@budibase/client": "2.2.4-alpha.4", - "@budibase/pro": "2.2.4-alpha.3", + "@budibase/pro": "2.2.4-alpha.4", "@budibase/string-templates": "2.2.4-alpha.4", "@budibase/types": "2.2.4-alpha.4", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 94cdc996c8..87977b6157 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.4-alpha.3": - version "2.2.4-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.3.tgz#9651f883f94a8ad2f16078851a8d564ef05a2d0a" - integrity sha512-aJ5qLauH4wk6zFVjlpuy7+qpOgCDH+K5IaGQBMFBTswV/cZGmX5j6VkZin57CTZ/6RfaujvifAcDy90UDl8PRA== +"@budibase/backend-core@2.2.4-alpha.4": + version "2.2.4-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.4.tgz#c0b858936131ef4631c6baa2282482e089e6e9bf" + integrity sha512-CAK7cy6VSIAcQHpvD+yX4BHSglJ0pYEHIWfGjXVAk8iI0BDQg76NWhHNkuqko2bUhKxcGLe7J9hF5zWvY+J+/w== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.4-alpha.3" + "@budibase/types" "2.2.4-alpha.4" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -1373,13 +1373,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.4-alpha.3": - version "2.2.4-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.3.tgz#e872bc5db00716b3a3f180d2588c0cea5e3fb550" - integrity sha512-qHGgYdK1ny7gt73Qn3heAzadp3jqNQsJHuk9HEkmTIp5frvreya7J7FcA1thi6w2isUMxydk0bKegalDyT3fnA== +"@budibase/pro@2.2.4-alpha.4": + version "2.2.4-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.4.tgz#e8eb302a227cd3ef24830ae4ccca32790221af09" + integrity sha512-484bPOjmo617tyd4L1qZfiBIN5IMZH7+J4f6QrUGtHYy1JfEf0W0A0ZIbLoC/U7a/6D/FhVPRLQU8aWYnr+BIw== dependencies: - "@budibase/backend-core" "2.2.4-alpha.3" - "@budibase/types" "2.2.4-alpha.3" + "@budibase/backend-core" "2.2.4-alpha.4" + "@budibase/types" "2.2.4-alpha.4" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1404,10 +1404,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.4-alpha.3": - version "2.2.4-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.3.tgz#23009c111ecc46aa99b29f97176c68c39bce5180" - integrity sha512-w0UxNeea1wV3DChKHNckxkAYfnirKXyWJLyLCyq1U4z5p2XADmHKmL7LTdFCWZPJzbH+JmtXgNYm7+Nt9h6ogw== +"@budibase/types@2.2.4-alpha.4": + version "2.2.4-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.4.tgz#6f4ad1967546459efb49f8169e5d68147b90effc" + integrity sha512-VAPp8+FuM6lG2wUwVq9e7MvRnW/OBuNFDuB8vK2jUKxOMNu+C195DSQUBzVZGBgF/6R5pxnoLMfC0oJgftH7ww== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index bc3f509286..ac4c2bc403 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "2.2.4-alpha.4", - "@budibase/pro": "2.2.4-alpha.3", + "@budibase/pro": "2.2.4-alpha.4", "@budibase/string-templates": "2.2.4-alpha.4", "@budibase/types": "2.2.4-alpha.4", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index a5c6e6c627..aa2843fd03 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.4-alpha.3": - version "2.2.4-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.3.tgz#9651f883f94a8ad2f16078851a8d564ef05a2d0a" - integrity sha512-aJ5qLauH4wk6zFVjlpuy7+qpOgCDH+K5IaGQBMFBTswV/cZGmX5j6VkZin57CTZ/6RfaujvifAcDy90UDl8PRA== +"@budibase/backend-core@2.2.4-alpha.4": + version "2.2.4-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.4-alpha.4.tgz#c0b858936131ef4631c6baa2282482e089e6e9bf" + integrity sha512-CAK7cy6VSIAcQHpvD+yX4BHSglJ0pYEHIWfGjXVAk8iI0BDQg76NWhHNkuqko2bUhKxcGLe7J9hF5zWvY+J+/w== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "2.2.4-alpha.3" + "@budibase/types" "2.2.4-alpha.4" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-cloudfront-sign "2.2.0" @@ -520,23 +520,23 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.4-alpha.3": - version "2.2.4-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.3.tgz#e872bc5db00716b3a3f180d2588c0cea5e3fb550" - integrity sha512-qHGgYdK1ny7gt73Qn3heAzadp3jqNQsJHuk9HEkmTIp5frvreya7J7FcA1thi6w2isUMxydk0bKegalDyT3fnA== +"@budibase/pro@2.2.4-alpha.4": + version "2.2.4-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.4-alpha.4.tgz#e8eb302a227cd3ef24830ae4ccca32790221af09" + integrity sha512-484bPOjmo617tyd4L1qZfiBIN5IMZH7+J4f6QrUGtHYy1JfEf0W0A0ZIbLoC/U7a/6D/FhVPRLQU8aWYnr+BIw== dependencies: - "@budibase/backend-core" "2.2.4-alpha.3" - "@budibase/types" "2.2.4-alpha.3" + "@budibase/backend-core" "2.2.4-alpha.4" + "@budibase/types" "2.2.4-alpha.4" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" jsonwebtoken "8.5.1" node-fetch "^2.6.1" -"@budibase/types@2.2.4-alpha.3": - version "2.2.4-alpha.3" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.3.tgz#23009c111ecc46aa99b29f97176c68c39bce5180" - integrity sha512-w0UxNeea1wV3DChKHNckxkAYfnirKXyWJLyLCyq1U4z5p2XADmHKmL7LTdFCWZPJzbH+JmtXgNYm7+Nt9h6ogw== +"@budibase/types@2.2.4-alpha.4": + version "2.2.4-alpha.4" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.4-alpha.4.tgz#6f4ad1967546459efb49f8169e5d68147b90effc" + integrity sha512-VAPp8+FuM6lG2wUwVq9e7MvRnW/OBuNFDuB8vK2jUKxOMNu+C195DSQUBzVZGBgF/6R5pxnoLMfC0oJgftH7ww== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From 712f1d1fc127f04f0e811e2b39b7214ca744c6df Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Fri, 16 Dec 2022 13:16:37 +0000 Subject: [PATCH 107/236] Environment variable type coercion fix (#9074) * Environment variable type coercion fix * Update .gitignore --- .gitignore | 1 + packages/server/src/environment.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e1d3e6db0e..915e2ea160 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ builder/* packages/server/runtime_apps/ .idea/ bb-airgapped.tar.gz +*.iml # Logs logs diff --git a/packages/server/src/environment.ts b/packages/server/src/environment.ts index bf5330f9b6..e900753be3 100644 --- a/packages/server/src/environment.ts +++ b/packages/server/src/environment.ts @@ -108,12 +108,12 @@ const environment = { } // threading can cause memory issues with node-ts in development -if (isDev() && module.exports.DISABLE_THREADING == null) { +if (isDev() && environment.DISABLE_THREADING == null) { environment._set("DISABLE_THREADING", "1") } // clean up any environment variable edge cases -for (let [key, value] of Object.entries(module.exports)) { +for (let [key, value] of Object.entries(environment)) { // handle the edge case of "0" to disable an environment variable if (value === "0") { // @ts-ignore From 1835b89b7252dd1365620d2d3813d8c123588c3c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 13:32:25 +0000 Subject: [PATCH 108/236] v2.2.8 --- lerna.json | 2 +- packages/backend-core/package.json | 4 ++-- packages/bbui/package.json | 4 ++-- packages/builder/package.json | 10 +++++----- packages/cli/package.json | 8 ++++---- packages/client/package.json | 8 ++++---- packages/frontend-core/package.json | 4 ++-- packages/sdk/package.json | 2 +- packages/server/package.json | 10 +++++----- packages/string-templates/package.json | 2 +- packages/types/package.json | 2 +- packages/worker/package.json | 8 ++++---- 12 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lerna.json b/lerna.json index e47dc50106..2b9efd53b9 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.2.7", + "version": "2.2.8", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 1db36e07cd..6070a2cd50 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase backend core libraries used in server and worker", "main": "dist/src/index.js", "types": "dist/src/index.d.ts", @@ -21,7 +21,7 @@ }, "dependencies": { "@budibase/nano": "10.1.1", - "@budibase/types": "^2.2.7", + "@budibase/types": "^2.2.8", "@shopify/jest-koa-mocks": "5.0.1", "@techpass/passport-openidconnect": "0.3.2", "aws-sdk": "2.1030.0", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 8bc8d7edac..aa16117fa7 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": "2.2.7", + "version": "2.2.8", "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": "^2.2.7", + "@budibase/string-templates": "^2.2.8", "@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 8d7ec2c469..be2befbe44 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "2.2.7", + "version": "2.2.8", "license": "GPL-3.0", "private": true, "scripts": { @@ -71,10 +71,10 @@ } }, "dependencies": { - "@budibase/bbui": "^2.2.7", - "@budibase/client": "^2.2.7", - "@budibase/frontend-core": "^2.2.7", - "@budibase/string-templates": "^2.2.7", + "@budibase/bbui": "^2.2.8", + "@budibase/client": "^2.2.8", + "@budibase/frontend-core": "^2.2.8", + "@budibase/string-templates": "^2.2.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 974a1ad264..f38dc8105d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { @@ -26,9 +26,9 @@ "outputPath": "build" }, "dependencies": { - "@budibase/backend-core": "^2.2.7", - "@budibase/string-templates": "^2.2.7", - "@budibase/types": "^2.2.7", + "@budibase/backend-core": "^2.2.8", + "@budibase/string-templates": "^2.2.8", + "@budibase/types": "^2.2.8", "axios": "0.21.2", "chalk": "4.1.0", "cli-progress": "3.11.2", diff --git a/packages/client/package.json b/packages/client/package.json index 08e8f5e684..cdd8f4941f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "2.2.7", + "version": "2.2.8", "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": "^2.2.7", - "@budibase/frontend-core": "^2.2.7", - "@budibase/string-templates": "^2.2.7", + "@budibase/bbui": "^2.2.8", + "@budibase/frontend-core": "^2.2.8", + "@budibase/string-templates": "^2.2.8", "@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 476ed0e445..e92d54c74a 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^2.2.7", + "@budibase/bbui": "^2.2.8", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/sdk/package.json b/packages/sdk/package.json index 620efaec08..d30c707649 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/sdk", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase Public API SDK", "author": "Budibase", "license": "MPL-2.0", diff --git a/packages/server/package.json b/packages/server/package.json index c8cad9d95b..5295deb7f1 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -43,11 +43,11 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "10.0.3", - "@budibase/backend-core": "^2.2.7", - "@budibase/client": "^2.2.7", + "@budibase/backend-core": "^2.2.8", + "@budibase/client": "^2.2.8", "@budibase/pro": "2.2.7", - "@budibase/string-templates": "^2.2.7", - "@budibase/types": "^2.2.7", + "@budibase/string-templates": "^2.2.8", + "@budibase/types": "^2.2.8", "@bull-board/api": "3.7.0", "@bull-board/koa": "3.9.4", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 95d0c5a918..085e7b07cc 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "2.2.7", + "version": "2.2.8", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/types/package.json b/packages/types/package.json index 36d723c796..5ed20d6b66 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/types", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase types", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/packages/worker/package.json b/packages/worker/package.json index 397651eacc..ee721db565 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "2.2.7", + "version": "2.2.8", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -36,10 +36,10 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^2.2.7", + "@budibase/backend-core": "^2.2.8", "@budibase/pro": "2.2.7", - "@budibase/string-templates": "^2.2.7", - "@budibase/types": "^2.2.7", + "@budibase/string-templates": "^2.2.8", + "@budibase/types": "^2.2.8", "@koa/router": "8.0.8", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "0.3.2", From 7754ed5f35854131d0a99b413b37ec3ba301d9dc Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Fri, 16 Dec 2022 13:36:26 +0000 Subject: [PATCH 109/236] Update pro version to 2.2.8 --- packages/server/package.json | 2 +- packages/server/yarn.lock | 30 +++++++++++++++--------------- packages/worker/package.json | 2 +- packages/worker/yarn.lock | 30 +++++++++++++++--------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/server/package.json b/packages/server/package.json index 5295deb7f1..97783614a3 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -45,7 +45,7 @@ "@apidevtools/swagger-parser": "10.0.3", "@budibase/backend-core": "^2.2.8", "@budibase/client": "^2.2.8", - "@budibase/pro": "2.2.7", + "@budibase/pro": "2.2.8", "@budibase/string-templates": "^2.2.8", "@budibase/types": "^2.2.8", "@bull-board/api": "3.7.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 8365a19d0f..eb3ccd3b90 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1273,13 +1273,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" - integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== +"@budibase/backend-core@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.8.tgz#9a72bc9bab013f8322ab85cdab5c96b743aa2bcd" + integrity sha512-1wY+xVOCOyiLyhRokOu6VAfsU0WVu7U6Rbcmz1PMSJcYbricucH1XAThKISmKXPP6K3L8o/Ug+r4leI96yw1dQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.7" + "@budibase/types" "^2.2.8" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -1372,13 +1372,13 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" - integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== +"@budibase/pro@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.8.tgz#5b42e85b1843dcc133001e4eb130f371f0c6e973" + integrity sha512-rg4Vq1vWu09DTpqtuiP9yqJ+XyuKoIb9/HTWo1nFfuxOkNBagDEmHJnp8Q+Kwhs+ubWpCGCyC2Ge15JsbLhCCw== dependencies: - "@budibase/backend-core" "2.2.7" - "@budibase/types" "2.2.7" + "@budibase/backend-core" "2.2.8" + "@budibase/types" "2.2.8" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" @@ -1402,10 +1402,10 @@ svelte-apexcharts "^1.0.2" svelte-flatpickr "^3.1.0" -"@budibase/types@2.2.7", "@budibase/types@^2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" - integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== +"@budibase/types@2.2.8", "@budibase/types@^2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.8.tgz#fd681947d346c9262bb041f6ffea5a0691ff6ba5" + integrity sha512-mBhEkt+H4uzYuDDYcx7042EBoHUGungURhyi442NF6AWR60u4xbq9MoP+F5DGvSz8zAWQhO6gpkO3hNBeY2aGQ== "@bull-board/api@3.7.0": version "3.7.0" diff --git a/packages/worker/package.json b/packages/worker/package.json index ee721db565..0f6d6b9b35 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -37,7 +37,7 @@ "license": "GPL-3.0", "dependencies": { "@budibase/backend-core": "^2.2.8", - "@budibase/pro": "2.2.7", + "@budibase/pro": "2.2.8", "@budibase/string-templates": "^2.2.8", "@budibase/types": "^2.2.8", "@koa/router": "8.0.8", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 75a713bdf2..d4fdd2ace8 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -470,13 +470,13 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.7.tgz#f94e69589a9ce5a708c77cc16ca11fc4865fe04c" - integrity sha512-jiw/20J2J2PrpTHiKYnZp5G3e4Hs+C7yxEEt9HkNf+wN8DLcL1ySY/l17azUJ9ruTLGzIavU9ILdYBgc18F2Mg== +"@budibase/backend-core@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.2.8.tgz#9a72bc9bab013f8322ab85cdab5c96b743aa2bcd" + integrity sha512-1wY+xVOCOyiLyhRokOu6VAfsU0WVu7U6Rbcmz1PMSJcYbricucH1XAThKISmKXPP6K3L8o/Ug+r4leI96yw1dQ== dependencies: "@budibase/nano" "10.1.1" - "@budibase/types" "^2.2.7" + "@budibase/types" "^2.2.8" "@shopify/jest-koa-mocks" "5.0.1" "@techpass/passport-openidconnect" "0.3.2" aws-sdk "2.1030.0" @@ -519,22 +519,22 @@ qs "^6.11.0" tough-cookie "^4.1.2" -"@budibase/pro@2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.7.tgz#14b243f63b973668a6e92a450de670ee6d1f69d6" - integrity sha512-BCco7dhNj6HQkQCwQ8E4qLLquhbBve+ziaf8MKr3z8m2RraIp+/zwNTvXYo5YBSxfSuy66RhPNj5+nhEOl7TvA== +"@budibase/pro@2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.2.8.tgz#5b42e85b1843dcc133001e4eb130f371f0c6e973" + integrity sha512-rg4Vq1vWu09DTpqtuiP9yqJ+XyuKoIb9/HTWo1nFfuxOkNBagDEmHJnp8Q+Kwhs+ubWpCGCyC2Ge15JsbLhCCw== dependencies: - "@budibase/backend-core" "2.2.7" - "@budibase/types" "2.2.7" + "@budibase/backend-core" "2.2.8" + "@budibase/types" "2.2.8" "@koa/router" "8.0.8" bull "4.10.1" joi "17.6.0" node-fetch "^2.6.1" -"@budibase/types@2.2.7", "@budibase/types@^2.2.7": - version "2.2.7" - resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.7.tgz#a9c0ccf4d32631a995e560283affff2198bd672c" - integrity sha512-rfOXjHAmM0tgwUZCnhElywxfnr6xIpF7/16ojHfXXFrrx0D9+hPBRDiUbVzoKyZjrvXP8rA7AXvfbPz6PsvOaQ== +"@budibase/types@2.2.8", "@budibase/types@^2.2.8": + version "2.2.8" + resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.2.8.tgz#fd681947d346c9262bb041f6ffea5a0691ff6ba5" + integrity sha512-mBhEkt+H4uzYuDDYcx7042EBoHUGungURhyi442NF6AWR60u4xbq9MoP+F5DGvSz8zAWQhO6gpkO3hNBeY2aGQ== "@cspotcode/source-map-support@^0.8.0": version "0.8.1" From c0eb8c039ad0cf80714e766ee37c0a14d23d6721 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 16 Dec 2022 15:30:12 +0000 Subject: [PATCH 110/236] using production appID in BASIC screens test --- .../userManagement/appSpecificRoles.spec.ts | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index f375cf3158..cda597bb8c 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -204,45 +204,48 @@ describe("Internal API - App Specific Roles & Permissions", () => { describe("Screen Access for App specific roles", () => { it("Check Screen access for BASIC Role", async () => { + // Set up user const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId + // Update user roles const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID const body: User = { ...userInfoJson, roles: { - [app.appId]: "BASIC", + [prodAppId]: "BASIC", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("BASIC") + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("BASIC") - const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) - const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) - const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) await config.applications.publish(app.url) const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) expect(firstappPackageJson.screens).toBeDefined() expect(firstappPackageJson.screens.length).toEqual(3) - await config.login(appUser[0].email, appUser[0].password) + // login with BASIC user + await config.login(appUser[0].email!, appUser[0].password!) const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() - //Update password - const userWithNewPassword = { - ...selfInfoJson, - password: appUser[0].password - } - await config.users.changeSelfPassword(userWithNewPassword) - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) expect(appPackageJson.screens).toBeDefined() expect(appPackageJson.screens.length).toEqual(1) expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") @@ -255,35 +258,35 @@ describe("Internal API - App Specific Roles & Permissions", () => { const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) const body: User = { ...userInfoJson, roles: { - [app.appId]: "POWER", + [app.appId!]: "POWER", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("POWER") + expect(changedUserInfoJson.roles[app.appId!]).toBeDefined() + expect(changedUserInfoJson.roles[app.appId!]).toEqual("POWER") - const [basicScreenResponse, basicScreenJson] = await config.screen.create(generateScreen("BASIC")) - const [powerScreenResponse, powerScreenJson] = await config.screen.create(generateScreen("POWER")) - const [adminScreenResponse, adminScreenJson] = await config.screen.create(generateScreen("ADMIN")) + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) await config.applications.publish(app.url) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId!) expect(firstappPackageJson.screens).toBeDefined() expect(firstappPackageJson.screens.length).toEqual(3) - await config.login(appUser[0].email, appUser[0].password) + await config.login(appUser[0].email!, appUser[0].password!) const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) expect(appPackageJson.screens).toBeDefined() expect(appPackageJson.screens.length).toEqual(2) - expect(appPackageJson.screens[0].routing.roleId).toEqual("BASIC") }) it("Check Screen access for ADMIN role", async () => { @@ -307,7 +310,6 @@ describe("Internal API - App Specific Roles & Permissions", () => { const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) expect(changedUserInfoJson.roles[app.appId]).toBeDefined() expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") - }) }) describe.skip("Screen Access for custom roles", () => { From 8cc8db7842f5612b2943e146d10cd62a9a4bd745 Mon Sep 17 00:00:00 2001 From: Pedro Silva Date: Fri, 16 Dec 2022 18:17:30 +0000 Subject: [PATCH 111/236] Add for app specific custom roles --- .../TestConfiguration/userManagement.ts | 10 +- .../userManagement/appSpecificRoles.spec.ts | 334 +++++++++++++++++- 2 files changed, 327 insertions(+), 17 deletions(-) diff --git a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts index b10eafa217..12a52034cc 100644 --- a/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts +++ b/qa-core/src/config/internal-api/TestConfiguration/userManagement.ts @@ -1,5 +1,5 @@ import { Response } from "node-fetch" -import { Role, User, UserDeletedEvent } from "@budibase/types" +import { Role, User, UserDeletedEvent, UserRoles } from "@budibase/types" import InternalAPIClient from "./InternalAPIClient" import { responseMessage } from "../fixtures/types/responseMessage" @@ -87,7 +87,6 @@ export default class UserManagementApi { const response = await this.api.get(`/roles`) const json = await response.json() expect(response).toHaveStatusCode(200) - expect(json.length).toEqual(4) return [response, json] } @@ -124,4 +123,11 @@ export default class UserManagementApi { expect(json._rev).not.toEqual(body._rev) return [response, json] } + + async createRole(body: Partial): Promise<[Response, UserRoles]> { + const response = await this.api.post(`/roles`, { body }) + const json = await response.json() + expect(response).toHaveStatusCode(200) + return [response, json] + } } \ No newline at end of file diff --git a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts index cda597bb8c..d27e846b22 100644 --- a/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts +++ b/qa-core/src/tests/internal-api/userManagement/appSpecificRoles.spec.ts @@ -252,72 +252,376 @@ describe("Internal API - App Specific Roles & Permissions", () => { }) it("Check Screen access for POWER role", async () => { + // Set up user const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App const app = await config.applications.create(generateApp()) - config.applications.api.appId = app.appId + // Update user roles const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID const body: User = { ...userInfoJson, roles: { - [app.appId!]: "POWER", + [prodAppId]: "POWER", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId!]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId!]).toEqual("POWER") + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("POWER") await config.screen.create(generateScreen("BASIC")) await config.screen.create(generateScreen("POWER")) await config.screen.create(generateScreen("ADMIN")) await config.applications.publish(app.url) - const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId!) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) expect(firstappPackageJson.screens).toBeDefined() expect(firstappPackageJson.screens.length).toEqual(3) + // login with POWER user await config.login(appUser[0].email!, appUser[0].password!) - const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) expect(appPackageJson.screens).toBeDefined() expect(appPackageJson.screens.length).toEqual(2) }) it("Check Screen access for ADMIN role", async () => { + // Set up user const appUser = generateUser() expect(appUser[0].builder?.global).toEqual(false) expect(appUser[0].admin?.global).toEqual(false) const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + // Create App const app = await config.applications.create(generateApp()) config.applications.api.appId = app.appId + // Update user roles const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID const body: User = { ...userInfoJson, roles: { - [app.appId]: "ADMIN", + [prodAppId]: "ADMIN", } } await config.users.updateInfo(body) const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) - expect(changedUserInfoJson.roles[app.appId]).toBeDefined() - expect(changedUserInfoJson.roles[app.appId]).toEqual("ADMIN") + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual("ADMIN") + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with ADMIN user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(3) }) }) - describe.skip("Screen Access for custom roles", () => { - it("Custom role access for level 1 permissions", async () => { }) - it("Custom role access for level 2 permissions", async () => { }) - it("Custom role access for level 3 permissions", async () => { }) - it("Custom role access for level 4 permissions", async () => { }) - it("Custom role access for level 5 permissions", async () => { }) + describe("Screen Access for custom roles", () => { + it("Custom role access for level 1 permissions", async () => { + // Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "public", + name: "level 1" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 2 permissions", async () => {// Set up user + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "read_only", + name: "level 2" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 3 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "write", + name: "level 3" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 4 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "power", + name: "level 4" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) + it("Custom role access for level 5 permissions", async () => { + const appUser = generateUser() + expect(appUser[0].builder?.global).toEqual(false) + expect(appUser[0].admin?.global).toEqual(false) + const [createUserResponse, createUserJson] = await config.users.addMultiple(appUser) + + // Create App + const app = await config.applications.create(generateApp()) + config.applications.api.appId = app.appId + + //Create level 1 role + const role = { + inherits: "BASIC", + permissionId: "admin", + name: "level 5" + } + const [createRoleResponse, createRoleJson] = await config.users.createRole(role) + + + + // Update user roles + const [userInfoResponse, userInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + const prodAppId = db.getProdAppID(app.appId!) + + // Roles must always be set with prod appID + const body: User = { + ...userInfoJson, + roles: { + [prodAppId]: createRoleJson._id, + } + } + await config.users.updateInfo(body) + + const [changedUserInfoResponse, changedUserInfoJson] = await config.users.getInfo(createUserJson.created.successful[0]._id) + expect(changedUserInfoJson.roles[prodAppId]).toBeDefined() + expect(changedUserInfoJson.roles[prodAppId]).toEqual(createRoleJson._id) + + await config.screen.create(generateScreen("BASIC")) + await config.screen.create(generateScreen("POWER")) + await config.screen.create(generateScreen("ADMIN")) + + await config.applications.publish(app.url) + const [firstappPackageResponse, firstappPackageJson] = await config.applications.getAppPackage(app.appId) + expect(firstappPackageJson.screens).toBeDefined() + expect(firstappPackageJson.screens.length).toEqual(3) + + // login with level 1 user + await config.login(appUser[0].email!, appUser[0].password!) + const [selfInfoResponse, selfInfoJson] = await config.users.getSelf() + + // fetch app package + const [appPackageResponse, appPackageJson] = await config.applications.getAppPackage(app.appId!) + expect(appPackageJson.screens).toBeDefined() + expect(appPackageJson.screens.length).toEqual(1) + }) }) }) From 3b1819952d9eea37634902d05a9055af8e13087f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Sat, 17 Dec 2022 14:13:06 +0000 Subject: [PATCH 112/236] Builder data section routing refactor (#8996) * Improve theming with spectrum badges and dedupe spectrum label usage * Update data section nav to match designs and use panel component * Fix main content layout in data section * Update data section routing for tables * Improve data section routing for tables to account for edge cases * Update internal and sample datasource routing * Update external datasource routing * Update routing for queries and make a top level concept like everything else * Update routing for views * Fix undefined reference when deleting datasource * Reduce network calls and fix issues with stale datasourcenavigator state * Update routing for REST queries and unify routes for normal queries and REST queries * Lint * Fix links for queries from datasource details page * Remove redundant API calls and improve table deletion logic * Improve data entity deletion logic and redirection and fix query details keying * Improve determination of selected item in datasource tree * Lint * Fix BBUI import * Fix datasource navigator selected state not working for internal DB or sample data --- packages/bbui/src/Badge/Badge.svelte | 13 + .../src/Table/RelationshipRenderer.svelte | 11 +- .../components/backend/DataTable/Table.svelte | 1 - .../DataTable/modals/CreateViewModal.svelte | 4 +- .../DatasourceNavigator.svelte | 132 ++++++---- .../popovers/EditDatasourcePopover.svelte | 19 +- .../popovers/EditQueryPopover.svelte | 16 +- .../TableNavigator/TableNavigator.svelte | 33 +-- .../popovers/EditTablePopover.svelte | 9 +- .../popovers/EditViewPopover.svelte | 7 +- .../src/components/design/Panel.svelte | 2 + .../integration}/DynamicVariableModal.svelte | 0 .../components/integration/QueryViewer.svelte | 245 +++++++++--------- .../integration}/RestBodyInput.svelte | 0 .../integration/RestQueryViewer.svelte} | 37 ++- packages/builder/src/helpers/urlStateSync.js | 19 +- .../app/[application]/data/_layout.svelte | 69 ++--- .../datasource/[datasourceId]/_layout.svelte | 23 ++ .../index.svelte | 52 ++-- .../[query]/_layout.svelte | 23 -- .../[selectedDatasource]/[query]/index.svelte | 39 --- .../[selectedDatasource]/_layout.svelte | 17 -- .../rest/[query]/_layout.svelte | 13 - .../datasource/bb_internal/_layout.svelte | 7 - .../data/datasource/bb_internal/index.svelte | 10 +- .../_layout.svelte | 8 - .../index.svelte | 19 +- .../data/datasource/index.svelte | 10 +- .../data/query/[queryId]/_layout.svelte | 22 ++ .../data/query/[queryId]/index.svelte | 18 ++ .../app/[application]/data/query/index.svelte | 16 ++ .../query/new/[datasourceId]/index.svelte | 38 +++ .../[application]/data/query/new/index.svelte | 5 + .../data/table/[selectedTable]/_layout.svelte | 13 - .../data/table/[tableId]/_layout.svelte | 20 ++ .../index.svelte | 6 +- .../[rowId]/[field]}/index.svelte | 6 +- .../relationship/[rowId]}/index.svelte | 0 .../relationship/index.svelte | 0 .../[application]/data/table/_layout.svelte | 19 -- .../app/[application]/data/table/index.svelte | 11 +- .../data/view/[selectedView]/_layout.svelte | 22 -- .../data/view/[viewName]/_layout.svelte | 20 ++ .../index.svelte | 0 .../app/[application]/data/view/index.svelte | 16 ++ .../builder/src/stores/backend/datasources.js | 160 ++++++------ .../builder/src/stores/backend/queries.js | 226 ++++++++-------- packages/builder/src/stores/backend/tables.js | 196 +++++++------- packages/builder/src/stores/backend/views.js | 88 ++++--- 49 files changed, 894 insertions(+), 846 deletions(-) rename packages/builder/src/{pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components => components/integration}/DynamicVariableModal.svelte (100%) rename packages/builder/src/{pages/builder/app/[application]/data/datasource/[selectedDatasource]/_components => components/integration}/RestBodyInput.svelte (100%) rename packages/builder/src/{pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/index.svelte => components/integration/RestQueryViewer.svelte} (98%) create mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[datasourceId]/_layout.svelte rename packages/builder/src/pages/builder/app/[application]/data/datasource/{[selectedDatasource] => [datasourceId]}/index.svelte (87%) delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/[query]/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/[selectedDatasource]/rest/[query]/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/bb_internal/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/datasource/datasource_internal_bb_default/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/[queryId]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/[queryId]/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/new/[datasourceId]/index.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/query/new/index.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/table/[selectedTable]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/table/[tableId]/_layout.svelte rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable] => [tableId]}/index.svelte (71%) rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable]/relationship/[selectedRow]/[selectedField] => [tableId]/relationship/[rowId]/[field]}/index.svelte (62%) rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable]/relationship/[selectedRow] => [tableId]/relationship/[rowId]}/index.svelte (100%) rename packages/builder/src/pages/builder/app/[application]/data/table/{[selectedTable] => [tableId]}/relationship/index.svelte (100%) delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/table/_layout.svelte delete mode 100644 packages/builder/src/pages/builder/app/[application]/data/view/[selectedView]/_layout.svelte create mode 100644 packages/builder/src/pages/builder/app/[application]/data/view/[viewName]/_layout.svelte rename packages/builder/src/pages/builder/app/[application]/data/view/{[selectedView] => [viewName]}/index.svelte (100%) create mode 100644 packages/builder/src/pages/builder/app/[application]/data/view/index.svelte diff --git a/packages/bbui/src/Badge/Badge.svelte b/packages/bbui/src/Badge/Badge.svelte index 4bc701d983..8b54045297 100644 --- a/packages/bbui/src/Badge/Badge.svelte +++ b/packages/bbui/src/Badge/Badge.svelte @@ -10,10 +10,13 @@ export let green = false export let active = false export let inactive = false + export let hoverable = false + + diff --git a/packages/bbui/src/Table/RelationshipRenderer.svelte b/packages/bbui/src/Table/RelationshipRenderer.svelte index 4db0c63d95..b70eaeb07d 100644 --- a/packages/bbui/src/Table/RelationshipRenderer.svelte +++ b/packages/bbui/src/Table/RelationshipRenderer.svelte @@ -1,6 +1,7 @@ {#if $database?._id} @@ -44,8 +23,9 @@ border={idx > 0} icon={table._id === TableNames.USERS ? "UserGroup" : "Table"} text={table.name} - selected={$tables.selected?._id === table._id} - on:click={() => selectTable(table)} + selected={$isActive("./table/:tableId") && + $tables.selected?._id === table._id} + on:click={() => $goto(`./table/${table._id}`)} > {#if table._id !== TableNames.USERS} @@ -56,8 +36,9 @@ indentLevel={2} icon="Remove" text={viewName} - selected={selectedView === viewName} - on:click={() => onClickView(table, viewName)} + selected={$isActive("./view/:viewName") && + $views.selected?.name === viewName} + on:click={() => $goto(`./view/${viewName}`)} > - import { goto } from "@roxi/routify" + import { goto, params } from "@roxi/routify" import { store } from "builderStore" import { cloneDeep } from "lodash/fp" import { tables, datasources } from "stores/backend" @@ -41,17 +41,16 @@ } async function deleteTable() { - const wasSelectedTable = $tables.selected + const isSelected = $params.tableId === table._id try { await tables.delete(table) await store.actions.screens.delete(templateScreens) - await tables.fetch() if (table.type === "external") { await datasources.fetch() } notifications.success("Table deleted") - if (wasSelectedTable && wasSelectedTable._id === table._id) { - $goto("./table") + if (isSelected) { + $goto(`./datasource/${table.datasourceId}`) } } catch (error) { notifications.error("Error deleting table") diff --git a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte index f543b34ddc..44eb1e9b7b 100644 --- a/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte +++ b/packages/builder/src/components/backend/TableNavigator/popovers/EditViewPopover.svelte @@ -1,5 +1,5 @@ - - Query {integrationInfo?.friendlyName} - - Config -
-
- - -
- {#if queryConfig} -
- -
- Add a JavaScript function to transform the query result. - (query.transformer = e.detail)} - /> - -
-
- Results - - - - -
- - Below, you can preview the results from your query and change the schema. - -
- {#if data} - - - - - - - - - - - + {#if queryConfig} +
+ +