TablePanel: Check for table using keys (#17185)
* Fix: the type is not set so can check for columns and rows to validate is table (#16996) * Fix: the type is not set so can check for columns and rows to validate is table (#16996) * Fix: fix no table check and tests (#16996)
This commit is contained in:
committed by
Torkel Ödegaard
parent
66ba2aa524
commit
b695dcd0eb
@@ -108,7 +108,6 @@ describe('when transforming time series table', () => {
|
|||||||
{
|
{
|
||||||
type: 'foo',
|
type: 'foo',
|
||||||
columns: [{ text: 'Time' }, { text: 'Label Key 1' }, { text: 'Value' }],
|
columns: [{ text: 'Time' }, { text: 'Label Key 1' }, { text: 'Value' }],
|
||||||
rows: [[time, 'Label Value 1', 42]],
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -158,9 +158,8 @@ transformers['table'] = {
|
|||||||
if (!data || data.length === 0) {
|
if (!data || data.length === 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
const noTableIndex = _.findIndex(data, d => 'columns' in d && 'rows' in d);
|
||||||
const noTableIndex = _.findIndex(data, d => d.type !== 'table');
|
if (noTableIndex < 0) {
|
||||||
if (noTableIndex > -1) {
|
|
||||||
throw {
|
throw {
|
||||||
message: `Result of query #${String.fromCharCode(
|
message: `Result of query #${String.fromCharCode(
|
||||||
65 + noTableIndex
|
65 + noTableIndex
|
||||||
|
|||||||
Reference in New Issue
Block a user