Skip to content

Commit

Permalink
rename MyQuery to BitmovinAnalyticsDataQuery
Browse files Browse the repository at this point in the history
  • Loading branch information
MGJamJam committed May 3, 2024
1 parent af16116 commit f2661aa
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bitmovin-analytics-datasource/src/components/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -14,7 +14,7 @@ enum LoadingState {
Error = 'ERROR',
}

type Props = QueryEditorProps<DataSource, MyQuery, MyDataSourceOptions>;
type Props = QueryEditorProps<DataSource, BitmovinAnalyticsDataQuery, MyDataSourceOptions>;

export function QueryEditor({ query, onChange, onRunQuery, datasource }: Props) {
const [selectableLicenses, setSelectableLicenses] = useState<SelectableValue[]>([]);
Expand Down
6 changes: 3 additions & 3 deletions bitmovin-analytics-datasource/src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -24,7 +24,7 @@ type AnalyticsQuery = {
interval?: QueryInterval;
};

export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
export class DataSource extends DataSourceApi<BitmovinAnalyticsDataQuery, MyDataSourceOptions> {
baseUrl: string;
apiKey: string;
tenantOrgId?: string;
Expand All @@ -48,7 +48,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
* - 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<MyQuery>): Promise<DataQueryResponse> {
async query(options: DataQueryRequest<BitmovinAnalyticsDataQuery>): Promise<DataQueryResponse> {
const { range } = options;
const from = range!.from.toDate();
const to = range!.to.toDate();
Expand Down
4 changes: 2 additions & 2 deletions bitmovin-analytics-datasource/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, MyQuery, MyDataSourceOptions>(DataSource)
export const plugin = new DataSourcePlugin<DataSource, BitmovinAnalyticsDataQuery, MyDataSourceOptions>(DataSource)
.setConfigEditor(ConfigEditor)
.setQueryEditor(QueryEditor);
4 changes: 2 additions & 2 deletions bitmovin-analytics-datasource/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MyQuery> = {};
export const DEFAULT_QUERY: Partial<BitmovinAnalyticsDataQuery> = {};

/**
* These are options configured for each DataSource instance
Expand Down

0 comments on commit f2661aa

Please sign in to comment.