Browse Source

Merge branch 'develop' into wrap-account-check

pull/4023/head
Rory Powell 5 years ago
parent
commit
1ca2e48ba2
  1. 2
      lerna.json
  2. 2
      packages/auth/package.json
  3. 2
      packages/bbui/package.json
  4. 12
      packages/builder/cypress/integration/customThemingProperties.spec.js
  5. 8
      packages/builder/package.json
  6. 8
      packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte
  7. 2
      packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte
  8. 6
      packages/builder/src/components/integration/index.svelte
  9. 2
      packages/cli/package.json
  10. 6
      packages/client/package.json
  11. 8
      packages/server/package.json
  12. 14
      packages/server/src/integrations/rest.ts
  13. 70
      packages/server/src/integrations/tests/rest.spec.js
  14. 2
      packages/string-templates/package.json
  15. 6
      packages/worker/package.json

2
lerna.json

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

2
packages/auth/package.json

@ -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",

2
packages/bbui/package.json

@ -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",

12
packages/builder/cypress/integration/customThemingProperties.spec.js

@ -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()

8
packages/builder/package.json

@ -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",

8
packages/builder/src/components/automation/AutomationBuilder/FlowChart/ActionModal.svelte

@ -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>

2
packages/builder/src/components/automation/AutomationBuilder/FlowChart/FlowItem.svelte

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

6
packages/builder/src/components/integration/index.svelte

@ -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

2
packages/cli/package.json

@ -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": {

6
packages/client/package.json

@ -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"

8
packages/server/package.json

@ -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",

14
packages/server/src/integrations/rest.ts

@ -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,
})

70
packages/server/src/integrations/tests/rest.spec.js

@ -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",
},
})
})
})
})

2
packages/string-templates/package.json

@ -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",

6
packages/worker/package.json

@ -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",

Loading…
Cancel
Save