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",
"packages": [
"packages/*"

View File

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

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/bbui",
"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",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/builder",
"version": "0.9.160-alpha.0",
"version": "0.9.160-alpha.3",
"license": "AGPL-3.0",
"private": true,
"scripts": {
@ -65,10 +65,10 @@
}
},
"dependencies": {
"@budibase/bbui": "^0.9.160-alpha.0",
"@budibase/client": "^0.9.160-alpha.0",
"@budibase/bbui": "^0.9.160-alpha.3",
"@budibase/client": "^0.9.160-alpha.3",
"@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",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/client",
"version": "0.9.160-alpha.0",
"version": "0.9.160-alpha.3",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw"
},
"dependencies": {
"@budibase/bbui": "^0.9.160-alpha.0",
"@budibase/bbui": "^0.9.160-alpha.3",
"@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",
"shortid": "^2.2.15",
"svelte-spa-router": "^3.0.5"

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "0.9.160-alpha.0",
"version": "0.9.160-alpha.3",
"description": "Budibase Web Server",
"main": "src/index.js",
"repository": {
@ -66,9 +66,9 @@
"author": "Budibase",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@budibase/auth": "^0.9.160-alpha.0",
"@budibase/client": "^0.9.160-alpha.0",
"@budibase/string-templates": "^0.9.160-alpha.0",
"@budibase/auth": "^0.9.160-alpha.3",
"@budibase/client": "^0.9.160-alpha.3",
"@budibase/string-templates": "^0.9.160-alpha.3",
"@elastic/elasticsearch": "7.10.0",
"@koa/router": "8.0.0",
"@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 = {} }) {
this.headers = {
...this.config.defaultHeaders,
...headers,
}
const response = await fetch(this.config.url + path + queryString, {
const response = await fetch(this.getUrl(path, queryString), {
method: "POST",
headers: this.headers,
body: JSON.stringify(json),
@ -173,7 +177,7 @@ module RestModule {
...headers,
}
const response = await fetch(this.config.url + path + queryString, {
const response = await fetch(this.getUrl(path, queryString), {
headers: this.headers,
})
@ -186,7 +190,7 @@ module RestModule {
...headers,
}
const response = await fetch(this.config.url + path + queryString, {
const response = await fetch(this.getUrl(path, queryString), {
method: "POST",
headers: this.headers,
body: JSON.stringify(json),
@ -201,7 +205,7 @@ module RestModule {
...headers,
}
const response = await fetch(this.config.url + path + queryString, {
const response = await fetch(this.getUrl(path, queryString), {
method: "PATCH",
headers: this.headers,
body: JSON.stringify(json),
@ -216,7 +220,7 @@ module RestModule {
...headers,
}
const response = await fetch(this.config.url + path + queryString, {
const response = await fetch(this.getUrl(path, queryString), {
method: "DELETE",
headers: this.headers,
})

View File

@ -1,98 +1,100 @@
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 RestIntegration = require("../rest")
class TestConfiguration {
constructor(config = {}) {
this.integration = new RestIntegration.integration(config)
this.integration = new RestIntegration.integration(config)
}
}
describe("REST Integration", () => {
const BASE_URL = "https://myapi.com"
let config
let config
beforeEach(() => {
config = new TestConfiguration({
url: BASE_URL
url: BASE_URL,
})
})
it("calls the create method with the correct params", async () => {
const query = {
path: "/api",
queryString: "?test=1",
path: "api",
queryString: "test=1",
headers: {
Accept: "application/json"
Accept: "application/json",
},
json: {
name: "test"
}
name: "test",
},
}
const response = await config.integration.create(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
method: "POST",
body: "{\"name\":\"test\"}",
body: '{"name":"test"}',
headers: {
Accept: "application/json"
}
Accept: "application/json",
},
})
})
it("calls the read method with the correct params", async () => {
const query = {
path: "/api",
queryString: "?test=1",
path: "api",
queryString: "test=1",
headers: {
Accept: "text/html"
}
Accept: "text/html",
},
}
const response = await config.integration.read(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
headers: {
Accept: "text/html"
}
Accept: "text/html",
},
})
})
it("calls the update method with the correct params", async () => {
const query = {
path: "/api",
queryString: "?test=1",
path: "api",
queryString: "test=1",
headers: {
Accept: "application/json"
Accept: "application/json",
},
json: {
name: "test"
}
name: "test",
},
}
const response = await config.integration.update(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
method: "POST",
body: "{\"name\":\"test\"}",
body: '{"name":"test"}',
headers: {
Accept: "application/json"
}
Accept: "application/json",
},
})
})
it("calls the delete method with the correct params", async () => {
const query = {
path: "/api",
queryString: "?test=1",
path: "api",
queryString: "test=1",
headers: {
Accept: "application/json"
Accept: "application/json",
},
json: {
name: "test"
}
name: "test",
},
}
const response = await config.integration.delete(query)
expect(fetch).toHaveBeenCalledWith(`${BASE_URL}/api?test=1`, {
method: "DELETE",
headers: {
Accept: "application/json"
}
Accept: "application/json",
},
})
})
})
})

View File

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

View File

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