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

Commit 3d78da8

Browse files
committed
fix conflicts
2 parents 5d33643 + 860cabe commit 3d78da8

File tree

6 files changed

+46
-34
lines changed

6 files changed

+46
-34
lines changed
340 Bytes
Binary file not shown.

INSTALL.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ Add the below to your values.yaml
2727
## Pass the plugins you want installed as a list.
2828
##
2929
plugins:
30-
- https://github.com/doitintl/bigquery-grafana/archive/1.0.8.zip;doit-bigquery-datasource
30+
- https://github.com/doitintl/bigquery-grafana/archive/2.0.0.zip;doit-bigquery-datasource
31+
32+
grafana.ini:
33+
plugins:
34+
allow_loading_unsigned_plugins: doitintl-bigquery-datasource
3135
...
3236
```
3337

dist/MANIFEST.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ Hash: SHA512
99
"signedByOrgName": "DoiT International",
1010
"plugin": "doitintl-bigquery-datasource",
1111
"version": "2.0.1",
12-
"time": 1607954553807,
12+
"time": 1607956447803,
1313
"keyId": "7e4d0c6a708866e7",
1414
"files": {
1515
"LICENSE.md": "b40d79313086aafb7ab31bf033798850a20ff52daf52f9dba84f6ef169e326b2",
1616
"doitintl-bigquery-datasource_darwin_amd64": "89d3c1769d56208894555aaeb428d4d81d227d134d521cebdf1a3ea36333f93c",
17-
"module.js.map": "fa06a8f81f03b06129bbc093a4c54f28d0d37b6e256134b7959a42cebfc40cc8",
17+
"module.js.map": "850a6e4547db7b738abb14f8d40b0ec840ca07734708e087883cf4e597121ceb",
1818
"doitintl-bigquery-datasource_windows_amd64.exe": "89d3c1769d56208894555aaeb428d4d81d227d134d521cebdf1a3ea36333f93c",
1919
"plugin.json": "198f8a869a085aefecfd17d3eb40166a54df2ed113fad4408ac67ddb4019f215",
2020
"README.md": "2c54953a9adbfd16ac4cc4ee4de052dc1895892416713cd9626a0e353e5e2047",
2121
"img/logo.png": "dcd9277d3dfc4e412dc006a000d0ee5b9ff4d9f126687a01f189cea9987e2bfa",
22-
"module.js": "75f602d9feb799add56ae4f597aa9f803bb10ab233abfbd614574f1cadf4a165",
22+
"module.js": "e5deffe8848b7c966f55050587f7714f12a4ffa12e987d213a1baa01c61b1db9",
2323
"partials/annotations.editor.html": "c8b36fe73e7c3b13df4db94153ebd820a9bec4104c1b179db92d64dcdcf04156",
2424
"partials/query.editor.html": "23a40ae6a4a3e2dfa32bee8f5cc963c447750e9752a46e5aced85e6d7f70d6e5",
2525
"partials/config.html": "31cadbac85238e8a0cb8e4766fc20329cda9d918b4140e6130626cb3631dbe8d",
@@ -30,9 +30,9 @@ Hash: SHA512
3030
Version: OpenPGP.js v4.10.1
3131
Comment: https://openpgpjs.org
3232

33-
wqAEARMKAAYFAl/XcHkACgkQfk0ManCIZufGwAII8P9G86ZgjXW4aMfhKo30
34-
lCBurUib6jcYHV5z4mIik5FZ97yFnxXG0VqkI+5SpYtVH7nIuh9i+RGILU7S
35-
iHfTZIkCCI1SaNesvYBKUvDyr/ykgmeiiC0YedAl5ycfJGHJkAnYUnM6/Vyh
36-
D7424b4HKYdT7ZQMM10VCXDMEkduCTb3uxXP
37-
=CzU5
33+
wqEEARMKAAYFAl/Xd98ACgkQfk0ManCIZudNRwIIj0r5euochQC/cihenY8A
34+
WUocEkHTCgvWHW2klOAQAEFGkW1DQbpjUCEatvXn04CYDGSQrhbDOba4O72t
35+
/19kAiUCCQGiWfeSMR3bT0uERc/ru2CHVoXasu1weUGKHNusP/cRzLe7Jeuz
36+
hf0IV415nwN9zEzuOVm1JGKMG1niqloIWx8ttA==
37+
=8Fzc
3838
-----END PGP SIGNATURE-----

dist/module.js

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

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.

src/query_ctrl.ts

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,35 @@ export class BigQueryQueryCtrl extends QueryCtrl {
6060
{ text: 'DESC', value: '2' },
6161
];
6262
this.locations = [
63+
// Multi-regional locations
6364
{ text: 'United States (US)', value: 'US' },
6465
{ text: 'European Union (EU)', value: 'EU' },
66+
// Americas
67+
{ text: 'Las Vegas (us-west4)', value: 'us-west4' },
6568
{ text: 'Los Angeles (us-west2)', value: 'us-west2' },
66-
{
67-
text: 'Montréal (northamerica-northeast1)',
68-
value: 'northamerica-northeast1',
69-
},
70-
{ text: 'South Carolina (us-east1)', value: 'us-east1' },
69+
{ text: 'Montréal (northamerica-northeast1)', value: 'northamerica-northeast1' },
7170
{ text: 'Northern Virginia (us-east4)', value: 'us-east4' },
71+
{ text: 'Oregon (us-west1)', value: 'us-west1' },
72+
{ text: 'Salt Lake City (us-west3)', value: 'us-west3' },
7273
{ text: 'São Paulo (southamerica-east1)', value: 'southamerica-east1' },
74+
{ text: 'South Carolina (us-east1)', value: 'us-east1' },
75+
// Europe
76+
{ text: 'Belgium (europe-west1)', value: 'europe-west1' },
7377
{ text: 'Finland (europe-north1)', value: 'europe-north1' },
74-
{ text: 'London (europe-west2)', value: 'europe-west2' },
7578
{ text: 'Frankfurt (europe-west3)', value: 'europe-west3' },
79+
{ text: 'London (europe-west2)', value: 'europe-west2' },
80+
{ text: 'Netherlands (europe-west4)', value: 'europe-west4' },
7681
{ text: 'Zürich (europe-west6)', value: 'europe-west6' },
82+
// Asia Pacific
7783
{ text: 'Hong Kong (asia-east2)', value: 'asia-east2' },
84+
{ text: 'Jakarta (asia-southeast2)', value: 'asia-southeast2' },
7885
{ text: 'Mumbai (asia-south1)', value: 'asia-south1' },
7986
{ text: 'Osaka (asia-northeast2)', value: 'asia-northeast2' },
80-
{ text: 'Taiwan (asia-east1)', value: 'asia-east1' },
81-
{ text: 'Tokyo (asia-northeast1)', value: 'asia-northeast1' },
87+
{ text: 'Seoul (asia-northeast3)', value: 'asia-northeast3' },
8288
{ text: 'Singapore (asia-southeast1)', value: 'asia-southeast1' },
8389
{ text: 'Sydney (australia-southeast1)', value: 'australia-southeast1' },
90+
{ text: 'Taiwan (asia-east1)', value: 'asia-east1' },
91+
{ text: 'Tokyo (asia-northeast1)', value: 'asia-northeast1' },
8492
];
8593
if (!this.target.rawSql) {
8694
// special handling when in table panel
@@ -126,14 +134,14 @@ export class BigQueryQueryCtrl extends QueryCtrl {
126134

127135
public updateProjection() {
128136
this.selectParts = _.map(this.target.select, (parts: any) => {
129-
return _.map(parts, sqlPart.create).filter((n) => n);
137+
return _.map(parts, sqlPart.create).filter(n => n);
130138
});
131-
this.whereParts = _.map(this.target.where, sqlPart.create).filter((n) => n);
132-
this.groupParts = _.map(this.target.group, sqlPart.create).filter((n) => n);
139+
this.whereParts = _.map(this.target.where, sqlPart.create).filter(n => n);
140+
this.groupParts = _.map(this.target.group, sqlPart.create).filter(n => n);
133141
}
134142

135143
public updatePersistedParts() {
136-
this.target.select = _.map(this.selectParts, (selectParts) => {
144+
this.target.select = _.map(this.selectParts, selectParts => {
137145
return _.map(selectParts, (part: any) => {
138146
return {
139147
datatype: part.datatype,
@@ -279,8 +287,8 @@ export class BigQueryQueryCtrl extends QueryCtrl {
279287
this.target.partitioned = false;
280288
this.target.partitionedField = '';
281289
this.target.table = this.tableSegment.value;
282-
this.tablesDataPromise.then((value) => {
283-
value.forEach((v) => {
290+
this.tablesDataPromise.then(value => {
291+
value.forEach(v => {
284292
if (v.text === this.target.table) {
285293
const partitioned = v.value.indexOf('__partitioned');
286294
if (partitioned > -1) {
@@ -306,7 +314,7 @@ export class BigQueryQueryCtrl extends QueryCtrl {
306314
this.metricColumnSegment.value = segment.value;
307315
this.target.metricColumn = 'none';
308316

309-
const task1 = this.getTimeColumnSegments().then((result) => {
317+
const task1 = this.getTimeColumnSegments().then(result => {
310318
// check if time column is still valid
311319
if (result.length > 0 && !_.find(result, (r: any) => r.text === this.target.timeColumn)) {
312320
this.timeColumnSegment.html = this.uiSegmentSrv.newSegment(result[0].text).html;
@@ -315,7 +323,7 @@ export class BigQueryQueryCtrl extends QueryCtrl {
315323
return this.timeColumnChanged(false);
316324
});
317325

318-
const task2 = this.getValueColumnSegments().then((result) => {
326+
const task2 = this.getValueColumnSegments().then(result => {
319327
if (result.length > 0) {
320328
this.target.select = [[{ type: 'column', params: [result[0].text] }]];
321329
this.updateProjection();
@@ -377,8 +385,8 @@ export class BigQueryQueryCtrl extends QueryCtrl {
377385
}
378386

379387
public transformToSegments(config) {
380-
return (results) => {
381-
const segments = _.map(results, (segment) => {
388+
return results => {
389+
const segments = _.map(results, segment => {
382390
return this.uiSegmentSrv.newSegment({
383391
value: segment.text,
384392
expandable: segment.expandable,
@@ -449,7 +457,7 @@ export class BigQueryQueryCtrl extends QueryCtrl {
449457
partModel.params[0] = subItem.value;
450458
}
451459
let addAlias = false;
452-
const _addAlias = function () {
460+
const _addAlias = function() {
453461
return !_.find(selectParts, (p: any) => p.def.type === 'alias');
454462
};
455463
switch (partType) {
@@ -606,13 +614,13 @@ export class BigQueryQueryCtrl extends QueryCtrl {
606614
this._setGroupParts(partType, value);
607615
// add aggregates when adding group by
608616
for (const selectParts of this.selectParts) {
609-
if (!selectParts.some((part) => part.def.type === 'aggregate')) {
617+
if (!selectParts.some(part => part.def.type === 'aggregate')) {
610618
const aggregate = sqlPart.create({
611619
params: ['avg'],
612620
type: 'aggregate',
613621
});
614622
selectParts.splice(1, 0, aggregate);
615-
if (!selectParts.some((part) => part.def.type === 'alias')) {
623+
if (!selectParts.some(part => part.def.type === 'alias')) {
616624
const alias = sqlPart.create({
617625
params: [selectParts[0].part.params[0]],
618626
type: 'alias',
@@ -725,7 +733,7 @@ export class BigQueryQueryCtrl extends QueryCtrl {
725733

726734
public getGroupOptions() {
727735
return this.getMetricColumnSegments()
728-
.then((tags) => {
736+
.then(tags => {
729737
const options = [];
730738
if (!this.queryModel.hasTimeGroup()) {
731739
options.push(
@@ -782,7 +790,7 @@ export class BigQueryQueryCtrl extends QueryCtrl {
782790
let res = '';
783791
await this.datasource
784792
.getTableFields(this.target.project, this.target.dataset, this.target.table, ['DATE', 'TIMESTAMP', 'DATETIME'])
785-
.then((result) => {
793+
.then(result => {
786794
for (const f of result) {
787795
if (f.text === this.target.timeColumn) {
788796
res = f.value;

0 commit comments

Comments
 (0)