mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
set flow cell view actions
This commit is contained in:
parent
a6385cf4cf
commit
744f79053b
7 changed files with 160 additions and 34 deletions
|
@ -3,15 +3,29 @@ import { connect } from 'react-redux';
|
|||
import { FlowGrid } from '~/components/flow/FlowGrid';
|
||||
import { selectFlow } from '~/redux/flow/selectors';
|
||||
import * as NODE_ACTIONS from '~/redux/node/actions';
|
||||
import * as FLOW_ACTIONS from '~/redux/flow/actions';
|
||||
import pick from 'ramda/es/pick';
|
||||
import { selectUser } from '~/redux/auth/selectors';
|
||||
|
||||
const mapStateToProps = selectFlow;
|
||||
const mapStateToProps = state => ({
|
||||
flow: pick(['nodes'], selectFlow(state)),
|
||||
user: pick(['role', 'id'], selectUser(state)),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = { nodeLoadNode: NODE_ACTIONS.nodeLoadNode };
|
||||
const mapDispatchToProps = {
|
||||
nodeLoadNode: NODE_ACTIONS.nodeLoadNode,
|
||||
flowSetCellView: FLOW_ACTIONS.flowSetCellView,
|
||||
};
|
||||
|
||||
type IProps = ReturnType<typeof mapStateToProps> & typeof mapDispatchToProps & {};
|
||||
|
||||
const FlowLayoutUnconnected: FC<IProps> = ({ nodes, nodeLoadNode }) => (
|
||||
<FlowGrid nodes={nodes} onSelect={nodeLoadNode} />
|
||||
const FlowLayoutUnconnected: FC<IProps> = ({
|
||||
flow: { nodes },
|
||||
user,
|
||||
nodeLoadNode,
|
||||
flowSetCellView,
|
||||
}) => (
|
||||
<FlowGrid nodes={nodes} onSelect={nodeLoadNode} user={user} onChangeCellView={flowSetCellView} />
|
||||
);
|
||||
|
||||
const FlowLayout = connect(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue