From 191b6cc32c3a84b2192a53f51b6eab578aef9184 Mon Sep 17 00:00:00 2001 From: Erik Sundell Date: Mon, 10 Sep 2018 19:08:39 +0200 Subject: [PATCH] Stackdriver: Set target correctly --- .../datasource/stackdriver/query_ctrl.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/public/app/plugins/datasource/stackdriver/query_ctrl.ts b/public/app/plugins/datasource/stackdriver/query_ctrl.ts index 07728787c53..32fcc5638bc 100644 --- a/public/app/plugins/datasource/stackdriver/query_ctrl.ts +++ b/public/app/plugins/datasource/stackdriver/query_ctrl.ts @@ -13,17 +13,18 @@ export class StackdriverQueryCtrl extends QueryCtrl { }; defaultDropdownValue = 'select'; + defaults = { + project: { + id: 'default', + name: 'loading project...', + }, + metricType: this.defaultDropdownValue, + }; + /** @ngInject */ constructor($scope, $injector) { super($scope, $injector); - this.target = { - project: { - id: 'default', - name: 'loading project...', - }, - metricType: this.defaultDropdownValue, - }; - + _.defaultsDeep(this.target, this.defaults); this.getCurrentProject().then(this.getMetricTypes.bind(this)); }