Skip to content

Commit

Permalink
CB-4400 removed project margin styles to prevent tree jump on DnD (#2344
Browse files Browse the repository at this point in the history
)

* CB-4400 removed project margin styles to prevent tree jump on DnD

* CB-4400 removed DND jump lag for connection/script/dataset trees

* CB-4400 top tree project has margin

---------

Co-authored-by: s.teleshev <[email protected]>
  • Loading branch information
sergeyteleshev and s.teleshev authored Feb 6, 2024
1 parent 98d7d1f commit d96e0b8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.projectNode {
margin-top: 8px;

&.project:only-child,
&.hideProjects {
margin-top: 0px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ const ProjectRenderer: NavigationNodeRendererComponent = observer(function Manag
});

const hideProjects = elementsTreeContext?.tree.settings?.projects === false && !isDragging;
const singleProject = projectsService.activeProjects.length === 1;

if (!node) {
return (
Expand All @@ -113,16 +112,14 @@ const ProjectRenderer: NavigationNodeRendererComponent = observer(function Manag
);
}

const project = node.nodeType === NAV_NODE_TYPE_RM_PROJECT && singleProject && !isDragging;

return (
<SContext registry={registry}>
<NavigationNodeRendererLoader
node={node}
path={path}
expanded={expanded}
dragging={dragging}
className={s(styles, { projectNode: true, hideProjects, project }, className)}
className={s(styles, { projectNode: true, hideProjects }, className)}
control={NavigationNodeProjectControl}
component={component}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.projectNode {
margin-top: 8px;

&.project:only-child,
&.hideProjects {
margin-top: 0px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const ProjectRenderer: NavigationNodeRendererComponent = observer(function Manag
return isDraggingInsideProject(node.projectId, elementsTreeContext.tree.activeDnDData);
});

const singleProject = projectsService.activeProjects.length === 1;
const hideProjects = elementsTreeContext?.tree.settings?.projects === false && !isDragging;

if (!node) {
Expand All @@ -85,16 +84,14 @@ const ProjectRenderer: NavigationNodeRendererComponent = observer(function Manag
);
}

const project = node.nodeType === NAV_NODE_TYPE_PROJECT && singleProject && !isDragging;

return (
<SContext registry={registry}>
<NavigationNodeRendererLoader
node={node}
path={path}
expanded={expanded}
dragging={dragging}
className={s(styles, { projectNode: true, hideProjects, project }, className)}
className={s(styles, { projectNode: true, hideProjects }, className)}
control={NavigationNodeProjectControl}
component={component}
/>
Expand Down

0 comments on commit d96e0b8

Please sign in to comment.