1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 12:56:41 +07:00

flow grid now has 5 columns

This commit is contained in:
Fedor Katurov 2019-10-23 14:51:34 +07:00
parent 744f79053b
commit ed3f6369fb
5 changed files with 34 additions and 11 deletions

View file

@ -1,10 +1,11 @@
import { takeLatest, call, put } from 'redux-saga/effects';
import { takeLatest, call, put, select } from 'redux-saga/effects';
import { REHYDRATE } from 'redux-persist';
import { FLOW_ACTIONS } from './constants';
import { getNodes } from '../node/api';
import { flowSetNodes } from './actions';
import { objFromArray } from '~/utils/fn';
import { flowSetNodes, flowSetCellView } from './actions';
import { IResultWithStatus, INode } from '../types';
import { updateNodeEverywhere } from '../node/sagas';
import { selectFlowNodes } from './selectors';
function* onGetFlow() {
const {
@ -20,6 +21,12 @@ function* onGetFlow() {
yield put(flowSetNodes(nodes));
}
function* onSetCellView({ id, flow }: ReturnType<typeof flowSetCellView>) {
const nodes = yield select(selectFlowNodes);
yield put(flowSetNodes(nodes.map(node => (node.id === id ? { ...node, flow } : node))));
}
export default function* nodeSaga() {
yield takeLatest([FLOW_ACTIONS.GET_FLOW, REHYDRATE], onGetFlow);
yield takeLatest(FLOW_ACTIONS.SET_CELL_VIEW, onSetCellView);
}