Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.editor
Commits
79b583c0
Commit
79b583c0
authored
May 07, 2018
by
Jaden DIEFENBAUGH
Browse files
[toolchain] fix block io removal removing unrelated conns,
#98
parent
7d1f82f7
Pipeline
#19896
passed with stages
in 121 minutes and 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
conda/js/src/components/toolchain/ToolchainEditor.jsx
View file @
79b583c0
...
...
@@ -575,14 +575,16 @@ export class ToolchainEditor extends React.PureComponent<Props, State> {
deleteBlockIO
=
(
blockName
:
string
,
set
:
BlockSet
,
ioType
:
'
input
'
|
'
output
'
,
ioName
:
string
)
=>
{
const
rep
=
{...
this
.
state
.
cache
.
contents
.
representation
};
const
connectionLabel
=
`
${
blockName
}
.
${
ioName
}
`
;
rep
.
connections
=
Object
.
entries
(
rep
.
connections
).
filter
(([
name
,
rep
])
=>
{
if
(
!
name
.
includes
(
ioName
))
return
true
;
const
[
from
,
to
]
=
name
.
split
(
'
/
'
);
if
(
ioType
===
'
input
'
&&
to
.
endsWith
(
`.
${
ioName
}
`
)
)
if
(
ioType
===
'
input
'
&&
to
===
connectionLabel
)
return
false
;
if
(
ioType
===
'
output
'
&&
from
.
endsWith
(
`.
${
ioName
}
`
)
)
if
(
ioType
===
'
output
'
&&
from
===
connectionLabel
)
return
false
;
return
true
;
})
...
...
@@ -603,9 +605,9 @@ export class ToolchainEditor extends React.PureComponent<Props, State> {
return
newBlock
;
}),
connections
:
this
.
state
.
cache
.
contents
.
connections
.
filter
(
c
=>
{
if
(
ioType
===
'
input
'
&&
c
.
to
.
endsWith
(
`.
${
ioName
}
`
)
)
if
(
ioType
===
'
input
'
&&
c
.
to
===
connectionLabel
)
return
false
;
if
(
ioType
===
'
output
'
&&
c
.
from
.
endsWith
(
`.
${
ioName
}
`
)
)
if
(
ioType
===
'
output
'
&&
c
.
from
===
connectionLabel
)
return
false
;
return
true
;
}),
...
...
Write
Preview
Supports
Markdown
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