|
@@ -1,8 +1,15 @@
|
|
|
import React, { Component } from 'react'
|
|
|
+import { connect } from 'react-redux'
|
|
|
import Base from '../common/Base'
|
|
|
import ContainersTable from '../tables/ContainersTable'
|
|
|
+import { get } from '../../actions'
|
|
|
+import { CONTAINERS } from '../../constants/ResourceNames'
|
|
|
|
|
|
class ContainerList extends Component {
|
|
|
+ componentDidMount() {
|
|
|
+ this.props.loadData()
|
|
|
+ }
|
|
|
+
|
|
|
render() {
|
|
|
return (
|
|
|
<Base title={this.props.title}>
|
|
@@ -12,4 +19,26 @@ class ContainerList extends Component {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-export default ContainerList
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param {*} state
|
|
|
+ * @param {*} props
|
|
|
+ */
|
|
|
+const mapStateToProps = (state, props) => {
|
|
|
+ return {
|
|
|
+ data: state.containers
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ *
|
|
|
+ * @param {*} state
|
|
|
+ * @param {*} props
|
|
|
+ */
|
|
|
+const mapDispatchToProps = (dispatch, props) => ({
|
|
|
+ loadData() {
|
|
|
+ dispatch(get(CONTAINERS))
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+export default connect(mapStateToProps, mapDispatchToProps)(ContainerList)
|