Merge branch 'develop' into wrap-account-check

This commit is contained in:
Rory Powell 2021-10-12 11:02:32 +01:00
commit 1ca2e48ba2
15 changed files with 78 additions and 72 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/auth", "name": "@budibase/auth",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"description": "Authentication middlewares for budibase builder and apps", "description": "Authentication middlewares for budibase builder and apps",
"main": "src/index.js", "main": "src/index.js",
"author": "Budibase", "author": "Budibase",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/bbui", "name": "@budibase/bbui",
"description": "A UI solution used in the different Budibase projects.", "description": "A UI solution used in the different Budibase projects.",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",

View File

@ -7,8 +7,8 @@ context("Custom Theming Properties", () => {
// Default Values // Default Values
// Button roundness = Large // Button roundness = Large
// Primary colour = Blue 600 // Accent colour = Blue 600
// Primary colour (hover) = Blue 500 // Accent colour (hover) = Blue 500
// Navigation bar background colour = Gray 100 // Navigation bar background colour = Gray 100
// Navigation bar text colour = Gray 800 // Navigation bar text colour = Gray 800
it("should reset the color property values", () => { it("should reset the color property values", () => {
@ -26,10 +26,10 @@ context("Custom Theming Properties", () => {
const changeThemeColors = () => { const changeThemeColors = () => {
// Changes the theme colours // Changes the theme colours
cy.get(".spectrum-FieldLabel").contains("Primary color") cy.get(".spectrum-FieldLabel").contains("Accent color")
.parent().find(".container.svelte-z3cm5a").click() .parent().find(".container.svelte-z3cm5a").click()
.find('[title="Red 400"]').click() .find('[title="Red 400"]').click()
cy.get(".spectrum-FieldLabel").contains("Primary color (hover)") cy.get(".spectrum-FieldLabel").contains("Accent color (hover)")
.parent().find(".container.svelte-z3cm5a").click() .parent().find(".container.svelte-z3cm5a").click()
.find('[title="Orange 400"]').click() .find('[title="Orange 400"]').click()
cy.get(".spectrum-FieldLabel").contains("Navigation bar background color") cy.get(".spectrum-FieldLabel").contains("Navigation bar background color")
@ -41,11 +41,11 @@ context("Custom Theming Properties", () => {
} }
const checkThemeColorDefaults = () => { const checkThemeColorDefaults = () => {
cy.get(".spectrum-FieldLabel").contains("Primary color") cy.get(".spectrum-FieldLabel").contains("Accent color")
.parent().find(".container.svelte-z3cm5a").click() .parent().find(".container.svelte-z3cm5a").click()
.get('[title="Blue 600"]').children().find('[aria-label="Checkmark"]') .get('[title="Blue 600"]').children().find('[aria-label="Checkmark"]')
cy.get(".spectrum-Dialog-grid").click() cy.get(".spectrum-Dialog-grid").click()
cy.get(".spectrum-FieldLabel").contains("Primary color (hover)") cy.get(".spectrum-FieldLabel").contains("Accent color (hover)")
.parent().find(".container.svelte-z3cm5a").click() .parent().find(".container.svelte-z3cm5a").click()
.get('[title="Blue 500"]').children().find('[aria-label="Checkmark"]') .get('[title="Blue 500"]').children().find('[aria-label="Checkmark"]')
cy.get(".spectrum-Dialog-grid").click() cy.get(".spectrum-Dialog-grid").click()

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -65,10 +65,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^0.9.160-alpha.0", "@budibase/bbui": "^0.9.160-alpha.3",
"@budibase/client": "^0.9.160-alpha.0", "@budibase/client": "^0.9.160-alpha.3",
"@budibase/colorpicker": "1.1.2", "@budibase/colorpicker": "1.1.2",
"@budibase/string-templates": "^0.9.160-alpha.0", "@budibase/string-templates": "^0.9.160-alpha.3",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",
"@spectrum-css/page": "^3.0.1", "@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1", "@spectrum-css/vars": "^3.0.1",

View File

@ -4,10 +4,11 @@
import { externalActions } from "./ExternalActions" import { externalActions } from "./ExternalActions"
export let blockIdx export let blockIdx
export let blockComplete
let selectedAction let selectedAction
let actionVal let actionVal
let actions = Object.entries($automationStore.blockDefinitions.ACTION) let actions = Object.entries($automationStore.blockDefinitions.ACTION)
export let blockComplete
const external = actions.reduce((acc, elm) => { const external = actions.reduce((acc, elm) => {
const [k, v] = elm const [k, v] = elm
@ -36,10 +37,9 @@
actionVal.stepId, actionVal.stepId,
actionVal actionVal
) )
automationStore.actions.addBlockToAutomation(newBlock) automationStore.actions.addBlockToAutomation(newBlock, blockIdx + 1)
await automationStore.actions.save( await automationStore.actions.save(
$automationStore.selectedAutomation?.automation, $automationStore.selectedAutomation?.automation
blockIdx
) )
} }
</script> </script>

View File

@ -151,7 +151,7 @@
> >
{/if} {/if}
<Button <Button
disabled={disableAddButton ? true : !hasCompletedInputs} disabled={!hasCompletedInputs}
on:click={() => { on:click={() => {
setupToggled = false setupToggled = false
actionModal.show() actionModal.show()

View File

@ -17,9 +17,9 @@
$: urlDisplay = $: urlDisplay =
schema.urlDisplay && schema.urlDisplay &&
`${datasource.config.url}${query.fields.path ?? ""}${ `${datasource.config.url}${
query.fields.queryString ?? "" query.fields.path ? "/" + query.fields.path : ""
}` }${query.fields.queryString ? "?" + query.fields.queryString : ""}`
function updateQuery({ detail }) { function updateQuery({ detail }) {
query.fields[schema.type] = detail.value query.fields[schema.type] = detail.value

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"description": "Budibase CLI, for developers, self hosting and migrations.", "description": "Budibase CLI, for developers, self hosting and migrations.",
"main": "src/index.js", "main": "src/index.js",
"bin": { "bin": {

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"license": "MPL-2.0", "license": "MPL-2.0",
"module": "dist/budibase-client.js", "module": "dist/budibase-client.js",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^0.9.160-alpha.0", "@budibase/bbui": "^0.9.160-alpha.3",
"@budibase/standard-components": "^0.9.139", "@budibase/standard-components": "^0.9.139",
"@budibase/string-templates": "^0.9.160-alpha.0", "@budibase/string-templates": "^0.9.160-alpha.3",
"regexparam": "^1.3.0", "regexparam": "^1.3.0",
"shortid": "^2.2.15", "shortid": "^2.2.15",
"svelte-spa-router": "^3.0.5" "svelte-spa-router": "^3.0.5"

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.js", "main": "src/index.js",
"repository": { "repository": {
@ -66,9 +66,9 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/auth": "^0.9.160-alpha.0", "@budibase/auth": "^0.9.160-alpha.3",
"@budibase/client": "^0.9.160-alpha.0", "@budibase/client": "^0.9.160-alpha.3",
"@budibase/string-templates": "^0.9.160-alpha.0", "@budibase/string-templates": "^0.9.160-alpha.3",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",
"@koa/router": "8.0.0", "@koa/router": "8.0.0",
"@sendgrid/mail": "7.1.1", "@sendgrid/mail": "7.1.1",

View File

@ -152,13 +152,17 @@ module RestModule {
} }
} }
getUrl(path: string, queryString: string): string {
return `${this.config.url}/${path}?${queryString}`
}
async create({ path = "", queryString = "", headers = {}, json = {} }) { async create({ path = "", queryString = "", headers = {}, json = {} }) {
this.headers = { this.headers = {
...this.config.defaultHeaders, ...this.config.defaultHeaders,
...headers, ...headers,
} }
const response = await fetch(this.config.url + path + queryString, { const response = await fetch(this.getUrl(path, queryString), {
method: "POST", method: "POST",
headers: this.headers, headers: this.headers,
body: JSON.stringify(json), body: JSON.stringify(json),
@ -173,7 +177,7 @@ module RestModule {
...headers, ...headers,
} }
const response = await fetch(this.config.url + path + queryString, { const response = await fetch(this.getUrl(path, queryString), {
headers: this.headers, headers: this.headers,
}) })
@ -186,7 +190,7 @@ module RestModule {
...headers, ...headers,
} }
const response = await fetch(this.config.url + path + queryString, { const response = await fetch(this.getUrl(path, queryString), {
method: "POST", method: "POST",
headers: this.headers, headers: this.headers,
body: JSON.stringify(json), body: JSON.stringify(json),
@ -201,7 +205,7 @@ module RestModule {
...headers, ...headers,
} }
const response = await fetch(this.config.url + path + queryString, { const response = await fetch(this.getUrl(path, queryString), {
method: "PATCH", method: "PATCH",
headers: this.headers, headers: this.headers,
body: JSON.stringify(json), body: JSON.stringify(json),
@ -216,7 +220,7 @@ module RestModule {
...headers, ...headers,
} }
const response = await fetch(this.config.url + path + queryString, { const response = await fetch(this.getUrl(path, queryString), {
method: "DELETE", method: "DELETE",
headers: this.headers, headers: this.headers,
}) })

View File

@ -1,4 +1,6 @@
jest.mock("node-fetch", () => jest.fn(() => ({ json: jest.fn(), text: jest.fn() }))) jest.mock("node-fetch", () =>
jest.fn(() => ({ json: jest.fn(), text: jest.fn() }))
)
const fetch = require("node-fetch") const fetch = require("node-fetch")
const RestIntegration = require("../rest") const RestIntegration = require("../rest")
@ -14,85 +16,85 @@ describe("REST Integration", () => {
beforeEach(() => { beforeEach(() => {
config = new TestConfiguration({ config = new TestConfiguration({
url: BASE_URL url: BASE_URL,
}) })
}) })
it("calls the create method with the correct params", async () => { it("calls the create method with the correct params", async () => {
const query = { const query = {
path: "/api", path: "api",
queryString: "?test=1", queryString: "test=1",
headers: { headers: {
Accept: "application/json" Accept: "application/json",
}, },
json: { json: {
name: "test" name: "test",
} },
} }
const response = await config.integration.create(query) const response = await config.integration.create(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, { expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
method: "POST", method: "POST",
body: "{\"name\":\"test\"}", body: '{"name":"test"}',
headers: { headers: {
Accept: "application/json" Accept: "application/json",
} },
}) })
}) })
it("calls the read method with the correct params", async () => { it("calls the read method with the correct params", async () => {
const query = { const query = {
path: "/api", path: "api",
queryString: "?test=1", queryString: "test=1",
headers: { headers: {
Accept: "text/html" Accept: "text/html",
} },
} }
const response = await config.integration.read(query) const response = await config.integration.read(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, { expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
headers: { headers: {
Accept: "text/html" Accept: "text/html",
} },
}) })
}) })
it("calls the update method with the correct params", async () => { it("calls the update method with the correct params", async () => {
const query = { const query = {
path: "/api", path: "api",
queryString: "?test=1", queryString: "test=1",
headers: { headers: {
Accept: "application/json" Accept: "application/json",
}, },
json: { json: {
name: "test" name: "test",
} },
} }
const response = await config.integration.update(query) const response = await config.integration.update(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, { expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
method: "POST", method: "POST",
body: "{\"name\":\"test\"}", body: '{"name":"test"}',
headers: { headers: {
Accept: "application/json" Accept: "application/json",
} },
}) })
}) })
it("calls the delete method with the correct params", async () => { it("calls the delete method with the correct params", async () => {
const query = { const query = {
path: "/api", path: "api",
queryString: "?test=1", queryString: "test=1",
headers: { headers: {
Accept: "application/json" Accept: "application/json",
}, },
json: { json: {
name: "test" name: "test",
} },
} }
const response = await config.integration.delete(query) const response = await config.integration.delete(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, { expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
method: "DELETE", method: "DELETE",
headers: { headers: {
Accept: "application/json" Accept: "application/json",
} },
}) })
}) })
}) })

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"description": "Handlebars wrapper for Budibase templating.", "description": "Handlebars wrapper for Budibase templating.",
"main": "src/index.cjs", "main": "src/index.cjs",
"module": "dist/bundle.mjs", "module": "dist/bundle.mjs",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "0.9.160-alpha.0", "version": "0.9.160-alpha.3",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.js", "main": "src/index.js",
"repository": { "repository": {
@ -27,8 +27,8 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/auth": "^0.9.160-alpha.0", "@budibase/auth": "^0.9.160-alpha.3",
"@budibase/string-templates": "^0.9.160-alpha.0", "@budibase/string-templates": "^0.9.160-alpha.3",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@techpass/passport-openidconnect": "^0.3.0", "@techpass/passport-openidconnect": "^0.3.0",
"aws-sdk": "^2.811.0", "aws-sdk": "^2.811.0",