From dc5acfb020873b4403e75b84b92a213a92c1a982 Mon Sep 17 00:00:00 2001 From: Yury Molodov Date: Tue, 10 Dec 2024 17:05:27 +0100 Subject: [PATCH] fix plugin loading #149 (#150) --- CHANGELOG.md | 2 ++ src/modifyQuery.ts | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02e1e23..9feaee2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## tip +* BUGFIX: fix plugin loading issue in Grafana `v10.x.x`. See [this issue](https://github.com/VictoriaMetrics/victorialogs-datasource/issues/149). + ## v0.11.0 * FEATURE: add tooltips and info messages for query types. Now, plugin will warn about correct usage of `stats` panels and will provide more info about different query types. diff --git a/src/modifyQuery.ts b/src/modifyQuery.ts index daf124a..4541cf8 100644 --- a/src/modifyQuery.ts +++ b/src/modifyQuery.ts @@ -1,10 +1,8 @@ -import { scopeFilterOperatorMap } from "@grafana/data"; - import { buildVisualQueryFromString, splitExpression } from "./components/QueryEditor/QueryBuilder/utils/parseFromString"; import { parseVisualQueryToString } from "./components/QueryEditor/QueryBuilder/utils/parseToString"; import { FilterVisualQuery } from "./types"; -const operators = Object.keys(scopeFilterOperatorMap); +const operators = ["=", "!=", "=~", "!~", "<", ">"] export function queryHasFilter(query: string, key: string, value: string, operator?: string): boolean { const applicableOperators = operator ? [operator] : operators;