From 5b5dcabd22f03bacfb555cdf297bc245c67d416c Mon Sep 17 00:00:00 2001 From: Sven Klemm Date: Sat, 7 Jul 2018 21:21:11 +0200 Subject: [PATCH] add None to metric column suggestions --- public/app/plugins/datasource/postgres/query_ctrl.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/datasource/postgres/query_ctrl.ts b/public/app/plugins/datasource/postgres/query_ctrl.ts index 8f032cc0917..b44692ed673 100644 --- a/public/app/plugins/datasource/postgres/query_ctrl.ts +++ b/public/app/plugins/datasource/postgres/query_ctrl.ts @@ -111,7 +111,7 @@ export class PostgresQueryCtrl extends QueryCtrl { getMetricColumnSegments() { return this.datasource .metricFindQuery(this.queryBuilder.buildColumnQuery('metric')) - .then(this.transformToSegments({})) + .then(this.transformToSegments({ addNone: true })) .catch(this.handleQueryError.bind(this)); } @@ -182,6 +182,10 @@ export class PostgresQueryCtrl extends QueryCtrl { } } + if (config.addNone) { + segments.unshift(this.uiSegmentSrv.newSegment({ type: 'template', value: 'None', expandable: true })); + } + return segments; }; }