From dbfdaafb86c0528e1e9192a379a92a2ab18f5926 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sun, 18 Dec 2022 09:08:03 +0100 Subject: [PATCH] jsonl filtering fixes --- packages/sqltree/src/evaluateExpression.ts | 2 +- packages/web/src/datagrid/DataFilterControl.svelte | 2 ++ packages/web/src/datagrid/DataGridCore.svelte | 2 ++ packages/web/src/modals/ValueLookupModal.svelte | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/sqltree/src/evaluateExpression.ts b/packages/sqltree/src/evaluateExpression.ts index 2f99943c..e2d78f5e 100644 --- a/packages/sqltree/src/evaluateExpression.ts +++ b/packages/sqltree/src/evaluateExpression.ts @@ -6,7 +6,7 @@ import { dumpSqlSourceRef } from './dumpSqlSource'; export function evaluateExpression(expr: Expression, values) { switch (expr.exprType) { case 'column': - return values[expr.columnName]; + return _.get(values, expr.columnName); case 'placeholder': return values.__placeholder; diff --git a/packages/web/src/datagrid/DataFilterControl.svelte b/packages/web/src/datagrid/DataFilterControl.svelte index 38e76985..39d68181 100644 --- a/packages/web/src/datagrid/DataFilterControl.svelte +++ b/packages/web/src/datagrid/DataFilterControl.svelte @@ -33,6 +33,7 @@ export let customCommandIcon = null; export let onCustomCommand = null; export let customCommandTooltip = null; + export let formatterFunction = null; export let pureName = null; export let schemaName = null; @@ -276,6 +277,7 @@ schemaName, pureName, field: columnName || uniqueName, + formatterFunction, onConfirm: keys => setFilter(keys.map(x => getFilterValueExpression(x)).join(',')), }); } diff --git a/packages/web/src/datagrid/DataGridCore.svelte b/packages/web/src/datagrid/DataGridCore.svelte index 29adf299..ef9013d7 100644 --- a/packages/web/src/datagrid/DataGridCore.svelte +++ b/packages/web/src/datagrid/DataGridCore.svelte @@ -355,6 +355,7 @@ export let pureName = undefined; export let schemaName = undefined; export let allowDefineVirtualReferences = false; + export let formatterFunction; export let isLoadedAll; export let loadedTime; @@ -1743,6 +1744,7 @@ {conid} {database} {jslid} + {formatterFunction} driver={display?.driver} filterType={useEvalFilters ? 'eval' : col.filterType || getFilterType(col.dataType)} filter={display.getFilter(col.uniqueName)} diff --git a/packages/web/src/modals/ValueLookupModal.svelte b/packages/web/src/modals/ValueLookupModal.svelte index b235486e..07d62aa8 100644 --- a/packages/web/src/modals/ValueLookupModal.svelte +++ b/packages/web/src/modals/ValueLookupModal.svelte @@ -25,6 +25,7 @@ export let driver; export let multiselect = false; export let jslid; + export let formatterFunction; // console.log('ValueLookupModal', conid, database, pureName, schemaName, columnName, driver); @@ -42,6 +43,7 @@ jslid, search, field, + formatterFunction, }); } else { rows = await apiCall('database-connections/load-field-values', {