dynamic filter
Some checks are pending
Run tests / test-runner (push) Waiting to run

This commit is contained in:
Jan Prochazka 2024-08-19 14:03:07 +02:00
parent 9e28f6f3aa
commit 8cffeaa767

View File

@ -21,12 +21,16 @@
function buildGridMongoCondition(props) {
const filters = props?.display?.config?.filters;
const filterBehaviour =
props?.display?.driver?.getFilterBehaviour(null, standardFilterBehaviours) ?? mongoFilterBehaviour;
// console.log('USED FILTER BEHAVIOUR', filterBehaviour);
const conditions = [];
for (const uniqueName in filters || {}) {
if (!filters[uniqueName]) continue;
try {
const ast = parseFilter(filters[uniqueName], mongoFilterBehaviour);
const ast = parseFilter(filters[uniqueName], filterBehaviour);
// console.log('AST', ast);
const cond = _.cloneDeepWith(ast, expr => {
if (expr.__placeholder__) {
@ -123,7 +127,7 @@
import ChangeSetGrider from './ChangeSetGrider';
import LoadingDataGridCore from './LoadingDataGridCore.svelte';
import { mongoFilterBehaviour } from 'dbgate-tools';
import { mongoFilterBehaviour, standardFilterBehaviours } from 'dbgate-tools';
export let conid;
export let display;