FieldOverrides: Apply field overrides in PanelQueryRunner (#22439)

* Apply field overrides in PanelChrome

* Move applyFieldOverrides to panel query runner

* Review updates

* Make sure overrides are applied back on souce panel when exiting the new edit mode

* TS ignores in est

* Make field display work in viz repeater

* Review updates

* Review and test updates

* Change the way overrides and trransformations are retrieved in PQR

* Minor updates after review

* Fix null checks
This commit is contained in:
Dominik Prokop
2020-03-16 14:26:03 +01:00
committed by GitHub
parent ab0238eced
commit 642c1a16dd
19 changed files with 315 additions and 138 deletions
+3 -13
View File
@@ -3,10 +3,8 @@ import React, { Component } from 'react';
// Types
import { Table } from '@grafana/ui';
import { PanelProps, applyFieldOverrides } from '@grafana/data';
import { PanelProps } from '@grafana/data';
import { Options } from './types';
import { config } from 'app/core/config';
import { tableFieldRegistry } from './custom';
interface Props extends PanelProps<Options> {}
@@ -18,20 +16,12 @@ export class TablePanel extends Component<Props> {
}
render() {
const { data, height, width, replaceVariables, options } = this.props;
const { data, height, width } = this.props;
if (data.series.length < 1) {
return <div>No Table Data...</div>;
}
const dataProcessed = applyFieldOverrides({
data: data.series,
fieldOptions: options.fieldOptions,
theme: config.theme,
replaceVariables,
custom: tableFieldRegistry,
})[0];
return <Table height={height - paddingBottom} width={width} data={dataProcessed} />;
return <Table height={height - paddingBottom} width={width} data={data.series[0]} />;
}
}