Merge branch 'develop' into remove-automation-tooltip

This commit is contained in:
Martin McKeaveney 2023-09-25 13:58:32 +01:00 committed by GitHub
commit 1ef3c92195
7 changed files with 53 additions and 34 deletions

View File

@ -1,5 +1,5 @@
{ {
"version": "2.10.12-alpha.4", "version": "2.10.12-alpha.6",
"npmClient": "yarn", "npmClient": "yarn",
"packages": [ "packages": [
"packages/*" "packages/*"

View File

@ -83,8 +83,7 @@
if (Array.isArray(value)) { if (Array.isArray(value)) {
return value return value
} }
return value.split(",").map(x => x.trim())
return [value]
} }
if (type === "json") { if (type === "json") {
@ -146,7 +145,7 @@
placeholder={placeholders[schema.type]} placeholder={placeholders[schema.type]}
panel={AutomationBindingPanel} panel={AutomationBindingPanel}
value={Array.isArray(value[field]) value={Array.isArray(value[field])
? value[field].join(" ") ? value[field].join(",")
: value[field]} : value[field]}
on:change={e => onChange(e, field, schema.type)} on:change={e => onChange(e, field, schema.type)}
label={field} label={field}

View File

@ -55,9 +55,14 @@
bind:value={value[field]} bind:value={value[field]}
label={field} label={field}
options={schema.constraints.inclusion} options={schema.constraints.inclusion}
on:change={e => onChange(e, field)}
/> />
{:else if schema.type === "longform"} {:else if schema.type === "longform"}
<TextArea label={field} bind:value={value[field]} /> <TextArea
label={field}
bind:value={value[field]}
on:change={e => onChange(e, field)}
/>
{:else if schema.type === "json"} {:else if schema.type === "json"}
<span> <span>
<Label>{field}</Label> <Label>{field}</Label>
@ -73,7 +78,11 @@
/> />
</span> </span>
{:else if schema.type === "link"} {:else if schema.type === "link"}
<LinkedRowSelector bind:linkedRows={value[field]} {schema} /> <LinkedRowSelector
bind:linkedRows={value[field]}
{schema}
on:change={e => onChange(e, field)}
/>
{:else if schema.type === "string" || schema.type === "number"} {:else if schema.type === "string" || schema.type === "number"}
<svelte:component <svelte:component
this={isTestModal ? ModalBindableInput : DrawerBindableInput} this={isTestModal ? ModalBindableInput : DrawerBindableInput}

View File

@ -3,10 +3,13 @@
import { API } from "api" import { API } from "api"
import { Select, Label, Multiselect } from "@budibase/bbui" import { Select, Label, Multiselect } from "@budibase/bbui"
import { capitalise } from "../../helpers" import { capitalise } from "../../helpers"
import { createEventDispatcher } from "svelte"
export let schema export let schema
export let linkedRows = [] export let linkedRows = []
const dispatch = createEventDispatcher()
let rows = [] let rows = []
let linkedIds = (Array.isArray(linkedRows) ? linkedRows : [])?.map( let linkedIds = (Array.isArray(linkedRows) ? linkedRows : [])?.map(
row => row?._id || row row => row?._id || row
@ -44,7 +47,10 @@
options={rows} options={rows}
getOptionLabel={getPrettyName} getOptionLabel={getPrettyName}
getOptionValue={row => row._id} getOptionValue={row => row._id}
on:change={e => (linkedIds = e.detail ? [e.detail] : [])} on:change={e => {
linkedIds = e.detail ? [e.detail] : []
dispatch("change", linkedIds)
}}
{label} {label}
sort sort
/> />
@ -56,5 +62,6 @@
getOptionLabel={getPrettyName} getOptionLabel={getPrettyName}
getOptionValue={row => row._id} getOptionValue={row => row._id}
sort sort
on:change={() => dispatch("change", linkedIds)}
/> />
{/if} {/if}

View File

@ -61,7 +61,9 @@
key: "_css", key: "_css",
type: "text", type: "text",
}) })
$: settingOptions = settings.map(setting => ({ $: settingOptions = settings
.filter(setting => setting.supportsConditions !== false)
.map(setting => ({
label: makeLabel(setting), label: makeLabel(setting),
value: setting.key, value: setting.key,
})) }))

View File

@ -36,10 +36,7 @@
</script> </script>
<DetailSummary name={"Conditions"} collapsible={false}> <DetailSummary name={"Conditions"} collapsible={false}>
<div class="conditionCount">{conditionText}</div> <ActionButton on:click={openDrawer}>{conditionText}</ActionButton>
<div>
<ActionButton on:click={openDrawer}>Configure conditions</ActionButton>
</div>
</DetailSummary> </DetailSummary>
<Drawer bind:this={drawer} title="Conditions"> <Drawer bind:this={drawer} title="Conditions">
<svelte:fragment slot="description"> <svelte:fragment slot="description">
@ -48,10 +45,3 @@
<Button cta slot="buttons" on:click={() => save()}>Save</Button> <Button cta slot="buttons" on:click={() => save()}>Save</Button>
<ConditionalUIDrawer slot="body" bind:conditions={tempValue} {bindings} /> <ConditionalUIDrawer slot="body" bind:conditions={tempValue} {bindings} />
</Drawer> </Drawer>
<style>
.conditionCount {
font-weight: 600;
margin-top: -5px;
}
</style>

View File

@ -2539,7 +2539,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -2629,7 +2630,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -2685,7 +2687,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -2736,7 +2739,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -2841,7 +2845,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "boolean", "type": "boolean",
@ -2960,7 +2965,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -3143,7 +3149,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -3200,7 +3207,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -3301,7 +3309,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -3355,7 +3364,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "boolean", "type": "boolean",
@ -3622,7 +3632,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",
@ -3689,7 +3700,8 @@
{ {
"type": "text", "type": "text",
"label": "Default value", "label": "Default value",
"key": "defaultValue" "key": "defaultValue",
"supportsConditions": false
}, },
{ {
"type": "event", "type": "event",