Skip to content

Commit 3ded8c8

Browse files
froueneAxelRICHARD
authored andcommitted
[1033] Remove filter condition on root namespace for diagram creation
Bug: #1033 Signed-off-by: Florian ROUËNÉ <florian.rouene@obeosoft.com>
1 parent bc17b5d commit 3ded8c8

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

CHANGELOG.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
- https://github.com/eclipse-syson/syson/issues/1061[#1061] [general-view] Add ellipsis on `Packages` label, to provide visual feedback on name overflow.
1818
- https://github.com/eclipse-syson/syson/issues/1007[#1007] Improve direct edit on Feature elements to be able to set the `isDefault` and `isInitial` properties
19+
- https://github.com/eclipse-syson/syson/issues/1033[#1033] [explorer] Make it possible to create a diagram representation directly under a `root Namespace` element
1920

2021
=== New features
2122

backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewCreateService.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public ViewCreateService(IViewDiagramDescriptionSearchService viewDiagramDescrip
111111
* @return {@code true} if the diagram can be created on the provided {@code element}
112112
*/
113113
public boolean canCreateDiagram(Element element) {
114-
return !this.utilService.isRootNamespace(element);
114+
return true;
115115
}
116116

117117
/**
@@ -336,14 +336,14 @@ public Element createPartUsageAsActor(Element self, Element selectedObject) {
336336
* {@link RequirementDefinition}.
337337
*
338338
* @param self
339-
* a {@link RequirementUsage} or {@link RequirementDefinition}, otherwise no {@link PartUsage} will be
340-
* created.
339+
* a {@link RequirementUsage} or {@link RequirementDefinition}, otherwise no {@link PartUsage} will be
340+
* created.
341341
* @param selectedObject
342-
* a {@link ItemUsage} or {@link ItemDefinition} that will be subsetted by (respectively that will type)
343-
* the created {@link PartUsage}.
342+
* a {@link ItemUsage} or {@link ItemDefinition} that will be subsetted by (respectively that will type)
343+
* the created {@link PartUsage}.
344344
* @return the newly-created {@link PartUsage}, contained by {@code self} through a {@link StakeholderMembership}.
345-
* If {@code self} was neither a {@link RequirementUsage} nor a {@link RequirementDefinition}, {@code self}
346-
* is returned as-is.
345+
* If {@code self} was neither a {@link RequirementUsage} nor a {@link RequirementDefinition}, {@code self}
346+
* is returned as-is.
347347
*/
348348
public Element createPartUsageAsStakeholder(Element self, Element selectedObject) {
349349
Objects.requireNonNull(self);
50.5 KB
Loading

doc/content/modules/user-manual/pages/release-notes/2025.4.0.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ name is truncated.
1313

1414
image::release-notes-package-name-ellipsis-overflow.png[Package name overflow with ellipsis, width=85%,height=85%]
1515

16-
- In diagrams, the direct edit tool on `Feature` elements now allows to use the ":=" and "default" symbols (see for more details in xref:ROOT:how-tos/model-management.adoc#direct-edit[user documentation] ).
16+
- In diagrams, the direct edit tool on `Feature` elements now allows to use the ":=" and "default" symbols (see for more details in xref:user-manual:how-tos/model-management.adoc#direct-edit[user documentation] ).
17+
- It is now possible to create a `General View` diagram under root namespace elements.
18+
19+
image::release-notes-create-diagram-on-root-namespace-element.png[Create diagram on root namespace element, width=50%, height=50%]
1720

1821
== Dependency update
1922

integration-tests/cypress/e2e/project/diagrams/diagramCreationTests.cy.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,16 @@ describe('Diagram Creation Tests', () => {
153153
cy.getByTestId('new-representation').should('not.exist');
154154
});
155155
});
156+
157+
context('When we select a root namespace element', () => {
158+
it('Then we can create a new representation in it', () => {
159+
const explorer = new Explorer();
160+
cy.getByTestId('tree-filter-menu-icon').should('exist').click();
161+
cy.getByTestId('tree-filter-menu-checkbox-Hide Root Namespaces').click();
162+
explorer.getTreeItemByLabel('Namespace').should('exist');
163+
explorer.createRepresentation('Namespace', 'General View', 'generalView');
164+
diagram.getDiagram('generalView').should('exist');
165+
});
166+
});
156167
});
157168
});

0 commit comments

Comments
 (0)