Merge branch 'master' of github.com:Budibase/budibase into interactive-layouts

This commit is contained in:
Andrew Kingston 2021-06-09 18:54:36 +01:00
commit 9040a0bd1c
15 changed files with 63 additions and 42 deletions

View File

@ -1,5 +1,5 @@
{
"version": "0.9.39",
"version": "0.9.40",
"npmClient": "yarn",
"packages": [
"packages/*"

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/auth",
"version": "0.9.39",
"version": "0.9.40",
"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.39",
"version": "0.9.40",
"license": "AGPL-3.0",
"svelte": "src/index.js",
"module": "dist/bbui.es.js",

View File

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

View File

@ -38,17 +38,21 @@
let loading
async function saveSmtp() {
try {
// Save your SMTP config
const response = await api.post(`/api/admin/configs`, smtpConfig)
// Save your SMTP config
const response = await api.post(`/api/admin/configs`, smtpConfig)
if (response.status !== 200) {
const error = await response.text()
let message = error
try {
message = JSON.parse(error).message
} catch (err) {}
notifications.error(`Failed to save email settings, reason: ${message}`)
} else {
const json = await response.json()
if (response.status !== 200) throw new Error(json.message)
smtpConfig._rev = json._rev
smtpConfig._id = json._id
notifications.success(`Settings saved.`)
} catch (err) {
notifications.error(`Failed to save email settings. ${err}`)
}
}

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/cli",
"version": "0.9.39",
"version": "0.9.40",
"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.39",
"version": "0.9.40",
"license": "MPL-2.0",
"module": "dist/budibase-client.js",
"main": "dist/budibase-client.js",
@ -19,13 +19,13 @@
},
"dependencies": {
"@budibase/bbui": "^0.9.27",
"@budibase/string-templates": "^0.9.39",
"@budibase/string-templates": "^0.9.40",
"regexparam": "^1.3.0",
"shortid": "^2.2.15",
"svelte-spa-router": "^3.0.5"
},
"devDependencies": {
"@budibase/standard-components": "^0.9.39",
"@budibase/standard-components": "^0.9.40",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"fs-extra": "^8.1.0",

View File

@ -1,7 +1,7 @@
{
"name": "@budibase/server",
"email": "hi@budibase.com",
"version": "0.9.39",
"version": "0.9.40",
"description": "Budibase Web Server",
"main": "src/electron.js",
"repository": {
@ -55,9 +55,9 @@
"author": "Budibase",
"license": "AGPL-3.0-or-later",
"dependencies": {
"@budibase/auth": "^0.9.39",
"@budibase/client": "^0.9.39",
"@budibase/string-templates": "^0.9.39",
"@budibase/auth": "^0.9.40",
"@budibase/client": "^0.9.40",
"@budibase/string-templates": "^0.9.40",
"@elastic/elasticsearch": "7.10.0",
"@koa/router": "8.0.0",
"@sendgrid/mail": "7.1.1",
@ -109,7 +109,7 @@
"devDependencies": {
"@babel/core": "^7.14.3",
"@babel/preset-env": "^7.14.4",
"@budibase/standard-components": "^0.9.39",
"@budibase/standard-components": "^0.9.40",
"@jest/test-sequencer": "^24.8.0",
"babel-jest": "^27.0.2",
"docker-compose": "^0.23.6",

View File

@ -29,11 +29,11 @@
"keywords": [
"svelte"
],
"version": "0.9.39",
"version": "0.9.40",
"license": "MIT",
"gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc",
"dependencies": {
"@budibase/bbui": "^0.9.39",
"@budibase/bbui": "^0.9.40",
"@spectrum-css/page": "^3.0.1",
"@spectrum-css/vars": "^3.0.1",
"apexcharts": "^3.22.1",

View File

@ -13,7 +13,9 @@ export const buildLuceneQuery = filter => {
notEmpty: {},
}
if (Array.isArray(filter)) {
filter.forEach(({ operator, field, type, value }) => {
// Build up proper range filters
filter.forEach(expression => {
const { operator, field, type, value } = expression
if (operator.startsWith("range")) {
if (!query.range[field]) {
query.range[field] = {
@ -33,10 +35,24 @@ export const buildLuceneQuery = filter => {
query.range[field].high = value
}
} else if (query[operator]) {
query[operator][field] = value
if (type === "boolean") {
// Transform boolean filters to cope with null.
// "equals false" needs to be "not equals true"
// "not equals false" needs to be "equals true"
if (operator === "equal" && value === "false") {
query.notEqual[field] = "true"
} else if (operator === "notEqual" && value === "false") {
query.equal[field] = "true"
} else {
query[operator][field] = value
}
} else {
query[operator][field] = value
}
}
})
}
return query
}

View File

@ -1,6 +1,6 @@
{
"name": "@budibase/string-templates",
"version": "0.9.39",
"version": "0.9.40",
"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.39",
"version": "0.9.40",
"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.39",
"@budibase/string-templates": "^0.9.39",
"@budibase/auth": "^0.9.40",
"@budibase/string-templates": "^0.9.40",
"@koa/router": "^8.0.0",
"aws-sdk": "^2.811.0",
"bcryptjs": "^2.4.3",

View File

@ -27,11 +27,15 @@ exports.save = async function (ctx) {
})
}
// verify the configuration
switch (type) {
case Configs.SMTP:
await email.verifyConfig(config)
break
try {
// verify the configuration
switch (type) {
case Configs.SMTP:
await email.verifyConfig(config)
break
}
} catch (err) {
ctx.throw(400, err)
}
try {
@ -42,7 +46,7 @@ exports.save = async function (ctx) {
_rev: response.rev,
}
} catch (err) {
ctx.throw(err.status, err)
ctx.throw(400, err)
}
}

View File

@ -14,7 +14,6 @@ function smtpValidation() {
host: Joi.string().required(),
from: Joi.string().email().required(),
secure: Joi.boolean().optional(),
selfSigned: Joi.boolean().optional(),
auth: Joi.object({
type: Joi.string().valid("login", "oauth2", null),
user: Joi.string().required(),

View File

@ -27,10 +27,8 @@ function createSMTPTransport(config) {
secure: config.secure || false,
auth: config.auth,
}
if (config.selfSigned) {
options.tls = {
rejectUnauthorized: false,
}
options.tls = {
rejectUnauthorized: false,
}
} else {
options = {