From 4096f4857c9b0ae15a90ba4d2bb89788d3b01657 Mon Sep 17 00:00:00 2001 From: Christo Date: Thu, 8 Jul 2021 14:38:49 +0200 Subject: [PATCH 001/260] Feat: Add collection fields as "extra" query config for MongoDB --- .../integration/ExtraQueryConfig.svelte | 48 +++++++ .../components/integration/QueryViewer.svelte | 17 +++ packages/server/src/api/routes/query.js | 2 + packages/server/src/definitions/datasource.ts | 10 ++ packages/server/src/integrations/mongodb.ts | 125 ++++++++++++++++-- 5 files changed, 191 insertions(+), 11 deletions(-) create mode 100644 packages/builder/src/components/integration/ExtraQueryConfig.svelte diff --git a/packages/builder/src/components/integration/ExtraQueryConfig.svelte b/packages/builder/src/components/integration/ExtraQueryConfig.svelte new file mode 100644 index 0000000000..303beb1e4b --- /dev/null +++ b/packages/builder/src/components/integration/ExtraQueryConfig.svelte @@ -0,0 +1,48 @@ + + +{#each extraFields as { key, displayName, type }} +
+ + {#if type === "string"} + populateExtraQuery(extraQueryFields)} + bind:value={extraQueryFields[key]} + /> + {/if} + + {#if type === "list"} + queryConfig[verb]?.displayName || capitalise(verb)} />
+ {#if integrationInfo?.extra && query.queryVerb} + + {/if} {/if} diff --git a/packages/server/src/api/routes/query.js b/packages/server/src/api/routes/query.js index dd307c9444..2bbadcb40a 100644 --- a/packages/server/src/api/routes/query.js +++ b/packages/server/src/api/routes/query.js @@ -30,6 +30,7 @@ function generateQueryValidation() { default: Joi.string().allow(""), })), queryVerb: Joi.string().allow().required(), + extra: Joi.object().optional(), schema: Joi.object({}).required().unknown(true) })) } @@ -39,6 +40,7 @@ function generateQueryPreviewValidation() { return joiValidator.body(Joi.object({ fields: Joi.object().required(), queryVerb: Joi.string().allow().required(), + extra: Joi.object().optional(), datasourceId: Joi.string().required(), parameters: Joi.object({}).required().unknown(true) })) diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 22f1998601..24d8144940 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -49,6 +49,15 @@ export interface QueryDefinition { urlDisplay?: boolean } +export interface ExtraQueryConfig { + [key: string]: { + displayName: string, + type: string, + required: boolean + data?: object + } +} + export interface Integration { docs: string plus?: boolean @@ -58,6 +67,7 @@ export interface Integration { query: { [key: string]: QueryDefinition } + extra?: ExtraQueryConfig } export interface SearchFilters { diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index af7b49153d..ab21da6fd0 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -10,7 +10,7 @@ module MongoDBModule { interface MongoDBConfig { connectionString: string db: string - collection: string + // collection: string } const SCHEMA: Integration = { @@ -28,10 +28,6 @@ module MongoDBModule { type: DatasourceFieldTypes.STRING, required: true, }, - collection: { - type: DatasourceFieldTypes.STRING, - required: true, - }, }, query: { create: { @@ -40,7 +36,31 @@ module MongoDBModule { read: { type: QueryTypes.JSON, }, + update: { + type: QueryTypes.JSON, + }, + delete: { + type: QueryTypes.JSON, + } }, + extra: { + collection: { + displayName: "Collection", + type: DatasourceFieldTypes.STRING, + required: true, + }, + actionTypes: { + displayName: "Action Types", + type: DatasourceFieldTypes.LIST, + required: true, + data: { + read: ['find', 'findOne', 'findOneAndUpdate', "count", "distinct"], + create: ['insertOne', 'insertMany'], + update: ['updateOne', 'updateMany'], + delete: ['deleteOne', 'deleteMany'] + } + } + } } class MongoIntegration { @@ -56,12 +76,25 @@ module MongoDBModule { return this.client.connect() } - async create(query: { json: object }) { + async create(query: { json: object, extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) - const collection = db.collection(this.config.collection) - return collection.insertOne(query.json) + const collection = db.collection(query.extra.collection) + + // For mongodb we add an extra actionType to specify + // which method we want to call on the collection + switch(query.extra.actionTypes) { + case 'insertOne': { + return collection.insertOne(query.json) + } + case 'insertMany': { + return collection.insertOne(query.json).toArray() + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for create`) + } + } } catch (err) { console.error("Error writing to mongodb", err) throw err @@ -70,12 +103,32 @@ module MongoDBModule { } } - async read(query: { json: object }) { + async read(query: { json: object, extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) - const collection = db.collection(this.config.collection) - return collection.find(query.json).toArray() + const collection = db.collection(query.extra.collection) + + switch(query.extra.actionTypes) { + case 'find': { + return collection.find(query.json).toArray() + } + case 'findOne': { + return collection.findOne(query.json) + } + case 'findOneAndUpdate': { + return collection.findOneAndUpdate(query.json) + } + case 'count': { + return collection.countDocuments(query.json) + } + case 'distinct': { + return collection.distinct(query.json) + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for read`) + } + } } catch (err) { console.error("Error querying mongodb", err) throw err @@ -83,6 +136,56 @@ module MongoDBModule { await this.client.close() } } + + async update(query: { json: object, extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + + switch(query.extra.actionTypes) { + case 'updateOne': { + return collection.updateOne(query.json) + } + case 'updateMany': { + return collection.updateMany(query.json).toArray() + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for update`) + } + } + } catch (err) { + console.error("Error writing to mongodb", err) + throw err + } finally { + await this.client.close() + } + } + + async delete(query: { json: object, extra: { [key: string]: string } }) { + try { + await this.connect() + const db = this.client.db(this.config.db) + const collection = db.collection(query.extra.collection) + + switch(query.extra.actionTypes) { + case 'deleteOne': { + return collection.deleteOne(query.json) + } + case 'deleteMany': { + return collection.deleteMany(query.json).toArray() + } + default: { + throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for delete`) + } + } + } catch (err) { + console.error("Error writing to mongodb", err) + throw err + } finally { + await this.client.close() + } + } } module.exports = { From 8579d1872c1f44fe3490e1b6e6099b80643d8163 Mon Sep 17 00:00:00 2001 From: Christo Date: Fri, 9 Jul 2021 20:08:26 +0200 Subject: [PATCH 002/260] Test: Add some basic tests for mongodb queries --- packages/server/__mocks__/mongodb.ts | 15 ++++++ .../src/integrations/tests/mongo.spec.js | 48 ++++++++++++++++++- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/packages/server/__mocks__/mongodb.ts b/packages/server/__mocks__/mongodb.ts index d7d8f852c1..06eefefea6 100644 --- a/packages/server/__mocks__/mongodb.ts +++ b/packages/server/__mocks__/mongodb.ts @@ -5,11 +5,26 @@ module MongoMock { this.connect = jest.fn() this.close = jest.fn() this.insertOne = jest.fn() + this.insertMany = jest.fn(() => ({toArray: () => []})) this.find = jest.fn(() => ({toArray: () => []})) + this.findOne = jest.fn() + this.count = jest.fn() + this.deleteOne = jest.fn() + this.deleteMany = jest.fn(() => ({toArray: () => []})) + this.updateOne = jest.fn() + this.updateMany = jest.fn(() => ({toArray: () => []})) + this.collection = jest.fn(() => ({ insertOne: this.insertOne, find: this.find, + insertMany: this.insertMany, + findOne: this.findOne, + count: this.count, + deleteOne: this.deleteOne, + deleteMany: this.deleteMany, + updateOne: this.updateOne, + updateMany: this.updateMany, })) this.db = () => ({ diff --git a/packages/server/src/integrations/tests/mongo.spec.js b/packages/server/src/integrations/tests/mongo.spec.js index 1e37d5dd70..ce44617eb1 100644 --- a/packages/server/src/integrations/tests/mongo.spec.js +++ b/packages/server/src/integrations/tests/mongo.spec.js @@ -8,6 +8,13 @@ class TestConfiguration { } } +function disableConsole() { + jest.spyOn(console, 'error'); + console.error.mockImplementation(() => {}); + + return console.error.mockRestore; +} + describe("MongoDB Integration", () => { let config let indexName = "Users" @@ -22,7 +29,8 @@ describe("MongoDB Integration", () => { } const response = await config.integration.create({ index: indexName, - json: body + json: body, + extra: { collection: 'testCollection', actionTypes: 'insertOne'} }) expect(config.integration.client.insertOne).toHaveBeenCalledWith(body) }) @@ -31,10 +39,46 @@ describe("MongoDB Integration", () => { const query = { json: { address: "test" - } + }, + extra: { collection: 'testCollection', actionTypes: 'find'} } const response = await config.integration.read(query) expect(config.integration.client.find).toHaveBeenCalledWith(query.json) expect(response).toEqual(expect.any(Array)) }) + + it("calls the delete method with the correct params", async () => { + const query = { + json: { + id: "test" + }, + extra: { collection: 'testCollection', actionTypes: 'deleteOne'} + } + const response = await config.integration.delete(query) + expect(config.integration.client.deleteOne).toHaveBeenCalledWith(query.json) + }) + + it("calls the update method with the correct params", async () => { + const query = { + json: { + id: "test" + }, + extra: { collection: 'testCollection', actionTypes: 'updateOne'} + } + const response = await config.integration.update(query) + expect(config.integration.client.updateOne).toHaveBeenCalledWith(query.json) + }) + + it("throws an error when an invalid query.extra.actionType is passed for each method", async () => { + const restore = disableConsole() + + const query = { + extra: { collection: 'testCollection', actionTypes: 'deleteOne'} + } + // Weird, need to do an IIFE for jest to recognize that it throws + expect(() => config.integration.read(query)()).toThrow(expect.any(Object)) + + restore() + }) + }) \ No newline at end of file From 519d2bd0fb7d62d59cbddaa14d9da22e0fce3111 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Wed, 28 Jul 2021 09:09:37 +0200 Subject: [PATCH 003/260] replace spaces with underscores in screen routes --- packages/builder/cypress/integration/createScreen.js | 10 ++++++++++ packages/builder/cypress/support/commands.js | 4 +--- .../design/NavigationPanel/NewScreenModal.svelte | 1 + .../PropertyControls/PropertyControl.svelte | 8 +++++--- .../PropertiesPanel/ScreenSettingsSection.svelte | 10 +++++++--- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/packages/builder/cypress/integration/createScreen.js b/packages/builder/cypress/integration/createScreen.js index 4e166daaec..3595bb44f0 100644 --- a/packages/builder/cypress/integration/createScreen.js +++ b/packages/builder/cypress/integration/createScreen.js @@ -7,5 +7,15 @@ context("Screen Tests", () => { it("Should successfully create a screen", () => { cy.createScreen("Test Screen", "/test") + cy.get(".nav-items-container").within(() => { + cy.contains("/test").should("exist") + }) + }) + + it("Should update the url", () => { + cy.createScreen("Test Screen", "test with spaces") + cy.get(".nav-items-container").within(() => { + cy.contains("/test_with_spaces").should("exist") + }) }) }) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index d7452284a4..ec28b21d8e 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -160,7 +160,5 @@ Cypress.Commands.add("createScreen", (screenName, route) => { cy.get("input").eq(1).type(route) cy.get(".spectrum-Button--cta").click() }) - cy.get(".nav-items-container").within(() => { - cy.contains(route).should("exist") - }) + }) diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index a4c057abba..31842b984e 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -84,6 +84,7 @@ if (!event.detail.startsWith("/")) { route = "/" + event.detail } + route = route.replaceAll(' ', '_') } diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte index 40d579e9c9..900beca5ce 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte @@ -8,6 +8,7 @@ } from "builderStore/dataBinding" import BindingPanel from "components/common/bindings/BindingPanel.svelte" import { capitalise } from "helpers" + import { createEventDispatcher } from "svelte" export let label = "" export let bindable = true @@ -17,11 +18,12 @@ export let type = "" export let value = null export let props = {} - export let onChange = () => {} let bindingDrawer let anchor let valid + let dispatch = createEventDispatcher(); + $: bindableProperties = getBindableProperties( $currentAsset, @@ -53,9 +55,9 @@ } if (typeof innerVal === "string") { - onChange(replaceBindings(innerVal)) + dispatch('change', replaceBindings(innerVal)) } else { - onChange(innerVal) + dispatch('change', innerVal) } } diff --git a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte index a153c4fc87..b25964c5e5 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte @@ -10,7 +10,11 @@ export let componentInstance - function setAssetProps(name, value) { + function setAssetProps(name, value, parser) { + if (parser && typeof parser === 'function') { + value = parser(value) + } + const selectedAsset = get(currentAsset) store.update(state => { if ( @@ -28,7 +32,7 @@ const screenSettings = [ // { key: "description", label: "Description", control: Input }, - { key: "routing.route", label: "Route", control: Input }, + { key: "routing.route", label: "Route", control: Input, parser: (val) => val.replaceAll(' ', '_') }, { key: "routing.roleId", label: "Access", control: RoleSelect }, { key: "layoutId", label: "Layout", control: LayoutSelect }, ] @@ -43,7 +47,7 @@ label={def.label} key={def.key} value={deepGet($currentAsset, def.key)} - onChange={val => setAssetProps(def.key, val)} + on:change={event => setAssetProps(def.key, event.detail, def.parser)} /> {/each} From a77b386f6e0a8e012121af99207cb49260b07f0a Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Wed, 28 Jul 2021 10:19:10 +0200 Subject: [PATCH 004/260] fix lint issues --- packages/builder/cypress/support/commands.js | 1 - .../design/NavigationPanel/NewScreenModal.svelte | 2 +- .../PropertyControls/PropertyControl.svelte | 7 +++---- .../design/PropertiesPanel/ScreenSettingsSection.svelte | 9 +++++++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index ec28b21d8e..261b840577 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -160,5 +160,4 @@ Cypress.Commands.add("createScreen", (screenName, route) => { cy.get("input").eq(1).type(route) cy.get(".spectrum-Button--cta").click() }) - }) diff --git a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte index 31842b984e..96515478ab 100644 --- a/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte +++ b/packages/builder/src/components/design/NavigationPanel/NewScreenModal.svelte @@ -84,7 +84,7 @@ if (!event.detail.startsWith("/")) { route = "/" + event.detail } - route = route.replaceAll(' ', '_') + route = route.replaceAll(" ", "_") } diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte index 900beca5ce..7629afa40d 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte @@ -22,8 +22,7 @@ let bindingDrawer let anchor let valid - let dispatch = createEventDispatcher(); - + let dispatch = createEventDispatcher() $: bindableProperties = getBindableProperties( $currentAsset, @@ -55,9 +54,9 @@ } if (typeof innerVal === "string") { - dispatch('change', replaceBindings(innerVal)) + dispatch("change", replaceBindings(innerVal)) } else { - dispatch('change', innerVal) + dispatch("change", innerVal) } } diff --git a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte index b25964c5e5..db8cb1fd61 100644 --- a/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/ScreenSettingsSection.svelte @@ -11,7 +11,7 @@ export let componentInstance function setAssetProps(name, value, parser) { - if (parser && typeof parser === 'function') { + if (parser && typeof parser === "function") { value = parser(value) } @@ -32,7 +32,12 @@ const screenSettings = [ // { key: "description", label: "Description", control: Input }, - { key: "routing.route", label: "Route", control: Input, parser: (val) => val.replaceAll(' ', '_') }, + { + key: "routing.route", + label: "Route", + control: Input, + parser: val => val.replaceAll(" ", "_"), + }, { key: "routing.roleId", label: "Access", control: RoleSelect }, { key: "layoutId", label: "Layout", control: LayoutSelect }, ] From 8ec5e7f8ce97171ace62ed774a0427d64c9afa72 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Wed, 28 Jul 2021 11:30:57 +0200 Subject: [PATCH 005/260] revert change to event dispatcher --- .../PropertyControls/PropertyControl.svelte | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte index 7629afa40d..40d579e9c9 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte @@ -8,7 +8,6 @@ } from "builderStore/dataBinding" import BindingPanel from "components/common/bindings/BindingPanel.svelte" import { capitalise } from "helpers" - import { createEventDispatcher } from "svelte" export let label = "" export let bindable = true @@ -18,11 +17,11 @@ export let type = "" export let value = null export let props = {} + export let onChange = () => {} let bindingDrawer let anchor let valid - let dispatch = createEventDispatcher() $: bindableProperties = getBindableProperties( $currentAsset, @@ -54,9 +53,9 @@ } if (typeof innerVal === "string") { - dispatch("change", replaceBindings(innerVal)) + onChange(replaceBindings(innerVal)) } else { - dispatch("change", innerVal) + onChange(innerVal) } } From 0f1bb2ccff70bbf163eac889adb732eda563d470 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 29 Jul 2021 10:11:52 +0100 Subject: [PATCH 006/260] fix mongo code review comment --- packages/server/src/definitions/datasource.ts | 4 +- packages/server/src/integrations/mongodb.ts | 79 ++++++++++--------- 2 files changed, 45 insertions(+), 38 deletions(-) diff --git a/packages/server/src/definitions/datasource.ts b/packages/server/src/definitions/datasource.ts index 63de7f0d2a..ec6a0db9c9 100644 --- a/packages/server/src/definitions/datasource.ts +++ b/packages/server/src/definitions/datasource.ts @@ -51,8 +51,8 @@ export interface QueryDefinition { export interface ExtraQueryConfig { [key: string]: { - displayName: string, - type: string, + displayName: string + type: string required: boolean data?: object } diff --git a/packages/server/src/integrations/mongodb.ts b/packages/server/src/integrations/mongodb.ts index ab21da6fd0..bbab9a0d84 100644 --- a/packages/server/src/integrations/mongodb.ts +++ b/packages/server/src/integrations/mongodb.ts @@ -10,7 +10,6 @@ module MongoDBModule { interface MongoDBConfig { connectionString: string db: string - // collection: string } const SCHEMA: Integration = { @@ -41,26 +40,26 @@ module MongoDBModule { }, delete: { type: QueryTypes.JSON, - } + }, }, extra: { collection: { - displayName: "Collection", - type: DatasourceFieldTypes.STRING, - required: true, + displayName: "Collection", + type: DatasourceFieldTypes.STRING, + required: true, }, actionTypes: { displayName: "Action Types", type: DatasourceFieldTypes.LIST, required: true, data: { - read: ['find', 'findOne', 'findOneAndUpdate', "count", "distinct"], - create: ['insertOne', 'insertMany'], - update: ['updateOne', 'updateMany'], - delete: ['deleteOne', 'deleteMany'] - } - } - } + read: ["find", "findOne", "findOneAndUpdate", "count", "distinct"], + create: ["insertOne", "insertMany"], + update: ["updateOne", "updateMany"], + delete: ["deleteOne", "deleteMany"], + }, + }, + }, } class MongoIntegration { @@ -76,23 +75,25 @@ module MongoDBModule { return this.client.connect() } - async create(query: { json: object, extra: { [key: string]: string } }) { + async create(query: { json: object; extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) const collection = db.collection(query.extra.collection) - // For mongodb we add an extra actionType to specify + // For mongodb we add an extra actionType to specify // which method we want to call on the collection - switch(query.extra.actionTypes) { - case 'insertOne': { + switch (query.extra.actionTypes) { + case "insertOne": { return collection.insertOne(query.json) } - case 'insertMany': { + case "insertMany": { return collection.insertOne(query.json).toArray() } default: { - throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for create`) + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for create` + ) } } } catch (err) { @@ -103,30 +104,32 @@ module MongoDBModule { } } - async read(query: { json: object, extra: { [key: string]: string } }) { + async read(query: { json: object; extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) const collection = db.collection(query.extra.collection) - switch(query.extra.actionTypes) { - case 'find': { + switch (query.extra.actionTypes) { + case "find": { return collection.find(query.json).toArray() } - case 'findOne': { + case "findOne": { return collection.findOne(query.json) } - case 'findOneAndUpdate': { + case "findOneAndUpdate": { return collection.findOneAndUpdate(query.json) } - case 'count': { + case "count": { return collection.countDocuments(query.json) } - case 'distinct': { + case "distinct": { return collection.distinct(query.json) } default: { - throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for read`) + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for read` + ) } } } catch (err) { @@ -137,21 +140,23 @@ module MongoDBModule { } } - async update(query: { json: object, extra: { [key: string]: string } }) { + async update(query: { json: object; extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) const collection = db.collection(query.extra.collection) - switch(query.extra.actionTypes) { - case 'updateOne': { + switch (query.extra.actionTypes) { + case "updateOne": { return collection.updateOne(query.json) } - case 'updateMany': { + case "updateMany": { return collection.updateMany(query.json).toArray() } default: { - throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for update`) + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for update` + ) } } } catch (err) { @@ -162,21 +167,23 @@ module MongoDBModule { } } - async delete(query: { json: object, extra: { [key: string]: string } }) { + async delete(query: { json: object; extra: { [key: string]: string } }) { try { await this.connect() const db = this.client.db(this.config.db) const collection = db.collection(query.extra.collection) - switch(query.extra.actionTypes) { - case 'deleteOne': { + switch (query.extra.actionTypes) { + case "deleteOne": { return collection.deleteOne(query.json) } - case 'deleteMany': { + case "deleteMany": { return collection.deleteMany(query.json).toArray() } default: { - throw new Error(`actionType ${query.extra.actionTypes} does not exist on DB for delete`) + throw new Error( + `actionType ${query.extra.actionTypes} does not exist on DB for delete` + ) } } } catch (err) { From 4f2a2d3090203c3cd0705741bcfdc56984dcc967 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 29 Jul 2021 09:19:25 +0000 Subject: [PATCH 007/260] v0.9.86-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 | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 7c535c5420..e89c3049d8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.85", + "version": "0.9.86-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index a1955c3942..455e236b6b 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.85", + "version": "0.9.86-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 fd2943293a..de5aa3aad9 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.85", + "version": "0.9.86-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 9f8de0a45c..390aea4b6b 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.85", + "version": "0.9.86-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.85", - "@budibase/client": "^0.9.85", + "@budibase/bbui": "^0.9.86-alpha.0", + "@budibase/client": "^0.9.86-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.85", + "@budibase/string-templates": "^0.9.86-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 b98945fcfa..914aa6cd76 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.85", + "version": "0.9.86-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 4d52b28faa..3eb2d7b0e0 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.85", + "version": "0.9.86-alpha.0", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.85", - "@budibase/standard-components": "^0.9.85", - "@budibase/string-templates": "^0.9.85", + "@budibase/bbui": "^0.9.86-alpha.0", + "@budibase/standard-components": "^0.9.86-alpha.0", + "@budibase/string-templates": "^0.9.86-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 5dd51e5613..1033200c7a 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.85", + "version": "0.9.86-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -60,9 +60,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.85", - "@budibase/client": "^0.9.85", - "@budibase/string-templates": "^0.9.85", + "@budibase/auth": "^0.9.86-alpha.0", + "@budibase/client": "^0.9.86-alpha.0", + "@budibase/string-templates": "^0.9.86-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -115,7 +115,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.85", + "@budibase/standard-components": "^0.9.86-alpha.0", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index a473e0642d..5324f00670 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.85", + "version": "0.9.86-alpha.0", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.85", + "@budibase/bbui": "^0.9.86-alpha.0", "@spectrum-css/card": "^3.0.3", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index c332e6c843..6a66e67af6 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.85", + "version": "0.9.86-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 e9cf94d258..f080a80944 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.85", + "version": "0.9.86-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.85", - "@budibase/string-templates": "^0.9.85", + "@budibase/auth": "^0.9.86-alpha.0", + "@budibase/string-templates": "^0.9.86-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From da3dfe62668c5aa8bcfce547acc884eff2e7defa Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 29 Jul 2021 10:55:31 +0100 Subject: [PATCH 008/260] Merge master -> develop version bump 0.9.86 --- 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 | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index e89c3049d8..f5726646c4 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.86-alpha.0", + "version": "0.9.86", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 455e236b6b..dc41a16a0d 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.86-alpha.0", + "version": "0.9.86", "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 de5aa3aad9..a28c17b137 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.86-alpha.0", + "version": "0.9.86", "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 390aea4b6b..e9058f9b39 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.86-alpha.0", + "version": "0.9.86", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.86-alpha.0", - "@budibase/client": "^0.9.86-alpha.0", + "@budibase/bbui": "^0.9.86", + "@budibase/client": "^0.9.86", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.86-alpha.0", + "@budibase/string-templates": "^0.9.86", "@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 914aa6cd76..e026633a3c 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.86-alpha.0", + "version": "0.9.86", "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 3eb2d7b0e0..411f93275f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.86-alpha.0", + "version": "0.9.86", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.86-alpha.0", - "@budibase/standard-components": "^0.9.86-alpha.0", - "@budibase/string-templates": "^0.9.86-alpha.0", + "@budibase/bbui": "^0.9.86", + "@budibase/standard-components": "^0.9.86", + "@budibase/string-templates": "^0.9.86", "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 1033200c7a..68bebed65f 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.86-alpha.0", + "version": "0.9.86", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -60,9 +60,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.86-alpha.0", - "@budibase/client": "^0.9.86-alpha.0", - "@budibase/string-templates": "^0.9.86-alpha.0", + "@budibase/auth": "^0.9.86", + "@budibase/client": "^0.9.86", + "@budibase/string-templates": "^0.9.86", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -115,7 +115,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.86-alpha.0", + "@budibase/standard-components": "^0.9.86", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 5324f00670..8f3349c3ab 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.86-alpha.0", + "version": "0.9.86", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.86-alpha.0", + "@budibase/bbui": "^0.9.86", "@spectrum-css/card": "^3.0.3", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 6a66e67af6..e628d5b5ab 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.86-alpha.0", + "version": "0.9.86", "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 f080a80944..5f43e6a4bb 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.86-alpha.0", + "version": "0.9.86", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.86-alpha.0", - "@budibase/string-templates": "^0.9.86-alpha.0", + "@budibase/auth": "^0.9.86", + "@budibase/string-templates": "^0.9.86", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 96d11ef07fca69164c1a393e67ff40ebf9f37dfb Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 29 Jul 2021 10:20:04 +0000 Subject: [PATCH 009/260] v0.9.87-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 | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index f5726646c4..3811879b86 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.86", + "version": "0.9.87-alpha.0", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index dc41a16a0d..b7420e5ed3 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.86", + "version": "0.9.87-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 a28c17b137..8bd1d0f66f 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.86", + "version": "0.9.87-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 e9058f9b39..23ce0016d6 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.86", + "version": "0.9.87-alpha.0", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.86", - "@budibase/client": "^0.9.86", + "@budibase/bbui": "^0.9.87-alpha.0", + "@budibase/client": "^0.9.87-alpha.0", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.86", + "@budibase/string-templates": "^0.9.87-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 e026633a3c..f2e223b72d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.86", + "version": "0.9.87-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 411f93275f..84eb0b25c9 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.86", + "version": "0.9.87-alpha.0", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.86", - "@budibase/standard-components": "^0.9.86", - "@budibase/string-templates": "^0.9.86", + "@budibase/bbui": "^0.9.87-alpha.0", + "@budibase/standard-components": "^0.9.87-alpha.0", + "@budibase/string-templates": "^0.9.87-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 68bebed65f..79399d2d39 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.86", + "version": "0.9.87-alpha.0", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -60,9 +60,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.86", - "@budibase/client": "^0.9.86", - "@budibase/string-templates": "^0.9.86", + "@budibase/auth": "^0.9.87-alpha.0", + "@budibase/client": "^0.9.87-alpha.0", + "@budibase/string-templates": "^0.9.87-alpha.0", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -115,7 +115,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.86", + "@budibase/standard-components": "^0.9.87-alpha.0", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 8f3349c3ab..b69fab1229 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.86", + "version": "0.9.87-alpha.0", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.86", + "@budibase/bbui": "^0.9.87-alpha.0", "@spectrum-css/card": "^3.0.3", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index e628d5b5ab..dbb1a9c2cd 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.86", + "version": "0.9.87-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 5f43e6a4bb..a7547abe0d 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.86", + "version": "0.9.87-alpha.0", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.86", - "@budibase/string-templates": "^0.9.86", + "@budibase/auth": "^0.9.87-alpha.0", + "@budibase/string-templates": "^0.9.87-alpha.0", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 73d1cb41d87e12aa1a2b60b54424023c6eb5d8a7 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 29 Jul 2021 14:43:23 +0100 Subject: [PATCH 010/260] Sync profile picture when using SSO --- .../middleware/passport/third-party-common.js | 23 +++++++++++++++++-- .../src/pages/builder/apps/index.svelte | 6 ++++- .../src/pages/builder/portal/_layout.svelte | 6 ++++- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/packages/auth/src/middleware/passport/third-party-common.js b/packages/auth/src/middleware/passport/third-party-common.js index 2ab2816391..01125dfebb 100644 --- a/packages/auth/src/middleware/passport/third-party-common.js +++ b/packages/auth/src/middleware/passport/third-party-common.js @@ -6,6 +6,7 @@ const { authError } = require("./utils") const { newid } = require("../../hashing") const { createASession } = require("../../security/sessions") const { getGlobalUserByEmail } = require("../../utils") +const { default: fetch } = require("node-fetch") /** * Common authentication logic for third parties. e.g. OAuth, OIDC. @@ -65,7 +66,7 @@ exports.authenticateThirdParty = async function ( } } - dbUser = syncUser(dbUser, thirdPartyUser) + dbUser = await syncUser(dbUser, thirdPartyUser) // create or sync the user const response = await db.post(dbUser) @@ -86,10 +87,26 @@ exports.authenticateThirdParty = async function ( return done(null, dbUser) } +async function syncProfilePicture(user, thirdPartyUser) { + const pictureUrl = thirdPartyUser.profile._json.picture + if (pictureUrl) { + const response = await fetch(pictureUrl) + + if (response.status === 200) { + const type = response.headers.get("content-type") + if (type.startsWith("image/")) { + user.pictureUrl = pictureUrl + } + } + } + + return user +} + /** * @returns a user that has been sync'd with third party information */ -function syncUser(user, thirdPartyUser) { +async function syncUser(user, thirdPartyUser) { // provider user.provider = thirdPartyUser.provider user.providerType = thirdPartyUser.providerType @@ -112,6 +129,8 @@ function syncUser(user, thirdPartyUser) { } } + user = await syncProfilePicture(user, thirdPartyUser) + // profile user.thirdPartyProfile = { ...profile._json, diff --git a/packages/builder/src/pages/builder/apps/index.svelte b/packages/builder/src/pages/builder/apps/index.svelte index 69b6e770f6..c1bdc31cd4 100644 --- a/packages/builder/src/pages/builder/apps/index.svelte +++ b/packages/builder/src/pages/builder/apps/index.svelte @@ -54,7 +54,11 @@
- +
userInfoModal.show()}> diff --git a/packages/builder/src/pages/builder/portal/_layout.svelte b/packages/builder/src/pages/builder/portal/_layout.svelte index 4bc0b46167..20bdc9cb54 100644 --- a/packages/builder/src/pages/builder/portal/_layout.svelte +++ b/packages/builder/src/pages/builder/portal/_layout.svelte @@ -100,7 +100,11 @@
- +
userInfoModal.show()}> From dd8b1361d82a907f86a7d507d9966d4655bb18c3 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 29 Jul 2021 14:51:35 +0100 Subject: [PATCH 011/260] Fix import --- packages/auth/src/middleware/passport/third-party-common.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/auth/src/middleware/passport/third-party-common.js b/packages/auth/src/middleware/passport/third-party-common.js index 01125dfebb..54252b329d 100644 --- a/packages/auth/src/middleware/passport/third-party-common.js +++ b/packages/auth/src/middleware/passport/third-party-common.js @@ -6,7 +6,7 @@ const { authError } = require("./utils") const { newid } = require("../../hashing") const { createASession } = require("../../security/sessions") const { getGlobalUserByEmail } = require("../../utils") -const { default: fetch } = require("node-fetch") +const fetch = require("node-fetch") /** * Common authentication logic for third parties. e.g. OAuth, OIDC. From e17435aef79c024ac51855047b1f3970ea64b1f3 Mon Sep 17 00:00:00 2001 From: Maurits Lourens Date: Thu, 29 Jul 2021 16:21:02 +0200 Subject: [PATCH 012/260] Add size componentStyle options to form controls --- packages/standard-components/manifest.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/standard-components/manifest.json b/packages/standard-components/manifest.json index e0603c0f0b..c18d85d835 100644 --- a/packages/standard-components/manifest.json +++ b/packages/standard-components/manifest.json @@ -1679,6 +1679,7 @@ "name": "Field Group", "icon": "Group", "illegalChildren": ["section"], + "styles": ["size"], "hasChildren": true, "settings": [ { @@ -1707,6 +1708,7 @@ "name": "Text Field", "icon": "Text", "illegalChildren": ["section"], + "styles": ["size"], "settings": [ { "type": "field/string", @@ -1734,6 +1736,7 @@ "numberfield": { "name": "Number Field", "icon": "123", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -1762,6 +1765,7 @@ "passwordfield": { "name": "Password Field", "icon": "LockClosed", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -1790,6 +1794,7 @@ "optionsfield": { "name": "Options Picker", "icon": "ViewList", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -1819,6 +1824,7 @@ "booleanfield": { "name": "Checkbox", "icon": "Checkmark", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -1847,6 +1853,7 @@ "longformfield": { "name": "Rich Text", "icon": "TextParagraph", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -1876,6 +1883,7 @@ "datetimefield": { "name": "Date Picker", "icon": "DateInput", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -1910,6 +1918,7 @@ "attachmentfield": { "name": "Attachment", "icon": "Attach", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -1933,6 +1942,7 @@ "relationshipfield": { "name": "Relationship Picker", "icon": "TaskList", + "styles": ["size"], "illegalChildren": ["section"], "settings": [ { @@ -2066,6 +2076,7 @@ "daterangepicker": { "name": "Date Range", "icon": "Date", + "styles": ["size"], "hasChildren": false, "info": "Your data provider will be automatically filtered to the given date range.", "settings": [ From 8bc6ed5b3467cb22cba41e09a423d7e992f98663 Mon Sep 17 00:00:00 2001 From: Martin McKeaveney Date: Thu, 29 Jul 2021 15:30:29 +0100 Subject: [PATCH 013/260] readd one to many --- .../backend/DataTable/modals/CreateEditColumn.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte index 7f02b3c215..35722481db 100644 --- a/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte +++ b/packages/builder/src/components/backend/DataTable/modals/CreateEditColumn.svelte @@ -172,6 +172,11 @@ alt: `Many ${table.name} rows → many ${linkTable.name} rows`, value: RelationshipTypes.MANY_TO_MANY, }, + { + name: `One ${linkName} row → many ${thisName} rows`, + alt: `One ${linkTable.name} rows → many ${table.name} rows`, + value: RelationshipTypes.ONE_TO_MANY, + }, { name: `One ${thisName} row → many ${linkName} rows`, alt: `One ${table.name} rows → many ${linkTable.name} rows`, From 648661877af572ba155a06d1b2985f88be86d3a4 Mon Sep 17 00:00:00 2001 From: Rory Powell Date: Thu, 29 Jul 2021 20:32:18 +0100 Subject: [PATCH 014/260] Add watchtower hooks --- packages/server/.gitignore | 1 + packages/server/Dockerfile | 5 +++++ packages/server/scripts/watchtower-hooks/post-check.sh | 1 + packages/server/scripts/watchtower-hooks/post-update.sh | 1 + packages/server/scripts/watchtower-hooks/pre-check.sh | 1 + packages/server/scripts/watchtower-hooks/pre-update.sh | 1 + packages/worker/.gitignore | 1 + packages/worker/Dockerfile | 5 +++++ packages/worker/scripts/watchtower-hooks/post-check.sh | 1 + packages/worker/scripts/watchtower-hooks/post-update.sh | 1 + packages/worker/scripts/watchtower-hooks/pre-check.sh | 1 + packages/worker/scripts/watchtower-hooks/pre-update.sh | 1 + 12 files changed, 20 insertions(+) create mode 100755 packages/server/scripts/watchtower-hooks/post-check.sh create mode 100755 packages/server/scripts/watchtower-hooks/post-update.sh create mode 100755 packages/server/scripts/watchtower-hooks/pre-check.sh create mode 100755 packages/server/scripts/watchtower-hooks/pre-update.sh create mode 100755 packages/worker/scripts/watchtower-hooks/post-check.sh create mode 100755 packages/worker/scripts/watchtower-hooks/post-update.sh create mode 100755 packages/worker/scripts/watchtower-hooks/pre-check.sh create mode 100755 packages/worker/scripts/watchtower-hooks/pre-update.sh diff --git a/packages/server/.gitignore b/packages/server/.gitignore index e8589f631d..48207e3dd4 100644 --- a/packages/server/.gitignore +++ b/packages/server/.gitignore @@ -7,3 +7,4 @@ public/ db/dev.db/ dist coverage/ +watchtower-hook.json \ No newline at end of file diff --git a/packages/server/Dockerfile b/packages/server/Dockerfile index 253bcb339d..b2e4efadb9 100644 --- a/packages/server/Dockerfile +++ b/packages/server/Dockerfile @@ -1,5 +1,10 @@ FROM node:12-alpine +LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="scripts/watchtower-hooks/pre-check.sh" +LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-hooks/pre-update.sh" +LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh" +LABEL com.centurylinklabs.watchtower.lifecycle.post-check="scripts/watchtower-hooks/post-check.sh" + WORKDIR /app ENV PORT=4001 diff --git a/packages/server/scripts/watchtower-hooks/post-check.sh b/packages/server/scripts/watchtower-hooks/post-check.sh new file mode 100755 index 0000000000..df95917d98 --- /dev/null +++ b/packages/server/scripts/watchtower-hooks/post-check.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "post-check" }' > 'watchtower-hook.json' \ No newline at end of file diff --git a/packages/server/scripts/watchtower-hooks/post-update.sh b/packages/server/scripts/watchtower-hooks/post-update.sh new file mode 100755 index 0000000000..fe57719781 --- /dev/null +++ b/packages/server/scripts/watchtower-hooks/post-update.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "post-update" }' > 'watchtower-hook.json' \ No newline at end of file diff --git a/packages/server/scripts/watchtower-hooks/pre-check.sh b/packages/server/scripts/watchtower-hooks/pre-check.sh new file mode 100755 index 0000000000..ffaa41ad5f --- /dev/null +++ b/packages/server/scripts/watchtower-hooks/pre-check.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "pre-check" }' > 'watchtower-hook.json' \ No newline at end of file diff --git a/packages/server/scripts/watchtower-hooks/pre-update.sh b/packages/server/scripts/watchtower-hooks/pre-update.sh new file mode 100755 index 0000000000..4584d96fc9 --- /dev/null +++ b/packages/server/scripts/watchtower-hooks/pre-update.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "pre-update" }' > 'watchtower-hook.json' \ No newline at end of file diff --git a/packages/worker/.gitignore b/packages/worker/.gitignore index 713d5006da..0467f6a505 100644 --- a/packages/worker/.gitignore +++ b/packages/worker/.gitignore @@ -1,2 +1,3 @@ node_modules/ .env +watchtower-hook.json \ No newline at end of file diff --git a/packages/worker/Dockerfile b/packages/worker/Dockerfile index 76b35dfdd0..517e24678f 100644 --- a/packages/worker/Dockerfile +++ b/packages/worker/Dockerfile @@ -1,5 +1,10 @@ FROM node:12-alpine +LABEL com.centurylinklabs.watchtower.lifecycle.pre-check="scripts/watchtower-hooks/pre-check.sh" +LABEL com.centurylinklabs.watchtower.lifecycle.pre-update="scripts/watchtower-hooks/pre-update.sh" +LABEL com.centurylinklabs.watchtower.lifecycle.post-update="scripts/watchtower-hooks/post-update.sh" +LABEL com.centurylinklabs.watchtower.lifecycle.post-check="scripts/watchtower-hooks/post-check.sh" + WORKDIR /app # copy files and install dependencies diff --git a/packages/worker/scripts/watchtower-hooks/post-check.sh b/packages/worker/scripts/watchtower-hooks/post-check.sh new file mode 100755 index 0000000000..df95917d98 --- /dev/null +++ b/packages/worker/scripts/watchtower-hooks/post-check.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "post-check" }' > 'watchtower-hook.json' \ No newline at end of file diff --git a/packages/worker/scripts/watchtower-hooks/post-update.sh b/packages/worker/scripts/watchtower-hooks/post-update.sh new file mode 100755 index 0000000000..fe57719781 --- /dev/null +++ b/packages/worker/scripts/watchtower-hooks/post-update.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "post-update" }' > 'watchtower-hook.json' \ No newline at end of file diff --git a/packages/worker/scripts/watchtower-hooks/pre-check.sh b/packages/worker/scripts/watchtower-hooks/pre-check.sh new file mode 100755 index 0000000000..ffaa41ad5f --- /dev/null +++ b/packages/worker/scripts/watchtower-hooks/pre-check.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "pre-check" }' > 'watchtower-hook.json' \ No newline at end of file diff --git a/packages/worker/scripts/watchtower-hooks/pre-update.sh b/packages/worker/scripts/watchtower-hooks/pre-update.sh new file mode 100755 index 0000000000..4584d96fc9 --- /dev/null +++ b/packages/worker/scripts/watchtower-hooks/pre-update.sh @@ -0,0 +1 @@ +echo '{ "current-hook" : "pre-update" }' > 'watchtower-hook.json' \ No newline at end of file From 699c1964dc8c2f0f1692e7633f8ec36b1dd18561 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Thu, 29 Jul 2021 21:44:52 +0000 Subject: [PATCH 015/260] v0.9.87-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 | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 3811879b86..0a011bc6c8 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.87-alpha.0", + "version": "0.9.87-alpha.1", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index b7420e5ed3..5349f7be64 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.87-alpha.0", + "version": "0.9.87-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 8bd1d0f66f..ebe069d389 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.87-alpha.0", + "version": "0.9.87-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 23ce0016d6..16c8b668c1 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.87-alpha.0", + "version": "0.9.87-alpha.1", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.0", - "@budibase/client": "^0.9.87-alpha.0", + "@budibase/bbui": "^0.9.87-alpha.1", + "@budibase/client": "^0.9.87-alpha.1", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.87-alpha.0", + "@budibase/string-templates": "^0.9.87-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 f2e223b72d..05599cf4e5 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.87-alpha.0", + "version": "0.9.87-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 84eb0b25c9..b8c9738b8c 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.87-alpha.0", + "version": "0.9.87-alpha.1", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.0", - "@budibase/standard-components": "^0.9.87-alpha.0", - "@budibase/string-templates": "^0.9.87-alpha.0", + "@budibase/bbui": "^0.9.87-alpha.1", + "@budibase/standard-components": "^0.9.87-alpha.1", + "@budibase/string-templates": "^0.9.87-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 79399d2d39..be80d07f8b 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.87-alpha.0", + "version": "0.9.87-alpha.1", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -60,9 +60,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.87-alpha.0", - "@budibase/client": "^0.9.87-alpha.0", - "@budibase/string-templates": "^0.9.87-alpha.0", + "@budibase/auth": "^0.9.87-alpha.1", + "@budibase/client": "^0.9.87-alpha.1", + "@budibase/string-templates": "^0.9.87-alpha.1", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -115,7 +115,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.87-alpha.0", + "@budibase/standard-components": "^0.9.87-alpha.1", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index b69fab1229..002d5490cd 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.87-alpha.0", + "version": "0.9.87-alpha.1", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.0", + "@budibase/bbui": "^0.9.87-alpha.1", "@spectrum-css/card": "^3.0.3", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index dbb1a9c2cd..2e2fb3829e 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.87-alpha.0", + "version": "0.9.87-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 a7547abe0d..abb20a784b 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.87-alpha.0", + "version": "0.9.87-alpha.1", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.87-alpha.0", - "@budibase/string-templates": "^0.9.87-alpha.0", + "@budibase/auth": "^0.9.87-alpha.1", + "@budibase/string-templates": "^0.9.87-alpha.1", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From ffbcaf177798e28986811e681a59e4fb99659345 Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 30 Jul 2021 10:33:02 +0000 Subject: [PATCH 016/260] v0.9.87-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 | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 0a011bc6c8..493062234c 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.87-alpha.1", + "version": "0.9.87-alpha.2", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 5349f7be64..072fab9c7e 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.87-alpha.1", + "version": "0.9.87-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 ebe069d389..01b51486a7 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.87-alpha.1", + "version": "0.9.87-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 16c8b668c1..429b89b307 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.87-alpha.1", + "version": "0.9.87-alpha.2", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.1", - "@budibase/client": "^0.9.87-alpha.1", + "@budibase/bbui": "^0.9.87-alpha.2", + "@budibase/client": "^0.9.87-alpha.2", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.87-alpha.1", + "@budibase/string-templates": "^0.9.87-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 05599cf4e5..4d843a2388 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.87-alpha.1", + "version": "0.9.87-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 b8c9738b8c..7379322f9f 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.87-alpha.1", + "version": "0.9.87-alpha.2", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.1", - "@budibase/standard-components": "^0.9.87-alpha.1", - "@budibase/string-templates": "^0.9.87-alpha.1", + "@budibase/bbui": "^0.9.87-alpha.2", + "@budibase/standard-components": "^0.9.87-alpha.2", + "@budibase/string-templates": "^0.9.87-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 be80d07f8b..59396477f6 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.87-alpha.1", + "version": "0.9.87-alpha.2", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -60,9 +60,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.87-alpha.1", - "@budibase/client": "^0.9.87-alpha.1", - "@budibase/string-templates": "^0.9.87-alpha.1", + "@budibase/auth": "^0.9.87-alpha.2", + "@budibase/client": "^0.9.87-alpha.2", + "@budibase/string-templates": "^0.9.87-alpha.2", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -115,7 +115,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.87-alpha.1", + "@budibase/standard-components": "^0.9.87-alpha.2", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index 002d5490cd..c8269d28d8 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.87-alpha.1", + "version": "0.9.87-alpha.2", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.1", + "@budibase/bbui": "^0.9.87-alpha.2", "@spectrum-css/card": "^3.0.3", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index 2e2fb3829e..a8fda772b1 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.87-alpha.1", + "version": "0.9.87-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 abb20a784b..ca58744743 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.87-alpha.1", + "version": "0.9.87-alpha.2", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.87-alpha.1", - "@budibase/string-templates": "^0.9.87-alpha.1", + "@budibase/auth": "^0.9.87-alpha.2", + "@budibase/string-templates": "^0.9.87-alpha.2", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From 03e66795e4b388b14f1387e5cd57d790b1cc2d0c Mon Sep 17 00:00:00 2001 From: Budibase Staging Release Bot <> Date: Fri, 30 Jul 2021 11:04:41 +0000 Subject: [PATCH 017/260] v0.9.87-alpha.3 --- 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 | 8 ++++---- packages/server/package.json | 10 +++++----- packages/standard-components/package.json | 4 ++-- packages/string-templates/package.json | 2 +- packages/worker/package.json | 6 +++--- 10 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lerna.json b/lerna.json index 493062234c..0ee92c01b0 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.87-alpha.2", + "version": "0.9.87-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 072fab9c7e..6898b2ab8c 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.87-alpha.2", + "version": "0.9.87-alpha.3", "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 01b51486a7..6b8bc2e96d 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.87-alpha.2", + "version": "0.9.87-alpha.3", "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 429b89b307..19a0d1e0fd 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.87-alpha.2", + "version": "0.9.87-alpha.3", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.2", - "@budibase/client": "^0.9.87-alpha.2", + "@budibase/bbui": "^0.9.87-alpha.3", + "@budibase/client": "^0.9.87-alpha.3", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.87-alpha.2", + "@budibase/string-templates": "^0.9.87-alpha.3", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index 4d843a2388..64b5541666 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.87-alpha.2", + "version": "0.9.87-alpha.3", "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 7379322f9f..148e48ec5b 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.87-alpha.2", + "version": "0.9.87-alpha.3", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -18,9 +18,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.2", - "@budibase/standard-components": "^0.9.87-alpha.2", - "@budibase/string-templates": "^0.9.87-alpha.2", + "@budibase/bbui": "^0.9.87-alpha.3", + "@budibase/standard-components": "^0.9.87-alpha.3", + "@budibase/string-templates": "^0.9.87-alpha.3", "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 59396477f6..83fb3177a1 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.87-alpha.2", + "version": "0.9.87-alpha.3", "description": "Budibase Web Server", "main": "src/index.js", "repository": { @@ -60,9 +60,9 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.87-alpha.2", - "@budibase/client": "^0.9.87-alpha.2", - "@budibase/string-templates": "^0.9.87-alpha.2", + "@budibase/auth": "^0.9.87-alpha.3", + "@budibase/client": "^0.9.87-alpha.3", + "@budibase/string-templates": "^0.9.87-alpha.3", "@elastic/elasticsearch": "7.10.0", "@koa/router": "8.0.0", "@sendgrid/mail": "7.1.1", @@ -115,7 +115,7 @@ "devDependencies": { "@babel/core": "^7.14.3", "@babel/preset-env": "^7.14.4", - "@budibase/standard-components": "^0.9.87-alpha.2", + "@budibase/standard-components": "^0.9.87-alpha.3", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index c8269d28d8..c6a5c3c9fb 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,11 +29,11 @@ "keywords": [ "svelte" ], - "version": "0.9.87-alpha.2", + "version": "0.9.87-alpha.3", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { - "@budibase/bbui": "^0.9.87-alpha.2", + "@budibase/bbui": "^0.9.87-alpha.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a8fda772b1..c6f6c9c061 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.87-alpha.2", + "version": "0.9.87-alpha.3", "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 ca58744743..e42eae0480 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.87-alpha.2", + "version": "0.9.87-alpha.3", "description": "Budibase background service", "main": "src/index.js", "repository": { @@ -21,8 +21,8 @@ "author": "Budibase", "license": "AGPL-3.0-or-later", "dependencies": { - "@budibase/auth": "^0.9.87-alpha.2", - "@budibase/string-templates": "^0.9.87-alpha.2", + "@budibase/auth": "^0.9.87-alpha.3", + "@budibase/string-templates": "^0.9.87-alpha.3", "@koa/router": "^8.0.0", "@techpass/passport-openidconnect": "^0.3.0", "aws-sdk": "^2.811.0", From a831b7f91e10126dd80cb8a5f7963272afd8e3ec Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Jul 2021 13:57:33 +0100 Subject: [PATCH 018/260] Add modal option to hide divider, and make title rendering optional --- packages/bbui/src/Modal/ModalContent.svelte | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/bbui/src/Modal/ModalContent.svelte b/packages/bbui/src/Modal/ModalContent.svelte index e6d4ab5f0f..5bf8ab599c 100644 --- a/packages/bbui/src/Modal/ModalContent.svelte +++ b/packages/bbui/src/Modal/ModalContent.svelte @@ -15,6 +15,7 @@ export let showCloseIcon = true export let onConfirm = undefined export let disabled = false + export let showDivider = true const { hide, cancel } = getContext(Context.Modal) let loading = false @@ -41,11 +42,17 @@ aria-modal="true" >
-

- {title} -

- - + {#if title} +

+ {title} +

+ {#if showDivider} + + {/if} + {/if}
@@ -96,6 +103,9 @@ .spectrum-Dialog-heading { font-family: var(--font-sans); } + .spectrum-Dialog-heading.noDivider { + margin-bottom: 12px; + } .spectrum-Dialog-buttonGroup { gap: var(--spectrum-global-dimension-static-size-200); From e711fffc45e08c96b691fc528de092297f47ebf0 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Jul 2021 13:58:34 +0100 Subject: [PATCH 019/260] Break out notification component to standalone component --- .../bbui/src/Notification/Notification.svelte | 20 +++++++++++++ .../Notification/NotificationDisplay.svelte | 28 ++++--------------- packages/bbui/src/index.js | 1 + 3 files changed, 27 insertions(+), 22 deletions(-) create mode 100644 packages/bbui/src/Notification/Notification.svelte diff --git a/packages/bbui/src/Notification/Notification.svelte b/packages/bbui/src/Notification/Notification.svelte new file mode 100644 index 0000000000..cebc859bda --- /dev/null +++ b/packages/bbui/src/Notification/Notification.svelte @@ -0,0 +1,20 @@ + + +
+ {#if icon} + + {/if} +
+
{message || ""}
+
+
diff --git a/packages/bbui/src/Notification/NotificationDisplay.svelte b/packages/bbui/src/Notification/NotificationDisplay.svelte index 89e7666cc7..9d96bf7e70 100644 --- a/packages/bbui/src/Notification/NotificationDisplay.svelte +++ b/packages/bbui/src/Notification/NotificationDisplay.svelte @@ -2,30 +2,16 @@ import "@spectrum-css/toast/dist/index-vars.css" import Portal from "svelte-portal" import { flip } from "svelte/animate" - import { fly } from "svelte/transition" import { notifications } from "../Stores/notifications" + import Notification from "./Notification.svelte" + import { fly } from "svelte/transition"
{#each $notifications as { type, icon, message, id } (id)} -
- {#if icon} - - {/if} -
-
{message}
-
+
+
{/each}
@@ -34,7 +20,7 @@ diff --git a/packages/bbui/src/index.js b/packages/bbui/src/index.js index 4d045e504b..3a491bfb54 100644 --- a/packages/bbui/src/index.js +++ b/packages/bbui/src/index.js @@ -38,6 +38,7 @@ export { default as MenuItem } from "./Menu/Item.svelte" export { default as Modal } from "./Modal/Modal.svelte" export { default as ModalContent } from "./Modal/ModalContent.svelte" export { default as NotificationDisplay } from "./Notification/NotificationDisplay.svelte" +export { default as Notification } from "./Notification/Notification.svelte" export { default as SideNavigation } from "./SideNavigation/Navigation.svelte" export { default as SideNavigationItem } from "./SideNavigation/Item.svelte" export { default as DatePicker } from "./Form/DatePicker.svelte" From 7723a1ed60e59950893c7cfec277b6a804fdc25f Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 30 Jul 2021 13:59:04 +0100 Subject: [PATCH 020/260] Add checkbox to specify navigate action should open in a modal insteaf --- .../EventsEditor/actions/NavigateTo.svelte | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/NavigateTo.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/NavigateTo.svelte index e713ccce4a..931c807ec9 100644 --- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/NavigateTo.svelte +++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/EventsEditor/actions/NavigateTo.svelte @@ -1,5 +1,5 @@
- {#each $notifications as notification (notification.id)} -
-
{notification.message}
- {#if notification.icon}{/if} -
- {/each} + {#if $notificationStore} + {#key $notificationStore.id} +
+ +
+ {/key} + {/if}
diff --git a/packages/client/src/components/PeekScreenDisplay.svelte b/packages/client/src/components/PeekScreenDisplay.svelte new file mode 100644 index 0000000000..236a228c3b --- /dev/null +++ b/packages/client/src/components/PeekScreenDisplay.svelte @@ -0,0 +1,78 @@ + + +{#if $peekStore.showPeek} + + +