React UI: Fixed data table for matrix always showing 1 as value (#6896)

Signed-off-by: Simon Kirsten <1972314+skirsten@users.noreply.github.com>

React UI: Fixed data table for matrix always showing 1 as value
pull/6902/head
Simon Kirsten 5 years ago committed by GitHub
parent 0e78908407
commit 45fbed94d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -246,26 +246,26 @@ describe('DataTable', () => {
const rows = table.find('tr'); const rows = table.find('tr');
expect(table.find('tr')).toHaveLength(3); expect(table.find('tr')).toHaveLength(3);
const row = rows.at(0); const row = rows.at(0);
expect(row.text()).toEqual(`<SeriesName />1 @1572097950.93 expect(row.text()).toEqual(`<SeriesName />9 @1572097950.93
1 @1572097965.931 10 @1572097965.931
1 @1572097980.929 11 @1572097980.929
1 @1572097995.931 12 @1572097995.931
1 @1572098010.932 13 @1572098010.932
1 @1572098025.933 14 @1572098025.933
1 @1572098040.93 15 @1572098040.93
1 @1572098055.93 16 @1572098055.93
1 @1572098070.93 17 @1572098070.93
1 @1572098085.936 18 @1572098085.936
1 @1572098100.936 19 @1572098100.936
1 @1572098115.933 20 @1572098115.933
1 @1572098130.932 21 @1572098130.932
1 @1572098145.932 22 @1572098145.932
1 @1572098160.933 23 @1572098160.933
1 @1572098175.934 24 @1572098175.934
1 @1572098190.937 25 @1572098190.937
1 @1572098205.934 26 @1572098205.934
1 @1572098220.933 27 @1572098220.933
1 @1572098235.934`); 28 @1572098235.934`);
}); });
}); });

@ -80,7 +80,7 @@ const DataTable: FC<QueryResult> = ({ data }) => {
rows = (limitSeries(data.result) as RangeSamples[]).map((s, index) => { rows = (limitSeries(data.result) as RangeSamples[]).map((s, index) => {
const valueText = s.values const valueText = s.values
.map(v => { .map(v => {
return [1] + ' @' + v[0]; return v[1] + ' @' + v[0];
}) })
.join('\n'); .join('\n');
return ( return (

Loading…
Cancel
Save