Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[2640] Compute handle position on diagram conversion #2641

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ It uses our algorithm instead of elk.js to perform the arrange-all.
- https://github.com/eclipse-sirius/sirius-web/issues/2635[#2635] [diagram] Fix an error when switching between react flow representations.
- https://github.com/eclipse-sirius/sirius-web/issues/2581[#2581] [diagram] Fix an issue where nodes created by custom tool are always on the default position.
- https://github.com/eclipse-sirius/sirius-web/issues/2642[#2642] [diagram] Fix an issue where moving the viewport was slow.
- https://github.com/eclipse-sirius/sirius-web/issues/2640[#2640] [diagram] Compute the handle position on diagram conversion, which happens every time a diagram refresh payload is received.

=== New Features

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import { GQLLabel, GQLLabelStyle } from '../graphql/subscription/labelFragment.t
import { GQLNode, GQLNodeStyle, GQLViewModifier } from '../graphql/subscription/nodeFragment.types';
import { Diagram, Label, NodeData } from '../renderer/DiagramRenderer.types';
import { MultiLabelEdgeData } from '../renderer/edge/MultiLabelEdge.types';
import { RawDiagram } from '../renderer/layout/layout.types';
import { layoutHandles } from '../renderer/layout/layoutHandles';
import { DiagramNodeType } from '../renderer/node/NodeTypes.types';
import { IConvertEngine, INodeConverterHandler } from './ConvertEngine.types';
import { IconLabelNodeConverterHandler } from './IconLabelNodeConverterHandler';
Expand Down Expand Up @@ -211,14 +213,20 @@ export const convertDiagram = (
};
});

const rawDiagram: RawDiagram = {
nodes,
edges,
};
layoutHandles(rawDiagram);

return {
metadata: {
id: gqlDiagram.id,
label: gqlDiagram.metadata.label,
kind: gqlDiagram.metadata.kind,
targetObjectId: gqlDiagram.targetObjectId,
},
nodes,
edges,
nodes: rawDiagram.nodes,
edges: rawDiagram.edges,
};
};
Loading