File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
packages/ui/src/components/Visualization/Custom/hooks Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export const useDeleteStep = (vizNode: IVisualizationNode) => {
14
14
const deleteModalContext = useContext ( ActionConfirmationModalContext ) ;
15
15
const childrenNodes = vizNode . getChildren ( ) ;
16
16
const hasChildren = childrenNodes !== undefined && childrenNodes . length > 0 ;
17
+ const isPlaceholderNode = hasChildren && childrenNodes . length === 1 && childrenNodes [ 0 ] . data . isPlaceholder ;
17
18
const { getRegisteredInteractionAddons } = useContext ( NodeInteractionAddonContext ) ;
18
19
19
20
const onDeleteStep = useCallback ( async ( ) => {
@@ -22,7 +23,7 @@ export const useDeleteStep = (vizNode: IVisualizationNode) => {
22
23
) ;
23
24
24
25
let modalAnswer : string | undefined = ACTION_ID_CONFIRM ;
25
- if ( hasChildren || modalCustoms . length > 0 ) {
26
+ if ( ( hasChildren && ! isPlaceholderNode ) || modalCustoms . length > 0 ) {
26
27
const additionalModalText = modalCustoms . length > 0 ? modalCustoms [ 0 ] . additionalText : undefined ;
27
28
const buttonOptions = modalCustoms . length > 0 ? modalCustoms [ 0 ] . buttonOptions : undefined ;
28
29
/** Open delete confirm modal, get the confirmation */
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export const useReplaceStep = (vizNode: IVisualizationNode) => {
20
20
const replaceModalContext = useContext ( ActionConfirmationModalContext ) ;
21
21
const childrenNodes = vizNode . getChildren ( ) ;
22
22
const hasChildren = childrenNodes !== undefined && childrenNodes . length > 0 ;
23
+ const isPlaceholderNode = hasChildren && childrenNodes . length === 1 && childrenNodes [ 0 ] . data . isPlaceholder ;
23
24
const { getRegisteredInteractionAddons } = useContext ( NodeInteractionAddonContext ) ;
24
25
25
26
const onReplaceNode = useCallback ( async ( ) => {
@@ -29,7 +30,7 @@ export const useReplaceStep = (vizNode: IVisualizationNode) => {
29
30
getRegisteredInteractionAddons ( IInteractionAddonType . ON_DELETE , vn ) ,
30
31
) ;
31
32
let modalAnswer : string | undefined = ACTION_ID_CONFIRM ;
32
- if ( hasChildren ) {
33
+ if ( hasChildren && ! isPlaceholderNode ) {
33
34
const additionalModalText = modalCustoms . length > 0 ? modalCustoms [ 0 ] . additionalText : undefined ;
34
35
const buttonOptions = modalCustoms . length > 0 ? modalCustoms [ 0 ] . buttonOptions : undefined ;
35
36
/** Open delete confirm modal, get the confirmation */
You can’t perform that action at this time.
0 commit comments