Skip to content

Commit

Permalink
update to grafana 8.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
retzkek committed Aug 27, 2021
1 parent 994dfac commit 232be88
Show file tree
Hide file tree
Showing 7 changed files with 1,740 additions and 1,435 deletions.
16 changes: 4 additions & 12 deletions dist/module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "datasource",
"name": "GraphQL Data Source",
"name": "GraphQL",
"id": "fifemon-graphql-datasource",
"metrics": true,
"annotations": true,
Expand All @@ -25,7 +25,7 @@
{ "name": "GitHub Security Advisories", "path": "img/github_security_advisories.png"}
],
"version": "1.3.0",
"updated": "2021-03-16"
"updated": "2021-08-27"
},

"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
"author": "Kevin Retzke",
"license": "Apache-2.0",
"devDependencies": {
"@grafana/data": "7.4.3",
"@grafana/runtime": "7.4.3",
"@grafana/toolkit": "7.4.3",
"@grafana/ui": "7.4.3",
"@grafana/data": "8.1.2",
"@grafana/runtime": "8.1.2",
"@grafana/toolkit": "8.1.2",
"@grafana/ui": "8.1.2",
"moment": "*"
},
"dependencies": {
"@types/lodash": "^4.14.144"
"@types/lodash": "^4.14.172"
}
}
11 changes: 6 additions & 5 deletions src/DataSource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import defaults from 'lodash/defaults';

import {
AnnotationEvent,
AnnotationQueryRequest,
DataQueryRequest,
DataQueryResponse,
DataSourceApi,
MetricFindValue,
DataSourceInstanceSettings,
ScopedVars,
TimeRange,
dateTime,
MutableDataFrame,
FieldType,
DataFrame,
} from '@grafana/data';

import {
Expand All @@ -20,10 +23,8 @@ import {
MultiValueVariable,
TextValuePair,
} from './types';
import { dateTime, MutableDataFrame, FieldType, DataFrame } from '@grafana/data';
import { getTemplateSrv } from '@grafana/runtime';
import _ from 'lodash';
import { isEqual } from 'lodash';
import { flatten, isRFC3339_ISO6801 } from './util';

const supportedVariableTypes = ['constant', 'custom', 'query', 'textbox'];
Expand Down Expand Up @@ -222,7 +223,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
return { data: dataFrameArray };
});
}
annotationQuery(options: AnnotationQueryRequest<MyQuery>): Promise<AnnotationEvent[]> {
annotationQuery(options: any): Promise<AnnotationEvent[]> {
const query = defaults(options.annotation, defaultQuery);
return Promise.all([this.createQuery(query, options.range)]).then((results: any) => {
const r: AnnotationEvent[] = [];
Expand Down Expand Up @@ -337,7 +338,7 @@ export class DataSource extends DataSourceApi<MyQuery, MyDataSourceOptions> {
const supportedVariable = variable as MultiValueVariable;

let variableValue = supportedVariable.current.value;
if (variableValue === '$__all' || isEqual(variableValue, ['$__all'])) {
if (variableValue === '$__all' || _.isEqual(variableValue, ['$__all'])) {
if (supportedVariable.allValue === null || supportedVariable.allValue === '') {
variableValue = supportedVariable.options.slice(1).map((textValuePair) => textValuePair.value);
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "datasource",
"name": "GraphQL Data Source",
"name": "GraphQL",
"id": "fifemon-graphql-datasource",
"metrics": true,
"annotations": true,
Expand Down
Loading

0 comments on commit 232be88

Please sign in to comment.