Skip to content

Commit

Permalink
Merge pull request #1234 from strictdoc-project/stanislaw/fix_move_node
Browse files Browse the repository at this point in the history
export/html, server: fix edge case when dropping a req on another req
  • Loading branch information
stanislaw authored Jul 16, 2023
2 parents 648372e + 8df3665 commit cf4f26f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 12 deletions.
8 changes: 8 additions & 0 deletions strictdoc/server/routers/main_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,14 @@ async def move_node(request: Request):
)
current_parent_node = moved_node.parent

# Currently UI allows a child-like drag-and-drop on a requirement node.
# In that case, we make it add a node **after** the target requirement
# node (not as its child because that's not possible).
if whereto == NodeCreationOrder.CHILD and isinstance(
target_node, Requirement
):
whereto = NodeCreationOrder.AFTER

if whereto == NodeCreationOrder.CHILD:
# Disconnect the moved_node from its parent.
current_parent_node.section_contents.remove(moved_node)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from seleniumbase import BaseCase

from tests.end2end.e2e_case import E2ECase
from tests.end2end.end2end_test_setup import End2EndTestSetup
from tests.end2end.helpers.components.viewtype_selector import ViewType_Selector
from tests.end2end.helpers.screens.project_index.screen_project_index import (
Expand All @@ -8,7 +7,7 @@
from tests.end2end.server import SDocTestServer


class Test_UC60_T01_document_has_no_content(BaseCase):
class Test(E2ECase):
def test(self):
test_setup = End2EndTestSetup(path_to_test_file=__file__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from seleniumbase import BaseCase

from tests.end2end.e2e_case import E2ECase
from tests.end2end.end2end_test_setup import End2EndTestSetup
from tests.end2end.helpers.components.viewtype_selector import ViewType_Selector
from tests.end2end.helpers.screens.project_index.screen_project_index import (
Expand All @@ -8,7 +7,7 @@
from tests.end2end.server import SDocTestServer


class Test_UC60_T02_document_has_content(BaseCase):
class Test(E2ECase):
def test(self):
test_setup = End2EndTestSetup(path_to_test_file=__file__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from seleniumbase import BaseCase

from tests.end2end.e2e_case import E2ECase
from tests.end2end.end2end_test_setup import End2EndTestSetup
from tests.end2end.helpers.components.viewtype_selector import ViewType_Selector
from tests.end2end.helpers.screens.project_index.screen_project_index import (
Expand All @@ -8,7 +7,7 @@
from tests.end2end.server import SDocTestServer


class Test_UC30_T01_document_has_no_content(BaseCase):
class Test(E2ECase):
def test(self):
test_setup = End2EndTestSetup(path_to_test_file=__file__)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from seleniumbase import BaseCase

from tests.end2end.e2e_case import E2ECase
from tests.end2end.end2end_test_setup import End2EndTestSetup
from tests.end2end.helpers.components.viewtype_selector import ViewType_Selector
from tests.end2end.helpers.screens.project_index.screen_project_index import (
Expand All @@ -8,7 +7,7 @@
from tests.end2end.server import SDocTestServer


class Test_UC30_T02_document_has_content(BaseCase):
class Test(E2ECase):
def test(self):
test_setup = End2EndTestSetup(path_to_test_file=__file__)

Expand Down

0 comments on commit cf4f26f

Please sign in to comment.