Skip to content

Commit 2d4f785

Browse files
gcoutableAxelRICHARD
authored andcommitted
[2045] Prevent compartments from being revealed at node creation
Bug: #2045 Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr>
1 parent 053b63c commit 2d4f785

7 files changed

Lines changed: 577 additions & 12 deletions

File tree

CHANGELOG.adoc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
= Changelog
22

33
== v2026.5.0 (work in progress)
4-
4+
55
=== Shapes
6-
6+
77
=== Breaking changes
88

99
- SysON now requires **Java 21** or later.
1010
- [cleanup] The definition of the tools specific to the requirements table has been moved to the backend.
1111
As a result, the following GraphQL mutations have been removed `exposeRequirements` and `createRequirement`.
1212
- [test] Reduce our call to `DiagramNavigator#nodeWithTargetObjectLabel` which has been deprecated for removal.
1313
+ The API of `ToolTester#invokeTool` and `NodeCreationTestsService#createNode` has been updated accordingly to take a `targetObjectId` instead of a `label`.
14+
- https://github.com/eclipse-syson/syson/issues/2045[#2045] [diagrams] The service `ViewNodeService#revealCompartment` has been changed to reveal a compartment only when it is needed.
15+
+ Only reveal a compartment of a node when none of the revealed compartment can display the `targetElement`.
16+
+ If many compartment candidates exist, choose the first free form compartment.
1417

1518
=== Dependency update
1619

1720
- As of version 2026.5.0, SysON now requires **Java 21** or later.
1821

1922
=== Bug fixes
2023

24+
- https://github.com/eclipse-syson/syson/issues/2045[#2045] [diagrams] In Interconnection View diagrams, fix an issue where the `parts` compartment of a `PartDefinition` graphical node was incorrectly revealed when creating a `PartUsage` from the `PartDefinition` graphical node, even if the `interconnection` compartment was already visible.
25+
2126
=== Improvements
2227

2328
=== New features
@@ -123,7 +128,7 @@ Now the _end_ keyword is not displayed anymore in the label of these graphical n
123128
- https://github.com/eclipse-syson/syson/issues/2053[#2053] [diagrams] Prevent incoming and outgoing graphical edges of a graphical `ForkNode` or `JoinNode` to point empty space.
124129
- https://github.com/eclipse-syson/syson/issues/2059[#2059] [diagrams] Fix an issue where the _Add existing elements_ tool was not working correctly on the _action flow_ compartment of `ActionUsage` graphical nodes.
125130
- https://github.com/eclipse-syson/syson/issues/2043[#2043] [explorer] Prevent user libraries from being moved to the root of the project when a child is created in it.
126-
- https://github.com/eclipse-syson/syson/issues/2056[#2056] [diagams] Fix the user feedback when dropping an `Element` which is already exposed on a diagram.
131+
- https://github.com/eclipse-syson/syson/issues/2056[#2056] [diagrams] Fix the user feedback when dropping an `Element` which is already exposed on a diagram.
127132
- https://github.com/eclipse-syson/syson/issues/2048[#2048] [diagrams] Fix an issue where the non-empty compartments of graphical nodes were being displayed when executing the _Add existing elements_ tool.
128133

129134
=== Improvements

backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/diagrams/checkers/CheckNodeInCompartment.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public class CheckNodeInCompartment implements IDiagramChecker {
4646

4747
private boolean isRevealed;
4848

49+
private boolean isHidden;
50+
4951
public CheckNodeInCompartment(DiagramDescriptionIdProvider diagramDescriptionIdProvider, DiagramComparator diagramComparator) {
5052
this.diagramDescriptionIdProvider = diagramDescriptionIdProvider;
5153
this.diagramComparator = diagramComparator;
@@ -76,6 +78,11 @@ public CheckNodeInCompartment isRevealed() {
7678
return this;
7779
}
7880

81+
public CheckNodeInCompartment isHidden() {
82+
this.isHidden = true;
83+
return this;
84+
}
85+
7986
@Override
8087
public void check(Diagram previousDiagram, Diagram newDiagram) {
8188
List<Node> newNodes = this.diagramComparator.newNodes(previousDiagram, newDiagram);
@@ -93,5 +100,8 @@ public void check(Diagram previousDiagram, Diagram newDiagram) {
93100
if (this.isRevealed) {
94101
assertThat(compartmentNode.getState()).isEqualTo(ViewModifier.Normal);
95102
}
103+
if (this.isHidden) {
104+
assertThat(compartmentNode.getState()).isEqualTo(ViewModifier.Hidden);
105+
}
96106
}
97107
}

0 commit comments

Comments
 (0)