From f2661aa84335dbb2c0eca569cf9a0a1fc19d9f3f Mon Sep 17 00:00:00 2001 From: MGJamJam Date: Fri, 3 May 2024 08:31:27 -0300 Subject: [PATCH] rename MyQuery to BitmovinAnalyticsDataQuery --- .../src/components/QueryEditor.tsx | 4 ++-- bitmovin-analytics-datasource/src/datasource.ts | 6 +++--- bitmovin-analytics-datasource/src/module.ts | 4 ++-- bitmovin-analytics-datasource/src/types.ts | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bitmovin-analytics-datasource/src/components/QueryEditor.tsx b/bitmovin-analytics-datasource/src/components/QueryEditor.tsx index 1f8bcf6..3f4c22f 100644 --- a/bitmovin-analytics-datasource/src/components/QueryEditor.tsx +++ b/bitmovin-analytics-datasource/src/components/QueryEditor.tsx @@ -3,7 +3,7 @@ import { FieldSet, InlineField, InlineSwitch, Select } from '@grafana/ui'; import { QueryEditorProps, SelectableValue } from '@grafana/data'; import { DataSource } from '../datasource'; -import { MyDataSourceOptions, MyQuery } from '../types'; +import { MyDataSourceOptions, BitmovinAnalyticsDataQuery } from '../types'; import { fetchLicenses } from '../utils/licenses'; import { DEFAULT_SELECTABLE_QUERY_INTERVAL, SELECTABLE_QUERY_INTERVALS } from '../utils/intervalUtils'; @@ -14,7 +14,7 @@ enum LoadingState { Error = 'ERROR', } -type Props = QueryEditorProps; +type Props = QueryEditorProps; export function QueryEditor({ query, onChange, onRunQuery, datasource }: Props) { const [selectableLicenses, setSelectableLicenses] = useState([]); diff --git a/bitmovin-analytics-datasource/src/datasource.ts b/bitmovin-analytics-datasource/src/datasource.ts index 917d2b4..da62b9e 100644 --- a/bitmovin-analytics-datasource/src/datasource.ts +++ b/bitmovin-analytics-datasource/src/datasource.ts @@ -9,7 +9,7 @@ import { import { getBackendSrv } from '@grafana/runtime'; import { catchError, lastValueFrom, map, Observable, of } from 'rxjs'; -import { MixedDataRowList, MyDataSourceOptions, MyQuery, NumberDataRowList } from './types'; +import { MixedDataRowList, MyDataSourceOptions, BitmovinAnalyticsDataQuery, NumberDataRowList } from './types'; import { transformGroupedTimeSeriesData, transformSimpleTimeSeries, transformTableData } from './utils/dataUtils'; import { calculateQueryInterval, QueryInterval } from './utils/intervalUtils'; @@ -24,7 +24,7 @@ type AnalyticsQuery = { interval?: QueryInterval; }; -export class DataSource extends DataSourceApi { +export class DataSource extends DataSourceApi { baseUrl: string; apiKey: string; tenantOrgId?: string; @@ -48,7 +48,7 @@ export class DataSource extends DataSourceApi { * - Interval is not set: All values up to the last one (not included) can be considered string values * - The last value of each row is always be a number. * */ - async query(options: DataQueryRequest): Promise { + async query(options: DataQueryRequest): Promise { const { range } = options; const from = range!.from.toDate(); const to = range!.to.toDate(); diff --git a/bitmovin-analytics-datasource/src/module.ts b/bitmovin-analytics-datasource/src/module.ts index b8231eb..6f16065 100644 --- a/bitmovin-analytics-datasource/src/module.ts +++ b/bitmovin-analytics-datasource/src/module.ts @@ -2,8 +2,8 @@ import { DataSourcePlugin } from '@grafana/data'; import { DataSource } from './datasource'; import { ConfigEditor } from './components/ConfigEditor'; import { QueryEditor } from './components/QueryEditor'; -import { MyQuery, MyDataSourceOptions } from './types'; +import { BitmovinAnalyticsDataQuery, MyDataSourceOptions } from './types'; -export const plugin = new DataSourcePlugin(DataSource) +export const plugin = new DataSourcePlugin(DataSource) .setConfigEditor(ConfigEditor) .setQueryEditor(QueryEditor); diff --git a/bitmovin-analytics-datasource/src/types.ts b/bitmovin-analytics-datasource/src/types.ts index 84ceeee..e2ec81e 100644 --- a/bitmovin-analytics-datasource/src/types.ts +++ b/bitmovin-analytics-datasource/src/types.ts @@ -2,12 +2,12 @@ import { DataSourceJsonData } from '@grafana/data'; import { DataQuery } from '@grafana/schema'; import { QueryInterval } from './utils/intervalUtils'; -export interface MyQuery extends DataQuery { +export interface BitmovinAnalyticsDataQuery extends DataQuery { licenseKey: string; interval?: QueryInterval | 'AUTO'; } -export const DEFAULT_QUERY: Partial = {}; +export const DEFAULT_QUERY: Partial = {}; /** * These are options configured for each DataSource instance