Merge branch 'master' into ci/disable-major-update-run

This commit is contained in:
Sam Rose 2024-11-04 16:54:59 +00:00 committed by GitHub
commit 5ac76a7761
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 11 deletions

View File

@ -81,11 +81,17 @@ mkdir -p ${DATA_DIR}/minio
mkdir -p ${DATA_DIR}/redis mkdir -p ${DATA_DIR}/redis
chown -R couchdb:couchdb ${DATA_DIR}/couch chown -R couchdb:couchdb ${DATA_DIR}/couch
sed -i "s#DATA_DIR#${DATA_DIR}#g" /etc/redis/redis.conf REDIS_CONFIG="/etc/redis/redis.conf"
sed -i "s#DATA_DIR#${DATA_DIR}#g" "${REDIS_CONFIG}"
if [[ -n "${USE_DEFAULT_REDIS_CONFIG}" ]]; then
REDIS_CONFIG=""
fi
if [[ -n "${REDIS_PASSWORD}" ]]; then if [[ -n "${REDIS_PASSWORD}" ]]; then
redis-server /etc/redis/redis.conf --requirepass $REDIS_PASSWORD > /dev/stdout 2>&1 & redis-server "${REDIS_CONFIG}" --requirepass $REDIS_PASSWORD > /dev/stdout 2>&1 &
else else
redis-server /etc/redis/redis.conf > /dev/stdout 2>&1 & redis-server "${REDIS_CONFIG}" > /dev/stdout 2>&1 &
fi fi
/bbcouch-runner.sh & /bbcouch-runner.sh &

View File

@ -5,13 +5,13 @@
Button, Button,
Drawer, Drawer,
DrawerContent, DrawerContent,
Helpers,
} from "@budibase/bbui" } from "@budibase/bbui"
import { createEventDispatcher } from "svelte" import { createEventDispatcher } from "svelte"
import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding" import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding"
import FilterBuilder from "./FilterBuilder.svelte" import FilterBuilder from "./FilterBuilder.svelte"
import { tables, selectedScreen } from "stores/builder" import { tables, selectedScreen } from "stores/builder"
import { search } from "@budibase/frontend-core" import { search } from "@budibase/frontend-core"
import { utils } from "@budibase/shared-core"
const dispatch = createEventDispatcher() const dispatch = createEventDispatcher()
@ -22,7 +22,7 @@
let drawer let drawer
$: localFilters = Helpers.cloneDeep(value) $: localFilters = value
$: datasource = getDatasourceForProvider($selectedScreen, componentInstance) $: datasource = getDatasourceForProvider($selectedScreen, componentInstance)
$: dsSchema = getSchemaForDatasource($selectedScreen, datasource)?.schema $: dsSchema = getSchemaForDatasource($selectedScreen, datasource)?.schema
$: schemaFields = search.getFields( $: schemaFields = search.getFields(
@ -30,8 +30,7 @@
Object.values(schema || dsSchema || {}), Object.values(schema || dsSchema || {}),
{ allowLinks: true } { allowLinks: true }
) )
$: text = getText(value)
$: text = getText(value?.groups)
async function saveFilter() { async function saveFilter() {
dispatch("change", localFilters) dispatch("change", localFilters)
@ -39,11 +38,14 @@
drawer.hide() drawer.hide()
} }
const getText = (filterGroups = []) => { const getText = filters => {
const allFilters = filterGroups.reduce((acc, group) => { if (Array.isArray(filters)) {
filters = utils.processSearchFilters(filters)
}
const groups = filters?.groups || []
const allFilters = groups.reduce((acc, group) => {
return (acc += group.filters.filter(filter => filter.field).length) return (acc += group.filters.filter(filter => filter.field).length)
}, 0) }, 0)
if (allFilters === 0) { if (allFilters === 0) {
return "No filters set" return "No filters set"
} else { } else {
@ -62,7 +64,7 @@
on:drawerShow on:drawerShow
on:drawerShow={() => { on:drawerShow={() => {
// Reset to the currently available value. // Reset to the currently available value.
localFilters = Helpers.cloneDeep(value) localFilters = value
}} }}
> >
<Button cta slot="buttons" on:click={saveFilter}>Save</Button> <Button cta slot="buttons" on:click={saveFilter}>Save</Button>