@@ -12,13 +12,8 @@ import drawConnection, {
12
12
import drawOverlay from './drawOverlay'
13
13
import drawSelectBox from './drawSelectBox'
14
14
import drawEntryPoints from './drawEntryPoints'
15
- import {
16
- RELATION_AS_CHILD ,
17
- } from '../redux/ephemeral/outcome-connector/actions'
18
- import {
19
- getOutcomeHeight ,
20
- getOutcomeWidth ,
21
- } from './dimensions'
15
+ import { RELATION_AS_CHILD } from '../redux/ephemeral/outcome-connector/actions'
16
+ import { getOutcomeHeight , getOutcomeWidth } from './dimensions'
22
17
import {
23
18
ComputedOutcome ,
24
19
ComputedSimpleAchievementStatus ,
@@ -31,7 +26,10 @@ import { ProjectConnectionsState } from '../redux/persistent/projects/connection
31
26
import { ProjectEntryPointsState } from '../redux/persistent/projects/entry-points/reducer'
32
27
import { ProjectOutcomeMembersState } from '../redux/persistent/projects/outcome-members/reducer'
33
28
import { getPlaceholderOutcome } from './drawOutcome/placeholderOutcome'
34
- import { CoordinatesState , DimensionsState } from '../redux/ephemeral/layout/state-type'
29
+ import {
30
+ CoordinatesState ,
31
+ DimensionsState ,
32
+ } from '../redux/ephemeral/layout/state-type'
35
33
36
34
function setupCanvas ( canvas ) {
37
35
// Get the device pixel ratio, falling back to 1.
@@ -62,14 +60,15 @@ export type renderProps = {
62
60
connections : ProjectConnectionsState
63
61
outcomeConnectorFromAddress : ActionHashB64
64
62
outcomeConnectorToAddress : ActionHashB64
65
- existingParentConnectionAddress : ActionHashB64
66
63
outcomeConnectorRelation : RelationInput
64
+ outcomeConnectorExistingParent : ActionHashB64
67
65
outcomeFormIsOpen : boolean
68
66
outcomeFormFromActionHash : ActionHashB64
69
67
outcomeFormContent : string
70
68
outcomeFormRelation : RelationInput
71
69
outcomeFormLeftConnectionX : number
72
70
outcomeFormTopConnectionY : number
71
+ outcomeFormExistingParent : ActionHashB64
73
72
hoveredConnectionActionHash : ActionHashB64
74
73
selectedConnections : ActionHashB64 [ ]
75
74
selectedOutcomes : ActionHashB64 [ ]
@@ -115,13 +114,14 @@ function render(
115
114
outcomeConnectorFromAddress,
116
115
outcomeConnectorToAddress,
117
116
outcomeConnectorRelation,
118
- existingParentConnectionAddress ,
117
+ outcomeConnectorExistingParent ,
119
118
outcomeFormIsOpen,
120
119
outcomeFormFromActionHash,
121
120
outcomeFormRelation,
122
121
outcomeFormContent,
123
122
outcomeFormLeftConnectionX,
124
123
outcomeFormTopConnectionY,
124
+ outcomeFormExistingParent,
125
125
hoveredConnectionActionHash,
126
126
selectedConnections,
127
127
selectedOutcomes,
@@ -178,7 +178,14 @@ function render(
178
178
// if in the pending re-parenting mode for the child card of an existing connection,
179
179
// temporarily omit/hide the existing connection from view
180
180
// ASSUMPTION: one parent
181
- if ( connection . actionHash === existingParentConnectionAddress ) return
181
+ if (
182
+ connection . actionHash === outcomeFormExistingParent ||
183
+ connection . actionHash === outcomeConnectorExistingParent
184
+ ) {
185
+ // do not draw, because we are pre-representing the
186
+ // fact that this connection will be deleted/replaced
187
+ return
188
+ }
182
189
183
190
const childCoords = coordinates [ connection . childActionHash ]
184
191
const parentCoords = coordinates [ connection . parentActionHash ]
0 commit comments