Commit 53500972 authored by Tamas Kecskes's avatar Tamas Kecskes
Browse files

Redux removed from canvas item.

parent cc18f9bb
......@@ -53,10 +53,10 @@ class demoApp extends Component {
component: <DemoModalSpinner/>,
title: 'ModalSpinner',
},
// {
// component: <DemoContainmentCanvas/>,
// title: 'ContainmentCanvas',
// },
{
component: <DemoContainmentCanvas/>,
title: 'ContainmentCanvas',
},
{
component: <DemoSingleConnectedNode/>,
title: 'SingleConnectedNode',
......
......@@ -5,8 +5,8 @@ import {DropTarget} from 'react-dnd';
import SingleConnectedNode from '../SingleConnectedNode/SingleConnectedNode';
import DRAG_TYPES from '../../utils/dragTypes';
import SVGRegistryBasedCanvasItem from '../SVGRegistryBasedCanvasItem/SVGRegistryBasedCanvasItem';
import ConnectionManager from './ConnectionManager';
import BasicConnectingComponent from './BasicConnectingComponent';
import ConnectionManager from '../ConnectionManager/ConnectionManager';
import BasicConnectingComponent from '../ConnectionManager/BasicConnectingComponent';
import BasicEventManager from '../BasicEventManager/BasicEventManager';
import getIndexedName from '../../utils/getIndexedName';
......@@ -180,13 +180,14 @@ class ContainmentCanvas extends SingleConnectedNode {
const {connectDropTarget, activeNode, gmeClient} = this.props;
const {children, dragMode} = this.state;
const childrenItems = children.map(child => (<ContainmentCanvasItem
const childrenItems = children.map(child => (<SVGRegistryBasedCanvasItem
key={child.id}
gmeClient={gmeClient}
activeNode={child.id}
contextNode={activeNode}
connectionManager={this.cm}
eventManager={this.em}
scale={1}
/>));
const content = (
......
export const setActiveNode = activeNode => ({
type: 'SET_ACTIVE_NODE',
activeNode,
});
export const setActiveSelection = activeSelection => ({
type: 'SET_ACTIVE_SELECTION',
activeSelection,
});
export const toggleLeftDrawer = (show) => {
if (show) {
return {
type: 'SHOW_LEFT_DRAWER',
};
}
return {
type: 'HIDE_LEFT_DRAWER',
};
};
export const toggleRightDrawer = (show) => {
if (show) {
return {
type: 'SHOW_RIGHT_DRAWER',
};
}
return {
type: 'HIDE_RIGHT_DRAWER',
};
};
export const setScale = scale => ({
type: 'SET_SCALE',
scale,
});
export const addPlotVariable = variable => ({
type: 'ADD_PLOT_VARIABLE',
variable,
});
export const removePlotVariable = variable => ({
type: 'REMOVE_PLOT_VARIABLE',
variable,
});
export const clearPlotVariables = () => ({
type: 'CLEAR_PLOT_VARIABLES',
});
export const setPlotNode = nodeId => ({
type: 'SET_PLOT_NODE',
nodeId,
});
export const setSimResData = simRes => ({
type: 'SET_SIM_RES_DATA',
simRes,
});
export const setResultNode = resultNode => ({
type: 'SET_RESULT_NODE',
resultNode,
});
export const toggleModelingView = (show) => {
if (show) {
return {
type: 'MODELING_VIEW',
};
}
return {
type: 'SIMULATION_VIEW',
};
};
export const setSystemWaiting = systemWaiting => ({
type: 'SET_SYSTEM_WAITING',
systemWaiting,
});
export const setCurrentUser = currentUser => ({
type: 'SET_CURRENT_USER',
currentUser,
});
export const setIdToDisplayName = userIdToDisplayName => ({
type: 'SET_ID_TO_DISPLAY_NAME_MAP',
userIdToDisplayName,
});
......@@ -49,13 +49,19 @@ class SVGRegistryBasedCanvasItem extends Component {
contextNode: PropTypes.string.isRequired,
connectionManager: PropTypes.object.isRequired,
eventManager: PropTypes.object.isRequired,
selectNode: PropTypes.func.isRequired,
activateAttributeDrawer: PropTypes.func.isRequired,
selection: PropTypes.arrayOf(PropTypes.string).isRequired,
selectNode: PropTypes.func,
activateAttributeDrawer: PropTypes.func,
selection: PropTypes.arrayOf(PropTypes.string),
connectDragSource: PropTypes.func.isRequired,
isDragging: PropTypes.bool.isRequired,
};
static defaultProps = {
selectNode: function(){},
activateAttributeDrawer: function(){},
selection: [],
};
// TODO we need to gather the children info (new base class maybe)
state = {
position: null,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment