diff --git a/packages/bbui/src/Form/Core/Select.svelte b/packages/bbui/src/Form/Core/Select.svelte index 3806281438..7d325bb6cc 100644 --- a/packages/bbui/src/Form/Core/Select.svelte +++ b/packages/bbui/src/Form/Core/Select.svelte @@ -102,7 +102,9 @@ {onOptionMouseenter} {onOptionMouseleave} isPlaceholder={value == null || value === ""} - placeholderOption={placeholder === false ? null : placeholder} + placeholderOption={placeholder === false + ? null + : placeholder || "Choose an option"} isOptionSelected={option => compareOptionAndValue(option, value)} onSelectOption={selectOption} {loading} diff --git a/packages/builder/src/components/design/settings/componentSettings.js b/packages/builder/src/components/design/settings/componentSettings.js index f5ab1cb157..ede48b84ba 100644 --- a/packages/builder/src/components/design/settings/componentSettings.js +++ b/packages/builder/src/components/design/settings/componentSettings.js @@ -80,6 +80,7 @@ const componentMap = { "field/barcodeqr": FormFieldSelect, "field/signature_single": FormFieldSelect, "field/bb_reference": FormFieldSelect, + "field/bb_reference_single": FormFieldSelect, // Some validation types are the same as others, so not all types are // explicitly listed here. e.g. options uses string validation "validation/string": ValidationEditor, diff --git a/packages/frontend-core/src/components/grid/cells/SignatureCell.svelte b/packages/frontend-core/src/components/grid/cells/SignatureCell.svelte index 8b37cd8847..c3e1557ac5 100644 --- a/packages/frontend-core/src/components/grid/cells/SignatureCell.svelte +++ b/packages/frontend-core/src/components/grid/cells/SignatureCell.svelte @@ -129,6 +129,11 @@ width: 100%; min-width: unset; } + .signature-cell img { + max-width: 100%; + max-height: 100%; + object-fit: contain; + } .signature-cell.light img { -webkit-filter: invert(100%); filter: invert(100%); diff --git a/packages/server/src/integrations/googlesheets.ts b/packages/server/src/integrations/googlesheets.ts index 9dee9b2a53..f8f5209890 100644 --- a/packages/server/src/integrations/googlesheets.ts +++ b/packages/server/src/integrations/googlesheets.ts @@ -566,7 +566,13 @@ class GoogleSheetsIntegration implements DatasourcePlus { query.filters.equal[`_${GOOGLE_SHEETS_PRIMARY_KEY}`] = id } } - let filtered = dataFilters.runQuery(rows, query.filters || {}) + let filtered = dataFilters.runQuery( + rows, + query.filters || {}, + (row: GoogleSpreadsheetRow, headerKey: string) => { + return row.get(headerKey) + } + ) if (hasFilters && query.paginate) { filtered = filtered.slice(offset, offset + limit) } diff --git a/packages/shared-core/src/filters.ts b/packages/shared-core/src/filters.ts index 65caa9c434..f3fe3f726b 100644 --- a/packages/shared-core/src/filters.ts +++ b/packages/shared-core/src/filters.ts @@ -393,8 +393,15 @@ export const search = ( * Performs a client-side search on an array of data * @param docs the data * @param query the JSON query + * @param findInDoc optional fn when trying to extract a value + * from custom doc type e.g. Google Sheets + * */ -export const runQuery = (docs: Record[], query: SearchFilters) => { +export const runQuery = ( + docs: Record[], + query: SearchFilters, + findInDoc: Function = deepGet +) => { if (!docs || !Array.isArray(docs)) { return [] } @@ -419,7 +426,7 @@ export const runQuery = (docs: Record[], query: SearchFilters) => { ) => (doc: Record) => { for (const [key, testValue] of Object.entries(query[type] || {})) { - const result = test(deepGet(doc, removeKeyNumbering(key)), testValue) + const result = test(findInDoc(doc, removeKeyNumbering(key)), testValue) if (query.allOr && result) { return true } else if (!query.allOr && !result) {