1
0
Fork 0
mirror of synced 2024-10-01 17:47:46 +13:00

Bug fixes for logo and binding validation. Random fix for a button actions issue found while testing

This commit is contained in:
Dean 2023-02-02 12:49:26 +00:00
parent c2f883e781
commit 73f3fc41cb
3 changed files with 10 additions and 2 deletions

View file

@ -22,6 +22,7 @@
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
let bindingDrawer let bindingDrawer
let valid = true
$: readableValue = runtimeToReadableBinding(bindings, value) $: readableValue = runtimeToReadableBinding(bindings, value)
$: tempValue = readableValue $: tempValue = readableValue
@ -76,12 +77,15 @@
<svelte:fragment slot="description"> <svelte:fragment slot="description">
Add the objects on the left to enrich your text. Add the objects on the left to enrich your text.
</svelte:fragment> </svelte:fragment>
<Button cta slot="buttons" on:click={handleClose}>Save</Button> <Button cta slot="buttons" on:click={handleClose} disabled={!valid}>
Save
</Button>
<svelte:component <svelte:component
this={panel} this={panel}
slot="body" slot="body"
value={readableValue} value={readableValue}
close={handleClose} close={handleClose}
bind:valid
on:change={event => (tempValue = event.detail)} on:change={event => (tempValue = event.detail)}
{bindings} {bindings}
{allowJS} {allowJS}

View file

@ -118,6 +118,10 @@
const getAllBindings = (bindings, eventContextBindings, actions) => { const getAllBindings = (bindings, eventContextBindings, actions) => {
let allBindings = eventContextBindings.concat(bindings) let allBindings = eventContextBindings.concat(bindings)
if (!actions) {
return []
}
// Ensure bindings are generated for all "update state" action keys // Ensure bindings are generated for all "update state" action keys
actions actions
.filter(action => { .filter(action => {

View file

@ -267,7 +267,7 @@ export async function publicSettings(ctx: Ctx) {
// enrich the logo url // enrich the logo url
// empty url means deleted // empty url means deleted
if (config.config.logoUrl !== "") { if (config.config.logoUrl && config.config.logoUrl !== "") {
config.config.logoUrl = objectStore.getGlobalFileUrl( config.config.logoUrl = objectStore.getGlobalFileUrl(
"settings", "settings",
"logoUrl", "logoUrl",