Skip to content
This repository was archived by the owner on Dec 11, 2022. It is now read-only.

Commit 2d22c26

Browse files
author
Tamir Klein
authored
Merge pull request #245 from doitintl/feature/lior/v1.0.8
Feature/lior/v1.0.8
2 parents 7aa958d + 5bacd1f commit 2d22c26

File tree

9 files changed

+26
-15
lines changed

9 files changed

+26
-15
lines changed

INSTALL.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Install from [grafana.net](https://grafana.net/plugins/doitintl-bigquery-datasou
99
Use the [grafana-cli](http://docs.grafana.org/plugins/installation/#installing-plugins-manually)
1010

1111
```bash
12-
grafana-cli --pluginUrl https://github.com/doitintl/bigquery-grafana/archive/1.0.7.zip plugins install doitintl-bigquery-datasource
12+
grafana-cli --pluginUrl https://github.com/doitintl/bigquery-grafana/archive/1.0.8.zip plugins install doitintl-bigquery-datasource
1313
```
1414

1515
## Copy files
@@ -25,7 +25,7 @@ Add the below to your values.yaml
2525
## Pass the plugins you want installed as a list.
2626
##
2727
plugins:
28-
- https://github.com/doitintl/bigquery-grafana/archive/1.0.7.zip;doit-bigquery-datasource
28+
- https://github.com/doitintl/bigquery-grafana/archive/1.0.8.zip;doit-bigquery-datasource
2929
...
3030
```
3131

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Code Climate](https://codeclimate.com/github/doitintl/bigquery-grafana/badges/gpa.svg)](https://codeclimate.com/github/doitintl/bigquery-grafana/coverage)
66
[![Issue Count](https://codeclimate.com/github/doitintl/bigquery-grafana/badges/issue_count.svg)](https://codeclimate.com/github/doitintl/bigquery-grafana)
77
[![CodeCpv](https://codecov.io/gh/doitintl/bigquery-grafana/branch/master/graph/badge.svg)](https://codecov.io/gh/doitintl/bigquery-grafana/)
8+
[![Automated Release Notes by gren](https://img.shields.io/badge/%F0%9F%A4%96-release%20notes-00B2EE.svg)](https://github-tools.github.io/github-release-notes/)
89
## Status: Production Ready
910
# BigQuery DataSource for Grafana
1011

dist/module.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58753,15 +58753,16 @@ function () {
5875358753
return res;
5875458754
};
5875558755

58756-
BigQueryQuery.formatDateToString = function (date, separator, addtime) {
58756+
BigQueryQuery.formatDateToString = function (inputDate, separator, addtime) {
5875758757
if (separator === void 0) {
5875858758
separator = "";
5875958759
}
5876058760

5876158761
if (addtime === void 0) {
5876258762
addtime = false;
58763-
} // 01, 02, 03, ... 29, 30, 31
58763+
}
5876458764

58765+
var date = new Date(inputDate); // 01, 02, 03, ... 29, 30, 31
5876558766

5876658767
var DD = (date.getDate() < 10 ? "0" : "") + date.getDate(); // 01, 02, 03, ... 10, 11, 12
5876758768

@@ -59387,7 +59388,7 @@ function () {
5938759388

5938859389
BigQueryQuery.prototype._calcAutoInterval = function (options) {
5938959390
var seconds = (this.templateSrv.timeRange.to._d - this.templateSrv.timeRange.from._d) / 1000;
59390-
return Math.round(seconds / options.maxDataPoints) + "s";
59391+
return Math.ceil(seconds / options.maxDataPoints) + "s";
5939159392
};
5939259393

5939359394
BigQueryQuery.prototype._getDateRangePart = function (part) {
@@ -60342,7 +60343,14 @@ function () {
6034260343
var limit = q.match(/[^]+(\bLIMIT\b)/gi);
6034360344

6034460345
if (limit == null) {
60345-
q += " LIMIT " + options.maxDataPoints;
60346+
var limitStatement = " LIMIT " + options.maxDataPoints;
60347+
var limitPosition = q.match(/\$__limitPosition/g);
60348+
60349+
if (limitPosition !== null) {
60350+
q = q.replace(/\$__limitPosition/g, limitStatement);
60351+
} else {
60352+
q += limitStatement;
60353+
}
6034660354
}
6034760355

6034860356
return q;

dist/module.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"build:prod": "webpack --config webpack.config.prod.js",
77
"build:dev": "webpack --mode development",
88
"build:watch": "webpack --mode development --watch",
9-
"test": "jest --config jest.config.js && codecov",
9+
"test:codecov": "jest --config jest.config.js && codecov",
10+
"test": "jest --config jest.config.js",
1011
"test:watch": "jest --config jest.config.js --watch"
1112
},
1213
"author": "DoiT International",
@@ -38,7 +39,7 @@
3839
"copy-webpack-plugin": "^5.1.1",
3940
"googleapis": "^49.0.0",
4041
"grafana-sdk-mocks": "github:grafana/grafana-sdk-mocks",
41-
"jest": "^25.4.0",
42+
"jest": "^26.0.1",
4243
"ng-annotate-webpack-plugin": "^0.3.0",
4344
"plugin-typescript": "^8.0.0",
4445
"prettier": "^1.16.4",

src/bigquery_query.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export default class BigQueryQuery {
2222
return res;
2323
}
2424

25-
public static formatDateToString(date, separator = "", addtime = false) {
25+
public static formatDateToString(inputDate, separator = "", addtime = false) {
26+
const date = new Date(inputDate);
2627
// 01, 02, 03, ... 29, 30, 31
2728
const DD = (date.getDate() < 10 ? "0" : "") + date.getDate();
2829
// 01, 02, 03, ... 10, 11, 12

src/datasource.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { validate } from "@babel/types";
2-
import { sheets } from "googleapis/build/src/apis/sheets";
1+
// import { validate } from "@babel/types";
2+
// import { sheets } from "googleapis/build/src/apis/sheets";
33
import _ from "lodash";
4-
import { countBy, size } from "lodash-es";
4+
// import { countBy, size } from "lodash-es";
55
import moment from "moment";
66
import BigQueryQuery from "./bigquery_query";
77
import ResponseParser, { IResultFormat } from "./response_parser";

src/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
{"name": "GitHub", "url": "https://github.com/doitintl/bigquery-grafana"},
2727
{"name": "MIT License", "url": "https://github.com/doitintl/bigquery-grafana/blob/master/LICENSE.md"}
2828
],
29-
"version": "1.0.7"
29+
"version": "1.0.8"
3030
},
3131
"routes": [
3232
{

src/response_parser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default class ResponseParser {
236236
const r = [];
237237
each(ser, v => {
238238
for (let i = 0; i < v.length; i++) {
239-
const val = ResponseParser._convertValues(v[i].v, columns[i].type);
239+
const val = v[i].v ? ResponseParser._convertValues(v[i].v, columns[i].type) : "";
240240
r.push(val);
241241
}
242242
});

0 commit comments

Comments
 (0)