diff --git a/lerna.json b/lerna.json index 0982cc8bb4..27fbed5858 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.74", + "version": "0.9.78", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 4e6c859a8a..6ad144687a 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.74", + "version": "0.9.78", "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 5118c1b7cf..5e11c19012 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.74", + "version": "0.9.78", "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 261db322d7..aa6b165731 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.74", + "version": "0.9.78", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.74", - "@budibase/client": "^0.9.74", + "@budibase/bbui": "^0.9.78", + "@budibase/client": "^0.9.78", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.74", + "@budibase/string-templates": "^0.9.78", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/pages/builder/portal/manage/email/[template].svelte b/packages/builder/src/pages/builder/portal/manage/email/[template].svelte index cd4c7c739d..60ff3d6110 100644 --- a/packages/builder/src/pages/builder/portal/manage/email/[template].svelte +++ b/packages/builder/src/pages/builder/portal/manage/email/[template].svelte @@ -16,6 +16,7 @@ import Editor from "components/integration/QueryEditor.svelte" import TemplateBindings from "./_components/TemplateBindings.svelte" + // this is the email purpose export let template let htmlEditor @@ -24,9 +25,11 @@ $: selectedTemplate = $email.templates?.find( ({ purpose }) => purpose === template ) + $: name = $email.definitions?.info[template]?.name + $: description = $email.definitions?.info[template]?.description $: baseTemplate = $email.templates?.find(({ purpose }) => purpose === "base") $: templateBindings = - $email.definitions?.bindings?.[selectedTemplate.purpose] || [] + $email.definitions?.bindings?.[selectedTemplate?.purpose] || [] $: previewContent = makePreviewContent(baseTemplate, selectedTemplate) async function saveTemplate() { @@ -81,10 +84,12 @@
- Email Template: {template} + Email Template: {name}
+ Description + {description} Change the email template here. Add dynamic content by using the bindings menu on the right. - import { goto } from "@roxi/routify" - - export let value - - - $goto(`./${value}`)}>{value} - - diff --git a/packages/builder/src/pages/builder/portal/manage/email/index.svelte b/packages/builder/src/pages/builder/portal/manage/email/index.svelte index 2c7b798d5e..4a2b21b691 100644 --- a/packages/builder/src/pages/builder/portal/manage/email/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/email/index.svelte @@ -14,7 +14,6 @@ Checkbox, } from "@budibase/bbui" import { email } from "stores/portal" - import TemplateLink from "./_components/TemplateLink.svelte" import api from "builderStore/api" import { cloneDeep } from "lodash/fp" @@ -23,23 +22,30 @@ } const templateSchema = { - purpose: { - displayName: "Email", + name: { + displayName: "Name", + editable: false, + }, + category: { + displayName: "Category", editable: false, }, } - const customRenderers = [ - { - column: "purpose", - component: TemplateLink, - }, - ] + $: emailInfo = getEmailInfo($email.definitions) let smtpConfig let loading let requireAuth = false + function getEmailInfo(definitions) { + if (!definitions) { + return [] + } + const entries = Object.entries(definitions.info) + return entries.map(([key, value]) => ({ purpose: key, ...value })) + } + async function saveSmtp() { // clone it so we can remove stuff if required const smtp = cloneDeep(smtpConfig) @@ -159,8 +165,7 @@ $goto(`./${detail.purpose}`)} diff --git a/packages/cli/package.json b/packages/cli/package.json index b616255130..bb0dac5262 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "0.9.74", + "version": "0.9.78", "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 c9f3935569..5c75abd6b8 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "0.9.74", + "version": "0.9.78", "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.74", - "@budibase/standard-components": "^0.9.74", - "@budibase/string-templates": "^0.9.74", + "@budibase/bbui": "^0.9.78", + "@budibase/standard-components": "^0.9.78", + "@budibase/string-templates": "^0.9.78", "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 88961336cf..d3a2eea138 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.74", + "version": "0.9.78", "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.74", - "@budibase/client": "^0.9.74", - "@budibase/string-templates": "^0.9.74", + "@budibase/auth": "^0.9.78", + "@budibase/client": "^0.9.78", + "@budibase/string-templates": "^0.9.78", "@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.74", + "@budibase/standard-components": "^0.9.78", "@jest/test-sequencer": "^24.8.0", "@types/bull": "^3.15.1", "@types/jest": "^26.0.23", diff --git a/packages/server/src/api/controllers/row/internalSearch.js b/packages/server/src/api/controllers/row/internalSearch.js index 7225ab633a..72f5e6e5c8 100644 --- a/packages/server/src/api/controllers/row/internalSearch.js +++ b/packages/server/src/api/controllers/row/internalSearch.js @@ -148,12 +148,20 @@ class QueryBuilder { } if (this.query.equal) { build(this.query.equal, (key, value) => { - return value ? `${key}:${luceneEscape(value.toLowerCase())}` : null + const escapedValue = luceneEscape(value.toLowerCase()) + // have to do the or to manage straight values, or strings + return value + ? `(${key}:${escapedValue} OR ${key}:"${escapedValue}")` + : null }) } if (this.query.notEqual) { build(this.query.notEqual, (key, value) => { - return value ? `!${key}:${luceneEscape(value.toLowerCase())}` : null + const escapedValue = luceneEscape(value.toLowerCase()) + // have to do the or to manage straight values, or strings + return value + ? `(!${key}:${escapedValue} OR !${key}:"${escapedValue}")` + : null }) } if (this.query.empty) { diff --git a/packages/server/src/automations/steps/updateRow.js b/packages/server/src/automations/steps/updateRow.js index f873eecbdb..206e429efa 100644 --- a/packages/server/src/automations/steps/updateRow.js +++ b/packages/server/src/automations/steps/updateRow.js @@ -76,7 +76,10 @@ module.exports.run = async function ({ inputs, appId, emitter }) { rowId: inputs.rowId, }, request: { - body: inputs.row, + body: { + ...inputs.row, + _id: inputs.rowId, + }, }, appId, eventEmitter: emitter, diff --git a/packages/standard-components/package.json b/packages/standard-components/package.json index a1e2a46260..0b7a7b9d57 100644 --- a/packages/standard-components/package.json +++ b/packages/standard-components/package.json @@ -29,12 +29,12 @@ "keywords": [ "svelte" ], - "version": "0.9.74", + "version": "0.9.78", "license": "MIT", "gitHead": "d1836a898cab3f8ab80ee6d8f42be1a9eed7dcdc", "dependencies": { "@spectrum-css/card": "^3.0.3", - "@budibase/bbui": "^0.9.74", + "@budibase/bbui": "^0.9.78", "@spectrum-css/link": "^3.1.3", "@spectrum-css/page": "^3.0.1", "@spectrum-css/typography": "^3.0.2", diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index f75a11cf4b..b120864673 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "0.9.74", + "version": "0.9.78", "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 134eb55593..c50a6bf096 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.74", + "version": "0.9.78", "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.74", - "@budibase/string-templates": "^0.9.74", + "@budibase/auth": "^0.9.78", + "@budibase/string-templates": "^0.9.78", "@koa/router": "^8.0.0", "aws-sdk": "^2.811.0", "bcryptjs": "^2.4.3", diff --git a/packages/worker/src/api/controllers/admin/templates.js b/packages/worker/src/api/controllers/admin/templates.js index dde92ecca5..ab9c52cb5a 100644 --- a/packages/worker/src/api/controllers/admin/templates.js +++ b/packages/worker/src/api/controllers/admin/templates.js @@ -28,12 +28,18 @@ exports.save = async ctx => { exports.definitions = async ctx => { const bindings = {} - + const info = {} for (let template of TemplateMetadata.email) { bindings[template.purpose] = template.bindings + info[template.purpose] = { + name: template.name, + description: template.description, + category: template.category, + } } ctx.body = { + info, bindings: { ...bindings, common: Object.values(TemplateBindings), diff --git a/packages/worker/src/constants/index.js b/packages/worker/src/constants/index.js index ae52af9d7f..231ff37ee2 100644 --- a/packages/worker/src/constants/index.js +++ b/packages/worker/src/constants/index.js @@ -97,7 +97,10 @@ const TemplateBindings = { const TemplateMetadata = { [TemplateTypes.EMAIL]: [ { - name: "Base Format", + name: "Base format", + description: + "This is the base template, all others are based on it. The {{ body }} will be replaced with another email template.", + category: "miscellaneous", purpose: EmailTemplatePurpose.BASE, bindings: [ { @@ -111,7 +114,10 @@ const TemplateMetadata = { ], }, { - name: "Password Recovery", + name: "Password recovery", + description: + "When a user requests a password reset they will receive an email built with this template.", + category: "user management", purpose: EmailTemplatePurpose.PASSWORD_RECOVERY, bindings: [ { @@ -127,7 +133,18 @@ const TemplateMetadata = { ], }, { - name: "New User Invitation", + name: "User welcome", + description: + "When a new user is added they will be sent a welcome email using this template.", + category: "user management", + purpose: EmailTemplatePurpose.WELCOME, + bindings: [], + }, + { + name: "User invitation", + description: + "When inviting a user via the email on-boarding this template will be used.", + category: "user management", purpose: EmailTemplatePurpose.INVITATION, bindings: [ { @@ -144,6 +161,9 @@ const TemplateMetadata = { }, { name: "Custom", + description: + "A custom template, this is currently used for SMTP email actions in automations.", + category: "automations", purpose: EmailTemplatePurpose.CUSTOM, bindings: [ {