From 45fbed94d6ee17840254e78cfc421ab1db78f734 Mon Sep 17 00:00:00 2001
From: Simon Kirsten <1972314+skirsten@users.noreply.github.com>
Date: Sat, 29 Feb 2020 07:45:48 +0100
Subject: [PATCH] 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
---
.../src/pages/graph/DataTable.test.tsx | 40 +++++++++----------
.../react-app/src/pages/graph/DataTable.tsx | 2 +-
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/web/ui/react-app/src/pages/graph/DataTable.test.tsx b/web/ui/react-app/src/pages/graph/DataTable.test.tsx
index 382653df24..1e4fbd4609 100755
--- a/web/ui/react-app/src/pages/graph/DataTable.test.tsx
+++ b/web/ui/react-app/src/pages/graph/DataTable.test.tsx
@@ -246,26 +246,26 @@ describe('DataTable', () => {
const rows = table.find('tr');
expect(table.find('tr')).toHaveLength(3);
const row = rows.at(0);
- expect(row.text()).toEqual(`1 @1572097950.93
-1 @1572097965.931
-1 @1572097980.929
-1 @1572097995.931
-1 @1572098010.932
-1 @1572098025.933
-1 @1572098040.93
-1 @1572098055.93
-1 @1572098070.93
-1 @1572098085.936
-1 @1572098100.936
-1 @1572098115.933
-1 @1572098130.932
-1 @1572098145.932
-1 @1572098160.933
-1 @1572098175.934
-1 @1572098190.937
-1 @1572098205.934
-1 @1572098220.933
-1 @1572098235.934`);
+ expect(row.text()).toEqual(`9 @1572097950.93
+10 @1572097965.931
+11 @1572097980.929
+12 @1572097995.931
+13 @1572098010.932
+14 @1572098025.933
+15 @1572098040.93
+16 @1572098055.93
+17 @1572098070.93
+18 @1572098085.936
+19 @1572098100.936
+20 @1572098115.933
+21 @1572098130.932
+22 @1572098145.932
+23 @1572098160.933
+24 @1572098175.934
+25 @1572098190.937
+26 @1572098205.934
+27 @1572098220.933
+28 @1572098235.934`);
});
});
diff --git a/web/ui/react-app/src/pages/graph/DataTable.tsx b/web/ui/react-app/src/pages/graph/DataTable.tsx
index a6e728e9a2..592135e0ef 100644
--- a/web/ui/react-app/src/pages/graph/DataTable.tsx
+++ b/web/ui/react-app/src/pages/graph/DataTable.tsx
@@ -80,7 +80,7 @@ const DataTable: FC = ({ data }) => {
rows = (limitSeries(data.result) as RangeSamples[]).map((s, index) => {
const valueText = s.values
.map(v => {
- return [1] + ' @' + v[0];
+ return v[1] + ' @' + v[0];
})
.join('\n');
return (