diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-21 17:31:45 +0200 |
|---|---|---|
| committer | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-07-22 14:35:58 +0200 |
| commit | 7f083b47c2e2333819823fd7835332a0f486b626 (patch) | |
| tree | 4f7269996928ea480499e3cbe912b15ba994e43f /opendc-web/opendc-web-ui/src/components/topologies/RoomTable.js | |
| parent | 54f424a18cc21a52ea518d40893218a07ab55989 (diff) | |
feat(ui): Toggle to Floor Plan on room select
Diffstat (limited to 'opendc-web/opendc-web-ui/src/components/topologies/RoomTable.js')
| -rw-r--r-- | opendc-web/opendc-web-ui/src/components/topologies/RoomTable.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/opendc-web/opendc-web-ui/src/components/topologies/RoomTable.js b/opendc-web/opendc-web-ui/src/components/topologies/RoomTable.js index 8a5c401f..9bf369e9 100644 --- a/opendc-web/opendc-web-ui/src/components/topologies/RoomTable.js +++ b/opendc-web/opendc-web-ui/src/components/topologies/RoomTable.js @@ -4,15 +4,13 @@ import React from 'react' import { useDispatch } from 'react-redux' import { useTopology } from '../../data/topology' import { Table, TableBody, TableHeader } from '@patternfly/react-table' -import { goToRoom } from '../../redux/actions/interaction-level' import { deleteRoom } from '../../redux/actions/topology/room' import TableEmptyState from '../util/TableEmptyState' -function RoomTable({ topologyId }) { +function RoomTable({ topologyId, onSelect }) { const dispatch = useDispatch() const { status, data: topology } = useTopology(topologyId) - const onClick = (room) => dispatch(goToRoom(room._id)) const onDelete = (room) => dispatch(deleteRoom(room._id)) const columns = ['Name', 'Tiles', 'Racks'] @@ -24,7 +22,7 @@ function RoomTable({ topologyId }) { return [ { title: ( - <Button variant="link" isInline onClick={() => onClick(room)}> + <Button variant="link" isInline onClick={() => onSelect(room)}> {room.name} </Button> ), @@ -65,6 +63,7 @@ function RoomTable({ topologyId }) { RoomTable.propTypes = { topologyId: PropTypes.string, + onSelect: PropTypes.func, } export default RoomTable |
