Tables: optionally show field type icon in tables (#38855)

This commit is contained in:
Ryan McKinley
2021-09-08 00:44:41 -07:00
committed by GitHub
parent ecf40f0331
commit 10ffc9a754
9 changed files with 42 additions and 17 deletions

View File

@@ -19,6 +19,7 @@ export function PanelEditorTableView({ width, height, panel, dashboard }: Props)
const [options, setOptions] = useState<PanelOptions>({
frameIndex: 0,
showHeader: true,
showTypeIcons: true,
});
// Subscribe to panel event

View File

@@ -228,7 +228,7 @@ export class InspectDataTab extends PureComponent<Props, State> {
return (
<div style={{ width, height }}>
<Table width={width} height={height} data={dataFrame} />
<Table width={width} height={height} data={dataFrame} showTypeIcons={true} />
</div>
);
}}

View File

@@ -86,6 +86,7 @@ export class TablePanel extends Component<Props> {
width={width}
data={frame}
noHeader={!options.showHeader}
showTypeIcons={options.showTypeIcons}
resizable={true}
initialSortBy={options.sortBy}
onSortByChange={this.onSortByChange}

View File

@@ -25,6 +25,7 @@ Family: {
PanelOptions: {
frameIndex: number | *0
showHeader: bool | *true
showTypeIcons: bool | *false
sortBy?: [...ui.TableSortByFieldState]
}
PanelFieldConfig: {

View File

@@ -14,12 +14,14 @@ export const modelVersion = Object.freeze([1, 0]);
export interface PanelOptions {
frameIndex: number;
showHeader: boolean;
showTypeIcons?: boolean;
sortBy?: TableSortByFieldState[];
}
export const defaultPanelOptions: PanelOptions = {
frameIndex: 0,
showHeader: true,
showTypeIcons: false,
};
export interface PanelFieldConfig {