diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 9cbbf3d4d..50ad5c534 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -57,6 +57,8 @@ The `org.eclipse.syson.services.grammars` package in `syson-direct-edit-grammar` As a consequence, the `syson-table-requirements-view` and `syson-common-view` modules has been created. `IViewDescriptionProvider.java` and `SysONViewDescriptionProvider.java` have been moved from `syson-diagram-common-view` to `syson-common-view`. `GetIntermediateContainerCreationSwitch.java` has been moved from `syson-application-configuration` to `syson-services`. +- https://github.com/eclipse-syson/syson/issues/1245[#1245] [syson] Standardize read-only computation. +The class `SysMLReadOnlyService` and the interface `ISysMLReadOnlyService` have been removed, use `IReadOnlyObjectPredicate` instead. === Dependency update @@ -91,6 +93,13 @@ Consumers may override this by providing an implementation of `org.eclipse.syson With this enhancement, users can now easily identify which `ViewDefinition` is used by a `ViewUsage`. - https://github.com/eclipse-syson/syson/issues/1535[#1535] [explorer] Since it is now possible to switch from a _Standard Diagram View_ to another in SysON (for example from _General View_ to _Interconnection View_), the `ViewUsages` default name does not contain the name of the `ViewDefinition` anymore. With this enhancement, users avoid confusion when switching from one _ViewDefinition_ to another one in a `ViewUsage`. +- https://github.com/eclipse-syson/syson/issues/1245[#1245] [syson] Standardize read-only computation. +We removed the assumptions SysON made on whether a resource is read-only. +Resources are now considered read-only if: +* They are Sirius Web libraries imported by reference +* They are textual SysML files imported as read-only +* They are standard libraries (SysML and KerML) +All the other resources are read-write. === New features diff --git a/backend/application/pom.xml b/backend/application/pom.xml index f2a3bdfe9..f15142c1d 100644 --- a/backend/application/pom.xml +++ b/backend/application/pom.xml @@ -17,7 +17,7 @@ org.eclipse.syson syson-application-parent - 2025.8.5 + 2025.8.8 syson-application-parent SysON Application Parent diff --git a/backend/application/syson-application-configuration/pom.xml b/backend/application/syson-application-configuration/pom.xml index 1fe799eed..089098fa2 100644 --- a/backend/application/syson-application-configuration/pom.xml +++ b/backend/application/syson-application-configuration/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-application-configuration - 2025.8.5 + 2025.8.8 syson-application-configuration SysON Application Configuration @@ -69,27 +69,27 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel-edit - 2025.8.5 + 2025.8.8 @@ -105,7 +105,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegate.java b/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegate.java index 78444e849..52b9ff519 100644 --- a/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegate.java +++ b/backend/application/syson-application-configuration/src/main/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegate.java @@ -12,15 +12,11 @@ *******************************************************************************/ package org.eclipse.syson.application.services; -import java.util.Objects; - import org.eclipse.emf.ecore.EAnnotation; -import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.sirius.components.core.api.IReadOnlyObjectPredicate; import org.eclipse.sirius.components.core.api.IReadOnlyObjectPredicateDelegate; -import org.eclipse.syson.services.UtilService; -import org.eclipse.syson.services.api.ISysONResourceService; +import org.eclipse.sirius.components.emf.ResourceMetadataAdapter; import org.eclipse.syson.sysml.Element; import org.eclipse.syson.sysml.util.ElementUtil; import org.springframework.stereotype.Service; @@ -42,12 +38,6 @@ @Service public class SysONReadOnlyObjectPredicateDelegate implements IReadOnlyObjectPredicateDelegate { - private final ISysONResourceService sysONResourceService; - - public SysONReadOnlyObjectPredicateDelegate(final ISysONResourceService sysONResourceService) { - this.sysONResourceService = Objects.requireNonNull(sysONResourceService); - } - @Override public boolean canHandle(Object candidate) { return candidate instanceof Element || candidate instanceof Resource || candidate instanceof EAnnotation; @@ -60,12 +50,18 @@ public boolean test(Object candidate) { if (candidate instanceof Resource resource) { isReadOnly = ElementUtil.isStandardLibraryResource(resource) - || this.sysONResourceService.isImported(resource) && !new UtilService().getLibraries(resource, false).isEmpty(); - } else if (candidate instanceof Element || candidate instanceof EAnnotation) { - // Derive editability from the editability of the containing resource. - final EObject eObject = (EObject) candidate; - final Resource resource = eObject.eResource(); - isReadOnly = this.test(resource); + || resource.eAdapters().stream() + .filter(ResourceMetadataAdapter.class::isInstance) + .map(ResourceMetadataAdapter.class::cast) + .map(ResourceMetadataAdapter::isReadOnly) + .findFirst() + .orElse(false); + } else if (candidate instanceof Element element) { + // An element is read-only if it is contained in a standard LibraryPackage, regardless of whether its + // containing resource is read-only or not. + isReadOnly = this.test(element.eResource()) || ElementUtil.isFromStandardLibrary(element); + } else if (candidate instanceof EAnnotation eAnnotation) { + isReadOnly = this.test(eAnnotation.eResource()); } return isReadOnly; diff --git a/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java b/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java index 0e9f6d252..affc5b52c 100644 --- a/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java +++ b/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/DetailsViewServiceTest.java @@ -21,6 +21,7 @@ import org.eclipse.emf.edit.provider.ComposedAdapterFactory; import org.eclipse.sirius.components.core.api.IFeedbackMessageService; import org.eclipse.sirius.components.core.services.ComposedReadOnlyObjectPredicate; +import org.eclipse.sirius.components.emf.ResourceMetadataAdapter; import org.eclipse.sirius.components.emf.services.JSONResourceFactory; import org.eclipse.sirius.web.application.object.services.DefaultReadOnlyObjectPredicate; import org.eclipse.syson.sysml.LibraryPackage; @@ -46,7 +47,7 @@ public class DetailsViewServiceTest { public void setUp() { // Use a dummy CompsedAdapterFactory, we don't test methods that require the one used by SysON for the moment. this.detailsViewService = new DetailsViewService(new ComposedAdapterFactory(), new IFeedbackMessageService.NoOp(), - new ComposedReadOnlyObjectPredicate(List.of(new SysONReadOnlyObjectPredicateDelegate(new SysONResourceService())), new DefaultReadOnlyObjectPredicate())); + new ComposedReadOnlyObjectPredicate(List.of(new SysONReadOnlyObjectPredicateDelegate()), new DefaultReadOnlyObjectPredicate())); } @Test @@ -95,6 +96,20 @@ public void isReadOnlyElementInImportedLibrary() { namespace.getOwnedRelationship().add(owningMembership); owningMembership.getOwnedRelatedElement().add(libraryPackage); ElementUtil.setIsImported(resource, true); + assertThat(this.detailsViewService.isReadOnly(libraryPackage)).isFalse(); + } + + @Test + public void isReadOnlyElementInImportedLibraryFlaggedAsReadOnly() { + Resource resource = new JSONResourceFactory().createResourceFromPath("testResource"); + Namespace namespace = SysmlFactory.eINSTANCE.createNamespace(); + resource.getContents().add(namespace); + LibraryPackage libraryPackage = SysmlFactory.eINSTANCE.createLibraryPackage(); + OwningMembership owningMembership = SysmlFactory.eINSTANCE.createOwningMembership(); + namespace.getOwnedRelationship().add(owningMembership); + owningMembership.getOwnedRelatedElement().add(libraryPackage); + ElementUtil.setIsImported(resource, true); + resource.eAdapters().add(new ResourceMetadataAdapter("test", true)); assertThat(this.detailsViewService.isReadOnly(libraryPackage)).isTrue(); } diff --git a/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegateTests.java b/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegateTests.java index ae79d872a..7822b9758 100644 --- a/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegateTests.java +++ b/backend/application/syson-application-configuration/src/test/java/org/eclipse/syson/application/services/SysONReadOnlyObjectPredicateDelegateTests.java @@ -26,6 +26,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.sirius.components.core.api.IReadOnlyObjectPredicateDelegate; import org.eclipse.sirius.components.core.services.ComposedReadOnlyObjectPredicate; +import org.eclipse.sirius.components.emf.ResourceMetadataAdapter; import org.eclipse.sirius.components.emf.services.api.IEMFEditingContext; import org.eclipse.sirius.web.application.library.services.LibraryMetadataAdapter; import org.eclipse.syson.application.configuration.SysONDefaultLibrariesConfiguration; @@ -57,7 +58,7 @@ */ public class SysONReadOnlyObjectPredicateDelegateTests { - private final IReadOnlyObjectPredicateDelegate readOnlyObjectPredicateDelegate = new SysONReadOnlyObjectPredicateDelegate(new SysONResourceService()); + private final IReadOnlyObjectPredicateDelegate readOnlyObjectPredicateDelegate = new SysONReadOnlyObjectPredicateDelegate(); @SafeVarargs private static Resource createResource(final URI uri, final Consumer... postTreatments) { @@ -282,6 +283,8 @@ public class ImportedResources { private final Resource importedResourceWithSysmlLibraryPackage; + private final Resource importedResourceWithSysmlLibraryPackageAndFlaggedAsReadOnly; + private final Resource importedResourceWithSysmlMixedPackages; public ImportedResources() { @@ -295,6 +298,13 @@ public ImportedResources() { ElementUtil.setIsImported(resource, true); }); + this.importedResourceWithSysmlLibraryPackageAndFlaggedAsReadOnly = createResource(createEmfUri(), resource -> { + resource.getContents().addAll(EcoreUtil.copyAll(SysMLResources.this.resourceWithSysmlLibraryPackage.getContents())); + ElementUtil.setIsImported(resource, true); + ResourceMetadataAdapter resourceMetadataAdapter = new ResourceMetadataAdapter("test", true); + resource.eAdapters().add(resourceMetadataAdapter); + }); + this.importedResourceWithSysmlMixedPackages = createResource(createEmfUri(), resource -> { resource.getContents().addAll(EcoreUtil.copyAll(SysMLResources.this.resourceWithSysmlMixedPackages.getContents())); ElementUtil.setIsImported(resource, true); @@ -308,15 +318,21 @@ public void testResourceWithSysmlPackageImported() { } @Test - @DisplayName("Imported resource containing LibraryPackage is read-only (both the resource and all of its contents)") + @DisplayName("Imported resource containing LibraryPackage is not read-only (both the resource and all of its contents)") public void testResourceWithSysmlLibraryPackageImported() { - SysONReadOnlyObjectPredicateDelegateTests.this.assertResourceAndAllContentsIsReadOnly(this.importedResourceWithSysmlLibraryPackage, true); + SysONReadOnlyObjectPredicateDelegateTests.this.assertResourceAndAllContentsIsReadOnly(this.importedResourceWithSysmlLibraryPackage, false); + } + + @Test + @DisplayName("Imported resource containing LibraryPackage and flagged as read-only is read-only (both the resource and all of its contents)") + public void testResourceWithSysmlLibraryPackageImportedAndFlaggedAsReadOnly() { + SysONReadOnlyObjectPredicateDelegateTests.this.assertResourceAndAllContentsIsReadOnly(this.importedResourceWithSysmlLibraryPackageAndFlaggedAsReadOnly, true); } @Test - @DisplayName("Imported resource containing Package and LibraryPackage is read-only (both the resource and all of its contents)") + @DisplayName("Imported resource containing Package and LibraryPackage is not read-only (both the resource and all of its contents)") public void testResourceWithSysmlMixedPackagesImported() { - SysONReadOnlyObjectPredicateDelegateTests.this.assertResourceAndAllContentsIsReadOnly(this.importedResourceWithSysmlMixedPackages, true); + SysONReadOnlyObjectPredicateDelegateTests.this.assertResourceAndAllContentsIsReadOnly(this.importedResourceWithSysmlMixedPackages, false); } } @@ -339,26 +355,26 @@ public class ReferencedResources { public ReferencedResources() { this.referencedResourceWithSysmlPackage = createResource(createEmfUri(), resource -> { resource.getContents().addAll(EcoreUtil.copyAll(SysMLResources.this.resourceWithSysmlPackage.getContents())); - }, resource -> resource.eAdapters().add(createLibraryMetadataAdapter())); + }, ReferencedResources::addReferencedResourceAdapters); this.referencedResourceWithSysmlLibraryPackage = createResource(createEmfUri(), resource -> { resource.getContents().addAll(EcoreUtil.copyAll(SysMLResources.this.resourceWithSysmlLibraryPackage.getContents())); - }, resource -> resource.eAdapters().add(createLibraryMetadataAdapter())); + }, ReferencedResources::addReferencedResourceAdapters); this.referencedResourceWithSysmlMixedPackages = createResource(createEmfUri(), resource -> { resource.getContents().addAll(EcoreUtil.copyAll(SysMLResources.this.resourceWithSysmlMixedPackages.getContents())); - }, resource -> resource.eAdapters().add(createLibraryMetadataAdapter())); + }, ReferencedResources::addReferencedResourceAdapters); } - private static LibraryMetadataAdapter createLibraryMetadataAdapter() { - return new LibraryMetadataAdapter("namespace", "name", "version"); + private static void addReferencedResourceAdapters(Resource resource) { + resource.eAdapters().add(new LibraryMetadataAdapter("namespace", "name", "version")); + resource.eAdapters().add(new ResourceMetadataAdapter("test", true)); } @Test @DisplayName("Resource from referenced library containing Package is read-only (both the resource and all of its contents)") public void testResourceWithSysmlPackageImported() { - // Note that this might be a bug, see https://github.com/eclipse-syson/syson/issues/1342. - SysONReadOnlyObjectPredicateDelegateTests.this.assertResourceAndAllContentsIsReadOnly(this.referencedResourceWithSysmlPackage, false); + SysONReadOnlyObjectPredicateDelegateTests.this.assertResourceAndAllContentsIsReadOnly(this.referencedResourceWithSysmlPackage, true); } @Test diff --git a/backend/application/syson-application/pom.xml b/backend/application/syson-application/pom.xml index c59147278..a4049d27a 100644 --- a/backend/application/syson-application/pom.xml +++ b/backend/application/syson-application/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-application - 2025.8.5 + 2025.8.8 syson-application SysON Application @@ -82,62 +82,62 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-frontend - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-application-configuration - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-rest-api-services - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-diagram-common-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-standard-diagrams-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-table-requirements-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-tree-explorer-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-import - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-export - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-validation - 2025.8.5 + 2025.8.8 @@ -194,7 +194,7 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 test-jar test diff --git a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java index a23d0453a..be41a4d73 100644 --- a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java +++ b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controller/explorer/view/SysONExplorerTests.java @@ -236,6 +236,52 @@ public void getExplorerContentWithDefaultFilters() { } + @DisplayName("GIVEN an empty SysML Project, WHEN the explorer is displayed with KerML and SysML libraries expanded, THEN the library models are visible") + @Sql(scripts = { GeneralViewEmptyTestProjectData.SCRIPT_PATH }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) + @Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) + @Test + public void getExplorerContentWithKerMLAndSysMLExpanded() { + String librariesTreeItemId = UUID.nameUUIDFromBytes("SysON_Libraries_Directory".getBytes()).toString(); + String sysmlLibrariesTreeItemId = UUID.nameUUIDFromBytes("SysON_SysML_Directory".getBytes()).toString(); + String kermlLibrariesTreeItemId = UUID.nameUUIDFromBytes("SysON_KerML_Directory".getBytes()).toString(); + var explorerRepresentationId = this.representationIdBuilder.buildExplorerRepresentationId(this.treeDescriptionId, + List.of(librariesTreeItemId, sysmlLibrariesTreeItemId, kermlLibrariesTreeItemId), this.defaultFilters); + var input = new ExplorerEventInput(UUID.randomUUID(), GeneralViewEmptyTestProjectData.EDITING_CONTEXT, explorerRepresentationId); + var flux = this.explorerEventSubscriptionRunner.run(input); + this.givenCommittedTransaction.commit(); + + var initialExplorerContentConsumer = assertRefreshedTreeThat(tree -> { + assertThat(tree).isNotNull(); + assertThat(tree.getChildren()).hasSize(2); + TreeItem librariesDirectory = tree.getChildren().get(1); + assertThat(librariesDirectory.getLabel().toString()).isEqualTo("Libraries"); + assertThat(librariesDirectory.isDeletable()).isFalse(); + assertThat(librariesDirectory.isEditable()).isFalse(); + assertThat(librariesDirectory.isSelectable()).isTrue(); + assertThat(librariesDirectory.isHasChildren()).isTrue(); + assertThat(librariesDirectory.getChildren()).hasSize(2); + TreeItem kermlDirectory = librariesDirectory.getChildren().get(0); + assertThat(kermlDirectory.getLabel().toString()).isEqualTo("KerML"); + assertThat(kermlDirectory.isDeletable()).isFalse(); + assertThat(kermlDirectory.isEditable()).isFalse(); + assertThat(kermlDirectory.isSelectable()).isTrue(); + assertThat(kermlDirectory.isHasChildren()).isTrue(); + assertThat(kermlDirectory.getChildren()).allMatch(children -> !children.isDeletable() && !children.isEditable()); + TreeItem sysmlDirectory = librariesDirectory.getChildren().get(1); + assertThat(sysmlDirectory.getLabel().toString()).isEqualTo("SysML"); + assertThat(sysmlDirectory.isDeletable()).isFalse(); + assertThat(sysmlDirectory.isEditable()).isFalse(); + assertThat(sysmlDirectory.isSelectable()).isTrue(); + assertThat(sysmlDirectory.isHasChildren()).isTrue(); + assertThat(sysmlDirectory.getChildren()).allMatch(children -> !children.isDeletable() && !children.isEditable()); + }); + + StepVerifier.create(flux) + .consumeNextWith(initialExplorerContentConsumer) + .thenCancel() + .verify(Duration.ofSeconds(10)); + } + @DisplayName("GIVEN an empty SysML Project, WHEN the explorer is displayed with its root model expanded and the hide memberships and hide KerML libraries filters, THEN the root model is visible and is expanded") @Sql(scripts = { GeneralViewEmptyTestProjectData.SCRIPT_PATH }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) @Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) diff --git a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/explorer/view/ExplorerViewControllerIntegrationTests.java b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/explorer/view/ExplorerViewControllerIntegrationTests.java new file mode 100644 index 000000000..7c12f32de --- /dev/null +++ b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/controllers/explorer/view/ExplorerViewControllerIntegrationTests.java @@ -0,0 +1,182 @@ +/******************************************************************************* + * Copyright (c) 2025 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.syson.application.controllers.explorer.view; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.eclipse.sirius.components.trees.tests.TreeEventPayloadConsumer.assertRefreshedTreeThat; + +import com.jayway.jsonpath.JsonPath; + +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.sirius.components.core.api.IEditingContextSearchService; +import org.eclipse.sirius.components.core.api.IIdentityService; +import org.eclipse.sirius.components.emf.services.api.IEMFEditingContext; +import org.eclipse.sirius.components.trees.Tree; +import org.eclipse.sirius.components.trees.TreeItem; +import org.eclipse.sirius.components.trees.tests.graphql.InitialDirectEditTreeItemLabelQueryRunner; +import org.eclipse.sirius.web.application.views.explorer.ExplorerEventInput; +import org.eclipse.sirius.web.tests.services.api.IGivenInitialServerState; +import org.eclipse.sirius.web.tests.services.explorer.ExplorerEventSubscriptionRunner; +import org.eclipse.sirius.web.tests.services.representation.RepresentationIdBuilder; +import org.eclipse.syson.AbstractIntegrationTests; +import org.eclipse.syson.application.data.ExplorerViewDirectEditTestProjectData; +import org.eclipse.syson.tree.explorer.view.SysONTreeViewDescriptionProvider; +import org.eclipse.syson.tree.explorer.view.filters.SysONTreeFilterProvider; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.jdbc.Sql; +import org.springframework.test.context.jdbc.SqlConfig; +import org.springframework.transaction.annotation.Transactional; + +import reactor.test.StepVerifier; + +/** + * Integration tests of the Explorer view. + * + * @author arichard + */ +@Transactional +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +public class ExplorerViewControllerIntegrationTests extends AbstractIntegrationTests { + + /** + * Record used to contain both a way to find a tree item and some predicate to validate on said tree item in order + * to simplify the design of some advanced tests. + * + * @author arichard + */ + private record TreeItemMatcher(Function treeItemFinder, Predicate treeItemPredicate) { + } + + private final TreeItemMatcher view1GV = new TreeItemMatcher( + tree -> tree.getChildren().get(0).getChildren().get(0).getChildren().get(2), + treeItem -> treeItem.getLabel().toString().equals("view1 [GeneralView]")); + + private final TreeItemMatcher view2AFV = new TreeItemMatcher( + tree -> tree.getChildren().get(0).getChildren().get(0).getChildren().get(3), + treeItem -> treeItem.getLabel().toString().equals("view2 [ActionFlowView]")); + + private final TreeItemMatcher view3STV = new TreeItemMatcher( + tree -> tree.getChildren().get(0).getChildren().get(0).getChildren().get(4), + treeItem -> treeItem.getLabel().toString().equals("view3 [StateTransitionView]")); + + private final TreeItemMatcher view4IV = new TreeItemMatcher( + tree -> tree.getChildren().get(0).getChildren().get(0).getChildren().get(1).getChildren().get(1), + treeItem -> treeItem.getLabel().toString().equals("view4 [InterconnectionView]")); + + @Autowired + private IGivenInitialServerState givenInitialServerState; + + @Autowired + private IEditingContextSearchService editingContextSearchService; + + @Autowired + private IIdentityService identityService; + + @Autowired + private ExplorerEventSubscriptionRunner treeEventSubscriptionRunner; + + @Autowired + private InitialDirectEditTreeItemLabelQueryRunner initialDirectEditTreeItemLabelQueryRunner; + + @Autowired + private RepresentationIdBuilder representationIdBuilder; + + @Autowired + private SysONTreeViewDescriptionProvider sysONTreeViewDescriptionProvider; + + @BeforeEach + public void beforeEach() { + this.givenInitialServerState.initialize(); + } + + @DisplayName("GIVEN the SysON Explorer View, WHEN we direct edit a ViewUsage typed with a standard diagram, THEN the type of ViewUsage is not part of the initial value of the direct edit") + @Sql(scripts = { ExplorerViewDirectEditTestProjectData.SCRIPT_PATH }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, + config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) + @Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) + @Test + public void testDirectEditOnViewUsage() { + var expandedIds = this.getAllTreeItemIds(); + var activatedFilters = List.of(SysONTreeFilterProvider.HIDE_ROOT_NAMESPACES_ID, SysONTreeFilterProvider.HIDE_MEMBERSHIPS_TREE_ITEM_FILTER_ID); + var treeRepresentationId = this.representationIdBuilder.buildExplorerRepresentationId(this.sysONTreeViewDescriptionProvider.getDescriptionId(), expandedIds, activatedFilters); + + var treeEventInput = new ExplorerEventInput(UUID.randomUUID(), ExplorerViewDirectEditTestProjectData.EDITING_CONTEXT_ID, treeRepresentationId); + var treeFlux = this.treeEventSubscriptionRunner.run(treeEventInput); + + var hasProjectContent = this.getTreeRefreshedEventPayloadMatcher(List.of(this.view1GV, this.view2AFV, this.view3STV, this.view4IV)); + + StepVerifier.create(treeFlux) + .consumeNextWith(hasProjectContent) + .then(this.triggerDirectEditTreeItemLabel(ExplorerViewDirectEditTestProjectData.EDITING_CONTEXT_ID, treeRepresentationId, UUID.fromString(ExplorerViewDirectEditTestProjectData.SemanticIds.VIEW_1_GV_ID), "view1")) + .then(this.triggerDirectEditTreeItemLabel(ExplorerViewDirectEditTestProjectData.EDITING_CONTEXT_ID, treeRepresentationId, + UUID.fromString(ExplorerViewDirectEditTestProjectData.SemanticIds.VIEW_2_AFV_ID), "view2")) + .then(this.triggerDirectEditTreeItemLabel(ExplorerViewDirectEditTestProjectData.EDITING_CONTEXT_ID, treeRepresentationId, + UUID.fromString(ExplorerViewDirectEditTestProjectData.SemanticIds.VIEW_3_STV_ID), "view3")) + .then(this.triggerDirectEditTreeItemLabel(ExplorerViewDirectEditTestProjectData.EDITING_CONTEXT_ID, treeRepresentationId, + UUID.fromString(ExplorerViewDirectEditTestProjectData.SemanticIds.VIEW_4_IV_ID), "view4")) + .thenCancel() + .verify(Duration.ofSeconds(100)); + + } + + private List getAllTreeItemIds() { + var optionalEditingContext = this.editingContextSearchService.findById(ExplorerViewDirectEditTestProjectData.EDITING_CONTEXT_ID) + .filter(IEMFEditingContext.class::isInstance) + .map(IEMFEditingContext.class::cast); + assertThat(optionalEditingContext).isPresent(); + + var editingContext = optionalEditingContext.get(); + var expandedIds = new ArrayList(); + editingContext.getDomain().getResourceSet().getAllContents().forEachRemaining(notifier -> { + if (notifier instanceof Resource || notifier instanceof EObject) { + expandedIds.add(this.identityService.getId(notifier)); + } + }); + return expandedIds; + } + + private Consumer getTreeRefreshedEventPayloadMatcher(List treeItemMatchers) { + return assertRefreshedTreeThat(tree -> { + assertThat(treeItemMatchers).allMatch(treeItemMatcher -> { + var treeItem = treeItemMatcher.treeItemFinder.apply(tree); + return treeItemMatcher.treeItemPredicate.test(treeItem); + }); + }); + } + + private Runnable triggerDirectEditTreeItemLabel(String editingContextId, String treeId, UUID treeItemId, String expectedLabel) { + return () -> { + Map variables = Map.of( + "editingContextId", editingContextId, + "representationId", treeId, + "treeItemId", treeItemId); + var result = this.initialDirectEditTreeItemLabelQueryRunner.run(variables); + + String initialDirectEditLabel = JsonPath.read(result, "$.data.viewer.editingContext.representation.description.initialDirectEditTreeItemLabel"); + assertThat(initialDirectEditLabel).isEqualTo(expectedLabel); + }; + } +} diff --git a/backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/ExplorerViewDirectEditTestProjectData.java b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/ExplorerViewDirectEditTestProjectData.java new file mode 100644 index 000000000..f9062e390 --- /dev/null +++ b/backend/application/syson-application/src/test/java/org/eclipse/syson/application/data/ExplorerViewDirectEditTestProjectData.java @@ -0,0 +1,61 @@ +/******************************************************************************* + * Copyright (c) 2025 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.syson.application.data; + +/** + * Identifiers for the "ExplorerView-DirectEdit" project. + * + * @author Arthur Daussy + */ +public class ExplorerViewDirectEditTestProjectData { + + public static final String SCRIPT_PATH = "/scripts/database-content/ExplorerView-DirectEdit.sql"; + + public static final String PROJECT_NAME = "ExplorerView-DirectEdit"; + + public static final String EDITING_CONTEXT_ID = "4b5adc0c-90a2-48c6-9ae7-c3fc035ff38b"; + + public static final String PROJECT_ID = "a427f187-9003-498c-9178-72e8350cc67c"; + + public static final String DOCUMENT_ID = "9a59f836-1df2-4e5d-803c-9eb0ba7031aa"; + + /** + * Ids of graphical elements. + */ + public static class GraphicalIds { + + } + + /** + * Ids for the semantic elements. + */ + public static final class SemanticIds { + + public static final String PACKAGE_1_ID = "127c38e7-0e15-4232-aa02-76b342e3324a"; + + public static final String PART_DEF_ID = "0a70220d-707e-4a88-84dc-6aa43aa97269"; + + public static final String PART_ID = "a4f51a38-bfeb-4e0d-a870-55f8fe90405e"; + + public static final String PACKAGE2_ID = "ec12f223-8639-42a3-96c2-34163c6eccce"; + + public static final String VIEW_1_GV_ID = "17df78b1-ad06-4861-827e-c1cf15eed2a5"; + + public static final String VIEW_2_AFV_ID = "c7a3fc13-d643-469c-a0ad-5939869a2bee"; + + public static final String VIEW_3_STV_ID = "cca0616d-49d3-4311-a390-2511576cf759"; + + public static final String VIEW_4_IV_ID = "c3b15305-e5fb-44a9-96a1-4e0245fc4f2c"; + } + +} diff --git a/backend/application/syson-application/src/test/java/org/eclipse/syson/services/SysMLReadOnlyServiceTest.java b/backend/application/syson-application/src/test/java/org/eclipse/syson/services/SysMLReadOnlyServiceTest.java deleted file mode 100644 index 0c14d45a4..000000000 --- a/backend/application/syson-application/src/test/java/org/eclipse/syson/services/SysMLReadOnlyServiceTest.java +++ /dev/null @@ -1,103 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2025 Obeo. - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Obeo - initial API and implementation - *******************************************************************************/ -package org.eclipse.syson.services; - -import static org.assertj.core.api.Assertions.assertThat; - -import java.util.List; -import java.util.Optional; - -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.sirius.components.core.api.IEditingContext; -import org.eclipse.sirius.components.core.api.IEditingContextSearchService; -import org.eclipse.sirius.components.emf.services.JSONResourceFactory; -import org.eclipse.sirius.components.emf.services.api.IEMFEditingContext; -import org.eclipse.sirius.web.tests.services.api.IGivenCommittedTransaction; -import org.eclipse.sirius.web.tests.services.api.IGivenInitialServerState; -import org.eclipse.syson.AbstractIntegrationTests; -import org.eclipse.syson.application.data.SimpleProjectElementsTestProjectData; -import org.eclipse.syson.services.api.ISysMLReadOnlyService; -import org.eclipse.syson.sysml.Element; -import org.eclipse.syson.sysml.helper.EMFUtils; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.test.context.jdbc.Sql; -import org.springframework.test.context.jdbc.SqlConfig; -import org.springframework.transaction.annotation.Transactional; - -/** - * Integration test for {@link ISysMLReadOnlyService}. - * - * @author Arthur Daussy - */ -@Transactional -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class SysMLReadOnlyServiceTest extends AbstractIntegrationTests { - - @Autowired - private IGivenInitialServerState givenInitialServerState; - - @Autowired - private IGivenCommittedTransaction givenCommittedTransaction; - - @Autowired - private ISysMLReadOnlyService readOnlyService; - - @Autowired - private IEditingContextSearchService editingContextSearchService; - - @BeforeEach - public void beforeEach() { - this.givenInitialServerState.initialize(); - } - - @DisplayName("GIVEN a simple SysML project, WHEN we ask if an element is read only, THEN elements stored in standard libraries should be read-only whereas elements stored in other resources should be considered as editable") - @Sql(scripts = { SimpleProjectElementsTestProjectData.SCRIPT_PATH }, executionPhase = Sql.ExecutionPhase.BEFORE_TEST_METHOD, - config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) - @Sql(scripts = { "/scripts/cleanup.sql" }, executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD, config = @SqlConfig(transactionMode = SqlConfig.TransactionMode.ISOLATED)) - @Test - public void checkEditableElements() { - - this.givenCommittedTransaction.commit(); - - Optional ed = this.editingContextSearchService.findById(SimpleProjectElementsTestProjectData.EDITING_CONTEXT_ID); - - assertThat(ed).isPresent(); - - URI mainResourceURI = new JSONResourceFactory().createResourceURI(SimpleProjectElementsTestProjectData.DOCUMENT_ID); - - for (Resource r : ((IEMFEditingContext) ed.get()).getDomain().getResourceSet().getResources()) { - boolean expectedReadOnly = !mainResourceURI.equals(r.getURI()); - final String message = this.buildErrorMessage(expectedReadOnly); - List elements = EMFUtils.allContainedObjectOfType(r, Element.class).toList(); - for (Element element : elements) { - assertThat(this.readOnlyService.isReadOnly(element)).as(message, element.getElementId(), r.getURI()).isEqualTo(expectedReadOnly); - } - } - } - - private String buildErrorMessage(boolean expectedReadOnly) { - final String message; - if (expectedReadOnly) { - message = "Expecting %s in %s to %s to be read only"; - } else { - message = "Expecting %s in %s to %s to be editable"; - } - return message; - } - -} diff --git a/backend/application/syson-application/src/test/resources/scripts/database-content/ExplorerView-DirectEdit.sql b/backend/application/syson-application/src/test/resources/scripts/database-content/ExplorerView-DirectEdit.sql new file mode 100644 index 000000000..e74d4361c --- /dev/null +++ b/backend/application/syson-application/src/test/resources/scripts/database-content/ExplorerView-DirectEdit.sql @@ -0,0 +1,98 @@ +-- +-- PostgreSQL database dump +-- + +-- Dumped from database version 17.5 (Debian 17.5-1.pgdg120+1) +-- Dumped by pg_dump version 17.6 + +SET statement_timeout = 0; +SET lock_timeout = 0; +SET idle_in_transaction_session_timeout = 0; +SET client_encoding = 'UTF8'; +SET standard_conforming_strings = on; +SET check_function_bodies = false; +SET xmloption = content; +SET client_min_messages = warning; +SET row_security = off; + +-- +-- Data for Name: semantic_data; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + +INSERT INTO public.semantic_data (id, created_on, last_modified_on) VALUES ('4b5adc0c-90a2-48c6-9ae7-c3fc035ff38b', '2024-11-05 13:55:21.094331+00', '2025-09-25 12:24:39.579767+00'); + + +-- +-- Data for Name: document; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + +INSERT INTO public.document (id, semantic_data_id, name, content, created_on, last_modified_on, is_read_only) VALUES ('9a59f836-1df2-4e5d-803c-9eb0ba7031aa', '4b5adc0c-90a2-48c6-9ae7-c3fc035ff38b', 'SysMLv2.sysml', '{"json":{"version":"1.0","encoding":"utf-8"},"ns":{"sysml":"http://www.eclipse.org/syson/sysml"},"migration":{"lastMigrationPerformed":"OneDiagramDescriptionMigrationParticipant$$SpringCGLIB$$0","migrationVersion":"2025.8.0-202508220000"},"content":[{"id":"686dee81-b94c-4393-b15b-65dd73dfdd24","eClass":"sysml:Namespace","data":{"elementId":"bea38691-2169-4b70-87ac-ffa289824fde","ownedRelationship":[{"id":"e3c74bf2-55ba-4b0d-a4f5-9ab326f372c4","eClass":"sysml:OwningMembership","data":{"elementId":"a6fce401-4aaf-47c8-88a6-d75462e3c6db","ownedRelatedElement":[{"id":"127c38e7-0e15-4232-aa02-76b342e3324a","eClass":"sysml:Package","data":{"declaredName":"Package1","elementId":"d51791b8-6666-46e3-8c60-c975e1f3e490","ownedRelationship":[{"id":"0642ab55-a317-40c1-aa52-cc16306d937b","eClass":"sysml:NamespaceImport","data":{"elementId":"9f902e4a-4ca9-4787-92d8-713b3b06c490","importedNamespace":"ec12f223-8639-42a3-96c2-34163c6eccce"}},{"id":"883deb19-59a8-4c58-8887-978bf11fffcd","eClass":"sysml:OwningMembership","data":{"elementId":"be359545-8e91-439c-8bdf-0638ab702f9d","ownedRelatedElement":[{"id":"a4f51a38-bfeb-4e0d-a870-55f8fe90405e","eClass":"sysml:PartUsage","data":{"declaredName":"p","elementId":"d99634bb-d4e0-4afa-bbe4-ee553005937d","ownedRelationship":[{"id":"1ba5c6e8-1c6b-44f6-8a05-f82f2c7a2538","eClass":"sysml:FeatureTyping","data":{"elementId":"9bfede6e-a370-451e-aa33-c1102942dcb7","type":"0a70220d-707e-4a88-84dc-6aa43aa97269","typedFeature":"a4f51a38-bfeb-4e0d-a870-55f8fe90405e"}},{"id":"d0af8b7c-1a69-4817-be08-13fd7379fd81","eClass":"sysml:FeatureMembership","data":{"elementId":"9700175b-699c-4201-bfbd-8ce3d90cbc5f","ownedRelatedElement":[{"id":"c3b15305-e5fb-44a9-96a1-4e0245fc4f2c","eClass":"sysml:ViewUsage","data":{"declaredName":"view4","elementId":"bdedde81-86db-4f74-887b-20af07833c25","ownedRelationship":[{"id":"395ef21e-36d7-4d9a-9586-99a631fcedf0","eClass":"sysml:FeatureTyping","data":{"elementId":"edb72ff4-e724-4387-9dd6-7b3e7095607e","type":"sysml:ViewDefinition sysmllibrary:///faf517ae-dbcd-30a4-b3b9-3d9cb3bbf5c1#6518462a-2f51-5276-b95e-69ee5193db38","typedFeature":"c3b15305-e5fb-44a9-96a1-4e0245fc4f2c"}}]}}]}}],"isComposite":true}}]}},{"id":"a5e72c79-5496-4770-a4c7-296a56f47617","eClass":"sysml:OwningMembership","data":{"elementId":"4e21e33f-7920-49fe-8889-b4fab257dc78","ownedRelatedElement":[{"id":"17df78b1-ad06-4861-827e-c1cf15eed2a5","eClass":"sysml:ViewUsage","data":{"declaredName":"view1","elementId":"0a0c297f-a58b-4ef8-a4f6-8d0ff197b238","ownedRelationship":[{"id":"60d64858-90b3-44ed-af19-b966d72a8a8b","eClass":"sysml:FeatureTyping","data":{"elementId":"da3ad6ee-3e58-4ed4-a41a-88f7b3d1dbfa","type":"sysml:ViewDefinition sysmllibrary:///faf517ae-dbcd-30a4-b3b9-3d9cb3bbf5c1#03904fdf-d6f2-57b1-92d5-95d36b8208dc","typedFeature":"17df78b1-ad06-4861-827e-c1cf15eed2a5"}}],"isComposite":true}}]}},{"id":"28feab55-0a2d-4d69-85d5-29fe3b069b71","eClass":"sysml:OwningMembership","data":{"elementId":"41ccfd33-8013-4684-82b5-f279decaad1b","ownedRelatedElement":[{"id":"c7a3fc13-d643-469c-a0ad-5939869a2bee","eClass":"sysml:ViewUsage","data":{"declaredName":"view2","elementId":"dd76563a-251d-4c3e-a4bf-108304672629","ownedRelationship":[{"id":"ed5facc4-54a7-41f9-b4ec-6f08fc4061b5","eClass":"sysml:FeatureTyping","data":{"elementId":"c2d81d09-5098-4775-bb74-b746a70fe510","type":"sysml:ViewDefinition sysmllibrary:///faf517ae-dbcd-30a4-b3b9-3d9cb3bbf5c1#e1e8729f-a571-520c-b3f8-1b8dcdf5014d","typedFeature":"c7a3fc13-d643-469c-a0ad-5939869a2bee"}}]}}]}},{"id":"505066be-cc52-4edb-a1df-17a29242e4be","eClass":"sysml:OwningMembership","data":{"elementId":"c20baa6f-ffc6-4178-8dc1-e074b9e68782","ownedRelatedElement":[{"id":"cca0616d-49d3-4311-a390-2511576cf759","eClass":"sysml:ViewUsage","data":{"declaredName":"view3","elementId":"c691780a-a8a9-4444-acba-d33cfd628b73","ownedRelationship":[{"id":"82cc5a01-8b63-4e60-a7b1-df7631d00e22","eClass":"sysml:FeatureTyping","data":{"elementId":"5fa23d7d-50a7-407a-a631-f800ad514d8c","type":"sysml:ViewDefinition sysmllibrary:///faf517ae-dbcd-30a4-b3b9-3d9cb3bbf5c1#073ba87b-4f0a-5a2e-8ce5-71f9dc645098","typedFeature":"cca0616d-49d3-4311-a390-2511576cf759"}}]}}]}}]}}]}},{"id":"13001db6-0353-48ba-8bec-157bbd9a3b57","eClass":"sysml:OwningMembership","data":{"elementId":"cd1165da-f4a1-4962-90f6-d117e8c7a354","ownedRelatedElement":[{"id":"ec12f223-8639-42a3-96c2-34163c6eccce","eClass":"sysml:Package","data":{"declaredName":"Package2","elementId":"40c37406-f22d-4424-981f-99935f039244","ownedRelationship":[{"id":"bbe9c050-d108-4807-8c62-7d20c31817f6","eClass":"sysml:OwningMembership","data":{"elementId":"c0c5cec5-6606-4145-98c7-eef80964e95a","ownedRelatedElement":[{"id":"0a70220d-707e-4a88-84dc-6aa43aa97269","eClass":"sysml:PartDefinition","data":{"declaredName":"PartDefX","elementId":"47acdb65-63f9-4bd5-8675-e2596241dc2c"}}]}}]}}]}}]}}]}', '2025-09-25 12:24:39.579761+00', '2025-09-25 12:24:39.579761+00', false); + + +-- +-- Data for Name: image; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + + + +-- +-- Data for Name: library; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + + + +-- +-- Data for Name: project; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + +INSERT INTO public.project (id, name, created_on, last_modified_on) VALUES ('a427f187-9003-498c-9178-72e8350cc67c', 'ExplorerView-DirectEdit', '2024-11-05 13:55:20.956951+00', '2025-09-25 12:28:42.525205+00'); + + +-- +-- Data for Name: nature; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + + + +-- +-- Data for Name: project_image; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + + + +-- +-- Data for Name: project_semantic_data; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + +INSERT INTO public.project_semantic_data (id, project_id, semantic_data_id, name, created_on, last_modified_on) VALUES ('1c18ce38-862f-46a1-ad5d-0433cff8a7ab', 'a427f187-9003-498c-9178-72e8350cc67c', '4b5adc0c-90a2-48c6-9ae7-c3fc035ff38b', 'main', '2024-11-05 13:55:21.094331+00', '2024-11-05 13:57:15.80357+00'); + + +-- +-- Data for Name: representation_metadata; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + + + +-- +-- Data for Name: representation_content; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + + + +-- +-- Data for Name: semantic_data_dependency; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + + + +-- +-- Data for Name: semantic_data_domain; Type: TABLE DATA; Schema: public; Owner: dbuser +-- + +INSERT INTO public.semantic_data_domain (semantic_data_id, uri) VALUES ('4b5adc0c-90a2-48c6-9ae7-c3fc035ff38b', 'http://www.eclipse.org/syson/sysml'); + + +-- +-- PostgreSQL database dump complete +-- + diff --git a/backend/application/syson-frontend/pom.xml b/backend/application/syson-frontend/pom.xml index 0afed0d93..a5d9c9f2d 100644 --- a/backend/application/syson-frontend/pom.xml +++ b/backend/application/syson-frontend/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-frontend - 2025.8.5 + 2025.8.8 syson-frontend SysON Frontend diff --git a/backend/application/syson-sysml-export/pom.xml b/backend/application/syson-sysml-export/pom.xml index ae83d6550..dd5a7f83b 100644 --- a/backend/application/syson-sysml-export/pom.xml +++ b/backend/application/syson-sysml-export/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-sysml-export - 2025.8.5 + 2025.8.8 syson-sysml-export SysON SysML Export @@ -69,7 +69,7 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 @@ -85,14 +85,14 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 test-jar test diff --git a/backend/application/syson-sysml-import/pom.xml b/backend/application/syson-sysml-import/pom.xml index a785fee1a..344ac1e6a 100644 --- a/backend/application/syson-sysml-import/pom.xml +++ b/backend/application/syson-sysml-import/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-sysml-import - 2025.8.5 + 2025.8.8 syson-sysml-import SysON SysML Import @@ -65,12 +65,12 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 @@ -86,14 +86,14 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test org.eclipse.syson syson-application-configuration - 2025.8.5 + 2025.8.8 test diff --git a/backend/application/syson-sysml-validation/pom.xml b/backend/application/syson-sysml-validation/pom.xml index 903628e66..b319c1063 100644 --- a/backend/application/syson-sysml-validation/pom.xml +++ b/backend/application/syson-sysml-validation/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-sysml-validation - 2025.8.5 + 2025.8.8 syson-validation SysON SysMLv2 validation rules for Validation view @@ -69,17 +69,17 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 @@ -95,7 +95,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/metamodel/pom.xml b/backend/metamodel/pom.xml index 7f8b569c7..44c2a502d 100644 --- a/backend/metamodel/pom.xml +++ b/backend/metamodel/pom.xml @@ -17,7 +17,7 @@ org.eclipse.syson syson-metamodel-parent - 2025.8.5 + 2025.8.8 syson-metamodel-parent SysON Metamodel Parent diff --git a/backend/metamodel/syson-siriusweb-customnodes-metamodel-edit/pom.xml b/backend/metamodel/syson-siriusweb-customnodes-metamodel-edit/pom.xml index 49c6b47f0..07aafd310 100644 --- a/backend/metamodel/syson-siriusweb-customnodes-metamodel-edit/pom.xml +++ b/backend/metamodel/syson-siriusweb-customnodes-metamodel-edit/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-siriusweb-customnodes-metamodel-edit - 2025.8.5 + 2025.8.8 syson-siriusweb-customnodes-metamodel-edit SysON SysMLv2 Custom Nodes Metamodel - Edit Support @@ -70,7 +70,7 @@ org.eclipse.syson syson-siriusweb-customnodes-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.sirius diff --git a/backend/metamodel/syson-siriusweb-customnodes-metamodel/pom.xml b/backend/metamodel/syson-siriusweb-customnodes-metamodel/pom.xml index c4f57f6cc..525ce693b 100644 --- a/backend/metamodel/syson-siriusweb-customnodes-metamodel/pom.xml +++ b/backend/metamodel/syson-siriusweb-customnodes-metamodel/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-siriusweb-customnodes-metamodel - 2025.8.5 + 2025.8.8 syson-siriusweb-customnodes-metamodel SysON SysMLv2 Custom Nodes Metamodel for Sirius Web diff --git a/backend/metamodel/syson-sysml-metamodel-edit/pom.xml b/backend/metamodel/syson-sysml-metamodel-edit/pom.xml index 0adb186cd..95fedb1ba 100644 --- a/backend/metamodel/syson-sysml-metamodel-edit/pom.xml +++ b/backend/metamodel/syson-sysml-metamodel-edit/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-sysml-metamodel-edit - 2025.8.5 + 2025.8.8 syson-sysml-metamodel-edit SysON SysMLv2 Metamodel - Edit Support @@ -65,7 +65,7 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 diff --git a/backend/metamodel/syson-sysml-metamodel/pom.xml b/backend/metamodel/syson-sysml-metamodel/pom.xml index bfcec9124..3aa18934c 100644 --- a/backend/metamodel/syson-sysml-metamodel/pom.xml +++ b/backend/metamodel/syson-sysml-metamodel/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 syson-sysml-metamodel SysON SysMLv2 Metamodel diff --git a/backend/releng/pom.xml b/backend/releng/pom.xml index bf1c0d439..c4c6de6eb 100644 --- a/backend/releng/pom.xml +++ b/backend/releng/pom.xml @@ -17,7 +17,7 @@ org.eclipse.syson syson-releng-parent - 2025.8.5 + 2025.8.8 syson-releng-parent SysON Releng Parent diff --git a/backend/releng/syson-test-coverage/pom.xml b/backend/releng/syson-test-coverage/pom.xml index 8dbc66775..11804854c 100644 --- a/backend/releng/syson-test-coverage/pom.xml +++ b/backend/releng/syson-test-coverage/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-test-coverage - 2025.8.5 + 2025.8.8 syson-test-coverage-aggregation SysON Test Coverage Aggregation @@ -43,82 +43,82 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-direct-edit-grammar - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-rest-api-services - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-import - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-export - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-validation - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-diagram-common-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-standard-diagrams-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-table-requirements-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-tree-explorer-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-application-configuration - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-application - 2025.8.5 + 2025.8.8 diff --git a/backend/services/pom.xml b/backend/services/pom.xml index c734e85d8..20ff68dd4 100644 --- a/backend/services/pom.xml +++ b/backend/services/pom.xml @@ -17,7 +17,7 @@ org.eclipse.syson syson-services-parent - 2025.8.5 + 2025.8.8 syson-services-parent SysON Services Parent diff --git a/backend/services/syson-direct-edit-grammar/pom.xml b/backend/services/syson-direct-edit-grammar/pom.xml index bff8f93f6..9f6b7f6d4 100644 --- a/backend/services/syson-direct-edit-grammar/pom.xml +++ b/backend/services/syson-direct-edit-grammar/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-direct-edit-grammar - 2025.8.5 + 2025.8.8 syson-direct-edit-grammar SysON Direct Edit Grammar diff --git a/backend/services/syson-services/pom.xml b/backend/services/syson-services/pom.xml index 468191111..2425d6570 100644 --- a/backend/services/syson-services/pom.xml +++ b/backend/services/syson-services/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 syson-services SysON Services @@ -81,12 +81,12 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-direct-edit-grammar - 2025.8.5 + 2025.8.8 @@ -102,14 +102,14 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 test-jar test diff --git a/backend/services/syson-services/src/main/java/org/eclipse/syson/services/SysMLMoveElementService.java b/backend/services/syson-services/src/main/java/org/eclipse/syson/services/SysMLMoveElementService.java index 9545cc277..fd68462ca 100644 --- a/backend/services/syson-services/src/main/java/org/eclipse/syson/services/SysMLMoveElementService.java +++ b/backend/services/syson-services/src/main/java/org/eclipse/syson/services/SysMLMoveElementService.java @@ -15,8 +15,8 @@ import java.util.Objects; import org.eclipse.emf.ecore.EObject; +import org.eclipse.sirius.components.core.api.IReadOnlyObjectPredicate; import org.eclipse.syson.services.api.ISysMLMoveElementService; -import org.eclipse.syson.services.api.ISysMLReadOnlyService; import org.eclipse.syson.services.api.MoveStatus; import org.eclipse.syson.sysml.Element; import org.eclipse.syson.sysml.FeatureMembership; @@ -38,14 +38,14 @@ @Service public class SysMLMoveElementService implements ISysMLMoveElementService { - private final ISysMLReadOnlyService readOnlyService; + private final IReadOnlyObjectPredicate readOnlyObjectPredicate; private final DeleteService deleteService; private final UtilService utilService; - public SysMLMoveElementService(ISysMLReadOnlyService readOnlyService) { - this.readOnlyService = Objects.requireNonNull(readOnlyService); + public SysMLMoveElementService(IReadOnlyObjectPredicate readOnlyObjectPredicate) { + this.readOnlyObjectPredicate = Objects.requireNonNull(readOnlyObjectPredicate); this.deleteService = new DeleteService(); this.utilService = new UtilService(); } @@ -70,9 +70,9 @@ public MoveStatus moveSemanticElement(Element element, Element newParent) { moveStatus = MoveStatus.buildFailure("Unable to move an Element to one of its descendant"); } else if (newParent instanceof Membership) { moveStatus = MoveStatus.buildFailure("Membership can't be used as a target of a move"); - } else if (this.readOnlyService.isReadOnly(element)) { + } else if (this.readOnlyObjectPredicate.test(element)) { moveStatus = MoveStatus.buildFailure("Unable to move a read only Element"); - } else if (this.readOnlyService.isReadOnly(newParent)) { + } else if (this.readOnlyObjectPredicate.test(newParent)) { moveStatus = MoveStatus.buildFailure("Unable to move a Element to a read only Element"); } else { moveStatus = this.doMoveElement(element, newParent); diff --git a/backend/services/syson-services/src/main/java/org/eclipse/syson/services/SysMLReadOnlyService.java b/backend/services/syson-services/src/main/java/org/eclipse/syson/services/SysMLReadOnlyService.java deleted file mode 100644 index 6acc8d5ce..000000000 --- a/backend/services/syson-services/src/main/java/org/eclipse/syson/services/SysMLReadOnlyService.java +++ /dev/null @@ -1,56 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2025 Obeo. - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Obeo - initial API and implementation - *******************************************************************************/ -package org.eclipse.syson.services; - -import java.util.Objects; - -import org.eclipse.syson.services.api.ISysMLReadOnlyService; -import org.eclipse.syson.services.api.ISysONResourceService; -import org.eclipse.syson.sysml.Element; -import org.eclipse.syson.sysml.LibraryPackage; -import org.eclipse.syson.sysml.helper.EMFUtils; -import org.eclipse.syson.sysml.util.ElementUtil; -import org.springframework.stereotype.Service; - -/** - * Implementation of {@link ISysMLReadOnlyService}. - * - * @author Arthur Daussy - */ -@Service -public class SysMLReadOnlyService implements ISysMLReadOnlyService { - - private final ISysONResourceService sysONResourceService; - - public SysMLReadOnlyService(final ISysONResourceService sysONResourceService) { - this.sysONResourceService = Objects.requireNonNull(sysONResourceService); - } - - @Override - public boolean isReadOnly(Element element) { - return this.isStandardLibrary(element) || this.isReadOnlyLibraryElement(element); - } - - private boolean isStandardLibrary(Element element) { - if (element != null) { - return ElementUtil.isStandardLibraryResource(element.eResource()); - } - return false; - } - - private boolean isReadOnlyLibraryElement(Element element) { - return EMFUtils.getFirstAncestor(LibraryPackage.class, element, null) - .map(lib -> lib.isIsStandard() || this.sysONResourceService.isImported(lib.eResource())) - .orElse(false); - } -} diff --git a/backend/services/syson-services/src/main/java/org/eclipse/syson/services/api/ISysMLReadOnlyService.java b/backend/services/syson-services/src/main/java/org/eclipse/syson/services/api/ISysMLReadOnlyService.java deleted file mode 100644 index c0013a840..000000000 --- a/backend/services/syson-services/src/main/java/org/eclipse/syson/services/api/ISysMLReadOnlyService.java +++ /dev/null @@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2025 Obeo. - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Obeo - initial API and implementation - *******************************************************************************/ -package org.eclipse.syson.services.api; - -import org.eclipse.syson.sysml.Element; - -/** - * Check if an element is read only. - * - * @author Arthur Daussy - */ -public interface ISysMLReadOnlyService { - - /** - * Check if an element is read only. - * - * @param element - * an element to test - * @return true if the element is read only, false otherwise - */ - boolean isReadOnly(Element element); - -} diff --git a/backend/services/syson-sysml-rest-api-services/pom.xml b/backend/services/syson-sysml-rest-api-services/pom.xml index ed9f3e9e7..0e66ffe6a 100644 --- a/backend/services/syson-sysml-rest-api-services/pom.xml +++ b/backend/services/syson-sysml-rest-api-services/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-sysml-rest-api-services - 2025.8.5 + 2025.8.8 syson-sysml-rest-api-services SysON SysML REST API Services @@ -68,12 +68,12 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 @@ -89,7 +89,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/tests/pom.xml b/backend/tests/pom.xml index 7978a45bf..587ce2be8 100644 --- a/backend/tests/pom.xml +++ b/backend/tests/pom.xml @@ -17,7 +17,7 @@ org.eclipse.syson syson-tests-parent - 2025.8.5 + 2025.8.8 syson-tests-parent SysON Tests Parent diff --git a/backend/tests/syson-tests/pom.xml b/backend/tests/syson-tests/pom.xml index 59e76c47e..16337c10a 100644 --- a/backend/tests/syson-tests/pom.xml +++ b/backend/tests/syson-tests/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 syson-tests SysON Tests diff --git a/backend/views/pom.xml b/backend/views/pom.xml index 6850401ec..48f261eed 100644 --- a/backend/views/pom.xml +++ b/backend/views/pom.xml @@ -17,7 +17,7 @@ org.eclipse.syson syson-views-parent - 2025.8.5 + 2025.8.8 syson-views-parent SysON Views Parent diff --git a/backend/views/syson-common-view/pom.xml b/backend/views/syson-common-view/pom.xml index d3bb68c56..db4556b4d 100644 --- a/backend/views/syson-common-view/pom.xml +++ b/backend/views/syson-common-view/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-common-view - 2025.8.5 + 2025.8.8 syson-common-view SysON Sirius Web common elements for SysMLv2 views @@ -73,22 +73,22 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 @@ -104,7 +104,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/views/syson-diagram-common-view/pom.xml b/backend/views/syson-diagram-common-view/pom.xml index 08dc393fb..bb43cf788 100644 --- a/backend/views/syson-diagram-common-view/pom.xml +++ b/backend/views/syson-diagram-common-view/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-diagram-common-view - 2025.8.5 + 2025.8.8 syson-diagram-common-view SysON Sirius Web common elements for SysMLv2 diagrams @@ -73,22 +73,22 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 @@ -104,7 +104,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewCreateService.java b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewCreateService.java index a2f9c6726..027729ec8 100644 --- a/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewCreateService.java +++ b/backend/views/syson-diagram-common-view/src/main/java/org/eclipse/syson/diagram/common/view/services/ViewCreateService.java @@ -25,6 +25,7 @@ import org.eclipse.sirius.components.core.api.IEditingContext; import org.eclipse.sirius.components.core.api.IFeedbackMessageService; import org.eclipse.sirius.components.core.api.IObjectSearchService; +import org.eclipse.sirius.components.core.api.IReadOnlyObjectPredicate; import org.eclipse.sirius.components.diagrams.Diagram; import org.eclipse.sirius.components.diagrams.Node; import org.eclipse.sirius.components.representations.Message; @@ -32,7 +33,6 @@ import org.eclipse.syson.services.DeleteService; import org.eclipse.syson.services.ElementInitializerSwitch; import org.eclipse.syson.services.UtilService; -import org.eclipse.syson.services.api.ISysMLReadOnlyService; import org.eclipse.syson.sysml.AcceptActionUsage; import org.eclipse.syson.sysml.ActionDefinition; import org.eclipse.syson.sysml.ActionUsage; @@ -93,7 +93,7 @@ public class ViewCreateService { private final IObjectSearchService objectSearchService; - private final ISysMLReadOnlyService readOnlyService; + private final IReadOnlyObjectPredicate readOnlyObjectPredicate; private final ShowDiagramsInheritedMembersService showDiagramsInheritedMembersService; @@ -105,11 +105,11 @@ public class ViewCreateService { private final IFeedbackMessageService feedbackMessageService; - public ViewCreateService(IObjectSearchService objectSearchService, ISysMLReadOnlyService readOnlyService, + public ViewCreateService(IObjectSearchService objectSearchService, IReadOnlyObjectPredicate readOnlyObjectPredicate, ShowDiagramsInheritedMembersService showDiagramsInheritedMembersService, IFeedbackMessageService feedbackMessageService) { this.feedbackMessageService = Objects.requireNonNull(feedbackMessageService); this.objectSearchService = Objects.requireNonNull(objectSearchService); - this.readOnlyService = Objects.requireNonNull(readOnlyService); + this.readOnlyObjectPredicate = Objects.requireNonNull(readOnlyObjectPredicate); this.showDiagramsInheritedMembersService = Objects.requireNonNull(showDiagramsInheritedMembersService); this.elementInitializerSwitch = new ElementInitializerSwitch(); this.deleteService = new DeleteService(); @@ -1197,11 +1197,11 @@ public Element createPartUsageAndInterface(PartUsage self) { private Element getEdgeSemanticContainer(Node source, Node target, Diagram diagram, IEditingContext editingContext) { final Element semanticContainer; Element semanticSourceGraphicalParent = this.getGraphicalContainerSemanticElement(source, diagram, editingContext); - if (semanticSourceGraphicalParent != null && !this.readOnlyService.isReadOnly(semanticSourceGraphicalParent)) { + if (semanticSourceGraphicalParent != null && !this.readOnlyObjectPredicate.test(semanticSourceGraphicalParent)) { semanticContainer = semanticSourceGraphicalParent; } else { Element semanticTargetGraphicalParent = this.getGraphicalContainerSemanticElement(target, diagram, editingContext); - if (semanticTargetGraphicalParent != null && !this.readOnlyService.isReadOnly(semanticTargetGraphicalParent)) { + if (semanticTargetGraphicalParent != null && !this.readOnlyObjectPredicate.test(semanticTargetGraphicalParent)) { semanticContainer = semanticTargetGraphicalParent; } else { semanticContainer = null; diff --git a/backend/views/syson-diagram-tests/pom.xml b/backend/views/syson-diagram-tests/pom.xml index d3ca78c35..4ab665a78 100644 --- a/backend/views/syson-diagram-tests/pom.xml +++ b/backend/views/syson-diagram-tests/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-diagram-tests - 2025.8.5 + 2025.8.8 syson-diagram-tests SysON Diagram Tests @@ -97,17 +97,17 @@ org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-diagram-common-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.testcontainers diff --git a/backend/views/syson-standard-diagrams-view/pom.xml b/backend/views/syson-standard-diagrams-view/pom.xml index 1064f2c11..b1f5d5fb6 100644 --- a/backend/views/syson-standard-diagrams-view/pom.xml +++ b/backend/views/syson-standard-diagrams-view/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-standard-diagrams-view - 2025.8.5 + 2025.8.8 syson-standard-diagrams-view SysON Sirius Web diagram description of the SysMLv2 Standard Diagrams Views @@ -93,32 +93,32 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-siriusweb-customnodes-metamodel-edit - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-common-view - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-diagram-common-view - 2025.8.5 + 2025.8.8 @@ -134,13 +134,13 @@ org.eclipse.syson syson-diagram-tests - 2025.8.5 + 2025.8.8 test org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/views/syson-table-requirements-view/pom.xml b/backend/views/syson-table-requirements-view/pom.xml index 55f7df30b..73063fe71 100644 --- a/backend/views/syson-table-requirements-view/pom.xml +++ b/backend/views/syson-table-requirements-view/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-table-requirements-view - 2025.8.5 + 2025.8.8 syson-table-requirements-view SysON Table Requirements View @@ -73,17 +73,17 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-common-view - 2025.8.5 + 2025.8.8 @@ -99,7 +99,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/views/syson-tree-explorer-view/pom.xml b/backend/views/syson-tree-explorer-view/pom.xml index 499fcd375..b86bbecc4 100644 --- a/backend/views/syson-tree-explorer-view/pom.xml +++ b/backend/views/syson-tree-explorer-view/pom.xml @@ -23,7 +23,7 @@ org.eclipse.syson syson-tree-explorer-view - 2025.8.5 + 2025.8.8 syson-tree-explorer-view SysON Sirius Web tree description of the explorer view @@ -68,17 +68,17 @@ org.eclipse.syson syson-sysml-metamodel - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-application-configuration - 2025.8.5 + 2025.8.8 org.eclipse.syson syson-services - 2025.8.5 + 2025.8.8 @@ -94,7 +94,7 @@ org.eclipse.syson syson-tests - 2025.8.5 + 2025.8.8 test diff --git a/backend/views/syson-tree-explorer-view/src/main/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServices.java b/backend/views/syson-tree-explorer-view/src/main/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServices.java index bc00c9c41..f7e5bda46 100644 --- a/backend/views/syson-tree-explorer-view/src/main/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServices.java +++ b/backend/views/syson-tree-explorer-view/src/main/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServices.java @@ -24,6 +24,7 @@ import org.eclipse.sirius.components.core.api.IEditingContext; import org.eclipse.sirius.components.core.api.IIdentityService; import org.eclipse.sirius.components.core.api.ILabelService; +import org.eclipse.sirius.components.core.api.IReadOnlyObjectPredicate; import org.eclipse.sirius.components.core.api.labels.StyledString; import org.eclipse.sirius.components.emf.services.api.IEMFEditingContext; import org.eclipse.sirius.components.trees.TreeItem; @@ -32,10 +33,7 @@ import org.eclipse.sirius.web.application.views.explorer.services.api.IExplorerServices; import org.eclipse.sirius.web.domain.boundedcontexts.representationdata.RepresentationMetadata; import org.eclipse.sirius.web.domain.boundedcontexts.representationdata.services.api.IRepresentationMetadataSearchService; -import org.eclipse.syson.services.UtilService; -import org.eclipse.syson.services.api.ISysONResourceService; import org.eclipse.syson.sysml.Element; -import org.eclipse.syson.sysml.Namespace; import org.eclipse.syson.sysml.util.ElementUtil; import org.eclipse.syson.tree.explorer.view.fragments.KerMLStandardLibraryDirectory; import org.eclipse.syson.tree.explorer.view.fragments.LibrariesDirectory; @@ -67,20 +65,17 @@ public class SysONDefaultExplorerServices implements ISysONDefaultExplorerServic private final ISysONExplorerFilterService filterService; - private final UtilService utilService = new UtilService(); - - private final ISysONResourceService sysONResourceService; + private final IReadOnlyObjectPredicate readOnlyObjectPredicate; public SysONDefaultExplorerServices(IIdentityService identityService, IContentService contentService, IRepresentationMetadataSearchService representationMetadataSearchService, - IExplorerServices explorerServices, ILabelService labelService, - ISysONExplorerFilterService filterService, final ISysONResourceService sysONResourceService) { + IExplorerServices explorerServices, ILabelService labelService, ISysONExplorerFilterService filterService, final IReadOnlyObjectPredicate readOnlyObjectPredicate) { this.identityService = Objects.requireNonNull(identityService); this.contentService = Objects.requireNonNull(contentService); this.representationMetadataSearchService = Objects.requireNonNull(representationMetadataSearchService); this.explorerServices = Objects.requireNonNull(explorerServices); this.labelService = Objects.requireNonNull(labelService); this.filterService = Objects.requireNonNull(filterService); - this.sysONResourceService = Objects.requireNonNull(sysONResourceService); + this.readOnlyObjectPredicate = Objects.requireNonNull(readOnlyObjectPredicate); } @Override @@ -90,7 +85,7 @@ public List getElements(IEditingContext editingContext, List act siriusWebContext.getDomain().getResourceSet().getResources().stream() .filter(r -> !this.filterService.isSysMLStandardLibrary(r)) .filter(r -> !this.filterService.isKerMLStandardLibrary(r)) - .filter(r -> !this.sysONResourceService.isImported(r) || this.utilService.getLibraries(r, false).isEmpty()) + .filter(r -> !this.filterService.isUserLibrary(r)) .forEach(results::add); LibrariesDirectory librariesDirectory = new LibrariesDirectory("Libraries", editingContext, this.filterService); if (librariesDirectory.hasChildren(editingContext, List.of(), List.of(), activeFilterIds)) { @@ -205,7 +200,7 @@ public boolean canExpandAll(TreeItem treeItem, IEditingContext editingContext) { @Override public boolean canCreateNewObjectsFromText(Object self) { - return self instanceof Element && isEditable(self); + return self instanceof Element && this.isEditable(self); } @Override @@ -243,24 +238,10 @@ public boolean isEditable(Object self) { boolean result = true; if (self instanceof ISysONExplorerFragment fragment) { result = fragment.isEditable(); - } else if (self instanceof Namespace namespace) { - if (this.utilService.isRootNamespace(namespace)) { - result = !(this.filterService.isUserLibrary(namespace.eResource())) - && namespace.getOwnedElement().stream().noneMatch(ownedElement -> ElementUtil.isFromStandardLibrary(ownedElement)); - } else { - result = !ElementUtil.isFromStandardLibrary(namespace) - && !(this.filterService.isUserLibrary(namespace.eResource())); - } } else if (self instanceof Element element) { - result = !ElementUtil.isFromStandardLibrary(element) - && !(this.filterService.isUserLibrary(element.eResource())); + result = !this.readOnlyObjectPredicate.test(element); } else if (self instanceof Resource resource) { - result = !(this.filterService.isUserLibrary(resource)) - && resource.getContents().stream() - .filter(Namespace.class::isInstance) - .map(Namespace.class::cast) - .flatMap(namespace -> namespace.getOwnedElement().stream()) - .noneMatch(ElementUtil::isFromStandardLibrary); + result = !this.readOnlyObjectPredicate.test(resource); } return result; } @@ -269,26 +250,13 @@ public boolean isEditable(Object self) { public boolean isDeletable(Object self) { boolean result = true; if (self instanceof ISysONExplorerFragment fragment) { - result = fragment.isEditable(); - } else if (self instanceof Namespace namespace) { - if (this.utilService.isRootNamespace(namespace)) { - result = !(this.filterService.isUserLibrary(namespace.eResource())) - && namespace.getOwnedElement().stream().noneMatch(ownedElement -> ElementUtil.isFromStandardLibrary(ownedElement)); - } else { - result = !ElementUtil.isFromStandardLibrary(namespace) - && !(this.filterService.isUserLibrary(namespace.eResource())); - } + result = fragment.isDeletable(); } else if (self instanceof Element element) { - result = !ElementUtil.isFromStandardLibrary(element) - && !(this.filterService.isUserLibrary(element.eResource())); + result = !this.readOnlyObjectPredicate.test(element); } else if (self instanceof Resource resource) { - // Allow to delete resources containing user libraries, users may want to remove an imported library from - // their project. - result = resource.getContents().stream() - .filter(Namespace.class::isInstance) - .map(Namespace.class::cast) - .flatMap(namespace -> namespace.getOwnedElement().stream()) - .noneMatch(ElementUtil::isFromStandardLibrary); + // Allow to delete read-only resources imported from textual SysML, users may want to remove an imported + // library from their project. + result = !this.readOnlyObjectPredicate.test(resource) || ElementUtil.isImported(resource); } return result; } diff --git a/backend/views/syson-tree-explorer-view/src/main/java/org/eclipse/syson/tree/explorer/view/services/SysONExplorerInitialDirectEditTreeItemLabelProvider.java b/backend/views/syson-tree-explorer-view/src/main/java/org/eclipse/syson/tree/explorer/view/services/SysONExplorerInitialDirectEditTreeItemLabelProvider.java new file mode 100644 index 000000000..1894e688c --- /dev/null +++ b/backend/views/syson-tree-explorer-view/src/main/java/org/eclipse/syson/tree/explorer/view/services/SysONExplorerInitialDirectEditTreeItemLabelProvider.java @@ -0,0 +1,107 @@ +/******************************************************************************* + * Copyright (c) 2025 Obeo. + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.syson.tree.explorer.view.services; + +import java.util.Objects; +import java.util.Optional; + +import org.eclipse.sirius.components.collaborative.trees.api.IInitialDirectEditTreeItemLabelProvider; +import org.eclipse.sirius.components.collaborative.trees.dto.InitialDirectEditElementLabelInput; +import org.eclipse.sirius.components.collaborative.trees.dto.InitialDirectEditElementLabelSuccessPayload; +import org.eclipse.sirius.components.core.api.IEditingContext; +import org.eclipse.sirius.components.core.api.IObjectSearchService; +import org.eclipse.sirius.components.core.api.IPayload; +import org.eclipse.sirius.components.core.api.labels.StyledString; +import org.eclipse.sirius.components.trees.Tree; +import org.eclipse.sirius.components.trees.TreeItem; +import org.eclipse.sirius.web.application.views.explorer.services.ExplorerDescriptionProvider; +import org.eclipse.syson.sysml.ViewUsage; +import org.eclipse.syson.tree.explorer.view.SysONTreeViewDescriptionProvider; +import org.springframework.core.Ordered; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Service; + +/** + * Used to compute the initial label to display when the direct edit of a tree item of the SysON Explorer is triggered + * on the frontend. + * + * @author arichard + */ +@Service +@Order(Ordered.HIGHEST_PRECEDENCE) +public class SysONExplorerInitialDirectEditTreeItemLabelProvider implements IInitialDirectEditTreeItemLabelProvider { + + private final SysONTreeViewDescriptionProvider sysONTreeViewDescriptionProvider; + + private final IObjectSearchService objectSearchService; + + public SysONExplorerInitialDirectEditTreeItemLabelProvider(SysONTreeViewDescriptionProvider sysONTreeViewDescriptionProvider, IObjectSearchService objectSearchService) { + this.sysONTreeViewDescriptionProvider = Objects.requireNonNull(sysONTreeViewDescriptionProvider); + this.objectSearchService = Objects.requireNonNull(objectSearchService); + } + + @Override + public boolean canHandle(Tree tree) { + return tree.getId().startsWith(ExplorerDescriptionProvider.PREFIX) + && Objects.equals(tree.getDescriptionId(), this.sysONTreeViewDescriptionProvider.getDescriptionId()); + } + + @Override + public IPayload handle(IEditingContext editingContext, Tree tree, InitialDirectEditElementLabelInput input) { + String initialLabel = tree.getChildren().stream() + .map(treeItems -> this.searchById(treeItems, input.treeItemId())) + .filter(Optional::isPresent) + .map(Optional::get) + .map(TreeItem::getLabel) + .map(StyledString::toString) + .findFirst() + .orElse(""); + + var optViewUsage = this.objectSearchService.getObject(editingContext, input.treeItemId()).filter(ViewUsage.class::isInstance).map(ViewUsage.class::cast); + if (optViewUsage.isPresent()) { + if (initialLabel.endsWith("[GeneralView]")) { + initialLabel = this.replaceLast(initialLabel, " [GeneralView]", ""); + } else if (initialLabel.endsWith("[InterconnectionView]")) { + initialLabel = this.replaceLast(initialLabel, " [InterconnectionView]", ""); + } else if (initialLabel.endsWith("[ActionFlowView]")) { + initialLabel = this.replaceLast(initialLabel, " [ActionFlowView]", ""); + } else if (initialLabel.endsWith("[StateTransitionView]")) { + initialLabel = this.replaceLast(initialLabel, " [StateTransitionView]", ""); + } + } + + return new InitialDirectEditElementLabelSuccessPayload(input.id(), initialLabel); + } + + private Optional searchById(TreeItem treeItem, String id) { + Optional optionalTreeItem = Optional.empty(); + if (treeItem.getId().equals(id)) { + optionalTreeItem = Optional.of(treeItem); + } + if (optionalTreeItem.isEmpty() && treeItem.isHasChildren()) { + optionalTreeItem = treeItem.getChildren().stream() + .map(treeItems -> this.searchById(treeItems, id)) + .filter(Optional::isPresent) + .map(Optional::get).findFirst(); + } + return optionalTreeItem; + } + + String replaceLast(String string, String stringToReplace, String replacement) { + int index = string.lastIndexOf(stringToReplace); + if (index == -1) { + return string; + } + return string.substring(0, index) + replacement + string.substring(index + stringToReplace.length()); + } +} diff --git a/backend/views/syson-tree-explorer-view/src/test/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServicesTest.java b/backend/views/syson-tree-explorer-view/src/test/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServicesTest.java index 1fe889a53..c35c20a49 100644 --- a/backend/views/syson-tree-explorer-view/src/test/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServicesTest.java +++ b/backend/views/syson-tree-explorer-view/src/test/java/org/eclipse/syson/tree/explorer/view/services/SysONDefaultExplorerServicesTest.java @@ -68,7 +68,7 @@ public class SysONDefaultExplorerServicesTest { public SysONDefaultExplorerServicesTest() { this.resourceService = new SysONResourceService(); - this.defaultExplorerService = this.createMockDefaultExplorerService(resourceService); + this.defaultExplorerService = this.createMockDefaultExplorerService(this.resourceService); } @BeforeAll @@ -101,23 +101,23 @@ public void hasChildrenCanHandleNonSysmlContent() { EAttribute c1a2 = EcoreFactory.eINSTANCE.createEAttribute(); c1.getEStructuralFeatures().add(c1a2); - assertThat(defaultExplorerService.hasChildren(ePackage, editingContext, List.of(), List.of(), List.of())).isTrue(); - assertThat(defaultExplorerService.hasChildren(c1, editingContext, List.of(), List.of(), List.of())).isTrue(); - assertThat(defaultExplorerService.hasChildren(c1a1, editingContext, List.of(), List.of(), List.of())).isFalse(); + assertThat(this.defaultExplorerService.hasChildren(ePackage, editingContext, List.of(), List.of(), List.of())).isTrue(); + assertThat(this.defaultExplorerService.hasChildren(c1, editingContext, List.of(), List.of(), List.of())).isTrue(); + assertThat(this.defaultExplorerService.hasChildren(c1a1, editingContext, List.of(), List.of(), List.of())).isFalse(); } @Test @DisplayName("When service 'canCreateNewObjectsFromText' is called on null, the result is always negative") public void testNull() { - assertThat(defaultExplorerService.canCreateNewObjectsFromText(null)).isFalse(); + assertThat(this.defaultExplorerService.canCreateNewObjectsFromText(null)).isFalse(); } @Test @DisplayName("When service 'canCreateNewObjectsFromText' is called on non-SysML model elements, the result is always negative") public void testNonSysMLElements() { final EPackage ePackage = EcorePackage.eINSTANCE; - assertThat(getAllConcreteEClasses(ePackage)) - .noneMatch(eClass -> defaultExplorerService.canCreateNewObjectsFromText( + assertThat(this.getAllConcreteEClasses(ePackage)) + .noneMatch(eClass -> this.defaultExplorerService.canCreateNewObjectsFromText( ePackage.getEFactoryInstance().create(eClass))); } @@ -125,8 +125,8 @@ public void testNonSysMLElements() { @DisplayName("When service 'canCreateNewObjectsFromText' is called on SysML model elements, the result is always positive") public void testSysMLElements() { final EPackage ePackage = SysmlPackage.eINSTANCE; - assertThat(getAllConcreteEClasses(ePackage)) - .allMatch(eClass -> defaultExplorerService.canCreateNewObjectsFromText( + assertThat(this.getAllConcreteEClasses(ePackage)) + .allMatch(eClass -> this.defaultExplorerService.canCreateNewObjectsFromText( ePackage.getEFactoryInstance().create(eClass))); } @@ -154,7 +154,7 @@ public boolean test(Object arg0) { ISysONExplorerFilterService filterService = new SysONExplorerFilterService(sysONResourceService); - return new SysONDefaultExplorerServices(identityService, contentService, representationMetadataSearchService, explorerServices, labelService, filterService, sysONResourceService); + return new SysONDefaultExplorerServices(identityService, contentService, representationMetadataSearchService, explorerServices, labelService, filterService, readOnlyObjectPredicate); } private List getAllConcreteEClasses(final EPackage ePackage) { diff --git a/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc b/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc index 2b01caecf..2041e5d5f 100644 --- a/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc +++ b/doc/content/modules/user-manual/pages/release-notes/2025.10.0.adoc @@ -109,6 +109,14 @@ With this enhancement, users avoid confusion when switching from one _ViewDefini image::view-usage-label-with-type-explorer-view.png[ViewUsage in Explorer View, width=65%,height=65%] +- Standardize read-only computation. +We removed the assumptions SysON made on whether a resource is read-only. +Resources are now considered read-only if: +* They are Sirius Web libraries imported by reference +* They are textual SysML files imported as read-only +* They are standard libraries (SysML and KerML) +All the other resources are read-write. + == Dependency update - Update to https://github.com/eclipse-sirius/sirius-web[Sirius Web 2025.8.8] diff --git a/frontend/syson-components/package.json b/frontend/syson-components/package.json index 7f1498f2b..b140fb0ba 100644 --- a/frontend/syson-components/package.json +++ b/frontend/syson-components/package.json @@ -1,6 +1,6 @@ { "name": "@eclipse-syson/syson-components", - "version": "2025.8.5", + "version": "2025.8.8", "author": "Eclipse SysON", "license": "EPL-2.0", "repository": { diff --git a/frontend/syson/package.json b/frontend/syson/package.json index 23affa214..2c1f2982b 100644 --- a/frontend/syson/package.json +++ b/frontend/syson/package.json @@ -1,7 +1,7 @@ { "name": "@eclipse-syson/syson", "author": "Eclipse SysON", - "version": "2025.8.5", + "version": "2025.8.8", "license": "EPL-2.0", "repository": { "type": "git", @@ -32,7 +32,7 @@ "@eclipse-sirius/sirius-components-widget-reference": "2025.8.8", "@eclipse-sirius/sirius-components-widget-table": "2025.8.8", "@eclipse-sirius/sirius-web-application": "2025.8.8", - "@eclipse-syson/syson-components": "2025.8.5", + "@eclipse-syson/syson-components": "2025.8.8", "@lexical/react": "0.8.1", "@mui/icons-material": "7.0.2", "@mui/material": "7.0.2", diff --git a/integration-tests/package-lock.json b/integration-tests/package-lock.json index 1bdea3182..672213791 100644 --- a/integration-tests/package-lock.json +++ b/integration-tests/package-lock.json @@ -1,12 +1,12 @@ { "name": "syson-integration-tests", - "version": "2025.8.5", + "version": "2025.8.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "syson-integration-tests", - "version": "2025.8.5", + "version": "2025.8.8", "license": "EPL-2.0", "dependencies": { "prettier": "2.7.1" diff --git a/integration-tests/package.json b/integration-tests/package.json index 1fde32196..4c0588c51 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -1,6 +1,6 @@ { "name": "syson-integration-tests", - "version": "2025.8.5", + "version": "2025.8.8", "license": "EPL-2.0", "private": true, "devDependencies": { diff --git a/package-lock.json b/package-lock.json index 550566ed8..5a99b2911 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@eclipse-syson/syson-parent", - "version": "2025.8.5", + "version": "2025.8.8", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@eclipse-syson/syson-parent", - "version": "2025.8.5", + "version": "2025.8.8", "license": "EPL-2.0", "workspaces": [ "./frontend/*" @@ -21,7 +21,7 @@ }, "frontend/syson": { "name": "@eclipse-syson/syson", - "version": "2025.8.5", + "version": "2025.8.8", "license": "EPL-2.0", "dependencies": { "@apollo/client": "3.10.4", @@ -44,7 +44,7 @@ "@eclipse-sirius/sirius-components-widget-reference": "2025.8.8", "@eclipse-sirius/sirius-components-widget-table": "2025.8.8", "@eclipse-sirius/sirius-web-application": "2025.8.8", - "@eclipse-syson/syson-components": "2025.8.5", + "@eclipse-syson/syson-components": "2025.8.8", "@lexical/react": "0.8.1", "@mui/icons-material": "7.0.2", "@mui/material": "7.0.2", @@ -99,7 +99,7 @@ }, "frontend/syson-components": { "name": "@eclipse-syson/syson-components", - "version": "2025.8.5", + "version": "2025.8.8", "license": "EPL-2.0", "devDependencies": { "@apollo/client": "3.10.4", @@ -11111,7 +11111,7 @@ "@eclipse-sirius/sirius-components-widget-reference": "2025.8.8", "@eclipse-sirius/sirius-components-widget-table": "2025.8.8", "@eclipse-sirius/sirius-web-application": "2025.8.8", - "@eclipse-syson/syson-components": "2025.8.5", + "@eclipse-syson/syson-components": "2025.8.8", "@lexical/react": "0.8.1", "@mui/icons-material": "7.0.2", "@mui/material": "7.0.2", diff --git a/package.json b/package.json index e5dc2ca6a..b0dde5a35 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eclipse-syson/syson-parent", - "version": "2025.8.5", + "version": "2025.8.8", "author": "Eclipse SysON", "license": "EPL-2.0", "repository": { diff --git a/pom.xml b/pom.xml index 200655e8b..c64a88454 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,7 @@ org.eclipse.syson syson - 2025.8.5 + 2025.8.8 syson SysON diff --git a/scripts/check-coverage.jsh b/scripts/check-coverage.jsh index 22b9fcff7..aa956057d 100755 --- a/scripts/check-coverage.jsh +++ b/scripts/check-coverage.jsh @@ -31,12 +31,12 @@ double checkCoverage(String module) { record ModuleCoverage(String moduleName, double expectedCoverage) {} double expectedGlobalCoverage = 66.0; var moduleCoverageData = List.of( - new ModuleCoverage("syson-sysml-metamodel", 77.0), + new ModuleCoverage("syson-sysml-metamodel", 76.0), new ModuleCoverage("syson-sysml-metamodel-edit", 16.0), new ModuleCoverage("syson-siriusweb-customnodes-metamodel", 47.0), new ModuleCoverage("syson-siriusweb-customnodes-metamodel-edit", 0.0), new ModuleCoverage("syson-direct-edit-grammar", 66.0), - new ModuleCoverage("syson-services", 71.0), + new ModuleCoverage("syson-services", 70.0), new ModuleCoverage("syson-sysml-rest-api-services", 93.0), new ModuleCoverage("syson-sysml-import", 84.0), new ModuleCoverage("syson-sysml-export", 64.0),