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
@@ -4,7 +4,7 @@ import m from "mithril";
|
||||
import config from "../config";
|
||||
import * as store from "../store";
|
||||
import * as funcCache from "../../common/func-cache";
|
||||
import Filter from "../../common/filter";
|
||||
import * as expression from "../../common/expression";
|
||||
|
||||
const CHARTS = config.ui.overview.charts;
|
||||
|
||||
@@ -13,10 +13,8 @@ const component = {
|
||||
const device = vnode.attrs.device;
|
||||
const chart = CHARTS[vnode.attrs.chart];
|
||||
for (let slice of Object.values(chart.slices)) {
|
||||
const filter = store.unpackFilter(
|
||||
funcCache.get(Filter.parse, slice.filter)
|
||||
);
|
||||
if (filter.test(device)) {
|
||||
const filter = funcCache.get(expression.parse, slice.filter);
|
||||
if (store.evaluateExpression(filter, device)) {
|
||||
const dot = m(
|
||||
"svg",
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user