Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
ewoksweb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
workflow
ewoks
ewoksweb
Commits
34b653c0
Commit
34b653c0
authored
1 year ago
by
Giannis Koumoutsos
Browse files
Options
Downloads
Patches
Plain Diff
allow generated type and connect it to basic node type
parent
a0cd1a47
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!402
generated type is correctly displayed on canvas
Pipeline
#137832
failed
1 year ago
Stage: test
Stage: style
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/edition/Canvas/Canvas.tsx
+20
-13
20 additions, 13 deletions
src/edition/Canvas/Canvas.tsx
src/types.ts
+3
-2
3 additions, 2 deletions
src/types.ts
with
23 additions
and
15 deletions
src/edition/Canvas/Canvas.tsx
+
20
−
13
View file @
34b653c0
...
@@ -55,6 +55,7 @@ const nodeTypes = {
...
@@ -55,6 +55,7 @@ const nodeTypes = {
graph
:
GraphNode
,
graph
:
GraphNode
,
method
:
DataNode
,
method
:
DataNode
,
ppfmethod
:
DataNode
,
ppfmethod
:
DataNode
,
generated
:
DataNode
,
graphInput
:
GraphInOutNode
,
graphInput
:
GraphInOutNode
,
graphOutput
:
GraphInOutNode
,
graphOutput
:
GraphInOutNode
,
class
:
DataNode
,
class
:
DataNode
,
...
@@ -71,10 +72,10 @@ function Canvas() {
...
@@ -71,10 +72,10 @@ function Canvas() {
}
>
();
}
>
();
const
displayedWorkflowInfo
=
useStore
(
const
displayedWorkflowInfo
=
useStore
(
(
state
)
=>
state
.
displayedWorkflowInfo
,
(
state
)
=>
state
.
displayedWorkflowInfo
);
);
const
setDisplayedWorkflowInfo
=
useStore
(
const
setDisplayedWorkflowInfo
=
useStore
(
(
state
)
=>
state
.
setDisplayedWorkflowInfo
,
(
state
)
=>
state
.
setDisplayedWorkflowInfo
);
);
const
addLoadedGraph
=
useStore
((
state
)
=>
state
.
addLoadedGraph
);
const
addLoadedGraph
=
useStore
((
state
)
=>
state
.
addLoadedGraph
);
...
@@ -88,8 +89,15 @@ function Canvas() {
...
@@ -88,8 +89,15 @@ function Canvas() {
const
setDataFromNodes
=
useNodeDataStore
((
state
)
=>
state
.
setDataFromNodes
);
const
setDataFromNodes
=
useNodeDataStore
((
state
)
=>
state
.
setDataFromNodes
);
const
setEdgeData
=
useEdgeDataStore
((
state
)
=>
state
.
setEdgeData
);
const
setEdgeData
=
useEdgeDataStore
((
state
)
=>
state
.
setEdgeData
);
const
setDataFromEdges
=
useEdgeDataStore
((
state
)
=>
state
.
setDataFromEdges
);
const
setDataFromEdges
=
useEdgeDataStore
((
state
)
=>
state
.
setDataFromEdges
);
const
{
fitView
,
setNodes
,
setEdges
,
getNodes
,
getEdges
,
addNodes
,
getNode
}
=
const
{
rfInstance
;
fitView
,
setNodes
,
setEdges
,
getNodes
,
getEdges
,
addNodes
,
getNode
,
}
=
rfInstance
;
useEffect
(()
=>
{
useEffect
(()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
...
@@ -122,11 +130,10 @@ function Canvas() {
...
@@ -122,11 +130,10 @@ function Canvas() {
}
}
const
stateRF
=
storeRF
.
getState
();
const
stateRF
=
storeRF
.
getState
();
const
reactFlowBounds
=
const
reactFlowBounds
=
reactFlowWrapper
.
current
?.
getBoundingClientRect
()
||
{
reactFlowWrapper
.
current
?.
getBoundingClientRect
()
||
{
left
:
0
,
left
:
0
,
top
:
0
,
top
:
0
,
};
};
const
taskInfo
=
retrieveTaskInfo
(
event
.
dataTransfer
);
const
taskInfo
=
retrieveTaskInfo
(
event
.
dataTransfer
);
if
(
!
taskInfo
)
{
if
(
!
taskInfo
)
{
...
@@ -210,7 +217,7 @@ function Canvas() {
...
@@ -210,7 +217,7 @@ function Canvas() {
getNodes
(),
getNodes
(),
getEdges
(),
getEdges
(),
getNodesData
(),
getNodesData
(),
oldEdge
,
oldEdge
);
);
if
(
!
isValid
)
{
if
(
!
isValid
)
{
showWarningMsg
(
reason
);
showWarningMsg
(
reason
);
...
@@ -218,7 +225,7 @@ function Canvas() {
...
@@ -218,7 +225,7 @@ function Canvas() {
const
newEdges
=
addEdge
(
const
newEdges
=
addEdge
(
{
...
oldEdge
,
...
newConnection
},
{
...
oldEdge
,
...
newConnection
},
getEdges
().
filter
((
edge
)
=>
edge
.
id
!==
oldEdge
.
id
)
,
getEdges
().
filter
((
edge
)
=>
edge
.
id
!==
oldEdge
.
id
)
);
);
setEdges
(
newEdges
);
setEdges
(
newEdges
);
...
@@ -283,7 +290,7 @@ function Canvas() {
...
@@ -283,7 +290,7 @@ function Canvas() {
},
300
);
},
300
);
}
else
{
}
else
{
showErrorMsg
(
showErrorMsg
(
`The subgraph
${
nodeData
.
task_props
.
task_identifier
}
cannot be located!`
,
`The subgraph
${
nodeData
.
task_props
.
task_identifier
}
cannot be located!`
);
);
}
}
}
}
...
@@ -331,7 +338,7 @@ function Canvas() {
...
@@ -331,7 +338,7 @@ function Canvas() {
connection
,
connection
,
getNodes
(),
getNodes
(),
getEdges
(),
getEdges
(),
getNodesData
()
,
getNodesData
()
);
);
if
(
!
isValid
)
{
if
(
!
isValid
)
{
showWarningMsg
(
reason
);
showWarningMsg
(
reason
);
...
...
This diff is collapsed.
Click to expand it.
src/types.ts
+
3
−
2
View file @
34b653c0
...
@@ -104,7 +104,8 @@ export type TaskType =
...
@@ -104,7 +104,8 @@ export type TaskType =
|
'
class
'
|
'
class
'
|
'
note
'
|
'
note
'
|
'
script
'
|
'
script
'
|
'
subworkflow
'
;
|
'
subworkflow
'
|
'
generated
'
;
export
interface
Task
{
export
interface
Task
{
task_type
:
TaskType
;
task_type
:
TaskType
;
...
@@ -298,7 +299,7 @@ export interface CustomTableCellProps {
...
@@ -298,7 +299,7 @@ export interface CustomTableCellProps {
onChange
(
onChange
(
e
:
{
target
:
{
name
:
string
;
value
:
string
|
number
}
},
e
:
{
target
:
{
name
:
string
;
value
:
string
|
number
}
},
row
:
EditableTableRow
,
row
:
EditableTableRow
,
index
:
number
,
index
:
number
):
void
;
):
void
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment