Merge branch 'develop' of github.com:Budibase/budibase into fix/7865

This commit is contained in:
mike12345567 2022-12-07 17:35:41 +00:00
commit 936582bee7
32 changed files with 208 additions and 180 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/backend-core", "name": "@budibase/backend-core",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"description": "Budibase backend core libraries used in server and worker", "description": "Budibase backend core libraries used in server and worker",
"main": "dist/src/index.js", "main": "dist/src/index.js",
"types": "dist/src/index.d.ts", "types": "dist/src/index.d.ts",
@ -20,7 +20,7 @@
"test:watch": "jest --watchAll" "test:watch": "jest --watchAll"
}, },
"dependencies": { "dependencies": {
"@budibase/types": "2.1.43-alpha.10", "@budibase/types": "2.1.43-alpha.12",
"@shopify/jest-koa-mocks": "5.0.1", "@shopify/jest-koa-mocks": "5.0.1",
"@techpass/passport-openidconnect": "0.3.2", "@techpass/passport-openidconnect": "0.3.2",
"aws-sdk": "2.1030.0", "aws-sdk": "2.1030.0",

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": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"module": "dist/bbui.es.js", "module": "dist/bbui.es.js",
@ -38,7 +38,7 @@
], ],
"dependencies": { "dependencies": {
"@adobe/spectrum-css-workflow-icons": "^1.2.1", "@adobe/spectrum-css-workflow-icons": "^1.2.1",
"@budibase/string-templates": "2.1.43-alpha.10", "@budibase/string-templates": "2.1.43-alpha.12",
"@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actionbutton": "^1.0.1",
"@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1",
"@spectrum-css/avatar": "^3.0.2", "@spectrum-css/avatar": "^3.0.2",

View File

@ -205,7 +205,10 @@
width: 100%; width: 100%;
} }
.spectrum-Popover.auto-width :global(.spectrum-Menu-itemLabel) { .spectrum-Popover.auto-width :global(.spectrum-Menu-itemLabel) {
max-width: 400px;
white-space: nowrap; white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
} }
.spectrum-Picker { .spectrum-Picker {
width: 100%; width: 100%;

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/builder", "name": "@budibase/builder",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"license": "GPL-3.0", "license": "GPL-3.0",
"private": true, "private": true,
"scripts": { "scripts": {
@ -71,10 +71,10 @@
} }
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "2.1.43-alpha.10", "@budibase/bbui": "2.1.43-alpha.12",
"@budibase/client": "2.1.43-alpha.10", "@budibase/client": "2.1.43-alpha.12",
"@budibase/frontend-core": "2.1.43-alpha.10", "@budibase/frontend-core": "2.1.43-alpha.12",
"@budibase/string-templates": "2.1.43-alpha.10", "@budibase/string-templates": "2.1.43-alpha.12",
"@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

@ -481,6 +481,7 @@ const getSelectedRowsBindings = asset => {
block._id + "-table" block._id + "-table"
)}.${makePropSafe("selectedRows")}`, )}.${makePropSafe("selectedRows")}`,
readableBinding: `${block._instanceName}.Selected rows`, readableBinding: `${block._instanceName}.Selected rows`,
category: "Selected rows",
})) }))
) )
} }
@ -1004,7 +1005,10 @@ const bindingReplacement = (
* {{ literal [componentId] }} * {{ literal [componentId] }}
*/ */
const extractLiteralHandlebarsID = value => { const extractLiteralHandlebarsID = value => {
return value?.match(/{{\s*literal\s*\[+([^\]]+)].*}}/)?.[1] if (!value || typeof value !== "string") {
return null
}
return value.match(/{{\s*literal\s*\[+([^\]]+)].*}}/)?.[1]
} }
/** /**

View File

@ -1049,8 +1049,8 @@ export const getFrontendStore = () => {
const updatedSetting = settings.find(setting => setting.key === name) const updatedSetting = settings.find(setting => setting.key === name)
if ( if (
updatedSetting.type === "dataSource" || updatedSetting?.type === "dataSource" ||
updatedSetting.type === "table" updatedSetting?.type === "table"
) { ) {
const { schema } = getSchemaForDatasource(null, value) const { schema } = getSchemaForDatasource(null, value)
const columnNames = Object.keys(schema || {}) const columnNames = Object.keys(schema || {})

View File

@ -38,13 +38,15 @@
export let testData export let testData
export let schemaProperties export let schemaProperties
export let isTestModal = false export let isTestModal = false
let webhookModal let webhookModal
let drawer let drawer
let tempFilters = lookForFilters(schemaProperties) || []
let fillWidth = true let fillWidth = true
let codeBindingOpen = false let codeBindingOpen = false
let inputData let inputData
$: filters = lookForFilters(schemaProperties) || []
$: tempFilters = filters
$: stepId = block.stepId $: stepId = block.stepId
$: bindings = getAvailableBindings( $: bindings = getAvailableBindings(
block || $automationStore.selectedBlock, block || $automationStore.selectedBlock,
@ -222,16 +224,17 @@
{:else if value.customType === "filters"} {:else if value.customType === "filters"}
<ActionButton on:click={drawer.show}>Define filters</ActionButton> <ActionButton on:click={drawer.show}>Define filters</ActionButton>
<Drawer bind:this={drawer} {fillWidth} title="Filtering"> <Drawer bind:this={drawer} {fillWidth} title="Filtering">
<Button cta slot="buttons" on:click={() => saveFilters(key)} <Button cta slot="buttons" on:click={() => saveFilters(key)}>
>Save</Button Save
> </Button>
<FilterDrawer <FilterDrawer
slot="body" slot="body"
bind:filters={tempFilters} {filters}
{bindings} {bindings}
{schemaFields} {schemaFields}
panel={AutomationBindingPanel} panel={AutomationBindingPanel}
fillWidth fillWidth
on:change={e => (tempFilters = e.detail)}
/> />
</Drawer> </Drawer>
{:else if value.customType === "password"} {:else if value.customType === "password"}

View File

@ -25,6 +25,7 @@
import { API } from "api" import { API } from "api"
let hideAutocolumns = true let hideAutocolumns = true
let filters
$: isUsersTable = $tables.selected?._id === TableNames.USERS $: isUsersTable = $tables.selected?._id === TableNames.USERS
$: type = $tables.selected?.type $: type = $tables.selected?.type
@ -36,6 +37,7 @@
$: hasCols = checkHasCols(schema) $: hasCols = checkHasCols(schema)
$: hasRows = !!$fetch.rows?.length $: hasRows = !!$fetch.rows?.length
$: showError($fetch.error) $: showError($fetch.error)
$: id, (filters = null)
const showError = error => { const showError = error => {
if (error) { if (error) {
@ -102,8 +104,9 @@
// Fetch data whenever filters change // Fetch data whenever filters change
const onFilter = e => { const onFilter = e => {
filters = e.detail
fetch.update({ fetch.update({
filter: e.detail, filter: filters,
}) })
} }
@ -178,6 +181,7 @@
{#key id} {#key id}
<TableFilterButton <TableFilterButton
{schema} {schema}
{filters}
on:change={onFilter} on:change={onFilter}
disabled={!hasCols} disabled={!hasCols}
/> />

View File

@ -8,9 +8,10 @@
export let disabled = false export let disabled = false
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
let modal
let tempValue = filters || []
let modal
$: tempValue = filters || []
$: schemaFields = Object.values(schema || {}) $: schemaFields = Object.values(schema || {})
</script> </script>
@ -34,8 +35,9 @@
<div class="wrapper"> <div class="wrapper">
<FilterDrawer <FilterDrawer
allowBindings={false} allowBindings={false}
bind:filters={tempValue} {filters}
{schemaFields} {schemaFields}
on:change={e => (tempValue = e.detail)}
/> />
</div> </div>
</ModalContent> </ModalContent>

View File

@ -39,6 +39,7 @@
export let value = "" export let value = ""
export let valid export let valid
export let allowJS = false export let allowJS = false
export let allowHelpers = true
let helpers = handlebarsCompletions() let helpers = handlebarsCompletions()
let getCaretPosition let getCaretPosition
@ -85,7 +86,7 @@
return helper.label.match(searchRgx) || helper.description.match(searchRgx) return helper.label.match(searchRgx) || helper.description.match(searchRgx)
}) })
$: categoryNames = [...categories.map(cat => cat[0]), "Helpers"] $: categoryNames = getCategoryNames(categories)
$: codeMirrorHints = bindings?.map(x => `$("${x.readableBinding}")`) $: codeMirrorHints = bindings?.map(x => `$("${x.readableBinding}")`)
@ -96,6 +97,14 @@
} }
} }
const getCategoryNames = categories => {
let names = [...categories.map(cat => cat[0])]
if (allowHelpers) {
names.push("Helpers")
}
return names
}
// Adds a JS/HBS helper to the expression // Adds a JS/HBS helper to the expression
const addHelper = (helper, js) => { const addHelper = (helper, js) => {
let tempVal let tempVal
@ -343,7 +352,7 @@
for more details. for more details.
</p> </p>
{/if} {/if}
{#if $admin.isDev} {#if $admin.isDev && allowJS}
<div class="convert"> <div class="convert">
<Button secondary on:click={convert}>Convert to JS</Button> <Button secondary on:click={convert}>Convert to JS</Button>
</div> </div>

View File

@ -5,6 +5,7 @@
export let valid export let valid
export let value = "" export let value = ""
export let allowJS = false export let allowJS = false
export let allowHelpers = true
$: enrichedBindings = enrichBindings(bindings) $: enrichedBindings = enrichBindings(bindings)
@ -25,5 +26,6 @@
bindings={enrichedBindings} bindings={enrichedBindings}
{value} {value}
{allowJS} {allowJS}
{allowHelpers}
on:change on:change
/> />

View File

@ -17,6 +17,7 @@
export let disabled = false export let disabled = false
export let fillWidth export let fillWidth
export let allowJS = true export let allowJS = true
export let allowHelpers = true
export let updateOnChange = true export let updateOnChange = true
export let drawerLeft export let drawerLeft
@ -77,6 +78,7 @@
on:change={event => (tempValue = event.detail)} on:change={event => (tempValue = event.detail)}
{bindings} {bindings}
{allowJS} {allowJS}
{allowHelpers}
/> />
</Drawer> </Drawer>

View File

@ -17,22 +17,30 @@
import { generate } from "shortid" import { generate } from "shortid"
import { LuceneUtils, Constants } from "@budibase/frontend-core" import { LuceneUtils, Constants } from "@budibase/frontend-core"
import { getFields } from "helpers/searchFields" import { getFields } from "helpers/searchFields"
import { createEventDispatcher, onMount } from "svelte" import { createEventDispatcher } from "svelte"
const dispatch = createEventDispatcher()
const { OperatorOptions } = Constants
const { getValidOperatorsForType } = LuceneUtils
export let schemaFields export let schemaFields
export let filters = [] export let filters = []
export let bindings = [] export let bindings = []
export let panel = ClientBindingPanel export let panel = ClientBindingPanel
export let allowBindings = true export let allowBindings = true
export let allOr = false
export let fillWidth = false export let fillWidth = false
export let tableId export let tableId
$: dispatch("change", filters) const dispatch = createEventDispatcher()
const { OperatorOptions } = Constants
const { getValidOperatorsForType } = LuceneUtils
const KeyedFieldRegex = /\d[0-9]*:/g
const behaviourOptions = [
{ value: "and", label: "Match all filters" },
{ value: "or", label: "Match any filter" },
]
let rawFilters
let matchAny = false
$: parseFilters(filters)
$: dispatch("change", enrichFilters(rawFilters, matchAny))
$: enrichedSchemaFields = getFields( $: enrichedSchemaFields = getFields(
schemaFields || [], schemaFields || [],
{ allowLinks: true }, { allowLinks: true },
@ -41,14 +49,41 @@
$: fieldOptions = enrichedSchemaFields.map(field => field.name) || [] $: fieldOptions = enrichedSchemaFields.map(field => field.name) || []
$: valueTypeOptions = allowBindings ? ["Value", "Binding"] : ["Value"] $: valueTypeOptions = allowBindings ? ["Value", "Binding"] : ["Value"]
let behaviourValue // Remove field key prefixes and determine whether to use the "match all"
const behaviourOptions = [ // or "match any" behaviour
{ value: "and", label: "Match all of the following filters" }, const parseFilters = filters => {
{ value: "or", label: "Match any of the following filters" }, matchAny = filters?.find(filter => filter.operator === "allOr") != null
] rawFilters = (filters || [])
.filter(filter => filter.operator !== "allOr")
.map(filter => {
const { field } = filter
let newFilter = { ...filter }
delete newFilter.allOr
if (typeof field === "string" && field.match(KeyedFieldRegex) != null) {
const parts = field.split(":")
parts.shift()
newFilter.field = parts.join(":")
}
return newFilter
})
}
// Add field key prefixes and a special metadata filter object to indicate
// whether to use the "match all" or "match any" behaviour
const enrichFilters = (rawFilters, matchAny) => {
let count = 1
return rawFilters
.filter(filter => filter.field)
.map(filter => ({
...filter,
field: `${count++}:${filter.field}`,
}))
.concat(matchAny ? [{ operator: "allOr" }] : [])
}
const addFilter = () => { const addFilter = () => {
filters = [ rawFilters = [
...filters, ...rawFilters,
{ {
id: generate(), id: generate(),
field: null, field: null,
@ -60,13 +95,13 @@
} }
const removeFilter = id => { const removeFilter = id => {
filters = filters.filter(field => field.id !== id) rawFilters = rawFilters.filter(field => field.id !== id)
} }
const duplicateFilter = id => { const duplicateFilter = id => {
const existingFilter = filters.find(filter => filter.id === id) const existingFilter = rawFilters.find(filter => filter.id === id)
const duplicate = { ...existingFilter, id: generate() } const duplicate = { ...existingFilter, id: generate() }
filters = [...filters, duplicate] rawFilters = [...rawFilters, duplicate]
} }
const getSchema = filter => { const getSchema = filter => {
@ -133,32 +168,22 @@
const schema = enrichedSchemaFields.find(x => x.name === field) const schema = enrichedSchemaFields.find(x => x.name === field)
return schema?.constraints?.inclusion || [] return schema?.constraints?.inclusion || []
} }
onMount(() => {
behaviourValue = allOr ? "or" : "and"
})
</script> </script>
<DrawerContent> <DrawerContent>
<div class="container"> <div class="container">
<Layout noPadding> <Layout noPadding>
<Body size="S"> {#if !rawFilters?.length}
{#if !filters?.length} <Body size="S">Add your first filter expression.</Body>
Add your first filter expression. {:else}
{:else}
Results are filtered to only those which match all of the following
constraints.
{/if}
</Body>
{#if filters?.length}
<div class="fields"> <div class="fields">
<Select <Select
label="Behaviour" label="Behaviour"
value={behaviourValue} value={matchAny ? "or" : "and"}
options={behaviourOptions} options={behaviourOptions}
getOptionLabel={opt => opt.label} getOptionLabel={opt => opt.label}
getOptionValue={opt => opt.value} getOptionValue={opt => opt.value}
on:change={e => (allOr = e.detail === "or")} on:change={e => (matchAny = e.detail === "or")}
placeholder={null} placeholder={null}
/> />
</div> </div>
@ -167,7 +192,7 @@
<Label>Filters</Label> <Label>Filters</Label>
</div> </div>
<div class="fields"> <div class="fields">
{#each filters as filter, idx} {#each rawFilters as filter, idx}
<Select <Select
bind:value={filter.field} bind:value={filter.field}
options={fieldOptions} options={fieldOptions}
@ -269,7 +294,7 @@
column-gap: var(--spacing-l); column-gap: var(--spacing-l);
row-gap: var(--spacing-s); row-gap: var(--spacing-s);
align-items: center; align-items: center;
grid-template-columns: 1fr 150px 120px 1fr 16px 16px; grid-template-columns: minmax(150px, 1fr) 170px 120px minmax(150px, 1fr) 16px 16px;
} }
.filter-label { .filter-label {

View File

@ -8,74 +8,22 @@
import FilterDrawer from "./FilterDrawer.svelte" import FilterDrawer from "./FilterDrawer.svelte"
import { currentAsset } from "builderStore" import { currentAsset } from "builderStore"
const QUERY_START_REGEX = /\d[0-9]*:/g
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
export let value = [] export let value = []
export let componentInstance export let componentInstance
export let bindings = [] export let bindings = []
let drawer, let drawer
toSaveFilters = null,
allOr,
initialAllOr
$: initialFilters = correctFilters(value || []) $: tempValue = value
$: dataSource = getDatasourceForProvider($currentAsset, componentInstance) $: dataSource = getDatasourceForProvider($currentAsset, componentInstance)
$: schema = getSchemaForDatasource($currentAsset, dataSource)?.schema $: schema = getSchemaForDatasource($currentAsset, dataSource)?.schema
$: schemaFields = Object.values(schema || {}) $: schemaFields = Object.values(schema || {})
function addNumbering(filters) {
let count = 1
for (let value of filters) {
if (value.field && value.field?.match(QUERY_START_REGEX) == null) {
value.field = `${count++}:${value.field}`
}
}
return filters
}
function correctFilters(filters) {
const corrected = []
for (let filter of filters) {
let field = filter.field
if (filter.operator === "allOr") {
initialAllOr = allOr = true
continue
}
if (
typeof filter.field === "string" &&
filter.field.match(QUERY_START_REGEX) != null
) {
const parts = field.split(":")
const number = parts[0]
// it's the new format, remove number
if (!isNaN(parseInt(number))) {
parts.shift()
field = parts.join(":")
}
}
corrected.push({
...filter,
field,
})
}
return corrected
}
async function saveFilter() { async function saveFilter() {
if (!toSaveFilters && allOr !== initialAllOr) { dispatch("change", tempValue)
toSaveFilters = initialFilters notifications.success("Filters saved")
}
const filters = toSaveFilters?.filter(filter => filter.operator !== "allOr")
if (allOr && filters) {
filters.push({ operator: "allOr" })
}
// only save if anything was updated
if (filters) {
dispatch("change", addNumbering(filters))
}
notifications.success("Filters saved.")
drawer.hide() drawer.hide()
} }
</script> </script>
@ -85,13 +33,10 @@
<Button cta slot="buttons" on:click={saveFilter}>Save</Button> <Button cta slot="buttons" on:click={saveFilter}>Save</Button>
<FilterDrawer <FilterDrawer
slot="body" slot="body"
filters={initialFilters} filters={value}
{bindings} {bindings}
{schemaFields} {schemaFields}
tableId={dataSource.tableId} tableId={dataSource.tableId}
bind:allOr on:change={e => (tempValue = e.detail)}
on:change={event => {
toSaveFilters = event.detail
}}
/> />
</Drawer> </Drawer>

View File

@ -33,6 +33,7 @@
export let showMenu = false export let showMenu = false
export let bindings = [] export let bindings = []
export let bindingDrawerLeft export let bindingDrawerLeft
export let allowHelpers = true
let fields = Object.entries(object || {}).map(([name, value]) => ({ let fields = Object.entries(object || {}).map(([name, value]) => ({
name, name,
@ -122,6 +123,7 @@
disabled={readOnly} disabled={readOnly}
value={field.value} value={field.value}
allowJS={false} allowJS={false}
{allowHelpers}
fillWidth={true} fillWidth={true}
drawerLeft={bindingDrawerLeft} drawerLeft={bindingDrawerLeft}
/> />

View File

@ -223,6 +223,7 @@
.config { .config {
display: grid; display: grid;
grid-gap: var(--spacing-s); grid-gap: var(--spacing-s);
z-index: 1;
} }
.config-field { .config-field {

View File

@ -37,6 +37,7 @@
valuePlaceholder="Default" valuePlaceholder="Default"
bindings={[...userBindings]} bindings={[...userBindings]}
bindingDrawerLeft="260px" bindingDrawerLeft="260px"
allowHelpers={false}
on:change on:change
/> />
</div> </div>

View File

@ -61,6 +61,13 @@
align-items: center; align-items: center;
gap: var(--spacing-l); gap: var(--spacing-l);
} }
.header-left {
flex: 1 1 auto;
width: 0;
}
.header-left :global(> *) {
max-width: 100%;
}
.header-left :global(.spectrum-Picker) { .header-left :global(.spectrum-Picker) {
font-weight: 600; font-weight: 600;
color: var(--spectrum-global-color-gray-900); color: var(--spectrum-global-color-gray-900);

View File

@ -282,12 +282,16 @@
gap: var(--spacing-l); gap: var(--spacing-l);
display: grid; display: grid;
align-items: center; align-items: center;
grid-template-columns: auto 160px auto 1fr 130px 130px 1fr auto auto; grid-template-columns:
auto 150px auto minmax(140px, 1fr) 120px 100px minmax(140px, 1fr)
auto auto;
border-radius: var(--border-radius-s); border-radius: var(--border-radius-s);
transition: background-color ease-in-out 130ms; transition: background-color ease-in-out 130ms;
} }
.condition.update { .condition.update {
grid-template-columns: auto 160px 1fr auto 1fr auto 1fr 130px 130px 1fr auto auto; grid-template-columns:
auto 150px minmax(140px, 1fr) auto minmax(140px, 1fr) auto
minmax(140px, 1fr) 120px 100px minmax(140px, 1fr) auto auto;
} }
.condition:hover { .condition:hover {
background-color: var(--spectrum-global-color-gray-100); background-color: var(--spectrum-global-color-gray-100);

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/cli", "name": "@budibase/cli",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"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": {
@ -26,9 +26,9 @@
"outputPath": "build" "outputPath": "build"
}, },
"dependencies": { "dependencies": {
"@budibase/backend-core": "2.1.43-alpha.10", "@budibase/backend-core": "2.1.43-alpha.12",
"@budibase/string-templates": "2.1.43-alpha.10", "@budibase/string-templates": "2.1.43-alpha.12",
"@budibase/types": "2.1.43-alpha.10", "@budibase/types": "2.1.43-alpha.12",
"axios": "0.21.2", "axios": "0.21.2",
"chalk": "4.1.0", "chalk": "4.1.0",
"cli-progress": "3.11.2", "cli-progress": "3.11.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/client", "name": "@budibase/client",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"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",
@ -19,9 +19,9 @@
"dev:builder": "rollup -cw" "dev:builder": "rollup -cw"
}, },
"dependencies": { "dependencies": {
"@budibase/bbui": "2.1.43-alpha.10", "@budibase/bbui": "2.1.43-alpha.12",
"@budibase/frontend-core": "2.1.43-alpha.10", "@budibase/frontend-core": "2.1.43-alpha.12",
"@budibase/string-templates": "2.1.43-alpha.10", "@budibase/string-templates": "2.1.43-alpha.12",
"@spectrum-css/button": "^3.0.3", "@spectrum-css/button": "^3.0.3",
"@spectrum-css/card": "^3.0.3", "@spectrum-css/card": "^3.0.3",
"@spectrum-css/divider": "^1.0.3", "@spectrum-css/divider": "^1.0.3",

View File

@ -29,6 +29,17 @@
// Derive visibility // Derive visibility
$: open = $sidePanelStore.contentId === $component.id $: open = $sidePanelStore.contentId === $component.id
// Derive a render key which is only changed whenever this panel is made
// visible after being hidden. We need to key the content to avoid showing
// stale data when re-revealing a side panel that was closed, but we cannot
// hide the content altogether when hidden as this breaks ejection.
let renderKey = null
$: {
if (open) {
renderKey = Math.random()
}
}
const showInSidePanel = (el, visible) => { const showInSidePanel = (el, visible) => {
const update = visible => { const update = visible => {
const target = document.getElementById("side-panel-container") const target = document.getElementById("side-panel-container")
@ -47,7 +58,10 @@
// Apply initial visibility // Apply initial visibility
update(visible) update(visible)
return { update } return {
update,
destroy: () => update(false),
}
} }
</script> </script>
@ -57,9 +71,9 @@
class="side-panel" class="side-panel"
class:open class:open
> >
{#if $sidePanelStore.open} {#key renderKey}
<slot /> <slot />
{/if} {/key}
</div> </div>
<style> <style>

View File

@ -1,12 +1,12 @@
{ {
"name": "@budibase/frontend-core", "name": "@budibase/frontend-core",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"description": "Budibase frontend core libraries used in builder and client", "description": "Budibase frontend core libraries used in builder and client",
"author": "Budibase", "author": "Budibase",
"license": "MPL-2.0", "license": "MPL-2.0",
"svelte": "src/index.js", "svelte": "src/index.js",
"dependencies": { "dependencies": {
"@budibase/bbui": "2.1.43-alpha.10", "@budibase/bbui": "2.1.43-alpha.12",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"svelte": "^3.46.2" "svelte": "^3.46.2"
} }

View File

@ -28,11 +28,11 @@ export const OperatorOptions = {
}, },
MoreThan: { MoreThan: {
value: "rangeLow", value: "rangeLow",
label: "More than", label: "More than or equal to",
}, },
LessThan: { LessThan: {
value: "rangeHigh", value: "rangeHigh",
label: "Less than", label: "Less than or equal to",
}, },
Contains: { Contains: {
value: "contains", value: "contains",

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/sdk", "name": "@budibase/sdk",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"description": "Budibase Public API SDK", "description": "Budibase Public API SDK",
"author": "Budibase", "author": "Budibase",
"license": "MPL-2.0", "license": "MPL-2.0",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/server", "name": "@budibase/server",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"description": "Budibase Web Server", "description": "Budibase Web Server",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -43,11 +43,11 @@
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@apidevtools/swagger-parser": "10.0.3", "@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "2.1.43-alpha.10", "@budibase/backend-core": "2.1.43-alpha.12",
"@budibase/client": "2.1.43-alpha.10", "@budibase/client": "2.1.43-alpha.12",
"@budibase/pro": "2.1.43-alpha.10", "@budibase/pro": "2.1.43-alpha.12",
"@budibase/string-templates": "2.1.43-alpha.10", "@budibase/string-templates": "2.1.43-alpha.12",
"@budibase/types": "2.1.43-alpha.10", "@budibase/types": "2.1.43-alpha.12",
"@bull-board/api": "3.7.0", "@bull-board/api": "3.7.0",
"@bull-board/koa": "3.9.4", "@bull-board/koa": "3.9.4",
"@elastic/elasticsearch": "7.10.0", "@elastic/elasticsearch": "7.10.0",

View File

@ -1273,12 +1273,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.1.43-alpha.10": "@budibase/backend-core@2.1.43-alpha.12":
version "2.1.43-alpha.10" version "2.1.43-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.43-alpha.10.tgz#573647b851993734d83ce201c44eb4c3df2b8141" resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.43-alpha.12.tgz#41d9ee3f2fc7b33205b9f85a8274f55bcf372c13"
integrity sha512-1YOwm0n1gydvtqas7xW7oje97LiYxCZ0jGIMoxXk8AK94iXAYW/UYEcc/BdOnEvK0Zz4KEfvZ8tgAvq4VM83uQ== integrity sha512-GrmDsFwsKBzcyCM08PMKim193vlbDutuA1eTm62HNkTRSG+TDejVOATgA0uHqmBXXS5QG39LwcmKEhuL5KtLfw==
dependencies: dependencies:
"@budibase/types" "2.1.43-alpha.10" "@budibase/types" "2.1.43-alpha.12"
"@shopify/jest-koa-mocks" "5.0.1" "@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2" "@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0" aws-sdk "2.1030.0"
@ -1360,13 +1360,13 @@
svelte-flatpickr "^3.2.3" svelte-flatpickr "^3.2.3"
svelte-portal "^1.0.0" svelte-portal "^1.0.0"
"@budibase/pro@2.1.43-alpha.10": "@budibase/pro@2.1.43-alpha.12":
version "2.1.43-alpha.10" version "2.1.43-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.43-alpha.10.tgz#300ba146e2715b9b3d36f4febcde030f01760347" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.43-alpha.12.tgz#d9f3c3ce61f7177e3cbdb6b26565779dcfd0c85e"
integrity sha512-q9bwYw3xcDD08z9OZVHfqiBKNGjdDQ+c+SEYQRlNrvF9EbGc4WFiPzKDJrNlVSQF+/+oBHxGo6J9mFqrL66sdA== integrity sha512-ZGmw4YdZZx1xBSmS54cUr+njRGJAtH52zDURYJJj3zfzhBtJUvZ5Ryc+m6OVA7PJTCDG5kocbw/n9lEaoeDCnw==
dependencies: dependencies:
"@budibase/backend-core" "2.1.43-alpha.10" "@budibase/backend-core" "2.1.43-alpha.12"
"@budibase/types" "2.1.43-alpha.10" "@budibase/types" "2.1.43-alpha.12"
"@koa/router" "8.0.8" "@koa/router" "8.0.8"
bull "4.10.1" bull "4.10.1"
joi "17.6.0" joi "17.6.0"
@ -1390,10 +1390,10 @@
svelte-apexcharts "^1.0.2" svelte-apexcharts "^1.0.2"
svelte-flatpickr "^3.1.0" svelte-flatpickr "^3.1.0"
"@budibase/types@2.1.43-alpha.10": "@budibase/types@2.1.43-alpha.12":
version "2.1.43-alpha.10" version "2.1.43-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.43-alpha.10.tgz#0ee0766d07126a36913836de94d8fcebc77aead3" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.43-alpha.12.tgz#193ca97d4559811e3a2b3e454b53b79c588f7c3f"
integrity sha512-APp/srnTGZ1nIgCuOMsm2rEimMjKzKHZYd1QkuRq13dFcuwTG+Gr/soITTWurczAbS9jTo3MfZh859s1uv2e3g== integrity sha512-lfTjCTnxUA1zbxzht+X/glcGebY9Rm/eLvfVLazRQk1WQMXl740KRaJn5Y7nBVJgusQLGchM5g+Vp5YE5Sd3UA==
"@bull-board/api@3.7.0": "@bull-board/api@3.7.0":
version "3.7.0" version "3.7.0"

View File

@ -1,6 +1,6 @@
{ {
"name": "@budibase/string-templates", "name": "@budibase/string-templates",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"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,6 +1,6 @@
{ {
"name": "@budibase/types", "name": "@budibase/types",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"description": "Budibase types", "description": "Budibase types",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",

View File

@ -1,7 +1,7 @@
{ {
"name": "@budibase/worker", "name": "@budibase/worker",
"email": "hi@budibase.com", "email": "hi@budibase.com",
"version": "2.1.43-alpha.10", "version": "2.1.43-alpha.12",
"description": "Budibase background service", "description": "Budibase background service",
"main": "src/index.ts", "main": "src/index.ts",
"repository": { "repository": {
@ -36,10 +36,10 @@
"author": "Budibase", "author": "Budibase",
"license": "GPL-3.0", "license": "GPL-3.0",
"dependencies": { "dependencies": {
"@budibase/backend-core": "2.1.43-alpha.10", "@budibase/backend-core": "2.1.43-alpha.12",
"@budibase/pro": "2.1.43-alpha.10", "@budibase/pro": "2.1.43-alpha.12",
"@budibase/string-templates": "2.1.43-alpha.10", "@budibase/string-templates": "2.1.43-alpha.12",
"@budibase/types": "2.1.43-alpha.10", "@budibase/types": "2.1.43-alpha.12",
"@koa/router": "8.0.8", "@koa/router": "8.0.8",
"@sentry/node": "6.17.7", "@sentry/node": "6.17.7",
"@techpass/passport-openidconnect": "0.3.2", "@techpass/passport-openidconnect": "0.3.2",

View File

@ -470,12 +470,12 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
"@budibase/backend-core@2.1.43-alpha.10": "@budibase/backend-core@2.1.43-alpha.12":
version "2.1.43-alpha.10" version "2.1.43-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.43-alpha.10.tgz#573647b851993734d83ce201c44eb4c3df2b8141" resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-2.1.43-alpha.12.tgz#41d9ee3f2fc7b33205b9f85a8274f55bcf372c13"
integrity sha512-1YOwm0n1gydvtqas7xW7oje97LiYxCZ0jGIMoxXk8AK94iXAYW/UYEcc/BdOnEvK0Zz4KEfvZ8tgAvq4VM83uQ== integrity sha512-GrmDsFwsKBzcyCM08PMKim193vlbDutuA1eTm62HNkTRSG+TDejVOATgA0uHqmBXXS5QG39LwcmKEhuL5KtLfw==
dependencies: dependencies:
"@budibase/types" "2.1.43-alpha.10" "@budibase/types" "2.1.43-alpha.12"
"@shopify/jest-koa-mocks" "5.0.1" "@shopify/jest-koa-mocks" "5.0.1"
"@techpass/passport-openidconnect" "0.3.2" "@techpass/passport-openidconnect" "0.3.2"
aws-sdk "2.1030.0" aws-sdk "2.1030.0"
@ -507,22 +507,22 @@
uuid "8.3.2" uuid "8.3.2"
zlib "1.0.5" zlib "1.0.5"
"@budibase/pro@2.1.43-alpha.10": "@budibase/pro@2.1.43-alpha.12":
version "2.1.43-alpha.10" version "2.1.43-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.43-alpha.10.tgz#300ba146e2715b9b3d36f4febcde030f01760347" resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-2.1.43-alpha.12.tgz#d9f3c3ce61f7177e3cbdb6b26565779dcfd0c85e"
integrity sha512-q9bwYw3xcDD08z9OZVHfqiBKNGjdDQ+c+SEYQRlNrvF9EbGc4WFiPzKDJrNlVSQF+/+oBHxGo6J9mFqrL66sdA== integrity sha512-ZGmw4YdZZx1xBSmS54cUr+njRGJAtH52zDURYJJj3zfzhBtJUvZ5Ryc+m6OVA7PJTCDG5kocbw/n9lEaoeDCnw==
dependencies: dependencies:
"@budibase/backend-core" "2.1.43-alpha.10" "@budibase/backend-core" "2.1.43-alpha.12"
"@budibase/types" "2.1.43-alpha.10" "@budibase/types" "2.1.43-alpha.12"
"@koa/router" "8.0.8" "@koa/router" "8.0.8"
bull "4.10.1" bull "4.10.1"
joi "17.6.0" joi "17.6.0"
node-fetch "^2.6.1" node-fetch "^2.6.1"
"@budibase/types@2.1.43-alpha.10": "@budibase/types@2.1.43-alpha.12":
version "2.1.43-alpha.10" version "2.1.43-alpha.12"
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.43-alpha.10.tgz#0ee0766d07126a36913836de94d8fcebc77aead3" resolved "https://registry.yarnpkg.com/@budibase/types/-/types-2.1.43-alpha.12.tgz#193ca97d4559811e3a2b3e454b53b79c588f7c3f"
integrity sha512-APp/srnTGZ1nIgCuOMsm2rEimMjKzKHZYd1QkuRq13dFcuwTG+Gr/soITTWurczAbS9jTo3MfZh859s1uv2e3g== integrity sha512-lfTjCTnxUA1zbxzht+X/glcGebY9Rm/eLvfVLazRQk1WQMXl740KRaJn5Y7nBVJgusQLGchM5g+Vp5YE5Sd3UA==
"@cspotcode/source-map-support@^0.8.0": "@cspotcode/source-map-support@^0.8.0":
version "0.8.1" version "0.8.1"