mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
grafana/ui: New table component (#20991)
* first working example * Support sorting, adding types while waiting for official ones * using react-window for windowing * styles via emotion * sizing * set an offset for the table * change table export * fixing table cell widths * Explore: Use new table component in explore (#21031) * Explore: Use new table component in explore * enable oncellclick * only let filterable columns be clickable, refactor renderrow * remove explore table * Keep using old merge tables logic * prettier * remove unused typings file * fixing tests * Fixed explore table issue * NewTable: Updated styles * Fixed unit test * Updated TableModel * Minor update to explore table height * typing
This commit is contained in:
@@ -131,21 +131,23 @@ describe('ResultProcessor', () => {
|
||||
it('then it should return correct table result', () => {
|
||||
const { resultProcessor } = testContext();
|
||||
const theResult = resultProcessor.getTableResult();
|
||||
const resultDataFrame = toDataFrame(
|
||||
new TableModel({
|
||||
columns: [
|
||||
{ text: 'value', type: 'number' },
|
||||
{ text: 'time', type: 'time' },
|
||||
{ text: 'message', type: 'string' },
|
||||
],
|
||||
rows: [
|
||||
[4, 100, 'this is a message'],
|
||||
[5, 200, 'second message'],
|
||||
[6, 300, 'third'],
|
||||
],
|
||||
type: 'table',
|
||||
})
|
||||
);
|
||||
|
||||
expect(theResult).toEqual({
|
||||
columnMap: {},
|
||||
columns: [
|
||||
{ text: 'value', type: 'number', filterable: undefined },
|
||||
{ text: 'time', type: 'time', filterable: undefined },
|
||||
{ text: 'message', type: 'string', filterable: undefined },
|
||||
],
|
||||
rows: [
|
||||
[4, 100, 'this is a message'],
|
||||
[5, 200, 'second message'],
|
||||
[6, 300, 'third'],
|
||||
],
|
||||
type: 'table',
|
||||
});
|
||||
expect(theResult).toEqual(resultDataFrame);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user