Replace Filter class with expression structure
This is in order to be able to support UPPER() and LOWER() functions in queries which are needed for case-insensitive search.
This commit is contained in:
1 parent
7194fcab44
commit
c2d13e8364
25 files changed
+716
-578
No files matched your search
@@ -3,16 +3,14 @@
|
||||
import m from "mithril";
|
||||
import * as components from "../components";
|
||||
import * as store from "../store";
|
||||
import Filter from "../../common/filter";
|
||||
import * as expression from "../../common/expression";
|
||||
import * as funcCache from "../../common/func-cache";
|
||||
|
||||
const component = {
|
||||
view: vnode => {
|
||||
if (vnode.attrs.filter) {
|
||||
const filter = store.unpackFilter(
|
||||
funcCache.get(Filter.parse, vnode.attrs.filter)
|
||||
);
|
||||
if (!filter.test(vnode.attrs.device)) return;
|
||||
const filter = funcCache.get(expression.parse, vnode.attrs.filter);
|
||||
if (!store.evaluateExpression(filter, vnode.attrs.device)) return;
|
||||
}
|
||||
|
||||
let children = Object.values(vnode.attrs.components).map(c => {
|
||||
|
||||
Reference in new issue
Block a user