@@ -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