From 862cb9248a65b54527f1fa92c455224f0528f75e Mon Sep 17 00:00:00 2001 From: MGJamJam Date: Mon, 6 May 2024 11:19:01 -0300 Subject: [PATCH] fix linting --- .../src/components/GroupByRow.tsx | 7 ++++--- .../src/components/QueryEditor.tsx | 18 +++++++++--------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/bitmovin-analytics-datasource/src/components/GroupByRow.tsx b/bitmovin-analytics-datasource/src/components/GroupByRow.tsx index b0779e3..4f910a3 100644 --- a/bitmovin-analytics-datasource/src/components/GroupByRow.tsx +++ b/bitmovin-analytics-datasource/src/components/GroupByRow.tsx @@ -8,7 +8,7 @@ import { difference } from 'lodash'; type Props = { readonly isAdAnalytics: boolean; - readonly onChange: (newGroupBys: Array | Array) => void; + readonly onChange: (newGroupBys: QueryAdAttribute[] | QueryAttribute[]) => void; }; export function GroupByRow(props: Props) { @@ -31,7 +31,7 @@ export function GroupByRow(props: Props) { setSelectedGroupBys(newSelectedGroupBys); const groupBys = newSelectedGroupBys.map((groupBy) => groupBy.value); - props.onChange(groupBys as Array | Array); + props.onChange(groupBys as QueryAttribute[] | QueryAdAttribute[]); }; const onSelectedGroupByChange = ( @@ -43,7 +43,7 @@ export function GroupByRow(props: Props) { setSelectedGroupBys(newSelectedGroupBys); const groupBys = newSelectedGroupBys.map((groupBy) => groupBy.value); - props.onChange(groupBys as Array | Array); + props.onChange(groupBys as QueryAttribute[] | QueryAdAttribute[]); }; const addGroupByInput = () => { @@ -55,6 +55,7 @@ export function GroupByRow(props: Props) { {selectedGroupBys?.map((item, index) => ( ) => onSelectedGroupByChange(index, newValue) diff --git a/bitmovin-analytics-datasource/src/components/QueryEditor.tsx b/bitmovin-analytics-datasource/src/components/QueryEditor.tsx index 6e10bd1..9f4701d 100644 --- a/bitmovin-analytics-datasource/src/components/QueryEditor.tsx +++ b/bitmovin-analytics-datasource/src/components/QueryEditor.tsx @@ -7,8 +7,8 @@ import { MyDataSourceOptions, BitmovinAnalyticsDataQuery } from '../types'; import { fetchLicenses } from '../utils/licenses'; import { DEFAULT_SELECTABLE_QUERY_INTERVAL, SELECTABLE_QUERY_INTERVALS } from '../utils/intervalUtils'; import { DEFAULT_SELECTABLE_AGGREGATION, SELECTABLE_AGGREGATIONS } from '../types/aggregations'; -import {QueryAdAttribute, SELECTABLE_QUERY_AD_ATTRIBUTES} from '../types/queryAdAttributes'; -import {QueryAttribute, SELECTABLE_QUERY_ATTRIBUTES} from '../types/queryAttributes'; +import { QueryAdAttribute, SELECTABLE_QUERY_AD_ATTRIBUTES } from '../types/queryAdAttributes'; +import { QueryAttribute, SELECTABLE_QUERY_ATTRIBUTES } from '../types/queryAttributes'; import { isMetric, SELECTABLE_METRICS } from '../types/metric'; import { GroupByRow } from './GroupByRow'; @@ -62,10 +62,10 @@ export function QueryEditor({ query, onChange, onRunQuery, datasource }: Props) onRunQuery(); }; - const onGroupByChange = (newGroupBys: Array | Array) => { - onChange({ ...query, groupBy: newGroupBys }); - onRunQuery(); - }; + const onGroupByChange = (newGroupBys: QueryAdAttribute[] | QueryAttribute[]) => { + onChange({ ...query, groupBy: newGroupBys }); + onRunQuery(); + }; const onFormatAsTimeSeriesChange = (event: ChangeEvent) => { setIsTimeSeries(event.currentTarget.checked); @@ -137,9 +137,9 @@ export function QueryEditor({ query, onChange, onRunQuery, datasource }: Props) } /> - - - + + +