From e7710675eced37e565937c523ecc7e38616c1a32 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Thu, 27 Jun 2019 00:49:45 -0700 Subject: [PATCH] TablePanel: Fix annotations display issue (backport) (#17785) --- public/app/features/panel/metrics_panel_ctrl.ts | 6 ++++++ public/app/plugins/panel/table/module.ts | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/public/app/features/panel/metrics_panel_ctrl.ts b/public/app/features/panel/metrics_panel_ctrl.ts index b8ee1cff372..c10299f2354 100644 --- a/public/app/features/panel/metrics_panel_ctrl.ts +++ b/public/app/features/panel/metrics_panel_ctrl.ts @@ -190,6 +190,12 @@ class MetricsPanelCtrl extends PanelCtrl { result = { data: [] }; } + // Some data is not an array (like table annotations) + if (!Array.isArray(result.data)) { + this.events.emit('data-received', result.data); + return; + } + // Make sure the data is TableData | TimeSeries const data = result.data.map(v => { if (isSeriesData(v)) { diff --git a/public/app/plugins/panel/table/module.ts b/public/app/plugins/panel/table/module.ts index 24f396918d6..19eda953ecd 100644 --- a/public/app/plugins/panel/table/module.ts +++ b/public/app/plugins/panel/table/module.ts @@ -95,11 +95,7 @@ class TablePanelCtrl extends MetricsPanelCtrl { range: this.range, }) .then((anno: any) => { - this.loading = false; - this.dataRaw = anno; - this.pageIndex = 0; - this.render(); - return { data: this.dataRaw }; // Not used + return { data: anno }; }); }