From c1bc231b410d875c2f51d580d8196cd238c34a1e Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 4 Nov 2024 15:52:41 +0000 Subject: [PATCH 1/3] Fix issue counting number of filters when legacy structure is used --- .../controls/FilterEditor/FilterEditor.svelte | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte index 34c317e865..0af48ca38d 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte @@ -12,6 +12,7 @@ import FilterBuilder from "./FilterBuilder.svelte" import { tables, selectedScreen } from "stores/builder" import { search } from "@budibase/frontend-core" + import { utils } from "@budibase/shared-core" const dispatch = createEventDispatcher() @@ -22,7 +23,7 @@ let drawer - $: localFilters = Helpers.cloneDeep(value) + $: localFilters = value $: datasource = getDatasourceForProvider($selectedScreen, componentInstance) $: dsSchema = getSchemaForDatasource($selectedScreen, datasource)?.schema $: schemaFields = search.getFields( @@ -30,8 +31,7 @@ Object.values(schema || dsSchema || {}), { allowLinks: true } ) - - $: text = getText(value?.groups) + $: text = getText(value) async function saveFilter() { dispatch("change", localFilters) @@ -39,11 +39,14 @@ drawer.hide() } - const getText = (filterGroups = []) => { - const allFilters = filterGroups.reduce((acc, group) => { + const getText = filters => { + 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) }, 0) - if (allFilters === 0) { return "No filters set" } else { @@ -62,7 +65,7 @@ on:drawerShow on:drawerShow={() => { // Reset to the currently available value. - localFilters = Helpers.cloneDeep(value) + localFilters = value }} > From 507ca710b2c1b53ee26eeacf6a896d712107d7bd Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 4 Nov 2024 16:02:54 +0000 Subject: [PATCH 2/3] Lint --- .../design/settings/controls/FilterEditor/FilterEditor.svelte | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte index 0af48ca38d..c48cc3b8ce 100644 --- a/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte +++ b/packages/builder/src/components/design/settings/controls/FilterEditor/FilterEditor.svelte @@ -5,7 +5,6 @@ Button, Drawer, DrawerContent, - Helpers, } from "@budibase/bbui" import { createEventDispatcher } from "svelte" import { getDatasourceForProvider, getSchemaForDatasource } from "dataBinding" From 6e2008c817d9b450f34712d838612686f2a9212b Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 4 Nov 2024 16:05:51 +0000 Subject: [PATCH 3/3] Add USE_DEFAULT_REDIS_CONFIG environment variable to single image to disable our config customisations. --- hosting/single/runner.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/hosting/single/runner.sh b/hosting/single/runner.sh index d9b8719f0f..e06a197ad5 100644 --- a/hosting/single/runner.sh +++ b/hosting/single/runner.sh @@ -81,11 +81,17 @@ mkdir -p ${DATA_DIR}/minio mkdir -p ${DATA_DIR}/redis 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 - 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 - redis-server /etc/redis/redis.conf > /dev/stdout 2>&1 & + redis-server "${REDIS_CONFIG}" > /dev/stdout 2>&1 & fi /bbcouch-runner.sh &