From 716dbe9c98abbf1783e93a40fd6e8beb4875b077 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Mon, 27 Sep 2021 18:19:25 +0100 Subject: [PATCH 01/43] Cypress Testing additions and changes -Changing baseurl to be the test env -Made a few updates to existing tests/commands --New commands also added -Add Radio Button Test -Add Multi Option Datatype test -Custom Theming Properties Test --Just the one so far, more to come --- packages/builder/cypress.json | 2 +- .../addMultiOptionDatatype.spec.js | 40 ++++++++++++ .../integration/addRadioButtons.spec.js | 39 ++++++++++++ .../cypress/integration/createApp.spec.js | 2 +- .../cypress/integration/createTable.spec.js | 2 +- .../cypress/integration/createView.spec.js | 13 ++-- .../customThemingProperties.spec.js | 61 +++++++++++++++++++ packages/builder/cypress/setup.js | 2 +- packages/builder/cypress/support/commands.js | 54 +++++++++++++--- 9 files changed, 200 insertions(+), 15 deletions(-) create mode 100644 packages/builder/cypress/integration/addMultiOptionDatatype.spec.js create mode 100644 packages/builder/cypress/integration/addRadioButtons.spec.js create mode 100644 packages/builder/cypress/integration/customThemingProperties.spec.js diff --git a/packages/builder/cypress.json b/packages/builder/cypress.json index 0908f2c839..cd63e19b01 100644 --- a/packages/builder/cypress.json +++ b/packages/builder/cypress.json @@ -1,5 +1,5 @@ { - "baseUrl": "http://localhost:10001/builder/", + "baseUrl": "https://test.budi.live/builder/", "video": true, "projectId": "bmbemn", "env": { diff --git a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js new file mode 100644 index 0000000000..5d4860ccec --- /dev/null +++ b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js @@ -0,0 +1,40 @@ +context("Add Multi-Option Datatype", () => { + before(() => { + cy.login() + cy.createTestApp() + }) + + it("should create a new table, with data", () => { + cy.createTable("Multi Data") + cy.addColumn("Multi Data", "Test Data", "Multi-select", "1\n2\n3\n4\n5") + cy.addRowMultiValue(["1", "2", "3", "4", "5"]) + }) + + it ("should add form with multi select picker, containing 5 options", () => { + cy.navigateToFrontend() + cy.wait(500) + // Add data provider + cy.get(`[data-cy="category-Data Provider"]`).click() + cy.get('[data-cy="dataSource-prop-control"]').click() + cy.get(".dropdown").contains("Multi Data").click() + cy.wait(500) + // Add Form with schema to match table + cy.addComponent("Form", "Form") + cy.get('[data-cy="dataSource-prop-control"').click() + cy.get(".dropdown").contains("Multi Data").click() + cy.wait(500) + // Add multi-select picker to form + cy.addComponent("Form", "Multi-select Picker").then((componentId) => { + cy.get('[data-cy="field-prop-control"]').type("Test Data").type('{enter}') + cy.getComponent(componentId).click() + // Check picker has 5 items + cy.getComponent(componentId).find('li').should('have.length', 5) + // Select all items + for (let i = 1; i < 6; i++) { + cy.getComponent(componentId).find('li').contains(i).click() + } + // Check items have been selected + cy.getComponent(componentId).find('.spectrum-Picker-label').contains("(5)") + }) + }) +}) \ No newline at end of file diff --git a/packages/builder/cypress/integration/addRadioButtons.spec.js b/packages/builder/cypress/integration/addRadioButtons.spec.js new file mode 100644 index 0000000000..ef16a02137 --- /dev/null +++ b/packages/builder/cypress/integration/addRadioButtons.spec.js @@ -0,0 +1,39 @@ +context("Add Radio Buttons", () => { + before(() => { + cy.login() + cy.createTestApp() + }) + +it("should add Radio Buttons options picker on form, add data, and confirm", () => { + cy.navigateToFrontend() + cy.addComponent("Form", "Form") + cy.addComponent("Form", "Options Picker").then((componentId) => { + // Provide field setting + cy.get(`[data-cy="field-prop-control"]`).type("1") + // Open dropdown and select Radio buttons + cy.get(`[data-cy="optionsType-prop-control"]`).click().then(() => { + cy.get('.spectrum-Popover').contains('Radio buttons') + .wait(500) + .click() + }) + const radioButtonsTotal = 3 + // Add values and confirm total + addRadioButtonData(radioButtonsTotal) + cy.getComponent(componentId).find('[type="radio"]') + .should('have.length', radioButtonsTotal) + }) + }) + + const addRadioButtonData = (totalRadioButtons) => { + cy.get(`[data-cy="optionsSource-prop-control"]`).click().then(() => { + cy.get('.spectrum-Popover').contains('Custom') + .wait(500) + .click() + }) + cy.addCustomSourceOptions(totalRadioButtons) + } +}) + + + + diff --git a/packages/builder/cypress/integration/createApp.spec.js b/packages/builder/cypress/integration/createApp.spec.js index 34f152b540..21732b9f3a 100644 --- a/packages/builder/cypress/integration/createApp.spec.js +++ b/packages/builder/cypress/integration/createApp.spec.js @@ -2,7 +2,7 @@ context("Create an Application", () => { it("should create a new application", () => { cy.login() cy.createTestApp() - cy.visit(`localhost:${Cypress.env("PORT")}/builder`) + cy.visit(`https://test.budi.live/builder`) cy.contains("Cypress Tests").should("exist") }) }) diff --git a/packages/builder/cypress/integration/createTable.spec.js b/packages/builder/cypress/integration/createTable.spec.js index eda72ba36d..5be32e2a18 100644 --- a/packages/builder/cypress/integration/createTable.spec.js +++ b/packages/builder/cypress/integration/createTable.spec.js @@ -38,7 +38,7 @@ context("Create a Table", () => { cy.wait(1000) cy.get(".spectrum-Modal input").type("Updated") cy.contains("Save").click() - cy.contains("RoverUpdated").should("have.text", "RoverUpdated") + cy.contains("Updated").should("have.text", "Updated") }) it("deletes a row", () => { diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index 3aef927e8d..aab8845836 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -1,3 +1,7 @@ +Cypress.on('uncaught:exception', (err, runnable) => { + return false; +}); + context("Create a View", () => { before(() => { cy.login() @@ -57,6 +61,7 @@ context("Create a View", () => { }) it("creates a stats calculation view based on age", () => { + cy.wait(1000) cy.contains("Calculate").click() cy.get(".modal-inner-wrapper").within(() => { cy.get(".spectrum-Picker-label").eq(0).click() @@ -65,7 +70,7 @@ context("Create a View", () => { cy.get(".spectrum-Picker-label").eq(1).click() cy.contains("age").click({ force: true }) - cy.contains("Save").click() + cy.get(".spectrum-Button").contains("Save").click({ force: true }) }) cy.wait(1000) @@ -126,7 +131,7 @@ context("Create a View", () => { cy.contains(".nav-item", "Test View") .find(".actions .icon") .click({ force: true }) - cy.contains("Edit").click() + cy.get(".spectrum-Menu-itemLabel").contains("Edit").click() cy.get(".modal-inner-wrapper").within(() => { cy.get("input").type(" Updated") cy.contains("Save").click() @@ -141,8 +146,8 @@ context("Create a View", () => { .click({ force: true }) cy.contains("Delete").click() cy.contains("Delete View").click() - cy.wait(1000) - cy.contains("TestView Updated").should("not.be.visible") + cy.wait(500) + cy.contains("TestView Updated").should("not.exist") }) }) diff --git a/packages/builder/cypress/integration/customThemingProperties.spec.js b/packages/builder/cypress/integration/customThemingProperties.spec.js new file mode 100644 index 0000000000..f0004b1343 --- /dev/null +++ b/packages/builder/cypress/integration/customThemingProperties.spec.js @@ -0,0 +1,61 @@ +context("Custom Theming Properties", () => { + before(() => { + cy.login() + cy.createTestApp() + cy.navigateToFrontend() + }) + + // Default Values + // Button roundness = Large + // Primary colour = Blue 600 + // Primary colour (hover) = Blue 500 + // Navigation bar background colour = Gray 100 + // Navigation bar text colour = Gray 800 + it("should reset the color property values", () => { + // Open Theme modal and change colours + cy.get(".spectrum-ActionButton-label").contains("Theme").click() + cy.get(".spectrum-Picker").contains("Large").click() + .parents() + .get(".spectrum-Menu-itemLabel").contains("None").click() + changeThemeColors() + // Reset colours + cy.get(".spectrum-Button-label").contains("Reset").click({force: true}) + // Check values have reset + checkThemeColorDefaults() + }) + + const changeThemeColors = () => { + // Changes the theme colours + cy.get(".spectrum-FieldLabel").contains("Primary color") + .parent().find(".container.svelte-z3cm5a").click() + .find('[title="Red 400"]').click() + cy.get(".spectrum-FieldLabel").contains("Primary color (hover)") + .parent().find(".container.svelte-z3cm5a").click() + .find('[title="Orange 400"]').click() + cy.get(".spectrum-FieldLabel").contains("Navigation bar background color") + .parent().find(".container.svelte-z3cm5a").click() + .find('[title="Yellow 400"]').click() + cy.get(".spectrum-FieldLabel").contains("Navigation bar text color") + .parent().find(".container.svelte-z3cm5a").click() + .find('[title="Green 400"]').click() + } + + const checkThemeColorDefaults = () => { + cy.get(".spectrum-FieldLabel").contains("Primary color") + .parent().find(".container.svelte-z3cm5a").click() + .get('[title="Blue 600"]').children().find('[aria-label="Checkmark"]') + cy.get(".spectrum-Dialog-grid").click() + cy.get(".spectrum-FieldLabel").contains("Primary color (hover)") + .parent().find(".container.svelte-z3cm5a").click() + .get('[title="Blue 500"]').children().find('[aria-label="Checkmark"]') + cy.get(".spectrum-Dialog-grid").click() + cy.get(".spectrum-FieldLabel").contains("Navigation bar background color") + .parent().find(".container.svelte-z3cm5a").click() + .get('[title="Gray 100"]').children().find('[aria-label="Checkmark"]') + cy.get(".spectrum-Dialog-grid").click() + cy.get(".spectrum-FieldLabel").contains("Navigation bar text color") + .parent().find(".container.svelte-z3cm5a").click() + .get('[title="Gray 800"]').children().find('[aria-label="Checkmark"]') + } + +}) \ No newline at end of file diff --git a/packages/builder/cypress/setup.js b/packages/builder/cypress/setup.js index 1a6f1d5b2b..e636f6aeb9 100644 --- a/packages/builder/cypress/setup.js +++ b/packages/builder/cypress/setup.js @@ -16,7 +16,7 @@ process.env.PORT = MAIN_PORT process.env.JWT_SECRET = cypressConfig.env.JWT_SECRET process.env.COUCH_URL = `leveldb://${tmpdir}/.data/` process.env.SELF_HOSTED = 1 -process.env.WORKER_URL = "http://localhost:10002/" +process.env.WORKER_URL = "https://test.budi.live/" process.env.MINIO_URL = `http://localhost:${MAIN_PORT}/` process.env.MINIO_ACCESS_KEY = "budibase" process.env.MINIO_SECRET_KEY = "budibase" diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index ea6ca81e66..f977ec01ec 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -6,8 +6,8 @@ // Cypress.Commands.add("login", () => { - cy.visit(`localhost:${Cypress.env("PORT")}/builder`) - cy.wait(500) + cy.visit(`https://test.budi.live/builder`) + cy.wait(2000) cy.url().then(url => { if (url.includes("builder/admin")) { // create admin user @@ -22,15 +22,17 @@ Cypress.Commands.add("login", () => { cy.get("input").first().type("test@test.com") cy.get('input[type="password"]').type("test") cy.get("button").first().click() + cy.wait(1000) }) } }) }) Cypress.Commands.add("createApp", name => { - cy.visit(`localhost:${Cypress.env("PORT")}/builder`) + cy.visit(`https://test.budi.live/builder`) cy.wait(500) cy.contains(/Create (new )?app/).click() + cy.wait(500) cy.get(".spectrum-Modal") .within(() => { cy.get("input").eq(0).type(name).should("have.value", name).blur() @@ -43,9 +45,9 @@ Cypress.Commands.add("createApp", name => { }) Cypress.Commands.add("deleteApp", () => { - cy.visit(`localhost:${Cypress.env("PORT")}/builder`) + cy.visit(`https://test.budi.live/builder`) cy.wait(1000) - cy.request(`localhost:${Cypress.env("PORT")}/api/applications?status=all`) + cy.request(`https://test.budi.live/api/applications?status=all`) .its("body") .then(val => { console.log(val) @@ -80,7 +82,7 @@ Cypress.Commands.add("createTable", tableName => { cy.contains(tableName).should("be.visible") }) -Cypress.Commands.add("addColumn", (tableName, columnName, type) => { +Cypress.Commands.add("addColumn", (tableName, columnName, type, multiOptions = null) => { // Select Table cy.selectTable(tableName) cy.contains(".nav-item", tableName).click() @@ -95,6 +97,11 @@ Cypress.Commands.add("addColumn", (tableName, columnName, type) => { cy.get(".spectrum-Picker-label").click() cy.contains(type).click() + // Add options for Multi-select Type + if(multiOptions !== null){ + cy.get(".spectrum-Textfield-input").eq(1).type(multiOptions) + } + cy.contains("Save Column").click() }) }) @@ -109,6 +116,19 @@ Cypress.Commands.add("addRow", values => { }) }) +Cypress.Commands.add("addRowMultiValue", values => { + cy.contains("Create row").click() + cy.get(".spectrum-Form-itemField").click().then(() => { + cy.get(".spectrum-Popover").within(() => { + for (let i = 0; i < values.length; i++) { + cy.get(".spectrum-Menu-item").eq(i).click() + } + }) + cy.get(".spectrum-Dialog-grid").click('top') + cy.get(".spectrum-ButtonGroup").contains("Create").click() + }) +}) + Cypress.Commands.add("createUser", email => { // quick hacky recorded way to create a user cy.contains("Users").click() @@ -127,7 +147,9 @@ Cypress.Commands.add("addComponent", (category, component) => { if (category) { cy.get(`[data-cy="category-${category}"]`).click() } - cy.get(`[data-cy="component-${component}"]`).click() + if (component){ + cy.get(`[data-cy="component-${component}"]`).click() + } cy.wait(1000) cy.location().then(loc => { const params = loc.pathname.split("/") @@ -149,8 +171,11 @@ Cypress.Commands.add("getComponent", componentId => { }) Cypress.Commands.add("navigateToFrontend", () => { + // Clicks on Design tab and then the Home nav item cy.wait(1000) cy.contains("Design").click() + cy.get(".spectrum-Search").type("/") + cy.get(".nav-item").contains("Home").click() }) Cypress.Commands.add("createScreen", (screenName, route) => { @@ -173,3 +198,18 @@ Cypress.Commands.add("selectTable", tableName => { cy.expandBudibaseConnection() cy.contains(".nav-item", tableName).click() }) + +Cypress.Commands.add("addCustomSourceOptions", totalOptions => { + cy.get(".spectrum-ActionButton").contains("Define Options").click().then(() => { + for (let i = 0; i < totalOptions; i++) { + // Add radio button options + cy.get(".spectrum-Button").contains("Add Option").click({force: true}).then(() => { + cy.wait(500) + cy.get("[placeholder='Label']").eq(i).type(i) + cy.get("[placeholder='Value']").eq(i).type(i) + }) + } + // Save options + cy.get(".spectrum-Button").contains("Save").click({force: true}) + }) +}) \ No newline at end of file From ee9a1135babe68e17c4d068498e7693205535e55 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 30 Sep 2021 13:52:20 +0100 Subject: [PATCH 02/43] Changing Environment I had this as the test env, changing it back to what it was previously. --- packages/builder/cypress.json | 2 +- .../cypress/integration/addMultiOptionDatatype.spec.js | 2 +- .../builder/cypress/integration/addRadioButtons.spec.js | 4 ---- packages/builder/cypress/integration/createApp.spec.js | 2 +- packages/builder/cypress/integration/createView.spec.js | 4 ---- .../cypress/integration/customThemingProperties.spec.js | 2 +- packages/builder/cypress/support/commands.js | 8 ++++---- 7 files changed, 8 insertions(+), 16 deletions(-) diff --git a/packages/builder/cypress.json b/packages/builder/cypress.json index cd63e19b01..0908f2c839 100644 --- a/packages/builder/cypress.json +++ b/packages/builder/cypress.json @@ -1,5 +1,5 @@ { - "baseUrl": "https://test.budi.live/builder/", + "baseUrl": "http://localhost:10001/builder/", "video": true, "projectId": "bmbemn", "env": { diff --git a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js index 5d4860ccec..032d8b01b5 100644 --- a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js +++ b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js @@ -37,4 +37,4 @@ context("Add Multi-Option Datatype", () => { cy.getComponent(componentId).find('.spectrum-Picker-label').contains("(5)") }) }) -}) \ No newline at end of file +}) diff --git a/packages/builder/cypress/integration/addRadioButtons.spec.js b/packages/builder/cypress/integration/addRadioButtons.spec.js index ef16a02137..68d0a74d55 100644 --- a/packages/builder/cypress/integration/addRadioButtons.spec.js +++ b/packages/builder/cypress/integration/addRadioButtons.spec.js @@ -33,7 +33,3 @@ it("should add Radio Buttons options picker on form, add data, and confirm", () cy.addCustomSourceOptions(totalRadioButtons) } }) - - - - diff --git a/packages/builder/cypress/integration/createApp.spec.js b/packages/builder/cypress/integration/createApp.spec.js index 21732b9f3a..34f152b540 100644 --- a/packages/builder/cypress/integration/createApp.spec.js +++ b/packages/builder/cypress/integration/createApp.spec.js @@ -2,7 +2,7 @@ context("Create an Application", () => { it("should create a new application", () => { cy.login() cy.createTestApp() - cy.visit(`https://test.budi.live/builder`) + cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.contains("Cypress Tests").should("exist") }) }) diff --git a/packages/builder/cypress/integration/createView.spec.js b/packages/builder/cypress/integration/createView.spec.js index aab8845836..d7d9606cd7 100644 --- a/packages/builder/cypress/integration/createView.spec.js +++ b/packages/builder/cypress/integration/createView.spec.js @@ -1,7 +1,3 @@ -Cypress.on('uncaught:exception', (err, runnable) => { - return false; -}); - context("Create a View", () => { before(() => { cy.login() diff --git a/packages/builder/cypress/integration/customThemingProperties.spec.js b/packages/builder/cypress/integration/customThemingProperties.spec.js index f0004b1343..47cb81a8a6 100644 --- a/packages/builder/cypress/integration/customThemingProperties.spec.js +++ b/packages/builder/cypress/integration/customThemingProperties.spec.js @@ -58,4 +58,4 @@ context("Custom Theming Properties", () => { .get('[title="Gray 800"]').children().find('[aria-label="Checkmark"]') } -}) \ No newline at end of file +}) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 3d96dd282f..90fc94ffb6 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -6,7 +6,7 @@ // Cypress.Commands.add("login", () => { - cy.visit(`https://test.budi.live/builder`) + cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.wait(2000) cy.url().then(url => { if (url.includes("builder/admin")) { @@ -29,7 +29,7 @@ Cypress.Commands.add("login", () => { }) Cypress.Commands.add("createApp", name => { - cy.visit(`https://test.budi.live/builder`) + cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.wait(500) cy.contains(/Create (new )?app/).click() cy.wait(500) @@ -48,7 +48,7 @@ Cypress.Commands.add("createApp", name => { }) Cypress.Commands.add("deleteApp", () => { - cy.visit(`https://test.budi.live/builder`) + cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.wait(1000) cy.request(`https://test.budi.live/api/applications?status=all`) .its("body") @@ -232,4 +232,4 @@ Cypress.Commands.add("addCustomSourceOptions", totalOptions => { // Save options cy.get(".spectrum-Button").contains("Save").click({force: true}) }) -}) \ No newline at end of file +}) From 108b5b0969d5392a7fdbdb7a1e68081a1436f09c Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 30 Sep 2021 14:00:26 +0100 Subject: [PATCH 03/43] changing worker-url --- packages/builder/cypress/setup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/cypress/setup.js b/packages/builder/cypress/setup.js index e636f6aeb9..1a6f1d5b2b 100644 --- a/packages/builder/cypress/setup.js +++ b/packages/builder/cypress/setup.js @@ -16,7 +16,7 @@ process.env.PORT = MAIN_PORT process.env.JWT_SECRET = cypressConfig.env.JWT_SECRET process.env.COUCH_URL = `leveldb://${tmpdir}/.data/` process.env.SELF_HOSTED = 1 -process.env.WORKER_URL = "https://test.budi.live/" +process.env.WORKER_URL = "http://localhost:10002/" process.env.MINIO_URL = `http://localhost:${MAIN_PORT}/` process.env.MINIO_ACCESS_KEY = "budibase" process.env.MINIO_SECRET_KEY = "budibase" From 2516d9bdc0b449938e36493133c7bc0f68b557af Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Thu, 30 Sep 2021 14:09:37 +0100 Subject: [PATCH 04/43] Fixing env change that i missed in commands file --- packages/builder/cypress/support/commands.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 90fc94ffb6..0309299468 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -50,7 +50,7 @@ Cypress.Commands.add("createApp", name => { Cypress.Commands.add("deleteApp", () => { cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.wait(1000) - cy.request(`https://test.budi.live/api/applications?status=all`) + cy.request(`localhost:${Cypress.env("PORT")}/api/applications?status=all`) .its("body") .then(val => { console.log(val) From 8699d7293b69d894c028ea030ae2c028bf5fab4d Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Oct 2021 15:31:32 +0100 Subject: [PATCH 05/43] Fixing an issue with new data source creation, could not view fetched tables until refresh page. --- packages/auth/src/redis/index.js | 6 ++++++ .../DatasourceNavigator/modals/DatasourceConfigModal.svelte | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/auth/src/redis/index.js b/packages/auth/src/redis/index.js index 48a24ad0bc..0ee17265ce 100644 --- a/packages/auth/src/redis/index.js +++ b/packages/auth/src/redis/index.js @@ -191,6 +191,12 @@ class RedisWrapper { } } + async getTTL(key) { + const db = this._db + const prefixedKey = addDbPrefix(db, key) + return CLIENT.ttl(prefixedKey) + } + async setExpiry(key, expirySeconds) { const db = this._db const prefixedKey = addDbPrefix(db, key) diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index 56fa26ee0a..ca8d29708e 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -3,7 +3,7 @@ import { ModalContent, notifications, Body, Layout } from "@budibase/bbui" import analytics, { Events } from "analytics" import IntegrationConfigForm from "components/backend/DatasourceNavigator/TableIntegrationMenu/IntegrationConfigForm.svelte" - import { datasources } from "stores/backend" + import { datasources, tables } from "stores/backend" import { IntegrationNames } from "constants" export let integration @@ -32,6 +32,8 @@ // Create datasource const resp = await datasources.save(datasource, datasource.plus) + // update the tables incase data source plus + await tables.fetch() await datasources.select(resp._id) $goto(`./datasource/${resp._id}`) notifications.success(`Datasource updated successfully.`) From 2b0bdffa6586d49b6d838572b2632db95aa7a194 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Oct 2021 16:27:46 +0100 Subject: [PATCH 06/43] Fixing an issue with attempting to access a locked app causes a redirect loop locking up browser. --- .../src/builderStore/store/frontend.js | 8 +++++++ .../DatasourceNavigator.svelte | 22 ++++++++++--------- .../modals/DatasourceConfigModal.svelte | 6 +++-- .../builder/app/[application]/_layout.svelte | 13 +++++++++-- packages/server/src/middleware/builder.js | 2 +- 5 files changed, 36 insertions(+), 15 deletions(-) diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index c567454eff..9110aa1430 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -67,6 +67,14 @@ export const getFrontendStore = () => { initialise: async pkg => { const { layouts, screens, application, clientLibPath } = pkg const components = await fetchComponentLibDefinitions(application.appId) + // make sure app isn't locked + if ( + components && + components.status === 400 && + components.message?.includes("lock") + ) { + throw { ok: false, reason: "locked" } + } store.update(state => ({ ...state, libraries: application.componentLibraries, diff --git a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte index 3c6fa83c01..796f70b43b 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/DatasourceNavigator.svelte @@ -11,16 +11,18 @@ import ICONS from "./icons" let openDataSources = [] - $: enrichedDataSources = $datasources.list.map(datasource => { - const selected = $datasources.selected === datasource._id - const open = openDataSources.includes(datasource._id) - const containsSelected = containsActiveEntity(datasource) - return { - ...datasource, - selected, - open: selected || open || containsSelected, - } - }) + $: enrichedDataSources = Array.isArray($datasources.list) + ? $datasources.list.map(datasource => { + const selected = $datasources.selected === datasource._id + const open = openDataSources.includes(datasource._id) + const containsSelected = containsActiveEntity(datasource) + return { + ...datasource, + selected, + open: selected || open || containsSelected, + } + }) + : [] $: openDataSource = enrichedDataSources.find(x => x.open) $: { // Ensure the open data source is always included in the list of open diff --git a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte index ca8d29708e..7074430889 100644 --- a/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte +++ b/packages/builder/src/components/backend/DatasourceNavigator/modals/DatasourceConfigModal.svelte @@ -11,12 +11,14 @@ function prepareData() { let datasource = {} let existingTypeCount = $datasources.list.filter( - ds => ds.source == integration.type + ds => ds.source === integration.type ).length let baseName = IntegrationNames[integration.type] let name = - existingTypeCount == 0 ? baseName : `${baseName}-${existingTypeCount + 1}` + existingTypeCount === 0 + ? baseName + : `${baseName}-${existingTypeCount + 1}` datasource.type = "datasource" datasource.source = integration.type diff --git a/packages/builder/src/pages/builder/app/[application]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/_layout.svelte index aaf948883d..603fb62d99 100644 --- a/packages/builder/src/pages/builder/app/[application]/_layout.svelte +++ b/packages/builder/src/pages/builder/app/[application]/_layout.svelte @@ -8,7 +8,7 @@ import NPSFeedbackForm from "components/feedback/NPSFeedbackForm.svelte" import { get } from "builderStore/api" import { auth, admin } from "stores/portal" - import { isActive, goto, layout } from "@roxi/routify" + import { isActive, goto, layout, redirect } from "@roxi/routify" import Logo from "assets/bb-emblem.svg" import { capitalise } from "helpers" import UpgradeModal from "../../../../components/upgrade/UpgradeModal.svelte" @@ -34,7 +34,16 @@ const pkg = await res.json() if (res.ok) { - await store.actions.initialise(pkg) + try { + await store.actions.initialise(pkg) + // edge case, lock wasn't known to client when it re-directed, or user went directly + } catch (err) { + if (!err.ok && err.reason === "locked") { + $redirect("../../") + } else { + throw err + } + } await automationStore.actions.fetch() await roles.fetch() return pkg diff --git a/packages/server/src/middleware/builder.js b/packages/server/src/middleware/builder.js index 240a2d1912..8ea49a3b48 100644 --- a/packages/server/src/middleware/builder.js +++ b/packages/server/src/middleware/builder.js @@ -33,7 +33,7 @@ async function checkDevAppLocks(ctx) { return } if (!(await doesUserHaveLock(appId, ctx.user))) { - ctx.throw(403, "User does not hold app lock.") + ctx.throw(400, "User does not hold app lock.") } // they do have lock, update it From f96b0c95e8e8b2c3b0a9921be73184c849a7aa4d Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 6 Oct 2021 15:36:11 +0000 Subject: [PATCH 07/43] v0.9.153 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 9ac2a8d4d2..67c0d105df 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.153-alpha.1", + "version": "0.9.153", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 88d5ace67b..aad357fb8d 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index facc46b82d..5110e4bc41 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 9ee2044a1a..369f7d1a7f 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.153-alpha.1", - "@budibase/client": "^0.9.153-alpha.1", + "@budibase/bbui": "^0.9.153", + "@budibase/client": "^0.9.153", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/string-templates": "^0.9.153", "@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 37d316b17a..865ac4d637 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 3e932a9f1c..c9cbe1a9ff 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "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": "^0.9.153-alpha.1", + "@budibase/bbui": "^0.9.153", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/string-templates": "^0.9.153", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 6a04c3f4e9..dd49450c36 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153-alpha.1", - "@budibase/client": "^0.9.153-alpha.1", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/auth": "^0.9.153", + "@budibase/client": "^0.9.153", + "@budibase/string-templates": "^0.9.153", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 401f34013e..9085f74122 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index f0d196b2e6..7f081dacd6 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.153-alpha.1", + "version": "0.9.153", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153-alpha.1", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/auth": "^0.9.153", + "@budibase/string-templates": "^0.9.153", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 322ef42713dc0f01415fa687493f3aa6e48dcd0f Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Wed, 6 Oct 2021 16:50:15 +0100 Subject: [PATCH 08/43] Honour cookie domain when custom sso is enabled --- packages/worker/src/api/controllers/global/auth.js | 12 +++++++++--- packages/worker/src/environment.js | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/worker/src/api/controllers/global/auth.js b/packages/worker/src/api/controllers/global/auth.js index f3188d7777..4e5603b596 100644 --- a/packages/worker/src/api/controllers/global/auth.js +++ b/packages/worker/src/api/controllers/global/auth.js @@ -41,13 +41,19 @@ async function authInternal(ctx, user, err = null, info = null) { return ctx.throw(403, info ? info : "Unauthorized") } - // just store the user ID - ctx.cookies.set(Cookies.Auth, user.token, { + const config = { expires, path: "/", httpOnly: false, overwrite: true, - }) + } + + if (env.COOKIE_DOMAIN) { + config.domain = env.COOKIE_DOMAIN + } + + // just store the user ID + ctx.cookies.set(Cookies.Auth, user.token, config) } exports.authenticate = async (ctx, next) => { diff --git a/packages/worker/src/environment.js b/packages/worker/src/environment.js index 0ef83a327e..74bd40314c 100644 --- a/packages/worker/src/environment.js +++ b/packages/worker/src/environment.js @@ -41,6 +41,7 @@ module.exports = { SMTP_PORT: process.env.SMTP_PORT, SMTP_FROM_ADDRESS: process.env.SMTP_FROM_ADDRESS, PLATFORM_URL: process.env.PLATFORM_URL, + COOKIE_DOMAIN: process.env.COOKIE_DOMAIN, _set(key, value) { process.env[key] = value module.exports[key] = value From bd05793063e91a4de3b575e10f0f4b7fbfe180de Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 6 Oct 2021 16:12:27 +0000 Subject: [PATCH 09/43] v0.9.153-alpha.2 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 9ac2a8d4d2..6f4c9adb93 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 88d5ace67b..abf2895197 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index facc46b82d..84be0ebe09 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 9ee2044a1a..fc1a14d4cf 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.153-alpha.1", - "@budibase/client": "^0.9.153-alpha.1", + "@budibase/bbui": "^0.9.153-alpha.2", + "@budibase/client": "^0.9.153-alpha.2", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/string-templates": "^0.9.153-alpha.2", "@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 37d316b17a..183c4d8e52 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 3e932a9f1c..8527b24acb 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "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": "^0.9.153-alpha.1", + "@budibase/bbui": "^0.9.153-alpha.2", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/string-templates": "^0.9.153-alpha.2", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 6a04c3f4e9..1964f0569a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153-alpha.1", - "@budibase/client": "^0.9.153-alpha.1", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/auth": "^0.9.153-alpha.2", + "@budibase/client": "^0.9.153-alpha.2", + "@budibase/string-templates": "^0.9.153-alpha.2", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 401f34013e..52858874c2 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index f0d196b2e6..51162af912 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.153-alpha.1", + "version": "0.9.153-alpha.2", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153-alpha.1", - "@budibase/string-templates": "^0.9.153-alpha.1", + "@budibase/auth": "^0.9.153-alpha.2", + "@budibase/string-templates": "^0.9.153-alpha.2", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 32a6e40291dc9121de8fa4165361fd372767bdaf Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 6 Oct 2021 16:34:29 +0000 Subject: [PATCH 10/43] v0.9.154-alpha.0 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 67c0d105df..7c30f2a30c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.153", + "version": "0.9.154-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index aad357fb8d..4502641218 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 5110e4bc41..7863c5eadb 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 369f7d1a7f..0f8847c237 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.153", - "@budibase/client": "^0.9.153", + "@budibase/bbui": "^0.9.154-alpha.0", + "@budibase/client": "^0.9.154-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.153", + "@budibase/string-templates": "^0.9.154-alpha.0", "@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 865ac4d637..09aacd9074 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index c9cbe1a9ff..763a277239 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "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": "^0.9.153", + "@budibase/bbui": "^0.9.154-alpha.0", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.153", + "@budibase/string-templates": "^0.9.154-alpha.0", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index dd49450c36..bb46c4644d 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153", - "@budibase/client": "^0.9.153", - "@budibase/string-templates": "^0.9.153", + "@budibase/auth": "^0.9.154-alpha.0", + "@budibase/client": "^0.9.154-alpha.0", + "@budibase/string-templates": "^0.9.154-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 9085f74122..c1f2432c51 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 7f081dacd6..a179e58b9e 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.153", + "version": "0.9.154-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153", - "@budibase/string-templates": "^0.9.153", + "@budibase/auth": "^0.9.154-alpha.0", + "@budibase/string-templates": "^0.9.154-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 9ca8c3fda628572c49bc23cc0734cf2daa4e68fb Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 6 Oct 2021 16:37:28 +0000 Subject: [PATCH 11/43] v0.9.154 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 67c0d105df..2822d6ad36 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.153", + "version": "0.9.154", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index aad357fb8d..26828277c7 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.153", + "version": "0.9.154", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 5110e4bc41..9288f2bbdb 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.153", + "version": "0.9.154", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 369f7d1a7f..a73628fb87 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.153", + "version": "0.9.154", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.153", - "@budibase/client": "^0.9.153", + "@budibase/bbui": "^0.9.154", + "@budibase/client": "^0.9.154", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.153", + "@budibase/string-templates": "^0.9.154", "@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 865ac4d637..7fcb7410c5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.153", + "version": "0.9.154", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index c9cbe1a9ff..08caa98423 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.153", + "version": "0.9.154", "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": "^0.9.153", + "@budibase/bbui": "^0.9.154", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.153", + "@budibase/string-templates": "^0.9.154", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index dd49450c36..e8ad5b383a 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.153", + "version": "0.9.154", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153", - "@budibase/client": "^0.9.153", - "@budibase/string-templates": "^0.9.153", + "@budibase/auth": "^0.9.154", + "@budibase/client": "^0.9.154", + "@budibase/string-templates": "^0.9.154", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 9085f74122..7b30e876cb 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.153", + "version": "0.9.154", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 7f081dacd6..c520ce1baf 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.153", + "version": "0.9.154", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.153", - "@budibase/string-templates": "^0.9.153", + "@budibase/auth": "^0.9.154", + "@budibase/string-templates": "^0.9.154", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 3878cf76cd3b811193a4c4550f2305cb0c293e21 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Oct 2021 17:38:32 +0100 Subject: [PATCH 12/43] Fixing issue #2788 - making client side queries and SQL queries consistent with internal table ones. --- packages/builder/src/constants/lucene.js | 9 +++++++ packages/builder/src/helpers/lucene.js | 25 +++++++++++++++++++ .../src/api/controllers/row/external.js | 14 +++++++++++ packages/server/src/constants/index.js | 23 +++++++++++++++++ packages/server/src/integrations/base/sql.ts | 6 +++++ 5 files changed, 77 insertions(+) diff --git a/packages/builder/src/constants/lucene.js b/packages/builder/src/constants/lucene.js index 00da0c29bc..132790739c 100644 --- a/packages/builder/src/constants/lucene.js +++ b/packages/builder/src/constants/lucene.js @@ -44,6 +44,15 @@ export const OperatorOptions = { }, } +export const NoEmptyFilterStrings = [ + OperatorOptions.StartsWith.value, + OperatorOptions.Like.value, + OperatorOptions.Equals.value, + OperatorOptions.NotEquals.value, + OperatorOptions.Contains.value, + OperatorOptions.NotContains.value, +] + /** * Returns the valid operator options for a certain data type * @param type the data type diff --git a/packages/builder/src/helpers/lucene.js b/packages/builder/src/helpers/lucene.js index 03baa751cc..d344b462d1 100644 --- a/packages/builder/src/helpers/lucene.js +++ b/packages/builder/src/helpers/lucene.js @@ -1,3 +1,26 @@ +import { NoEmptyFilterStrings } from "../constants/lucene" + +/** + * Removes any fields that contain empty strings that would cause inconsistent + * behaviour with how backend tables are filtered (no value means no filter). + */ +function cleanupQuery(query) { + if (!query) { + return query + } + for (let filterField of NoEmptyFilterStrings) { + if (!query[filterField]) { + continue + } + for (let [key, value] of Object.entries(query[filterField])) { + if (!value || value === "") { + delete query[filterField][key] + } + } + } + return query +} + /** * Builds a lucene JSON query from the filter structure generated in the builder * @param filter the builder filter structure @@ -76,6 +99,8 @@ export const luceneQuery = (docs, query) => { if (!query) { return docs } + // make query consistent first + query = cleanupQuery(query) // Iterates over a set of filters and evaluates a fail function against a doc const match = (type, failFn) => doc => { diff --git a/packages/server/src/api/controllers/row/external.js b/packages/server/src/api/controllers/row/external.js index 3a96064a9f..534f2207b0 100644 --- a/packages/server/src/api/controllers/row/external.js +++ b/packages/server/src/api/controllers/row/external.js @@ -2,6 +2,7 @@ const { DataSourceOperation, SortDirection, FieldTypes, + NoEmptyFilterStrings, } = require("../../../constants") const { breakExternalTableId, @@ -11,6 +12,19 @@ const ExternalRequest = require("./ExternalRequest") const CouchDB = require("../../../db") async function handleRequest(appId, operation, tableId, opts = {}) { + // make sure the filters are cleaned up, no empty strings for equals, fuzzy or string + if (opts && opts.filters) { + for (let filterField of NoEmptyFilterStrings) { + if (!opts.filters[filterField]) { + continue + } + for (let [key, value] of Object.entries(opts.filters[filterField])) { + if (!value || value === "") { + delete opts.filters[filterField][key] + } + } + } + } return new ExternalRequest(appId, operation, tableId, opts.datasource).run( opts ) diff --git a/packages/server/src/constants/index.js b/packages/server/src/constants/index.js index bea58fd260..d19f9ff313 100644 --- a/packages/server/src/constants/index.js +++ b/packages/server/src/constants/index.js @@ -6,6 +6,29 @@ exports.JobQueues = { AUTOMATIONS: "automationQueue", } +const FilterTypes = { + STRING: "string", + FUZZY: "fuzzy", + RANGE: "range", + EQUAL: "equal", + NOT_EQUAL: "notEqual", + EMPTY: "empty", + NOT_EMPTY: "notEmpty", + CONTAINS: "contains", + NOT_CONTAINS: "notContains", + ONE_OF: "oneOf", +} + +exports.FilterTypes = FilterTypes +exports.NoEmptyFilterStrings = [ + FilterTypes.STRING, + FilterTypes.FUZZY, + FilterTypes.EQUAL, + FilterTypes.NOT_EQUAL, + FilterTypes.CONTAINS, + FilterTypes.NOT_CONTAINS, +] + exports.FieldTypes = { STRING: "string", LONGFORM: "longform", diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index 6bd2137f99..a12d8c3c08 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -55,6 +55,12 @@ function addFilters( query = query[fnc](key, "ilike", `${value}%`) }) } + if (filters.fuzzy) { + iterate(filters.fuzzy, (key, value) => { + const fnc = allOr ? "orWhere" : "where" + query = query[fnc](key, "ilike", `%${value}%`) + }) + } if (filters.range) { iterate(filters.range, (key, value) => { if (!value.high || !value.low) { From 1684f182176434372d5361527ecd8a9586db4a9b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Oct 2021 17:52:12 +0100 Subject: [PATCH 13/43] Fixing issue #2276 - allows reverting a SQL column to null if no input. --- packages/server/src/api/controllers/row/ExternalRequest.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/server/src/api/controllers/row/ExternalRequest.ts b/packages/server/src/api/controllers/row/ExternalRequest.ts index 3e9c707e69..222f921018 100644 --- a/packages/server/src/api/controllers/row/ExternalRequest.ts +++ b/packages/server/src/api/controllers/row/ExternalRequest.ts @@ -178,7 +178,12 @@ module External { manyRelationships: ManyRelationship[] = [] for (let [key, field] of Object.entries(table.schema)) { // if set already, or not set just skip it - if (!row[key] || newRow[key] || field.autocolumn) { + if ((!row[key] && row[key] !== "") || newRow[key] || field.autocolumn) { + continue + } + // if its an empty string then it means return the column to null (if possible) + if (row[key] === "") { + newRow[key] = null continue } // parse floats/numbers From 1fbd84b629ad3f748b1e78561185ef57db072127 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 6 Oct 2021 17:55:03 +0100 Subject: [PATCH 14/43] Making sure creation of SQL rows don't pass down null columns (no point). --- packages/server/src/integrations/base/sql.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/server/src/integrations/base/sql.ts b/packages/server/src/integrations/base/sql.ts index a12d8c3c08..4130900217 100644 --- a/packages/server/src/integrations/base/sql.ts +++ b/packages/server/src/integrations/base/sql.ts @@ -141,6 +141,12 @@ function buildCreate( const { endpoint, body } = json let query: KnexQuery = knex(endpoint.entityId) const parsedBody = parseBody(body) + // make sure no null values in body for creation + for (let [key, value] of Object.entries(parsedBody)) { + if (value == null) { + delete parsedBody[key] + } + } // mysql can't use returning if (opts.disableReturning) { return query.insert(parsedBody) From 399b6ba32737fd4fa94f19d0d9cd5ba9bda1b853 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Wed, 6 Oct 2021 18:20:14 +0000 Subject: [PATCH 15/43] v0.9.154-alpha.1 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 7c30f2a30c..1102d1e9d0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 4502641218..bc890882f7 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 7863c5eadb..2657593a0c 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 0f8847c237..44233f152a 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.154-alpha.0", - "@budibase/client": "^0.9.154-alpha.0", + "@budibase/bbui": "^0.9.154-alpha.1", + "@budibase/client": "^0.9.154-alpha.1", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.154-alpha.0", + "@budibase/string-templates": "^0.9.154-alpha.1", "@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 09aacd9074..62a90b5c6d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 763a277239..d4ddb724f3 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "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": "^0.9.154-alpha.0", + "@budibase/bbui": "^0.9.154-alpha.1", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.154-alpha.0", + "@budibase/string-templates": "^0.9.154-alpha.1", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index bb46c4644d..afe8bebf2c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.154-alpha.0", - "@budibase/client": "^0.9.154-alpha.0", - "@budibase/string-templates": "^0.9.154-alpha.0", + "@budibase/auth": "^0.9.154-alpha.1", + "@budibase/client": "^0.9.154-alpha.1", + "@budibase/string-templates": "^0.9.154-alpha.1", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index c1f2432c51..923ed47404 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index a179e58b9e..d996413f98 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.154-alpha.0", + "version": "0.9.154-alpha.1", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.154-alpha.0", - "@budibase/string-templates": "^0.9.154-alpha.0", + "@budibase/auth": "^0.9.154-alpha.1", + "@budibase/string-templates": "^0.9.154-alpha.1", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 2a8d5814b1e80a5942b56986b74e4580f6609568 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Wed, 6 Oct 2021 21:26:52 +0000 Subject: [PATCH 16/43] v0.9.155 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 2822d6ad36..057da4bae4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.154", + "version": "0.9.155", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 26828277c7..1ef946f5d0 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.154", + "version": "0.9.155", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 9288f2bbdb..387b29878e 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.154", + "version": "0.9.155", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index a73628fb87..e8aaf2a2ac 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.154", + "version": "0.9.155", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.154", - "@budibase/client": "^0.9.154", + "@budibase/bbui": "^0.9.155", + "@budibase/client": "^0.9.155", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.154", + "@budibase/string-templates": "^0.9.155", "@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 7fcb7410c5..64f99f62c8 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.154", + "version": "0.9.155", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 08caa98423..02b2ab086d 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.154", + "version": "0.9.155", "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": "^0.9.154", + "@budibase/bbui": "^0.9.155", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.154", + "@budibase/string-templates": "^0.9.155", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index e8ad5b383a..d3800a697c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.154", + "version": "0.9.155", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.154", - "@budibase/client": "^0.9.154", - "@budibase/string-templates": "^0.9.154", + "@budibase/auth": "^0.9.155", + "@budibase/client": "^0.9.155", + "@budibase/string-templates": "^0.9.155", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 7b30e876cb..9eb6258383 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.154", + "version": "0.9.155", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index c520ce1baf..3367780ad4 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.154", + "version": "0.9.155", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.154", - "@budibase/string-templates": "^0.9.154", + "@budibase/auth": "^0.9.155", + "@budibase/string-templates": "^0.9.155", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From be5f3a84ca191baef2b767127dc2e723b5cb33e1 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 08:32:14 +0100 Subject: [PATCH 17/43] Fixing minor mistake. --- packages/server/src/middleware/currentapp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/server/src/middleware/currentapp.js b/packages/server/src/middleware/currentapp.js index 55a657add0..e523850e1d 100644 --- a/packages/server/src/middleware/currentapp.js +++ b/packages/server/src/middleware/currentapp.js @@ -58,7 +58,7 @@ module.exports = async (ctx, next) => { // If user and app tenant Ids do not match, 403 if (env.MULTI_TENANCY && ctx.user) { const userTenantId = getTenantId() - const tenantId = getTenantIDFromAppID(ctx.appId) || DEFAULT_TENANT_ID + const tenantId = getTenantIDFromAppID(appId) || DEFAULT_TENANT_ID if (tenantId !== userTenantId) { ctx.throw(403, "Cannot access application.") } From 4b96866cd26f746d132adc7aa6e5416d2db884d9 Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 7 Oct 2021 07:50:40 +0000 Subject: [PATCH 18/43] v0.9.156 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 057da4bae4..d761f49f6d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.155", + "version": "0.9.156", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 1ef946f5d0..c2b70119de 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.155", + "version": "0.9.156", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 387b29878e..35ae9f46a7 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.155", + "version": "0.9.156", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index e8aaf2a2ac..e97c1aa4bd 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.155", + "version": "0.9.156", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.155", - "@budibase/client": "^0.9.155", + "@budibase/bbui": "^0.9.156", + "@budibase/client": "^0.9.156", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.155", + "@budibase/string-templates": "^0.9.156", "@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 64f99f62c8..32a1fded6d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.155", + "version": "0.9.156", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 02b2ab086d..cab9a8fe65 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.155", + "version": "0.9.156", "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": "^0.9.155", + "@budibase/bbui": "^0.9.156", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.155", + "@budibase/string-templates": "^0.9.156", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index d3800a697c..c1de0be72c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.155", + "version": "0.9.156", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.155", - "@budibase/client": "^0.9.155", - "@budibase/string-templates": "^0.9.155", + "@budibase/auth": "^0.9.156", + "@budibase/client": "^0.9.156", + "@budibase/string-templates": "^0.9.156", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 9eb6258383..ef9c4ae10d 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.155", + "version": "0.9.156", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 3367780ad4..58284e108b 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.155", + "version": "0.9.156", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.155", - "@budibase/string-templates": "^0.9.155", + "@budibase/auth": "^0.9.156", + "@budibase/string-templates": "^0.9.156", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From ff7683bb0b6c6edbc60389d55156f5f207e7c8fb Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 11:14:36 +0100 Subject: [PATCH 19/43] fix view export --- .../src/components/backend/DataTable/ViewDataTable.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte index 9913333054..a52fbdb177 100644 --- a/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte +++ b/packages/builder/src/components/backend/DataTable/ViewDataTable.svelte @@ -68,5 +68,5 @@ {/if} - + From 910477a7653547533e6fe115a82424b365df5a62 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 11:26:09 +0100 Subject: [PATCH 20/43] fix table view export in prod --- packages/server/src/api/controllers/view/utils.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/server/src/api/controllers/view/utils.js b/packages/server/src/api/controllers/view/utils.js index 1f3b980882..27fccaf47f 100644 --- a/packages/server/src/api/controllers/view/utils.js +++ b/packages/server/src/api/controllers/view/utils.js @@ -2,6 +2,8 @@ const { ViewNames, generateMemoryViewID, getMemoryViewParams, + DocumentTypes, + SEPARATOR, } = require("../../../db/utils") const env = require("../../../environment") @@ -10,6 +12,11 @@ exports.getView = async (db, viewName) => { const designDoc = await db.get("_design/database") return designDoc.views[viewName] } else { + // This is a table view, don't read the view from the DB + if (viewName.startsWith(DocumentTypes.TABLE + SEPARATOR)) { + return null + } + const viewDoc = await db.get(generateMemoryViewID(viewName)) return viewDoc.view } From ddcced8c81659e47d64e8f833412800a74eed85d Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 11:48:38 +0100 Subject: [PATCH 21/43] CSS fixes for template themes --- packages/builder/src/components/start/TemplateList.svelte | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/builder/src/components/start/TemplateList.svelte b/packages/builder/src/components/start/TemplateList.svelte index 576415762a..deddd92880 100644 --- a/packages/builder/src/components/start/TemplateList.svelte +++ b/packages/builder/src/components/start/TemplateList.svelte @@ -33,7 +33,10 @@ {/each}
onSelect(null)}> -
+
Start from scratch @@ -74,7 +77,7 @@ align-items: center; cursor: pointer; border-radius: 4px; - background: #1a1a1a; + background: var(--background-alt); padding: 8px 16px; } From b9a47f096d846fb6631f9e9c2fed9517dbb82364 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 12:03:08 +0100 Subject: [PATCH 22/43] fix intercom createdAt --- packages/builder/src/stores/portal/auth.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/builder/src/stores/portal/auth.js b/packages/builder/src/stores/portal/auth.js index f522095473..7beb25a1b4 100644 --- a/packages/builder/src/stores/portal/auth.js +++ b/packages/builder/src/stores/portal/auth.js @@ -56,7 +56,7 @@ export function createAuthStore() { analytics.identify(user._id, user) analytics.showChat({ email: user.email, - created_at: user.createdAt || Date.now(), + created_at: (user.createdAt || Date.now()) / 1000, name: user.name, user_id: user._id, tenant: user.tenantId, From eead9b07b3d6a26b84946cdf51dfe53ff26a2665 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 12:15:05 +0100 Subject: [PATCH 23/43] fix user ping event --- packages/server/src/api/controllers/analytics.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/server/src/api/controllers/analytics.js b/packages/server/src/api/controllers/analytics.js index e6e5d6a748..0c0761840e 100644 --- a/packages/server/src/api/controllers/analytics.js +++ b/packages/server/src/api/controllers/analytics.js @@ -21,9 +21,12 @@ exports.endUserPing = async ctx => { return } - posthogClient.capture("budibase:end_user_ping", { - userId: ctx.user && ctx.user._id, - appId: ctx.appId, + posthogClient.capture({ + event: "budibase:end_user_ping", + distinctId: ctx.user && ctx.user._id, + properties: { + appId: ctx.appId, + }, }) ctx.body = { From 245c92482c11bfcec1984cd3113e611547378c53 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 12:19:23 +0100 Subject: [PATCH 24/43] Fix an issue with current app cookie, get rid of it on login/logout. --- packages/worker/src/api/controllers/global/auth.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/worker/src/api/controllers/global/auth.js b/packages/worker/src/api/controllers/global/auth.js index 4e5603b596..76768d1700 100644 --- a/packages/worker/src/api/controllers/global/auth.js +++ b/packages/worker/src/api/controllers/global/auth.js @@ -54,6 +54,8 @@ async function authInternal(ctx, user, err = null, info = null) { // just store the user ID ctx.cookies.set(Cookies.Auth, user.token, config) + // get rid of any app cookies on login + clearCookie(ctx, Cookies.CurrentApp) } exports.authenticate = async (ctx, next) => { @@ -117,6 +119,7 @@ exports.resetUpdate = async ctx => { exports.logout = async ctx => { clearCookie(ctx, Cookies.Auth) + clearCookie(ctx, Cookies.CurrentApp) ctx.body = { message: "User logged out." } } From ad9e5e4334aa78168e3c3baacd2091bc8b41510e Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 14:06:28 +0100 Subject: [PATCH 25/43] Fixing an issue with handlebars-helpers --- packages/string-templates/package.json | 2 +- packages/string-templates/yarn.lock | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index ef9c4ae10d..5914389f5c 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -20,7 +20,7 @@ "manifest": "node ./scripts/gen-collection-info.js" }, "dependencies": { - "@budibase/handlebars-helpers": "^0.11.6", + "@budibase/handlebars-helpers": "^0.11.7", "dayjs": "^1.10.4", "handlebars": "^4.7.6", "handlebars-utils": "^1.0.6", diff --git a/packages/string-templates/yarn.lock b/packages/string-templates/yarn.lock index 86592f1cec..b5abb1403a 100644 --- a/packages/string-templates/yarn.lock +++ b/packages/string-templates/yarn.lock @@ -270,15 +270,14 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/handlebars-helpers@^0.11.6": - version "0.11.6" - resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.6.tgz#00e924a0142aac41c07e3d104607759635eec952" - integrity sha512-FLtCWkh0cNHC0/X6Pt5Xjmp4/r4tCpv5f5sP1JcZsaSKPyE5gpNu/+fqUxgDTzVS3PVo0KE6hdRPKVWvVqwPEw== +"@budibase/handlebars-helpers@^0.11.7": + version "0.11.7" + resolved "https://registry.yarnpkg.com/@budibase/handlebars-helpers/-/handlebars-helpers-0.11.7.tgz#8e5f9843d7dd10503e9f608555a96ccf4d836c46" + integrity sha512-PvGHAv22cWSFExs1kc0WglwsmCEUEOqWvSp6JCFZwtc3qAAr5yMfLK8WGVQ63ALvyzWZiyxF+yrlzeeaohCMJw== dependencies: array-sort "^1.0.0" define-property "^2.0.2" extend-shallow "^3.0.2" - "falsey" "^1.0.0" for-in "^1.0.2" get-object "^0.2.0" get-value "^3.0.1" @@ -1734,11 +1733,6 @@ extsprintf@^1.2.0: resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= -"falsey@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/falsey/-/falsey-1.0.0.tgz#71bdd775c24edad9f2f5c015ce8be24400bb5d7d" - integrity sha512-zMDNZ/Ipd8MY0+346CPvhzP1AsiVyNfTOayJza4reAIWf72xbkuFUDcJNxSAsQE1b9Bu0wijKb8Ngnh/a7fI5w== - fast-deep-equal@^3.1.1: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" From 6ccaea4a9f66f3fe50056fa454776e317a09d28b Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 15:39:22 +0100 Subject: [PATCH 26/43] remove currentapp stuff --- packages/server/src/middleware/currentapp.js | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/packages/server/src/middleware/currentapp.js b/packages/server/src/middleware/currentapp.js index e523850e1d..99f9d2318c 100644 --- a/packages/server/src/middleware/currentapp.js +++ b/packages/server/src/middleware/currentapp.js @@ -4,13 +4,9 @@ const { Cookies } = require("@budibase/auth").constants const { getRole } = require("@budibase/auth/roles") const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles") const { generateUserMetadataID } = require("../db/utils") -const { dbExists, getTenantIDFromAppID } = require("@budibase/auth/db") -const { getTenantId } = require("@budibase/auth/tenancy") +const { dbExists } = require("@budibase/auth/db") const { getCachedSelf } = require("../utilities/global") const CouchDB = require("../db") -const env = require("../environment") - -const DEFAULT_TENANT_ID = "default" module.exports = async (ctx, next) => { // try to get the appID from the request @@ -55,15 +51,6 @@ module.exports = async (ctx, next) => { return next() } - // If user and app tenant Ids do not match, 403 - if (env.MULTI_TENANCY && ctx.user) { - const userTenantId = getTenantId() - const tenantId = getTenantIDFromAppID(appId) || DEFAULT_TENANT_ID - if (tenantId !== userTenantId) { - ctx.throw(403, "Cannot access application.") - } - } - ctx.appId = appId if (roleId) { ctx.roleId = roleId From dfee7ebc7a75764e0a3a237652a28d798ceecbac Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 7 Oct 2021 15:41:53 +0100 Subject: [PATCH 27/43] Remove update screen in the cloud --- .../builder/src/pages/builder/portal/_layout.svelte | 13 +++++++++---- .../src/pages/builder/portal/settings/update.svelte | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index 02f49bec5a..8fca18d29d 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -46,11 +46,16 @@ title: "Theming", href: "/builder/portal/settings/theming", }, - { - title: "Updates", - href: "/builder/portal/settings/update", - }, ]) + + if (!$adminStore.cloud) { + menu = menu.concat([ + { + title: "Updates", + href: "/builder/portal/settings/update", + }, + ]) + } } else { menu = menu.concat([ { diff --git a/packages/builder/src/pages/builder/portal/settings/update.svelte b/packages/builder/src/pages/builder/portal/settings/update.svelte index 3931203f44..5deb724a7c 100644 --- a/packages/builder/src/pages/builder/portal/settings/update.svelte +++ b/packages/builder/src/pages/builder/portal/settings/update.svelte @@ -10,14 +10,14 @@ Label, } from "@budibase/bbui" import api from "builderStore/api" - import { auth } from "stores/portal" + import { auth, admin } from "stores/portal" import { redirect } from "@roxi/routify" let version // Only admins allowed here $: { - if (!$auth.isAdmin) { + if (!$auth.isAdmin || $admin.cloud) { $redirect("../../portal") } } From 380d0e030ec21668f05c4e4c9abcfce66e33348c Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 15:49:26 +0100 Subject: [PATCH 28/43] Fixing issue with user's being logged in and trying to access other tenants public apps, this work makes sure that users from other tenants will not be 403'd immediately (too aggressive) but instead they will have all other their RBAC roles revoked. --- packages/auth/src/db/constants.js | 15 +++++++ packages/auth/src/db/utils.js | 40 ++----------------- packages/auth/src/tenancy/tenancy.js | 33 ++++++++++++++- packages/server/src/api/controllers/auth.js | 10 ++++- .../server/src/api/routes/tests/user.spec.js | 1 - packages/server/src/middleware/currentapp.js | 35 +++++++++------- packages/server/src/utilities/global.js | 13 ++++-- .../server/src/utilities/workerRequests.js | 34 +--------------- 8 files changed, 91 insertions(+), 90 deletions(-) diff --git a/packages/auth/src/db/constants.js b/packages/auth/src/db/constants.js index ad4f6c9f66..477968975a 100644 --- a/packages/auth/src/db/constants.js +++ b/packages/auth/src/db/constants.js @@ -1,5 +1,20 @@ exports.SEPARATOR = "_" +const PRE_APP = "app" +const PRE_DEV = "dev" + +exports.DocumentTypes = { + USER: "us", + WORKSPACE: "workspace", + CONFIG: "config", + TEMPLATE: "template", + APP: PRE_APP, + DEV: PRE_DEV, + APP_DEV: `${PRE_APP}${exports.SEPARATOR}${PRE_DEV}`, + APP_METADATA: `${PRE_APP}${exports.SEPARATOR}metadata`, + ROLE: "role", +} + exports.StaticDatabases = { GLOBAL: { name: "global-db", diff --git a/packages/auth/src/db/utils.js b/packages/auth/src/db/utils.js index 09e2ff6314..fa162603e6 100644 --- a/packages/auth/src/db/utils.js +++ b/packages/auth/src/db/utils.js @@ -2,8 +2,8 @@ const { newid } = require("../hashing") const Replication = require("./Replication") const { DEFAULT_TENANT_ID } = require("../constants") const env = require("../environment") -const { StaticDatabases, SEPARATOR } = require("./constants") -const { getTenantId } = require("../tenancy") +const { StaticDatabases, SEPARATOR, DocumentTypes } = require("./constants") +const { getTenantId, getTenantIDFromAppID } = require("../tenancy") const fetch = require("node-fetch") const { getCouch } = require("./index") @@ -15,25 +15,11 @@ exports.ViewNames = { exports.StaticDatabases = StaticDatabases -const PRE_APP = "app" -const PRE_DEV = "dev" - -const DocumentTypes = { - USER: "us", - WORKSPACE: "workspace", - CONFIG: "config", - TEMPLATE: "template", - APP: PRE_APP, - DEV: PRE_DEV, - APP_DEV: `${PRE_APP}${SEPARATOR}${PRE_DEV}`, - APP_METADATA: `${PRE_APP}${SEPARATOR}metadata`, - ROLE: "role", -} - exports.DocumentTypes = DocumentTypes exports.APP_PREFIX = DocumentTypes.APP + SEPARATOR exports.APP_DEV = exports.APP_DEV_PREFIX = DocumentTypes.APP_DEV + SEPARATOR exports.SEPARATOR = SEPARATOR +exports.getTenantIDFromAppID = getTenantIDFromAppID /** * If creating DB allDocs/query params with only a single top level ID this can be used, this @@ -70,26 +56,6 @@ function isDevApp(app) { return exports.isDevAppID(app.appId) } -/** - * Given an app ID this will attempt to retrieve the tenant ID from it. - * @return {null|string} The tenant ID found within the app ID. - */ -exports.getTenantIDFromAppID = appId => { - if (!appId) { - return null - } - const split = appId.split(SEPARATOR) - const hasDev = split[1] === DocumentTypes.DEV - if ((hasDev && split.length === 3) || (!hasDev && split.length === 2)) { - return null - } - if (hasDev) { - return split[2] - } else { - return split[1] - } -} - /** * Generates a new workspace ID. * @returns {string} The new workspace ID which the workspace doc can be stored under. diff --git a/packages/auth/src/tenancy/tenancy.js b/packages/auth/src/tenancy/tenancy.js index 67dbfd5619..2cd05ea925 100644 --- a/packages/auth/src/tenancy/tenancy.js +++ b/packages/auth/src/tenancy/tenancy.js @@ -1,5 +1,5 @@ const { getDB } = require("../db") -const { SEPARATOR, StaticDatabases } = require("../db/constants") +const { SEPARATOR, StaticDatabases, DocumentTypes } = require("../db/constants") const { getTenantId, DEFAULT_TENANT_ID, isMultiTenant } = require("./context") const env = require("../environment") @@ -117,3 +117,34 @@ exports.getTenantUser = async identifier => { return null } } + +/** + * Given an app ID this will attempt to retrieve the tenant ID from it. + * @return {null|string} The tenant ID found within the app ID. + */ +exports.getTenantIDFromAppID = appId => { + if (!appId) { + return null + } + const split = appId.split(SEPARATOR) + const hasDev = split[1] === DocumentTypes.DEV + if ((hasDev && split.length === 3) || (!hasDev && split.length === 2)) { + return null + } + if (hasDev) { + return split[2] + } else { + return split[1] + } +} + +exports.isUserInAppTenant = (appId, user = null) => { + let userTenantId + if (user) { + userTenantId = user.tenantId || DEFAULT_TENANT_ID + } else { + userTenantId = getTenantId() + } + const tenantId = exports.getTenantIDFromAppID(appId) || DEFAULT_TENANT_ID + return tenantId === userTenantId +} diff --git a/packages/server/src/api/controllers/auth.js b/packages/server/src/api/controllers/auth.js index 5078218fc7..ac88599713 100644 --- a/packages/server/src/api/controllers/auth.js +++ b/packages/server/src/api/controllers/auth.js @@ -2,6 +2,7 @@ const CouchDB = require("../../db") const { outputProcessing } = require("../../utilities/rowProcessor") const { InternalTables } = require("../../db/utils") const { getFullUser } = require("../../utilities/users") +const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles") exports.fetchSelf = async ctx => { const appId = ctx.appId @@ -27,7 +28,14 @@ exports.fetchSelf = async ctx => { ...metadata, }) } catch (err) { - ctx.body = user + // user didn't exist in app, don't pretend they do + if (user.roleId === BUILTIN_ROLE_IDS.PUBLIC) { + ctx.body = {} + } + // user has a role of some sort, return them + else { + ctx.body = user + } } } else { ctx.body = user diff --git a/packages/server/src/api/routes/tests/user.spec.js b/packages/server/src/api/routes/tests/user.spec.js index 492ebfff5b..48117fbe4b 100644 --- a/packages/server/src/api/routes/tests/user.spec.js +++ b/packages/server/src/api/routes/tests/user.spec.js @@ -9,7 +9,6 @@ jest.mock("../../../utilities/workerRequests", () => ({ getGlobalSelf: jest.fn(() => { return {} }), - addAppRoleToUser: jest.fn(), deleteGlobalUser: jest.fn(), })) diff --git a/packages/server/src/middleware/currentapp.js b/packages/server/src/middleware/currentapp.js index e523850e1d..062c35a6ca 100644 --- a/packages/server/src/middleware/currentapp.js +++ b/packages/server/src/middleware/currentapp.js @@ -4,14 +4,12 @@ const { Cookies } = require("@budibase/auth").constants const { getRole } = require("@budibase/auth/roles") const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles") const { generateUserMetadataID } = require("../db/utils") -const { dbExists, getTenantIDFromAppID } = require("@budibase/auth/db") -const { getTenantId } = require("@budibase/auth/tenancy") +const { dbExists } = require("@budibase/auth/db") +const { isUserInAppTenant } = require("@budibase/auth/tenancy") const { getCachedSelf } = require("../utilities/global") const CouchDB = require("../db") const env = require("../environment") -const DEFAULT_TENANT_ID = "default" - module.exports = async (ctx, next) => { // try to get the appID from the request let requestAppId = getAppId(ctx) @@ -55,13 +53,21 @@ module.exports = async (ctx, next) => { return next() } - // If user and app tenant Ids do not match, 403 - if (env.MULTI_TENANCY && ctx.user) { - const userTenantId = getTenantId() - const tenantId = getTenantIDFromAppID(appId) || DEFAULT_TENANT_ID - if (tenantId !== userTenantId) { - ctx.throw(403, "Cannot access application.") - } + let noCookieSet = false + // if the user not in the right tenant then make sure they have no permissions + // need to judge this only based on the request app ID, + if ( + env.MULTI_TENANCY && + ctx.user && + requestAppId && + !isUserInAppTenant(requestAppId) + ) { + // don't error, simply remove the users rights (they are a public user) + delete ctx.user.builder + delete ctx.user.admin + delete ctx.user.roles + roleId = BUILTIN_ROLE_IDS.PUBLIC + noCookieSet = true } ctx.appId = appId @@ -78,9 +84,10 @@ module.exports = async (ctx, next) => { } } if ( - requestAppId !== appId || - appCookie == null || - appCookie.appId !== requestAppId + (requestAppId !== appId || + appCookie == null || + appCookie.appId !== requestAppId) && + !noCookieSet ) { setCookie(ctx, { appId }, Cookies.CurrentApp) } diff --git a/packages/server/src/utilities/global.js b/packages/server/src/utilities/global.js index 8f032df7f0..3637c11eea 100644 --- a/packages/server/src/utilities/global.js +++ b/packages/server/src/utilities/global.js @@ -6,13 +6,20 @@ const { BUILTIN_ROLE_IDS } = require("@budibase/auth/roles") const { getDeployedAppID } = require("@budibase/auth/db") const { getGlobalUserParams } = require("@budibase/auth/db") const { user: userCache } = require("@budibase/auth/cache") -const { getGlobalDB } = require("@budibase/auth/tenancy") +const { getGlobalDB, isUserInAppTenant } = require("@budibase/auth/tenancy") +const env = require("../environment") exports.updateAppRole = (appId, user) => { - if (!user.roles) { + if (!user || !user.roles) { + return user + } + // if in an multi-tenancy environment make sure roles are never updated + if (env.MULTI_TENANCY && !isUserInAppTenant(appId, user)) { + delete user.builder + delete user.admin + user.roleId = BUILTIN_ROLE_IDS.PUBLIC return user } - // always use the deployed app user.roleId = user.roles[getDeployedAppID(appId)] // if a role wasn't found then either set as admin (builder) or public (everyone else) diff --git a/packages/server/src/utilities/workerRequests.js b/packages/server/src/utilities/workerRequests.js index c07c93ba70..6a15e1b243 100644 --- a/packages/server/src/utilities/workerRequests.js +++ b/packages/server/src/utilities/workerRequests.js @@ -2,7 +2,7 @@ const fetch = require("node-fetch") const env = require("../environment") const { checkSlashesInUrl } = require("./index") const { getDeployedAppID } = require("@budibase/auth/db") -const { updateAppRole, getGlobalUser } = require("./global") +const { updateAppRole } = require("./global") const { Headers } = require("@budibase/auth/constants") const { getTenantId, isTenantIdSet } = require("@budibase/auth/tenancy") @@ -98,38 +98,6 @@ exports.getGlobalSelf = async (ctx, appId = null) => { return json } -exports.addAppRoleToUser = async (ctx, appId, roleId, userId = null) => { - let user, - endpoint, - body = {} - if (!userId) { - user = await exports.getGlobalSelf(ctx) - endpoint = `/api/global/users/self` - } else { - user = await getGlobalUser(appId, userId) - body._id = userId - endpoint = `/api/global/users` - } - body = { - ...body, - roles: { - ...user.roles, - [getDeployedAppID(appId)]: roleId, - }, - } - const response = await fetch( - checkSlashesInUrl(env.WORKER_URL + endpoint), - request(ctx, { - method: "POST", - body, - }) - ) - if (response.status !== 200) { - ctx.throw(400, "Unable to save self globally.") - } - return response.json() -} - exports.removeAppFromUserRoles = async (ctx, appId) => { const deployedAppId = getDeployedAppID(appId) const response = await fetch( From 64b98a6d18419b23d10128aaf1b9bb69ab5baec8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 16:11:33 +0100 Subject: [PATCH 29/43] Adding functionality to check if ethereal is down, if it is don't fail the test. --- .../worker/src/api/routes/tests/realEmail.spec.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/worker/src/api/routes/tests/realEmail.spec.js b/packages/worker/src/api/routes/tests/realEmail.spec.js index 845e31d911..f61aee830f 100644 --- a/packages/worker/src/api/routes/tests/realEmail.spec.js +++ b/packages/worker/src/api/routes/tests/realEmail.spec.js @@ -34,8 +34,18 @@ describe("/api/global/email", () => { const testUrl = nodemailer.getTestMessageUrl(res.body) console.log(`${purpose} URL: ${testUrl}`) expect(testUrl).toBeDefined() - const response = await fetch(testUrl) - const text = await response.text() + let response, text + try { + response = await fetch(testUrl) + text = await response.text() + } catch (err) { + // ethereal hiccup, can't test right now + if (err.status > 400) { + return + } else { + throw err + } + } let toCheckFor switch (purpose) { case EmailTemplatePurpose.WELCOME: From a4014c558036f1e8b317890e50566c7ae8f6445b Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 16:14:00 +0100 Subject: [PATCH 30/43] Fixing a small issue with email test fix. --- .../src/api/routes/tests/realEmail.spec.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/worker/src/api/routes/tests/realEmail.spec.js b/packages/worker/src/api/routes/tests/realEmail.spec.js index f61aee830f..5ca2b54ebc 100644 --- a/packages/worker/src/api/routes/tests/realEmail.spec.js +++ b/packages/worker/src/api/routes/tests/realEmail.spec.js @@ -20,27 +20,27 @@ describe("/api/global/email", () => { await config.saveEtherealSmtpConfig() await config.saveSettingsConfig() const user = await config.getUser("test@test.com") - const res = await request - .post(`/api/global/email/send`) - .send({ - email: "test@test.com", - purpose, - userId: user._id, - }) - .set(config.defaultHeaders()) - .expect("Content-Type", /json/) - .expect(200) - expect(res.body.message).toBeDefined() - const testUrl = nodemailer.getTestMessageUrl(res.body) - console.log(`${purpose} URL: ${testUrl}`) - expect(testUrl).toBeDefined() let response, text try { + const res = await request + .post(`/api/global/email/send`) + .send({ + email: "test@test.com", + purpose, + userId: user._id, + }) + .set(config.defaultHeaders()) + .expect("Content-Type", /json/) + .expect(200) + expect(res.body.message).toBeDefined() + const testUrl = nodemailer.getTestMessageUrl(res.body) + console.log(`${purpose} URL: ${testUrl}`) + expect(testUrl).toBeDefined() response = await fetch(testUrl) text = await response.text() } catch (err) { // ethereal hiccup, can't test right now - if (err.status > 400) { + if (parseInt(err.status) > 400) { return } else { throw err From b267698caa5bb719cef4c8a67d64270e6bcf4e58 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 16:35:11 +0100 Subject: [PATCH 31/43] Fixing another issue with ethereal test package. --- packages/worker/src/api/routes/tests/realEmail.spec.js | 8 ++++---- .../src/api/routes/tests/utilities/TestConfiguration.js | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/worker/src/api/routes/tests/realEmail.spec.js b/packages/worker/src/api/routes/tests/realEmail.spec.js index 5ca2b54ebc..54238e9270 100644 --- a/packages/worker/src/api/routes/tests/realEmail.spec.js +++ b/packages/worker/src/api/routes/tests/realEmail.spec.js @@ -17,11 +17,11 @@ describe("/api/global/email", () => { afterAll(setup.afterAll) async function sendRealEmail(purpose) { - await config.saveEtherealSmtpConfig() - await config.saveSettingsConfig() - const user = await config.getUser("test@test.com") let response, text try { + await config.saveEtherealSmtpConfig() + await config.saveSettingsConfig() + const user = await config.getUser("test@test.com") const res = await request .post(`/api/global/email/send`) .send({ @@ -40,7 +40,7 @@ describe("/api/global/email", () => { text = await response.text() } catch (err) { // ethereal hiccup, can't test right now - if (parseInt(err.status) > 400) { + if (parseInt(err.status) >= 400) { return } else { throw err diff --git a/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js b/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js index 7f84de6b7d..9638e2a2a7 100644 --- a/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js +++ b/packages/worker/src/api/routes/tests/utilities/TestConfiguration.js @@ -38,6 +38,9 @@ class TestConfiguration { request.request = { body: config, } + request.throw = (status, err) => { + throw { status, message: err } + } if (params) { request.params = params } From b87559917b59632c8e7e63d34d618b04c27c3fc8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Thu, 7 Oct 2021 17:39:44 +0100 Subject: [PATCH 32/43] Adding a check for test environment to not clear app cookie on login as this breaks cypress. --- packages/worker/src/api/controllers/global/auth.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/worker/src/api/controllers/global/auth.js b/packages/worker/src/api/controllers/global/auth.js index 76768d1700..9d7df7ca37 100644 --- a/packages/worker/src/api/controllers/global/auth.js +++ b/packages/worker/src/api/controllers/global/auth.js @@ -55,7 +55,10 @@ async function authInternal(ctx, user, err = null, info = null) { // just store the user ID ctx.cookies.set(Cookies.Auth, user.token, config) // get rid of any app cookies on login - clearCookie(ctx, Cookies.CurrentApp) + // have to check test because this breaks cypress + if (!env.isTest()) { + clearCookie(ctx, Cookies.CurrentApp) + } } exports.authenticate = async (ctx, next) => { From 43d3c2af4d3a5191de5162ef6175dcae25113446 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 20:57:50 +0100 Subject: [PATCH 33/43] adding made in budibase tag --- .../design/AppPreview/iframeTemplate.js | 2 +- .../src/components/MadeInBudibase.svelte | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 packages/client/src/components/MadeInBudibase.svelte diff --git a/packages/builder/src/components/design/AppPreview/iframeTemplate.js b/packages/builder/src/components/design/AppPreview/iframeTemplate.js index d992be8cd7..58557273f2 100644 --- a/packages/builder/src/components/design/AppPreview/iframeTemplate.js +++ b/packages/builder/src/components/design/AppPreview/iframeTemplate.js @@ -64,7 +64,7 @@ export default ` appId, theme, customTheme, - previewDevice + previewDevice, } = parsed // Set some flags so the app knows we're in the builder diff --git a/packages/client/src/components/MadeInBudibase.svelte b/packages/client/src/components/MadeInBudibase.svelte new file mode 100644 index 0000000000..2e5d6336f1 --- /dev/null +++ b/packages/client/src/components/MadeInBudibase.svelte @@ -0,0 +1,42 @@ + +
+ Budibase +

Made In Budibase

+
+
+ + From d3934eaeda35699e22161243944ec82b16e5478a Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 7 Oct 2021 20:07:47 +0000 Subject: [PATCH 34/43] v0.9.157 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index d761f49f6d..b2f38f0ffc 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.156", + "version": "0.9.157", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index c2b70119de..5db8694df0 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.156", + "version": "0.9.157", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 35ae9f46a7..9b2aece866 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.156", + "version": "0.9.157", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index e97c1aa4bd..da7efe97db 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.156", + "version": "0.9.157", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.156", - "@budibase/client": "^0.9.156", + "@budibase/bbui": "^0.9.157", + "@budibase/client": "^0.9.157", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.156", + "@budibase/string-templates": "^0.9.157", "@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 32a1fded6d..9e3aba144a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.156", + "version": "0.9.157", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index cab9a8fe65..07f579b713 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.156", + "version": "0.9.157", "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": "^0.9.156", + "@budibase/bbui": "^0.9.157", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.156", + "@budibase/string-templates": "^0.9.157", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index c1de0be72c..bced5dab59 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.156", + "version": "0.9.157", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.156", - "@budibase/client": "^0.9.156", - "@budibase/string-templates": "^0.9.156", + "@budibase/auth": "^0.9.157", + "@budibase/client": "^0.9.157", + "@budibase/string-templates": "^0.9.157", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5914389f5c..989dd60ff9 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.156", + "version": "0.9.157", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 58284e108b..2be283ae33 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.156", + "version": "0.9.157", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.156", - "@budibase/string-templates": "^0.9.156", + "@budibase/auth": "^0.9.157", + "@budibase/string-templates": "^0.9.157", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 40b72d2562f52f3e914da260b38d45d4c04964fe Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Oct 2021 20:17:21 +0000 Subject: [PATCH 35/43] v0.9.157-alpha.0 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index d761f49f6d..e59e04bc85 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.156", + "version": "0.9.157-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index c2b70119de..e3f433b43b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 35ae9f46a7..7b6f5810f9 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index e97c1aa4bd..c716d42e26 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.156", - "@budibase/client": "^0.9.156", + "@budibase/bbui": "^0.9.157-alpha.0", + "@budibase/client": "^0.9.157-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.156", + "@budibase/string-templates": "^0.9.157-alpha.0", "@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 32a1fded6d..8242b45e5c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index cab9a8fe65..20f97212f6 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "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": "^0.9.156", + "@budibase/bbui": "^0.9.157-alpha.0", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.156", + "@budibase/string-templates": "^0.9.157-alpha.0", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index c1de0be72c..0925ab01b1 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.156", - "@budibase/client": "^0.9.156", - "@budibase/string-templates": "^0.9.156", + "@budibase/auth": "^0.9.157-alpha.0", + "@budibase/client": "^0.9.157-alpha.0", + "@budibase/string-templates": "^0.9.157-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 5914389f5c..c877124f84 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 58284e108b..5c33c4f88f 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.156", + "version": "0.9.157-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.156", - "@budibase/string-templates": "^0.9.156", + "@budibase/auth": "^0.9.157-alpha.0", + "@budibase/string-templates": "^0.9.157-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From fb2720968f56f79a10df5e8b2b7f85027c07ab86 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 7 Oct 2021 21:09:01 +0000 Subject: [PATCH 36/43] v0.9.158-alpha.0 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index b2f38f0ffc..33eb240067 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.157", + "version": "0.9.158-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 5db8694df0..2d91bd7dbf 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 9b2aece866..bd088af7e8 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index da7efe97db..afdef177c1 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.157", - "@budibase/client": "^0.9.157", + "@budibase/bbui": "^0.9.158-alpha.0", + "@budibase/client": "^0.9.158-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.157", + "@budibase/string-templates": "^0.9.158-alpha.0", "@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 9e3aba144a..70d78a6f1c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 07f579b713..dfed5117f2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "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": "^0.9.157", + "@budibase/bbui": "^0.9.158-alpha.0", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.157", + "@budibase/string-templates": "^0.9.158-alpha.0", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index bced5dab59..1fb9e080e0 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.157", - "@budibase/client": "^0.9.157", - "@budibase/string-templates": "^0.9.157", + "@budibase/auth": "^0.9.158-alpha.0", + "@budibase/client": "^0.9.158-alpha.0", + "@budibase/string-templates": "^0.9.158-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 989dd60ff9..204dc49d9e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 2be283ae33..3efafebca8 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.157", + "version": "0.9.158-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.157", - "@budibase/string-templates": "^0.9.157", + "@budibase/auth": "^0.9.158-alpha.0", + "@budibase/string-templates": "^0.9.158-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 59cdc495d5066cddbd24a3992a3fdf318ca4db4a Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 7 Oct 2021 21:20:53 +0000 Subject: [PATCH 37/43] v0.9.158 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 33eb240067..8decea321f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.158-alpha.0", + "version": "0.9.158", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 2d91bd7dbf..2a52db08bc 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index bd088af7e8..38d8d170e5 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index afdef177c1..402e7c1402 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.158-alpha.0", - "@budibase/client": "^0.9.158-alpha.0", + "@budibase/bbui": "^0.9.158", + "@budibase/client": "^0.9.158", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.158-alpha.0", + "@budibase/string-templates": "^0.9.158", "@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 70d78a6f1c..c0f0bd904a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index dfed5117f2..bc2ff877cc 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "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": "^0.9.158-alpha.0", + "@budibase/bbui": "^0.9.158", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.158-alpha.0", + "@budibase/string-templates": "^0.9.158", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 1fb9e080e0..17f6691d76 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.158-alpha.0", - "@budibase/client": "^0.9.158-alpha.0", - "@budibase/string-templates": "^0.9.158-alpha.0", + "@budibase/auth": "^0.9.158", + "@budibase/client": "^0.9.158", + "@budibase/string-templates": "^0.9.158", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 204dc49d9e..675bd19e8e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 3efafebca8..8039a17b76 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.158-alpha.0", + "version": "0.9.158", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.158-alpha.0", - "@budibase/string-templates": "^0.9.158-alpha.0", + "@budibase/auth": "^0.9.158", + "@budibase/string-templates": "^0.9.158", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 812d6e5a512bd0f09b66019e2a1749dbbab8292c Mon Sep 17 00:00:00 2001 From: Budibase Release Bot <> Date: Thu, 7 Oct 2021 21:55:18 +0000 Subject: [PATCH 38/43] v0.9.159 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 8decea321f..510f605b3f 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.158", + "version": "0.9.159", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 2a52db08bc..5af97cb10a 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.158", + "version": "0.9.159", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 38d8d170e5..bba2722293 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.158", + "version": "0.9.159", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index 402e7c1402..f09c2e9c59 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.158", + "version": "0.9.159", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.158", - "@budibase/client": "^0.9.158", + "@budibase/bbui": "^0.9.159", + "@budibase/client": "^0.9.159", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.158", + "@budibase/string-templates": "^0.9.159", "@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 c0f0bd904a..4024bf0906 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.158", + "version": "0.9.159", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index bc2ff877cc..4b1e88b2fa 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.158", + "version": "0.9.159", "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": "^0.9.158", + "@budibase/bbui": "^0.9.159", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.158", + "@budibase/string-templates": "^0.9.159", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index 17f6691d76..f3fa66a595 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.158", + "version": "0.9.159", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.158", - "@budibase/client": "^0.9.158", - "@budibase/string-templates": "^0.9.158", + "@budibase/auth": "^0.9.159", + "@budibase/client": "^0.9.159", + "@budibase/string-templates": "^0.9.159", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 675bd19e8e..fa2e0ae8c0 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.158", + "version": "0.9.159", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 8039a17b76..30e7107fd3 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.158", + "version": "0.9.159", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.158", - "@budibase/string-templates": "^0.9.158", + "@budibase/auth": "^0.9.159", + "@budibase/string-templates": "^0.9.159", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 1aa5d0cde731e6e3946de6b60f40c29f259115df Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 7 Oct 2021 23:08:21 +0100 Subject: [PATCH 39/43] updating workflow to push to self hosters --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b38a70eb7..5f8f7b1f0d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,7 @@ jobs: run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD yarn build - yarn build:docker + yarn build:docker:production env: DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} From f4b6715d6153794761156be9685fd9397aec5cea Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Fri, 8 Oct 2021 10:37:08 +0100 Subject: [PATCH 40/43] separate release and self host flows --- .github/workflows/release-selfhost.yml | 57 ++++++++++++++++++++++++++ .github/workflows/release.yml | 33 +-------------- 2 files changed, 58 insertions(+), 32 deletions(-) create mode 100644 .github/workflows/release-selfhost.yml diff --git a/.github/workflows/release-selfhost.yml b/.github/workflows/release-selfhost.yml new file mode 100644 index 0000000000..a4cbc4e70a --- /dev/null +++ b/.github/workflows/release-selfhost.yml @@ -0,0 +1,57 @@ +name: Budibase Release + +on: + workflow_dispatch: + +env: + POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} + INTERCOM_TOKEN: ${{ secrets.INTERCOM_TOKEN }} + POSTHOG_URL: ${{ secrets.POSTHOG_URL }} + SENTRY_DSN: ${{ secrets.SENTRY_DSN }} + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12.x + - run: yarn + - run: yarn bootstrap + + - name: Configure AWS Credentials + uses: aws-actions/configure-aws-credentials@v1 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: eu-west-1 + + - name: 'Get Previous tag' + id: previoustag + uses: "WyriHaximus/github-action-get-previous-tag@v1" + + - name: Build/release Docker images (Self Host) + if: ${{ github.event.inputs.release_self_host == 'Y' }} + run: | + docker login -u $DOCKER_USER -p $DOCKER_PASSWORD + yarn build + yarn build:docker:production + env: + DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} + BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} + + - uses: azure/setup-helm@v1 + id: install + + # So, we need to inject the values into this + - run: yarn release:helm + + - name: Run chart-releaser + uses: helm/chart-releaser-action@v1.1.0 + with: + charts_dir: docs + env: + CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f8f7b1f0d..40154be992 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,12 +4,6 @@ on: push: branches: - master - workflow_dispatch: - inputs: - release_self_host: - description: 'Release to self hosters? (Y/N)' - required: true - default: 'N' env: POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} @@ -54,7 +48,6 @@ jobs: uses: "WyriHaximus/github-action-get-previous-tag@v1" - name: Build/release Docker images - if: ${{ github.event.inputs.release_self_host != 'Y' }} run: | docker login -u $DOCKER_USER -p $DOCKER_PASSWORD yarn build @@ -62,28 +55,4 @@ jobs: env: DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} - BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} - - - name: Build/release Docker images (Self Host) - if: ${{ github.event.inputs.release_self_host == 'Y' }} - run: | - docker login -u $DOCKER_USER -p $DOCKER_PASSWORD - yarn build - yarn build:docker:production - env: - DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_API_KEY }} - BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} - - - uses: azure/setup-helm@v1 - id: install - - # So, we need to inject the values into this - - run: yarn release:helm - - - name: Run chart-releaser - uses: helm/chart-releaser-action@v1.1.0 - with: - charts_dir: docs - env: - CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + BUDIBASE_RELEASE_VERSION: ${{ steps.previoustag.outputs.tag }} \ No newline at end of file From 58a40be2e5781680a981934c8adb718663ca83a1 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Fri, 8 Oct 2021 10:56:44 +0100 Subject: [PATCH 41/43] Update commands.js --- packages/builder/cypress/support/commands.js | 89 +++++++++++--------- 1 file changed, 50 insertions(+), 39 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index b10e7b9990..6d6f292461 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -101,29 +101,32 @@ Cypress.Commands.add("createTable", tableName => { cy.contains(tableName).should("be.visible") }) -Cypress.Commands.add("addColumn", (tableName, columnName, type, multiOptions = null) => { - // Select Table - cy.selectTable(tableName) - cy.contains(".nav-item", tableName).click() - cy.contains("Create column").click() +Cypress.Commands.add( + "addColumn", + (tableName, columnName, type, multiOptions = null) => { + // Select Table + cy.selectTable(tableName) + cy.contains(".nav-item", tableName).click() + cy.contains("Create column").click() - // Configure column - cy.get(".spectrum-Modal").within(() => { - cy.get("input").first().type(columnName).blur() + // Configure column + cy.get(".spectrum-Modal").within(() => { + cy.get("input").first().type(columnName).blur() - // Unset table display column - cy.contains("display column").click({ force: true }) - cy.get(".spectrum-Picker-label").click() - cy.contains(type).click() + // Unset table display column + cy.contains("display column").click({ force: true }) + cy.get(".spectrum-Picker-label").click() + cy.contains(type).click() - // Add options for Multi-select Type - if(multiOptions !== null){ - cy.get(".spectrum-Textfield-input").eq(1).type(multiOptions) - } + // Add options for Multi-select Type + if (multiOptions !== null) { + cy.get(".spectrum-Textfield-input").eq(1).type(multiOptions) + } - cy.contains("Save Column").click() - }) -}) + cy.contains("Save Column").click() + }) + } +) Cypress.Commands.add("addRow", values => { cy.contains("Create row").click() @@ -137,15 +140,17 @@ Cypress.Commands.add("addRow", values => { Cypress.Commands.add("addRowMultiValue", values => { cy.contains("Create row").click() - cy.get(".spectrum-Form-itemField").click().then(() => { - cy.get(".spectrum-Popover").within(() => { - for (let i = 0; i < values.length; i++) { - cy.get(".spectrum-Menu-item").eq(i).click() - } + cy.get(".spectrum-Form-itemField") + .click() + .then(() => { + cy.get(".spectrum-Popover").within(() => { + for (let i = 0; i < values.length; i++) { + cy.get(".spectrum-Menu-item").eq(i).click() + } + }) + cy.get(".spectrum-Dialog-grid").click("top") + cy.get(".spectrum-ButtonGroup").contains("Create").click() }) - cy.get(".spectrum-Dialog-grid").click('top') - cy.get(".spectrum-ButtonGroup").contains("Create").click() - }) }) Cypress.Commands.add("createUser", email => { @@ -166,7 +171,7 @@ Cypress.Commands.add("addComponent", (category, component) => { if (category) { cy.get(`[data-cy="category-${category}"]`).click() } - if (component){ + if (component) { cy.get(`[data-cy="component-${component}"]`).click() } cy.wait(1000) @@ -219,16 +224,22 @@ Cypress.Commands.add("selectTable", tableName => { }) Cypress.Commands.add("addCustomSourceOptions", totalOptions => { - cy.get(".spectrum-ActionButton").contains("Define Options").click().then(() => { - for (let i = 0; i < totalOptions; i++) { - // Add radio button options - cy.get(".spectrum-Button").contains("Add Option").click({force: true}).then(() => { - cy.wait(500) - cy.get("[placeholder='Label']").eq(i).type(i) - cy.get("[placeholder='Value']").eq(i).type(i) + cy.get(".spectrum-ActionButton") + .contains("Define Options") + .click() + .then(() => { + for (let i = 0; i < totalOptions; i++) { + // Add radio button options + cy.get(".spectrum-Button") + .contains("Add Option") + .click({ force: true }) + .then(() => { + cy.wait(500) + cy.get("[placeholder='Label']").eq(i).type(i) + cy.get("[placeholder='Value']").eq(i).type(i) + }) + } + // Save options + cy.get(".spectrum-Button").contains("Save").click({ force: true }) }) - } - // Save options - cy.get(".spectrum-Button").contains("Save").click({force: true}) - }) }) From 5e4e15fe9e5568605a871bb4b4b8ed9f043253ae Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 8 Oct 2021 10:05:15 +0000 Subject: [PATCH 42/43] v0.9.160-alpha.0 --- lerna.json | 2 +- packages/auth/package.json | 2 +- packages/bbui/package.json | 2 +- packages/builder/package.json | 8 ++++---- packages/cli/package.json | 2 +- packages/client/package.json | 6 +++--- packages/server/package.json | 8 ++++---- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 9 files changed, 19 insertions(+), 19 deletions(-) diff --git a/lerna.json b/lerna.json index 510f605b3f..a687b57552 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.159", + "version": "0.9.160-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 5af97cb10a..6469114278 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index bba2722293..6c838587b0 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index f09c2e9c59..71e7e8c9a8 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.159", - "@budibase/client": "^0.9.159", + "@budibase/bbui": "^0.9.160-alpha.0", + "@budibase/client": "^0.9.160-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.159", + "@budibase/string-templates": "^0.9.160-alpha.0", "@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 4024bf0906..7e677bf08e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 4b1e88b2fa..a933a2bef2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "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": "^0.9.159", + "@budibase/bbui": "^0.9.160-alpha.0", "@budibase/standard-components": "^0.9.139", - "@budibase/string-templates": "^0.9.159", + "@budibase/string-templates": "^0.9.160-alpha.0", "regexparam": "^1.3.0", "shortid": "^2.2.15", "svelte-spa-router": "^3.0.5" diff --git a/packages/server/package.json b/packages/server/package.json index f3fa66a595..5325a68557 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -66,9 +66,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.159", - "@budibase/client": "^0.9.159", - "@budibase/string-templates": "^0.9.159", + "@budibase/auth": "^0.9.160-alpha.0", + "@budibase/client": "^0.9.160-alpha.0", + "@budibase/string-templates": "^0.9.160-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index fa2e0ae8c0..bf397ae041 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 30e7107fd3..ced8f73c07 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "0.9.159", + "version": "0.9.160-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -27,8 +27,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.159", - "@budibase/string-templates": "^0.9.159", + "@budibase/auth": "^0.9.160-alpha.0", + "@budibase/string-templates": "^0.9.160-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From ce64923813b65c4446433edc36a91312dfda3d39 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Fri, 8 Oct 2021 11:45:54 +0100 Subject: [PATCH 43/43] Some changes for addMultiOptionDatatype --- .../cypress/integration/addMultiOptionDatatype.spec.js | 3 ++- packages/builder/cypress/support/commands.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js index 032d8b01b5..bc2619c53d 100644 --- a/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js +++ b/packages/builder/cypress/integration/addMultiOptionDatatype.spec.js @@ -26,7 +26,8 @@ context("Add Multi-Option Datatype", () => { // Add multi-select picker to form cy.addComponent("Form", "Multi-select Picker").then((componentId) => { cy.get('[data-cy="field-prop-control"]').type("Test Data").type('{enter}') - cy.getComponent(componentId).click() + cy.wait(1000) + cy.getComponent(componentId).contains("Choose some options").click() // Check picker has 5 items cy.getComponent(componentId).find('li').should('have.length', 5) // Select all items diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 6d6f292461..c8e01435aa 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -5,6 +5,10 @@ // *********************************************** // +Cypress.on('uncaught:exception', (err, runnable) => { + return false +}) + Cypress.Commands.add("login", () => { cy.visit(`localhost:${Cypress.env("PORT")}/builder`) cy.wait(2000)