Merge branch 'master' into fix/formblock-ux-updates

This commit is contained in:
Andrew Kingston 2023-11-28 19:36:55 +00:00 committed by GitHub
commit a1a7ab227d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 48 additions and 10 deletions

View File

@ -26,27 +26,48 @@ if [[ "${TARGETBUILD}" = "aas" ]]; then
sed -i "s#DATA_DIR#/home#g" /opt/clouseau/clouseau.ini
sed -i "s#DATA_DIR#/home#g" /opt/couchdb/etc/local.ini
elif [[ "${TARGETBUILD}" = "single" ]]; then
# In the single image build, the Dockerfile specifies /data as a volume
# mount, so we use that for all persistent data.
sed -i "s#DATA_DIR#/data#g" /opt/clouseau/clouseau.ini
sed -i "s#DATA_DIR#/data#g" /opt/couchdb/etc/local.ini
elif [[ -n $KUBERNETES_SERVICE_HOST ]]; then
# In Kubernetes the directory /opt/couchdb/data has a persistent volume
# mount for storing database data.
sed -i "s#DATA_DIR#/opt/couchdb/data#g" /opt/clouseau/clouseau.ini
sed -i "s#DATA_DIR#/opt/couchdb/data#g" /opt/couchdb/etc/local.ini
# We remove the database_dir and view_index_dir settings from the local.ini
# in Kubernetes because it will default to /opt/couchdb/data which is what
# our Helm chart was using prior to us switching to using our own CouchDB
# image.
sed -i "s#^database_dir.*\$##g" /opt/couchdb/etc/local.ini
sed -i "s#^view_index_dir.*\$##g" /opt/couchdb/etc/local.ini
# We remove the -name setting from the vm.args file in Kubernetes because
# it will default to the pod FQDN, which is what's required for clustering
# to work.
sed -i "s/^-name .*$//g" /opt/couchdb/etc/vm.args
else
# For all other builds, we use /data for persistent data.
sed -i "s#DATA_DIR#/data#g" /opt/clouseau/clouseau.ini
sed -i "s#DATA_DIR#/data#g" /opt/couchdb/etc/local.ini
fi
# Start Clouseau. Budibase won't function correctly without Clouseau running, it
# powers the search API endpoints which are used to do all sorts, including
# populating app grids.
/opt/clouseau/bin/clouseau > /dev/stdout 2>&1 &
# Start CouchDB.
/docker-entrypoint.sh /opt/couchdb/bin/couchdb &
# Wati for CouchDB to start up.
while [[ $(curl -s -w "%{http_code}\n" http://localhost:5984/_up -o /dev/null) -ne 200 ]]; do
echo 'Waiting for CouchDB to start...';
sleep 5;
done
# CouchDB needs the `_users` and `_replicator` databases to exist before it will
# function correctly, so we create them here.
curl -X PUT http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@localhost:5984/_users
curl -X PUT http://${COUCHDB_USER}:${COUCHDB_PASSWORD}@localhost:5984/_replicator
sleep infinity

View File

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

View File

@ -64,7 +64,7 @@
</span>
{:else if schema.type === "link"}
<LinkedRowSelector
bind:linkedRows={value[field]}
linkedRows={value[field]}
{schema}
on:change={e => onChange(e, field)}
useLabel={false}

View File

@ -70,7 +70,12 @@
options={meta.constraints.inclusion}
/>
{:else if type === "link"}
<LinkedRowSelector {error} bind:linkedRows={value} schema={meta} />
<LinkedRowSelector
{error}
linkedRows={value}
schema={meta}
on:change={e => (value = e.detail)}
/>
{:else if type === "longform"}
{#if meta.useRichText}
<RichTextField {error} {label} height="150px" bind:value />

View File

@ -56,12 +56,12 @@
/>
{:else}
<Multiselect
bind:value={linkedIds}
value={linkedIds}
{label}
options={rows}
getOptionLabel={getPrettyName}
getOptionValue={row => row._id}
sort
on:change={() => dispatch("change", linkedIds)}
on:change
/>
{/if}

View File

@ -205,7 +205,7 @@
messages: [
{
message:
"We've updated our pricing - read the blog post to learn more.",
"We've updated our pricing - see our website to learn more.",
type: BANNER_TYPES.NEUTRAL,
extraButtonText: "Learn More",
extraButtonAction: () =>

View File

@ -1,6 +1,6 @@
<script>
import { CoreSelect, CoreMultiselect } from "@budibase/bbui"
import { fetchData } from "@budibase/frontend-core"
import { fetchData, Utils } from "@budibase/frontend-core"
import { getContext } from "svelte"
import Field from "./Field.svelte"
import { FieldTypes } from "../../../constants"
@ -108,7 +108,7 @@
}
}
$: fetchRows(searchTerm, primaryDisplay, defaultValue)
$: debouncedFetchRows(searchTerm, primaryDisplay, defaultValue)
const fetchRows = async (searchTerm, primaryDisplay, defaultVal) => {
const allRowsFetched =
@ -124,10 +124,22 @@
query: { equal: { _id: defaultVal } },
})
}
// Ensure we match all filters, rather than any
const baseFilter = (filter || []).filter(x => x.operator !== "allOr")
await fetch.update({
query: { string: { [primaryDisplay]: searchTerm } },
filter: [
...baseFilter,
{
// Use a big numeric prefix to avoid clashing with an existing filter
field: `999:${primaryDisplay}`,
operator: "string",
value: searchTerm,
},
],
})
}
const debouncedFetchRows = Utils.debounce(fetchRows, 250)
const flatten = values => {
if (!values) {