Skip to content

Commit

Permalink
fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
MGJamJam committed May 6, 2024
1 parent 897ba1d commit 862cb92
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
7 changes: 4 additions & 3 deletions bitmovin-analytics-datasource/src/components/GroupByRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { difference } from 'lodash';

type Props = {
readonly isAdAnalytics: boolean;
readonly onChange: (newGroupBys: Array<QueryAdAttribute> | Array<QueryAttribute>) => void;
readonly onChange: (newGroupBys: QueryAdAttribute[] | QueryAttribute[]) => void;
};

export function GroupByRow(props: Props) {
Expand All @@ -31,7 +31,7 @@ export function GroupByRow(props: Props) {
setSelectedGroupBys(newSelectedGroupBys);

const groupBys = newSelectedGroupBys.map((groupBy) => groupBy.value);
props.onChange(groupBys as Array<QueryAttribute> | Array<QueryAdAttribute>);
props.onChange(groupBys as QueryAttribute[] | QueryAdAttribute[]);
};

const onSelectedGroupByChange = (
Expand All @@ -43,7 +43,7 @@ export function GroupByRow(props: Props) {
setSelectedGroupBys(newSelectedGroupBys);

const groupBys = newSelectedGroupBys.map((groupBy) => groupBy.value);
props.onChange(groupBys as Array<QueryAttribute> | Array<QueryAdAttribute>);
props.onChange(groupBys as QueryAttribute[] | QueryAdAttribute[]);
};

const addGroupByInput = () => {
Expand All @@ -55,6 +55,7 @@ export function GroupByRow(props: Props) {
<Stack>
{selectedGroupBys?.map((item, index) => (
<GroupByInput
key={index}
groupBy={item}
onChange={(newValue: SelectableValue<QueryAdAttribute | QueryAttribute>) =>
onSelectedGroupByChange(index, newValue)
Expand Down
18 changes: 9 additions & 9 deletions bitmovin-analytics-datasource/src/components/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -62,10 +62,10 @@ export function QueryEditor({ query, onChange, onRunQuery, datasource }: Props)
onRunQuery();
};

const onGroupByChange = (newGroupBys: Array<QueryAdAttribute> | Array<QueryAttribute>) => {
onChange({ ...query, groupBy: newGroupBys });
onRunQuery();
};
const onGroupByChange = (newGroupBys: QueryAdAttribute[] | QueryAttribute[]) => {
onChange({ ...query, groupBy: newGroupBys });
onRunQuery();
};

const onFormatAsTimeSeriesChange = (event: ChangeEvent<HTMLInputElement>) => {
setIsTimeSeries(event.currentTarget.checked);
Expand Down Expand Up @@ -137,9 +137,9 @@ export function QueryEditor({ query, onChange, onRunQuery, datasource }: Props)
}
/>
</InlineField>
<InlineField label="Group By" labelWidth={20}>
<GroupByRow isAdAnalytics={datasource.adAnalytics ? true : false} onChange={onGroupByChange} />
</InlineField>
<InlineField label="Group By" labelWidth={20}>
<GroupByRow isAdAnalytics={datasource.adAnalytics ? true : false} onChange={onGroupByChange} />
</InlineField>
<InlineField label="Format as time series" labelWidth={20}>
<InlineSwitch value={isTimeSeries} onChange={onFormatAsTimeSeriesChange}></InlineSwitch>
</InlineField>
Expand Down

0 comments on commit 862cb92

Please sign in to comment.