): string {
let result = leftOperand + ` ${binaryQuery.operator} `;
if (binaryQuery.vectorMatches) {
@@ -37,7 +36,7 @@ function renderBinaryQuery(leftOperand: string, binaryQuery: VisualQueryBinary
): string {
@@ -118,7 +117,7 @@ export function renderQuery(
* This ensures we only add parentheses when needed
*/
function renderNestedPart(
- query: PromLokiVisualQuery,
+ query: PrometheusVisualQuery,
operationsRegistry?: Map
): string {
// First render the query itself
diff --git a/packages/grafana-prometheus/src/querybuilder/shared/types.ts b/packages/grafana-prometheus/src/querybuilder/shared/types.ts
index a06b0823c80..fa2cfb81998 100644
--- a/packages/grafana-prometheus/src/querybuilder/shared/types.ts
+++ b/packages/grafana-prometheus/src/querybuilder/shared/types.ts
@@ -99,3 +99,17 @@ export interface VisualQueryModeller {
getOperationDef(id: string): QueryBuilderOperationDef | undefined;
}
+
+export interface VisualQueryBinary {
+ operator: string;
+ vectorMatchesType?: 'on' | 'ignoring';
+ vectorMatches?: string;
+ query: T;
+}
+
+export interface PrometheusVisualQuery {
+ metric?: string;
+ labels: QueryBuilderLabelFilter[];
+ operations: QueryBuilderOperation[];
+ binaryQueries?: Array>;
+}
diff --git a/packages/grafana-prometheus/src/querybuilder/shared/types/visual_query.ts b/packages/grafana-prometheus/src/querybuilder/shared/types/visual_query.ts
deleted file mode 100644
index 12f0c1b6c2e..00000000000
--- a/packages/grafana-prometheus/src/querybuilder/shared/types/visual_query.ts
+++ /dev/null
@@ -1,13 +0,0 @@
-import { QueryBuilderLabelFilter, QueryBuilderOperation } from '../types';
-
-export interface PromLokiVisualQuery {
- metric?: string;
- labels: QueryBuilderLabelFilter[];
- operations: QueryBuilderOperation[];
-}
-
-export interface VisualQueryBinary {
- operator: string;
- vectorMatches?: string;
- query: PromLokiVisualQuery;
-}
diff --git a/packages/grafana-prometheus/src/querybuilder/types.ts b/packages/grafana-prometheus/src/querybuilder/types.ts
index 39042a9b975..991cfec8969 100644
--- a/packages/grafana-prometheus/src/querybuilder/types.ts
+++ b/packages/grafana-prometheus/src/querybuilder/types.ts
@@ -1,6 +1,10 @@
// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/public/app/plugins/datasource/prometheus/querybuilder/types.ts
-import { VisualQueryBinary } from './shared/LokiAndPromQueryModellerBase';
-import { QueryBuilderLabelFilter, QueryBuilderOperation, QueryBuilderOperationDef } from './shared/types';
+import {
+ QueryBuilderLabelFilter,
+ QueryBuilderOperation,
+ QueryBuilderOperationDef,
+ VisualQueryBinary,
+} from './shared/types';
/**
* Visual query model
diff --git a/packages/grafana-prometheus/src/resource_clients.ts b/packages/grafana-prometheus/src/resource_clients.ts
index 04ab0559274..cc59213cf47 100644
--- a/packages/grafana-prometheus/src/resource_clients.ts
+++ b/packages/grafana-prometheus/src/resource_clients.ts
@@ -4,8 +4,7 @@ import { BackendSrvRequest } from '@grafana/runtime';
import { getDefaultCacheHeaders } from './caching';
import { DEFAULT_SERIES_LIMIT, EMPTY_SELECTOR, MATCH_ALL_LABELS, METRIC_LABEL } from './constants';
import { PrometheusDatasource } from './datasource';
-import { removeQuotesIfExist } from './language_provider';
-import { getRangeSnapInterval, processHistogramMetrics } from './language_utils';
+import { getRangeSnapInterval, processHistogramMetrics, removeQuotesIfExist } from './language_utils';
import { buildVisualQueryFromString } from './querybuilder/parsing';
import { PrometheusCacheLevel } from './types';
import { escapeForUtf8Support, utf8Support } from './utf8_support';
diff --git a/packages/grafana-prometheus/src/test/helpers/selectOptionInTest.ts b/packages/grafana-prometheus/src/test/helpers/selectOptionInTest.ts
deleted file mode 100644
index e902abf315a..00000000000
--- a/packages/grafana-prometheus/src/test/helpers/selectOptionInTest.ts
+++ /dev/null
@@ -1,9 +0,0 @@
-// Core Grafana history https://github.com/grafana/grafana/blob/v11.0.0-preview/packages/grafana-ui/src/components/Select/SelectBase.tsx
-import { waitFor } from '@testing-library/react';
-import { select } from 'react-select-event';
-
-// Used to select an option or options from a Select in unit tests
-export const selectOptionInTest = async (
- input: HTMLElement,
- optionOrOptions: string | RegExp | Array
-) => await waitFor(() => select(input, optionOrOptions, { container: document.body }));