Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Patrik Meijer
react-components
Commits
53500972
Commit
53500972
authored
Nov 07, 2018
by
Tamas Kecskes
Browse files
Redux removed from canvas item.
parent
cc18f9bb
Changes
6
Hide whitespace changes
Inline
Side-by-side
demo/demoApp.jsx
View file @
53500972
...
...
@@ -53,10 +53,10 @@ class demoApp extends Component {
component
:
<
DemoModalSpinner
/>,
title
:
'
ModalSpinner
'
,
},
//
{
//
component: <DemoContainmentCanvas/>,
//
title: 'ContainmentCanvas',
//
},
{
component
:
<
DemoContainmentCanvas
/>,
title
:
'
ContainmentCanvas
'
,
},
{
component
:
<
DemoSingleConnectedNode
/>,
title
:
'
SingleConnectedNode
'
,
...
...
src/components/Con
tainmentCanvas
/BasicConnectingComponent.jsx
→
src/components/Con
nectionManager
/BasicConnectingComponent.jsx
View file @
53500972
File moved
src/components/Con
tainmentCanvas
/ConnectionManager.jsx
→
src/components/Con
nectionManager
/ConnectionManager.jsx
View file @
53500972
File moved
src/components/ContainmentCanvas/ContainmentCanvas.jsx
View file @
53500972
...
...
@@ -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
=>
(<
Containment
CanvasItem
const
childrenItems
=
children
.
map
(
child
=>
(<
SVGRegistryBased
CanvasItem
key
=
{
child
.
id
}
gmeClient
=
{
gmeClient
}
activeNode
=
{
child
.
id
}
contextNode
=
{
activeNode
}
connectionManager
=
{
this
.
cm
}
eventManager
=
{
this
.
em
}
scale
=
{
1
}
/>));
const
content
=
(
...
...
src/components/ContainmentCanvas/actions.jsx
deleted
100644 → 0
View file @
cc18f9bb
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
,
});
src/components/SVGRegistryBasedCanvasItem/SVGRegistryBasedCanvasItem.jsx
View file @
53500972
...
...
@@ -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
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment