Merge branch 'master' of github.com:Budibase/budibase into fix/cypress-fixes

This commit is contained in:
mike12345567 2021-05-25 16:02:06 +01:00
commit 1564724dc3
19 changed files with 171 additions and 205 deletions

View File

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

View File

@ -40,12 +40,5 @@
"test:e2e:ci": "lerna run cy:ci", "test:e2e:ci": "lerna run cy:ci",
"build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh && cd -", "build:docker": "lerna run build:docker && cd hosting/scripts/linux/ && ./release-to-docker-hub.sh && cd -",
"build:docker:staging": "cd hosting/scripts/linux/ && ./release-to-docker-hub.sh staging && cd -" "build:docker:staging": "cd hosting/scripts/linux/ && ./release-to-docker-hub.sh staging && cd -"
},
"dependencies": {
"@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/link": "^3.1.1",
"@spectrum-css/menu": "^3.0.1",
"@spectrum-css/toast": "^3.0.1"
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/auth", "name": "@budibase/auth",
"version": "0.9.4", "version": "0.9.5",
"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.4", "version": "0.9.5",
"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

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "0.9.4", "version": "0.9.5",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -65,10 +65,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^0.9.4", "@budibase/bbui": "^0.9.5",
"@budibase/client": "^0.9.4", "@budibase/client": "^0.9.5",
"@budibase/colorpicker": "1.1.2", "@budibase/colorpicker": "1.1.2",
"@budibase/string-templates": "^0.9.4", "@budibase/string-templates": "^0.9.5",
"@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

@ -91,14 +91,6 @@
<DeployModal /> <DeployModal />
</div> </div>
</div> </div>
<div class="beta">
<Button
secondary
href="https://github.com/Budibase/budibase/discussions/categories/ideas"
>
Request feature
</Button>
</div>
<slot /> <slot />
</div> </div>
{:catch error} {:catch error}
@ -200,14 +192,4 @@
i:hover { i:hover {
color: var(--ink); color: var(--ink);
} }
.beta {
position: absolute;
bottom: var(--spacing-m);
left: var(--spacing-m);
z-index: 1;
}
.beta :global(button) {
background-color: var(--background);
}
</style> </style>

View File

@ -1,7 +1,7 @@
<script> <script>
import { Page } from "@budibase/bbui" import { Page } from "@budibase/bbui"
import { auth } from "stores/portal" import { auth } from "stores/portal"
import { redirect } from "@roxi/routify" import { page, redirect } from "@roxi/routify"
// Only admins allowed here // Only admins allowed here
$: { $: {
@ -9,10 +9,12 @@
$redirect("../") $redirect("../")
} }
} }
$: console.log($page)
</script> </script>
{#if $auth.isAdmin} {#if $auth.isAdmin}
<Page> <Page wide={$page.path.includes("email/:template")}>
<slot /> <slot />
</Page> </Page>
{/if} {/if}

View File

@ -69,71 +69,69 @@
} }
</script> </script>
<Page wide> <Layout gap="XS" noPadding>
<Layout gap="XS" noPadding> <div class="back">
<div class="back"> <ActionButton
<ActionButton on:click={() => $goto("./")}
on:click={() => $goto("./")} quiet
quiet size="S"
size="S" icon="BackAndroid"
icon="BackAndroid"
>
Back to email settings
</ActionButton>
</div>
<header>
<Heading>
Email Template: {template}
</Heading>
<Button cta on:click={saveTemplate}>Save</Button>
</header>
<Body
>Change the email template here. Add dynamic content by using the bindings
menu on the right.</Body
> >
</Layout> Back to email settings
<Tabs selected="Edit" on:select={fixMountBug}> </ActionButton>
<Tab title="Edit"> </div>
<div class="template-editor"> <header>
<Editor <Heading>
editorHeight={800} Email Template: {template}
bind:this={htmlEditor} </Heading>
mode="handlebars" <Button cta on:click={saveTemplate}>Save</Button>
on:change={e => { </header>
selectedTemplate.contents = e.detail.value <Body
}} >Change the email template here. Add dynamic content by using the bindings
value={selectedTemplate?.contents} menu on the right.</Body
/> >
<div class="bindings-editor"> </Layout>
<Detail size="L">Bindings</Detail> <Tabs selected="Edit" on:select={fixMountBug}>
{#if mounted} <Tab title="Edit">
<Tabs selected="Template"> <div class="template-editor">
<Tab title="Template"> <Editor
<TemplateBindings editorHeight={800}
title="Template Bindings" bind:this={htmlEditor}
bindings={templateBindings} mode="handlebars"
onBindingClick={setTemplateBinding} on:change={e => {
/> selectedTemplate.contents = e.detail.value
</Tab> }}
<Tab title="Common"> value={selectedTemplate?.contents}
<TemplateBindings />
title="Common Bindings" <div class="bindings-editor">
bindings={$email?.definitions?.bindings?.common} <Detail size="L">Bindings</Detail>
onBindingClick={setTemplateBinding} {#if mounted}
/> <Tabs selected="Template">
</Tab> <Tab title="Template">
</Tabs> <TemplateBindings
{/if} title="Template Bindings"
</div> bindings={templateBindings}
onBindingClick={setTemplateBinding}
/>
</Tab>
<Tab title="Common">
<TemplateBindings
title="Common Bindings"
bindings={$email?.definitions?.bindings?.common}
onBindingClick={setTemplateBinding}
/>
</Tab>
</Tabs>
{/if}
</div> </div>
</Tab> </div>
<Tab title="Preview"> </Tab>
<div class="preview"> <Tab title="Preview">
<iframe srcdoc={previewContent} /> <div class="preview">
</div> <iframe srcdoc={previewContent} />
</Tab> </div>
</Tabs> </Tab>
</Page> </Tabs>
<style> <style>
.template-editor { .template-editor {

View File

@ -76,71 +76,69 @@
fetchSmtp() fetchSmtp()
</script> </script>
<Page> <Layout>
<Layout> <Layout noPadding gap="XS">
<Layout noPadding gap="XS"> <Heading size="M">Email</Heading>
<Heading size="M">Email</Heading> <Body>
<Body> Sending email is not required, but highly recommended for processes such
Sending email is not required, but highly recommended for processes such as password recovery. To setup automated auth emails, simply add the
as password recovery. To setup automated auth emails, simply add the values below and click activate.
values below and click activate. </Body>
</Layout>
<Divider />
{#if smtpConfig}
<Layout gap="XS" noPadding>
<Heading size="S">SMTP</Heading>
<Body size="S">
To allow your app to benefit from automated auth emails, add your SMTP
details below.
</Body> </Body>
</Layout> </Layout>
<Divider /> <Layout gap="XS" noPadding>
{#if smtpConfig} <div class="form-row">
<Layout gap="XS" noPadding> <Label size="L">Host</Label>
<Heading size="S">SMTP</Heading> <Input bind:value={smtpConfig.config.host} />
<Body size="S">
To allow your app to benefit from automated auth emails, add your SMTP
details below.
</Body>
</Layout>
<Layout gap="XS" noPadding>
<div class="form-row">
<Label size="L">Host</Label>
<Input bind:value={smtpConfig.config.host} />
</div>
<div class="form-row">
<Label size="L">Port</Label>
<Input type="number" bind:value={smtpConfig.config.port} />
</div>
<div class="form-row">
<Label size="L">User</Label>
<Input bind:value={smtpConfig.config.auth.user} />
</div>
<div class="form-row">
<Label size="L">Password</Label>
<Input type="password" bind:value={smtpConfig.config.auth.pass} />
</div>
<div class="form-row">
<Label size="L">From email address</Label>
<Input type="email" bind:value={smtpConfig.config.from} />
</div>
</Layout>
<div>
<Button cta on:click={saveSmtp}>Save</Button>
</div> </div>
<Divider /> <div class="form-row">
<Layout gap="XS" noPadding> <Label size="L">Port</Label>
<Heading size="S">Templates</Heading> <Input type="number" bind:value={smtpConfig.config.port} />
<Body size="S"> </div>
Budibase comes out of the box with ready-made email templates to help <div class="form-row">
with user onboarding. Please refrain from changing the links. <Label size="L">User</Label>
</Body> <Input bind:value={smtpConfig.config.auth.user} />
</Layout> </div>
<Table <div class="form-row">
{customRenderers} <Label size="L">Password</Label>
data={$email.templates} <Input type="password" bind:value={smtpConfig.config.auth.pass} />
schema={templateSchema} </div>
{loading} <div class="form-row">
on:click={({ detail }) => $goto(`./${detail.purpose}`)} <Label size="L">From email address</Label>
allowEditRows={false} <Input type="email" bind:value={smtpConfig.config.from} />
allowSelectRows={false} </div>
allowEditColumns={false} </Layout>
/> <div>
{/if} <Button cta on:click={saveSmtp}>Save</Button>
</Layout> </div>
</Page> <Divider />
<Layout gap="XS" noPadding>
<Heading size="S">Templates</Heading>
<Body size="S">
Budibase comes out of the box with ready-made email templates to help
with user onboarding. Please refrain from changing the links.
</Body>
</Layout>
<Table
{customRenderers}
data={$email.templates}
schema={templateSchema}
{loading}
on:click={({ detail }) => $goto(`./${detail.purpose}`)}
allowEditRows={false}
allowSelectRows={false}
allowEditColumns={false}
/>
{/if}
</Layout>
<style> <style>
.form-row { .form-row {

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "0.9.4", "version": "0.9.5",
"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": {
@ -11,6 +11,12 @@
"scripts": { "scripts": {
"build": "pkg . --out-path build" "build": "pkg . --out-path build"
}, },
"pkg": {
"targets": [
"node14"
],
"outputPath": "build"
},
"dependencies": { "dependencies": {
"axios": "^0.21.1", "axios": "^0.21.1",
"chalk": "^4.1.0", "chalk": "^4.1.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "0.9.4", "version": "0.9.5",
"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",
@ -18,13 +18,13 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/string-templates": "^0.9.4", "@budibase/string-templates": "^0.9.5",
"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"
}, },
"devDependencies": { "devDependencies": {
"@budibase/standard-components": "^0.9.4", "@budibase/standard-components": "^0.9.5",
"@rollup/plugin-commonjs": "^18.0.0", "@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1", "@rollup/plugin-node-resolve": "^11.2.1",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "0.9.4", "version": "0.9.5",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/electron.js", "main": "src/electron.js",
"repository": { "repository": {
@ -55,9 +55,9 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/auth": "^0.9.4", "@budibase/auth": "^0.9.5",
"@budibase/client": "^0.9.4", "@budibase/client": "^0.9.5",
"@budibase/string-templates": "^0.9.4", "@budibase/string-templates": "^0.9.5",
"@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",
@ -107,7 +107,7 @@
"zlib": "1.0.5" "zlib": "1.0.5"
}, },
"devDependencies": { "devDependencies": {
"@budibase/standard-components": "^0.9.4", "@budibase/standard-components": "^0.9.5",
"@jest/test-sequencer": "^24.8.0", "@jest/test-sequencer": "^24.8.0",
"docker-compose": "^0.23.6", "docker-compose": "^0.23.6",
"eslint": "^6.8.0", "eslint": "^6.8.0",

View File

@ -92,10 +92,6 @@ async function createInstance(template) {
// https://docs.couchdb.org/en/master/ddocs/views/collation.html#collation-specification // https://docs.couchdb.org/en/master/ddocs/views/collation.html#collation-specification
views: {}, views: {},
}) })
// add view for linked rows
await createLinkView(appId)
await createRoutingView(appId)
await createAllSearchIndex(appId)
// replicate the template data to the instance DB // replicate the template data to the instance DB
// this is currently very hard to test, downloading and importing template files // this is currently very hard to test, downloading and importing template files
@ -110,6 +106,11 @@ async function createInstance(template) {
await db.put(USERS_TABLE_SCHEMA) await db.put(USERS_TABLE_SCHEMA)
} }
// add view for linked rows
await createLinkView(appId)
await createRoutingView(appId)
await createAllSearchIndex(appId)
return { _id: appId } return { _id: appId }
} }

View File

@ -65,7 +65,10 @@ async function checkForCronTriggers({ appId, oldAuto, newAuto }) {
// need to create cron job // need to create cron job
else if (isCronTrigger(newAuto) && cronTriggerActivated) { else if (isCronTrigger(newAuto) && cronTriggerActivated) {
const job = await triggers.automationQueue.add( const job = await triggers.automationQueue.add(
{ automation: newAuto, event: { appId } }, {
automation: newAuto,
event: { appId, timestamp: Date.now() },
},
{ repeat: { cron: newTrigger.inputs.cron } } { repeat: { cron: newTrigger.inputs.cron } }
) )
// Assign cron job ID from bull so we can remove it later if the cron trigger is removed // Assign cron job ID from bull so we can remove it later if the cron trigger is removed

View File

@ -216,7 +216,15 @@ const BUILTIN_DEFINITIONS = {
}, },
required: ["cron"], required: ["cron"],
}, },
outputs: {}, outputs: {
properties: {
timestamp: {
type: "number",
description: "Timestamp the cron was executed",
},
},
required: ["timestamp"],
},
}, },
type: "TRIGGER", type: "TRIGGER",
}, },

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "0.9.4", "version": "0.9.5",
"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.4", "version": "0.9.5",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.js", "main": "src/index.js",
"repository": { "repository": {
@ -21,8 +21,8 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/auth": "^0.9.4", "@budibase/auth": "^0.9.5",
"@budibase/string-templates": "^0.9.4", "@budibase/string-templates": "^0.9.5",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"aws-sdk": "^2.811.0", "aws-sdk": "^2.811.0",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",

View File

@ -824,31 +824,6 @@
estree-walker "^1.0.1" estree-walker "^1.0.1"
micromatch "^4.0.2" micromatch "^4.0.2"
"@spectrum-css/actionbutton@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/actionbutton/-/actionbutton-1.0.1.tgz#9c75da37ea6915919fb574c74bd60dacc03b6577"
integrity sha512-AUqtyNabHF451Aj9i3xz82TxS5Z6k1dttA68/1hMeU9kbPCSS4P6Viw3vaRGs9CSspuR8xnnhDgrq+F+zMy2Hw==
"@spectrum-css/actiongroup@^1.0.1":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/actiongroup/-/actiongroup-1.0.1.tgz#b95b86e7af229e90fe1e70399d8d4b547b4bd31c"
integrity sha512-5Q6uMjzv5BFA2TwGASr/jAtJpTWl26fhWvgGY8kOA0RCSij35l+YJg/FPXf6Nnj2qCOl8DkNycjT9YXJ+bhyVA==
"@spectrum-css/link@^3.1.1":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/link/-/link-3.1.1.tgz#cb526a2e10b50ef5a7ae29cca7272e2610d597eb"
integrity sha512-Bi88lRhTY7g6nM/ryW1yY4Cji211ZYNtRxkxbV7n2lPvwMAAQtyx0qVD3ru4kTGj/FFVvmPR3XiOE10K13HSNA==
"@spectrum-css/menu@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/menu/-/menu-3.0.1.tgz#2a376f991acc24e12ec892bb6b9db2650fc41fbe"
integrity sha512-Qjg0+1O0eC89sb/bRFq2AGnQ8XqhVy23TUXHyffNM8qdcMssnlny3QmhzjURCZKvx/Y5UytCpzhedPQqSpQwZg==
"@spectrum-css/toast@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@spectrum-css/toast/-/toast-3.0.1.tgz#36f62ea05302761e59b9d53e05f6c04423861796"
integrity sha512-jov++S358BrN2tmMfaoYk1N6u9HojgeuQk61keXrK2m3VE5/n94x7Lg3kIPeSWO0odyDfBlMqT9jacbRey3QTg==
"@types/estree@0.0.39": "@types/estree@0.0.39":
version "0.0.39" version "0.0.39"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"