Merge branch 'master' into bugfix

This commit is contained in:
Michael Shanks 2020-10-01 09:33:20 +01:00
commit d54444d932
13 changed files with 20 additions and 155 deletions

View File

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

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "0.1.21", "version": "0.1.22",
"license": "AGPL-3.0", "license": "AGPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -64,7 +64,7 @@
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "^1.34.6", "@budibase/bbui": "^1.34.6",
"@budibase/client": "^0.1.21", "@budibase/client": "^0.1.22",
"@budibase/colorpicker": "^1.0.1", "@budibase/colorpicker": "^1.0.1",
"@fortawesome/fontawesome-free": "^5.14.0", "@fortawesome/fontawesome-free": "^5.14.0",
"@sentry/browser": "5.19.1", "@sentry/browser": "5.19.1",

View File

@ -52,14 +52,14 @@
<div class="input-group-row"> <div class="input-group-row">
<p>The</p> <p>The</p>
<Select secondary thin bind:value={view.calculation}> <Select secondary thin bind:value={view.calculation}>
<option value={null} /> <option value="">Choose an option</option>
{#each CALCULATIONS as calculation} {#each CALCULATIONS as calculation}
<option value={calculation.key}>{calculation.name}</option> <option value={calculation.key}>{calculation.name}</option>
{/each} {/each}
</Select> </Select>
<p>of</p> <p>of</p>
<Select secondary thin bind:value={view.field}> <Select secondary thin bind:value={view.field}>
<option value={null} /> <option value="">Choose an option</option>
{#each fields as field} {#each fields as field}
<option value={field}>{field}</option> <option value={field}>{field}</option>
{/each} {/each}

View File

@ -47,6 +47,7 @@
<Popover bind:this={dropdown} {anchor} align="left"> <Popover bind:this={dropdown} {anchor} align="left">
<h5>Export Format</h5> <h5>Export Format</h5>
<Select secondary thin bind:value={exportFormat}> <Select secondary thin bind:value={exportFormat}>
<option value={''}>Select an option</option>
{#each FORMATS as format} {#each FORMATS as format}
<option value={format.key}>{format.name}</option> <option value={format.key}>{format.name}</option>
{/each} {/each}
@ -66,6 +67,5 @@
margin-top: var(--spacing-l); margin-top: var(--spacing-l);
display: flex; display: flex;
justify-content: flex-end; justify-content: flex-end;
gap: var(--spacing-s);
} }
</style> </style>

View File

@ -106,17 +106,20 @@
<p>Where</p> <p>Where</p>
{:else} {:else}
<Select secondary thin bind:value={filter.conjunction}> <Select secondary thin bind:value={filter.conjunction}>
<option value="">Choose an option</option>
{#each CONJUNCTIONS as conjunction} {#each CONJUNCTIONS as conjunction}
<option value={conjunction.key}>{conjunction.name}</option> <option value={conjunction.key}>{conjunction.name}</option>
{/each} {/each}
</Select> </Select>
{/if} {/if}
<Select secondary thin bind:value={filter.key}> <Select secondary thin bind:value={filter.key}>
<option value="">Choose an option</option>
{#each fields as field} {#each fields as field}
<option value={field}>{field}</option> <option value={field}>{field}</option>
{/each} {/each}
</Select> </Select>
<Select secondary thin bind:value={filter.condition}> <Select secondary thin bind:value={filter.condition}>
<option value="">Choose an option</option>
{#each CONDITIONS as condition} {#each CONDITIONS as condition}
<option value={condition.key}>{condition.name}</option> <option value={condition.key}>{condition.name}</option>
{/each} {/each}

View File

@ -46,7 +46,7 @@
<div class="input-group-row"> <div class="input-group-row">
<p>Group By</p> <p>Group By</p>
<Select secondary thin bind:value={view.groupBy}> <Select secondary thin bind:value={view.groupBy}>
<option value={false} /> <option value="">Choose an option</option>
{#each fields as field} {#each fields as field}
<option value={field}>{field}</option> <option value={field}>{field}</option>
{/each} {/each}

View File

@ -15,6 +15,7 @@
name="Name" name="Name"
placeholder="Username" /> placeholder="Username" />
<Select disabled={!editMode} bind:value={user.accessLevelId} thin> <Select disabled={!editMode} bind:value={user.accessLevelId} thin>
<option value="">Choose an option</option>
<option value="ADMIN">Admin</option> <option value="ADMIN">Admin</option>
<option value="POWER_USER">Power User</option> <option value="POWER_USER">Power User</option>
</Select> </Select>

View File

@ -62,6 +62,7 @@
name="Password" name="Password"
placeholder="Password" /> placeholder="Password" />
<Select bind:value={accessLevelId} thin> <Select bind:value={accessLevelId} thin>
<option value="">Choose an option</option>
<option value="ADMIN">Admin</option> <option value="ADMIN">Admin</option>
<option value="POWER_USER">Power User</option> <option value="POWER_USER">Power User</option>
</Select> </Select>

View File

@ -1,139 +0,0 @@
<script>
import { Button, Select } from "@budibase/bbui"
import StateBindingCascader from "./StateBindingCascader.svelte"
import { find, map, keys, reduce, keyBy } from "lodash/fp"
import { pipe } from "components/common/core"
import {
EVENT_TYPE_MEMBER_NAME,
allHandlers,
} from "components/common/eventHandlers"
import { store } from "builderStore"
export let handler
export let onCreate
export let onChanged
export let onRemoved
export let index
export let newHandler
let eventOptions
let handlerType
let parameters = []
$: eventOptions = allHandlers()
$: {
if (handler) {
handlerType = handler[EVENT_TYPE_MEMBER_NAME]
parameters = Object.entries(handler.parameters).map(([name, value]) => ({
name,
value,
}))
} else {
// Empty Handler
handlerType = ""
parameters = []
}
}
const handlerChanged = (type, params) => {
const handlerParams = {}
for (let param of params) {
handlerParams[param.name] = param.value
}
const updatedHandler = {
[EVENT_TYPE_MEMBER_NAME]: type,
parameters: handlerParams,
}
onChanged(updatedHandler, index)
}
const handlerTypeChanged = e => {
const handlerType = eventOptions.find(
handler => handler.name === e.target.value
)
const defaultParams = handlerType.parameters.map(param => ({
name: param,
value: "",
}))
handlerChanged(handlerType.name, defaultParams)
}
const onParameterChanged = index => e => {
const value = e.target ? e.target.value : e
const newParams = [...parameters]
newParams[index].value = value
handlerChanged(handlerType, newParams)
}
</script>
<div class="type-selector-container {newHandler && 'new-handler'}">
<div class="handler-controls">
<div class="handler-option">
<span>Action</span>
<Select value={handlerType} on:change={handlerTypeChanged}>
<option />
{#each eventOptions as option}
<option value={option.name}>{option.name}</option>
{/each}
</Select>
</div>
{#if parameters}
<br />
{#each parameters as parameter, idx}
<StateBindingCascader on:change={onParameterChanged(idx)} {parameter} />
{/each}
{/if}
{#if parameters.length > 0}
<div class="button-container">
{#if newHandler}
<Button primary thin on:click={onCreate}>Add Action</Button>
{:else}
<Button outline thin on:click={onRemoved}>Remove Action</Button>
{/if}
</div>
{/if}
</div>
</div>
<style>
.type-selector-container {
display: grid;
grid-gap: 20px;
width: 100%;
background: rgba(223, 223, 223, 0.5);
border: 1px solid #dfdfdf;
margin-bottom: 18px;
}
.handler-option {
display: flex;
flex-direction: column;
}
.new-handler {
background: #fff;
}
.handler-controls {
display: grid;
grid-template-columns: 1fr;
grid-gap: 20px;
padding: 22px;
}
.button-container {
display: grid;
justify-items: end;
}
span {
font-size: 18px;
margin-bottom: 10px;
font-weight: 500;
}
</style>

View File

@ -1,6 +1,6 @@
{ {
"name": "budibase", "name": "budibase",
"version": "0.1.21", "version": "0.1.22",
"description": "Budibase CLI", "description": "Budibase CLI",
"repository": "https://github.com/Budibase/Budibase", "repository": "https://github.com/Budibase/Budibase",
"homepage": "https://www.budibase.com", "homepage": "https://www.budibase.com",
@ -17,7 +17,7 @@
"author": "Budibase", "author": "Budibase",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/server": "^0.1.21", "@budibase/server": "^0.1.22",
"@inquirer/password": "^0.0.6-alpha.0", "@inquirer/password": "^0.0.6-alpha.0",
"chalk": "^2.4.2", "chalk": "^2.4.2",
"dotenv": "^8.2.0", "dotenv": "^8.2.0",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "0.1.21", "version": "0.1.22",
"license": "MPL-2.0", "license": "MPL-2.0",
"main": "dist/budibase-client.js", "main": "dist/budibase-client.js",
"module": "dist/budibase-client.esm.mjs", "module": "dist/budibase-client.esm.mjs",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"version": "0.1.21", "version": "0.1.22",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/electron.js", "main": "src/electron.js",
"repository": { "repository": {
@ -42,7 +42,7 @@
"author": "Michael Shanks", "author": "Michael Shanks",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"@budibase/client": "^0.1.21", "@budibase/client": "^0.1.22",
"@koa/router": "^8.0.0", "@koa/router": "^8.0.0",
"@sendgrid/mail": "^7.1.1", "@sendgrid/mail": "^7.1.1",
"@sentry/node": "^5.19.2", "@sentry/node": "^5.19.2",

View File

@ -13,7 +13,7 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"devDependencies": { "devDependencies": {
"@budibase/client": "^0.1.21", "@budibase/client": "^0.1.22",
"@rollup/plugin-commonjs": "^11.1.0", "@rollup/plugin-commonjs": "^11.1.0",
"lodash": "^4.17.15", "lodash": "^4.17.15",
"rollup": "^1.11.0", "rollup": "^1.11.0",
@ -31,14 +31,13 @@
"keywords": [ "keywords": [
"svelte" "svelte"
], ],
"version": "0.1.21", "version": "0.1.22",
"license": "MIT", "license": "MIT",
"gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691", "gitHead": "284cceb9b703c38566c6e6363c022f79a08d5691",
"dependencies": { "dependencies": {
"@beyonk/svelte-googlemaps": "^2.2.0", "@beyonk/svelte-googlemaps": "^2.2.0",
"@budibase/bbui": "^1.34.6",
"@fortawesome/fontawesome-free": "^5.14.0",
"@budibase/bbui": "^1.34.2", "@budibase/bbui": "^1.34.2",
"@fortawesome/fontawesome-free": "^5.14.0",
"britecharts": "^2.16.1", "britecharts": "^2.16.1",
"d3-selection": "^1.4.2", "d3-selection": "^1.4.2",
"fast-sort": "^2.2.0", "fast-sort": "^2.2.0",