NewPanelEdit: Add back datalinks and new table panel fix (#22267)

* NewPanelEditor: Add back data links

* Made custom table options work in table panel
This commit is contained in:
Torkel Ödegaard 2020-02-18 17:08:40 +01:00 committed by GitHub
parent 4cf765839a
commit 7acea5b3fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -36,12 +36,13 @@ export const DataLinksValueEditor: React.FC<FieldConfigEditorProps<DataLink[], D
};
const onDataLinkAdd = () => {
const links = cloneDeep(value);
const links = cloneDeep(value) || [];
links.push({
title: '',
url: '',
});
onChange(links);
};

View File

@ -148,5 +148,6 @@ export const getStandardFieldConfigs = () => {
StandardFieldConfigEditors.thresholds,
StandardFieldConfigEditors.title,
StandardFieldConfigEditors.noValue,
StandardFieldConfigEditors.links,
];
};

View File

@ -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<Options> {}
@ -28,6 +29,7 @@ export class TablePanel extends Component<Props> {
fieldOptions: options.fieldOptions,
theme: config.theme,
replaceVariables,
custom: tableFieldRegistry,
})[0];
return <Table height={height - paddingBottom} width={width} data={dataProcessed} />;