From 42895f4fec0f914d2ca3696c6962830140610e6e Mon Sep 17 00:00:00 2001
From: Maximilian Hils <git@maximilianhils.com>
Date: Wed, 25 Oct 2017 15:25:41 +0200
Subject: [web] minor fixes and cleanup

---
 web/src/js/components/FlowTable.jsx | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

(limited to 'web/src/js/components/FlowTable.jsx')

diff --git a/web/src/js/components/FlowTable.jsx b/web/src/js/components/FlowTable.jsx
index 24c1f3a1..e3e3d505 100644
--- a/web/src/js/components/FlowTable.jsx
+++ b/web/src/js/components/FlowTable.jsx
@@ -1,17 +1,20 @@
 import React from 'react'
 import PropTypes from 'prop-types'
 import ReactDOM from 'react-dom'
+import { connect } from 'react-redux'
 import shallowEqual from 'shallowequal'
 import AutoScroll from './helpers/AutoScroll'
 import { calcVScroll } from './helpers/VirtualScroll'
 import FlowTableHead from './FlowTable/FlowTableHead'
 import FlowRow from './FlowTable/FlowRow'
 import Filt from "../filt/filt"
+import * as flowsActions from '../ducks/flows'
+
 
 class FlowTable extends React.Component {
 
     static propTypes = {
-        onSelect: PropTypes.func.isRequired,
+        selectFlow: PropTypes.func.isRequired,
         flows: PropTypes.array.isRequired,
         rowHeight: PropTypes.number,
         highlight: PropTypes.string,
@@ -107,7 +110,7 @@ class FlowTable extends React.Component {
                                 flow={flow}
                                 selected={flow === selected}
                                 highlighted={isHighlighted(flow)}
-                                onSelect={this.props.onSelect}
+                                onSelect={this.props.selectFlow}
                             />
                         ))}
                         <tr style={{ height: vScroll.paddingBottom }}></tr>
@@ -118,4 +121,15 @@ class FlowTable extends React.Component {
     }
 }
 
-export default AutoScroll(FlowTable)
+FlowTable = AutoScroll(FlowTable)
+
+export default connect(
+    state => ({
+        flows: state.flows.view,
+        highlight: state.flows.highlight,
+        selected: state.flows.byId[state.flows.selected[0]],
+    }),
+    {
+        selectFlow: flowsActions.select,
+    }
+)(FlowTable)
-- 
cgit v1.2.3


From 9d514330cad64e589987b5e539809ae95d14e137 Mon Sep 17 00:00:00 2001
From: Maximilian Hils <git@maximilianhils.com>
Date: Thu, 26 Oct 2017 16:34:24 +0200
Subject: [web] adjust tests

---
 web/src/js/components/FlowTable.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'web/src/js/components/FlowTable.jsx')

diff --git a/web/src/js/components/FlowTable.jsx b/web/src/js/components/FlowTable.jsx
index e3e3d505..a6381d0d 100644
--- a/web/src/js/components/FlowTable.jsx
+++ b/web/src/js/components/FlowTable.jsx
@@ -121,7 +121,7 @@ class FlowTable extends React.Component {
     }
 }
 
-FlowTable = AutoScroll(FlowTable)
+export const PureFlowTable = AutoScroll(FlowTable)
 
 export default connect(
     state => ({
@@ -132,4 +132,4 @@ export default connect(
     {
         selectFlow: flowsActions.select,
     }
-)(FlowTable)
+)(PureFlowTable)
-- 
cgit v1.2.3

