From 7acea5b3fa91210d32e564f1439a70c6f613b37e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 18 Feb 2020 17:08:40 +0100 Subject: [PATCH] NewPanelEdit: Add back datalinks and new table panel fix (#22267) * NewPanelEditor: Add back data links * Made custom table options work in table panel --- packages/grafana-ui/src/components/FieldConfigs/links.tsx | 3 ++- .../src/components/FieldConfigs/standardFieldConfigEditors.tsx | 1 + public/app/plugins/panel/table2/TablePanel.tsx | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/grafana-ui/src/components/FieldConfigs/links.tsx b/packages/grafana-ui/src/components/FieldConfigs/links.tsx index d11d04eb445..1ac0ec15c43 100644 --- a/packages/grafana-ui/src/components/FieldConfigs/links.tsx +++ b/packages/grafana-ui/src/components/FieldConfigs/links.tsx @@ -36,12 +36,13 @@ export const DataLinksValueEditor: React.FC { - const links = cloneDeep(value); + const links = cloneDeep(value) || []; links.push({ title: '', url: '', }); + onChange(links); }; diff --git a/packages/grafana-ui/src/components/FieldConfigs/standardFieldConfigEditors.tsx b/packages/grafana-ui/src/components/FieldConfigs/standardFieldConfigEditors.tsx index 0e34560c5bd..3f724e197db 100644 --- a/packages/grafana-ui/src/components/FieldConfigs/standardFieldConfigEditors.tsx +++ b/packages/grafana-ui/src/components/FieldConfigs/standardFieldConfigEditors.tsx @@ -148,5 +148,6 @@ export const getStandardFieldConfigs = () => { StandardFieldConfigEditors.thresholds, StandardFieldConfigEditors.title, StandardFieldConfigEditors.noValue, + StandardFieldConfigEditors.links, ]; }; diff --git a/public/app/plugins/panel/table2/TablePanel.tsx b/public/app/plugins/panel/table2/TablePanel.tsx index 1e30e901f61..5e3219c5335 100644 --- a/public/app/plugins/panel/table2/TablePanel.tsx +++ b/public/app/plugins/panel/table2/TablePanel.tsx @@ -6,6 +6,7 @@ import { Table } from '@grafana/ui'; import { PanelProps, applyFieldOverrides } from '@grafana/data'; import { Options } from './types'; import { config } from 'app/core/config'; +import { tableFieldRegistry } from './custom'; interface Props extends PanelProps {} @@ -28,6 +29,7 @@ export class TablePanel extends Component { fieldOptions: options.fieldOptions, theme: config.theme, replaceVariables, + custom: tableFieldRegistry, })[0]; return ;