Skip to content

Commit d14397a

Browse files
committed
UI: adjust Move Node to [[NODE]]
1 parent 3375caf commit d14397a

File tree

7 files changed

+7
-5
lines changed

7 files changed

+7
-5
lines changed

strictdoc/server/routers/main_router.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,11 +1507,13 @@ async def move_node(request: Request):
15071507
)
15081508
current_parent_node = moved_node.parent
15091509

1510-
# Currently UI allows a child-like drag-and-drop on a requirement node.
1511-
# In that case, we make it add a node **after** the target requirement
1512-
# node (not as its child because that's not possible).
1513-
if whereto == NodeCreationOrder.CHILD and isinstance(
1514-
target_node, SDocNode
1510+
# Currently UI allows a child-like drag-and-drop on a leaf (non-composite) node.
1511+
# In that case, we make it add a node **after** the target node
1512+
# (not as its child because that's not possible).
1513+
if (
1514+
whereto == NodeCreationOrder.CHILD
1515+
and isinstance(target_node, SDocNode)
1516+
and not target_node.is_composite
15151517
):
15161518
whereto = NodeCreationOrder.AFTER
15171519

tests/end2end/screens/document/move_node/move_node_move_node_to_composite_node/expected_output/document.sdoc

Whitespace-only changes.

tests/end2end/screens/document/move_node/move_node_move_node_to_composite_node/input/document.sdoc

Whitespace-only changes.

tests/end2end/screens/document/move_node/move_node_move_node_to_composite_node/test_case.py

Whitespace-only changes.

0 commit comments

Comments
 (0)