jsonl filtering fixes

This commit is contained in:
Jan Prochazka 2022-12-18 09:08:03 +01:00
parent cf3df9cda3
commit dbfdaafb86
4 changed files with 7 additions and 1 deletions

View File

@ -6,7 +6,7 @@ import { dumpSqlSourceRef } from './dumpSqlSource';
export function evaluateExpression(expr: Expression, values) { export function evaluateExpression(expr: Expression, values) {
switch (expr.exprType) { switch (expr.exprType) {
case 'column': case 'column':
return values[expr.columnName]; return _.get(values, expr.columnName);
case 'placeholder': case 'placeholder':
return values.__placeholder; return values.__placeholder;

View File

@ -33,6 +33,7 @@
export let customCommandIcon = null; export let customCommandIcon = null;
export let onCustomCommand = null; export let onCustomCommand = null;
export let customCommandTooltip = null; export let customCommandTooltip = null;
export let formatterFunction = null;
export let pureName = null; export let pureName = null;
export let schemaName = null; export let schemaName = null;
@ -276,6 +277,7 @@
schemaName, schemaName,
pureName, pureName,
field: columnName || uniqueName, field: columnName || uniqueName,
formatterFunction,
onConfirm: keys => setFilter(keys.map(x => getFilterValueExpression(x)).join(',')), onConfirm: keys => setFilter(keys.map(x => getFilterValueExpression(x)).join(',')),
}); });
} }

View File

@ -355,6 +355,7 @@
export let pureName = undefined; export let pureName = undefined;
export let schemaName = undefined; export let schemaName = undefined;
export let allowDefineVirtualReferences = false; export let allowDefineVirtualReferences = false;
export let formatterFunction;
export let isLoadedAll; export let isLoadedAll;
export let loadedTime; export let loadedTime;
@ -1743,6 +1744,7 @@
{conid} {conid}
{database} {database}
{jslid} {jslid}
{formatterFunction}
driver={display?.driver} driver={display?.driver}
filterType={useEvalFilters ? 'eval' : col.filterType || getFilterType(col.dataType)} filterType={useEvalFilters ? 'eval' : col.filterType || getFilterType(col.dataType)}
filter={display.getFilter(col.uniqueName)} filter={display.getFilter(col.uniqueName)}

View File

@ -25,6 +25,7 @@
export let driver; export let driver;
export let multiselect = false; export let multiselect = false;
export let jslid; export let jslid;
export let formatterFunction;
// console.log('ValueLookupModal', conid, database, pureName, schemaName, columnName, driver); // console.log('ValueLookupModal', conid, database, pureName, schemaName, columnName, driver);
@ -42,6 +43,7 @@
jslid, jslid,
search, search,
field, field,
formatterFunction,
}); });
} else { } else {
rows = await apiCall('database-connections/load-field-values', { rows = await apiCall('database-connections/load-field-values', {