Skip to content

Commit

Permalink
rename adAnalytics to isAdAnalytics
Browse files Browse the repository at this point in the history
  • Loading branch information
MGJamJam committed Jul 3, 2024
1 parent f9ee5c0 commit 3577842
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dist/module.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/module.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/components/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export function ConfigEditor(props: Props) {
const onAdAnalyticsChange = (event: ChangeEvent<HTMLInputElement>) => {
const jsonData = {
...options.jsonData,
adAnalytics: event.currentTarget.checked,
isAdAnalytics: event.currentTarget.checked,
};
onOptionsChange({ ...options, jsonData });
};
Expand Down Expand Up @@ -70,7 +70,7 @@ export function ConfigEditor(props: Props) {
/>
</InlineField>
<InlineField label="Ad Analytics" tooltip={'Check if you want to query ads data'} labelWidth={26}>
<InlineSwitch value={jsonData.adAnalytics || false} onChange={onAdAnalyticsChange}></InlineSwitch>
<InlineSwitch value={jsonData.isAdAnalytics || false} onChange={onAdAnalyticsChange}></InlineSwitch>
</InlineField>
</FieldSet>
</>
Expand Down
8 changes: 4 additions & 4 deletions src/components/QueryEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,29 +198,29 @@ export function QueryEditor(props: Props) {
onChange={handleDimensionChange}
width={30}
options={
props.datasource.adAnalytics
props.datasource.isAdAnalytics
? SELECTABLE_QUERY_AD_ATTRIBUTES
: SELECTABLE_QUERY_ATTRIBUTES.concat(SELECTABLE_METRICS)
}
/>
</InlineField>
<InlineField label="Filter" labelWidth={20}>
<FilterRow
isAdAnalytics={props.datasource.adAnalytics ? true : false}
isAdAnalytics={props.datasource.isAdAnalytics ? true : false}
onQueryFilterChange={handleQueryFilterChange}
filters={query.filter}
/>
</InlineField>
<InlineField label="Group By" labelWidth={20}>
<GroupByRow
isAdAnalytics={props.datasource.adAnalytics ? true : false}
isAdAnalytics={props.datasource.isAdAnalytics ? true : false}
onChange={handleGroupByChange}
groupBys={query.groupBy}
/>
</InlineField>
<InlineField label="Order By" labelWidth={20}>
<OrderByRow
isAdAnalytics={props.datasource.adAnalytics ? true : false}
isAdAnalytics={props.datasource.isAdAnalytics ? true : false}
onChange={handleOrderByChange}
orderBys={query.orderBy}
/>
Expand Down
8 changes: 4 additions & 4 deletions src/datasource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ export class DataSource extends DataSourceApi<
baseUrl: string;
apiKey: string;
tenantOrgId?: string;
adAnalytics?: boolean;
isAdAnalytics?: boolean;

constructor(instanceSettings: DataSourceInstanceSettings<BitmovinDataSourceOptions>) {
super(instanceSettings);

this.apiKey = instanceSettings.jsonData.apiKey;
this.tenantOrgId = instanceSettings.jsonData.tenantOrgId;
this.adAnalytics = instanceSettings.jsonData.adAnalytics;
this.isAdAnalytics = instanceSettings.jsonData.isAdAnalytics;
this.baseUrl = instanceSettings.url!;
}

Expand Down Expand Up @@ -110,7 +110,7 @@ export class DataSource extends DataSourceApi<
return {
name: filter.name,
operator: filter.operator,
value: convertFilterValueToProperType(filter.value, filter.name, filter.operator, !!this.adAnalytics),
value: convertFilterValueToProperType(filter.value, filter.name, filter.operator, !!this.isAdAnalytics),
};
});

Expand Down Expand Up @@ -193,7 +193,7 @@ export class DataSource extends DataSourceApi<

getRequestUrl(metric?: Metric, aggregation?: AggregationMethod): string {
let url = '/analytics';
if (this.adAnalytics === true) {
if (this.isAdAnalytics === true) {
url += '/ads';
}

Expand Down
2 changes: 1 addition & 1 deletion src/types/grafanaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ export const DEFAULT_QUERY: Partial<BitmovinAnalyticsDataQuery> = {
export interface BitmovinDataSourceOptions extends DataSourceJsonData {
apiKey: string;
tenantOrgId?: string;
adAnalytics?: boolean;
isAdAnalytics?: boolean;
}

0 comments on commit 3577842

Please sign in to comment.