Skip to content

Commit

Permalink
[2783] Remove the backend layout code
Browse files Browse the repository at this point in the history
Bug: #2783
Signed-off-by: Stéphane Bégaudeau <stephane.begaudeau@obeo.fr>
  • Loading branch information
sbegaudeau committed Jan 31, 2024
1 parent 36a01a9 commit 7b7aef8
Show file tree
Hide file tree
Showing 35 changed files with 21 additions and 2,801 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ The reference widget graphql schema and the frontend have been updated according
- https://github.com/eclipse-sirius/sirius-web/issues/2822[#2822] [diagram] The GraphQL type `Edge` must now implement `labelEditable` boolean field.
- https://github.com/eclipse-sirius/sirius-web/issues/2783[#2783] [diagram] Remove the package `sirius-components-diagrams` containing the Sprotty based implementation of our diagrams
- https://github.com/eclipse-sirius/sirius-web/issues/2783[#2783] [diagram] Rename the package `sirius-components-diagrams-reactflow` to `sirius-components-diagrams` since we only have one implementation now
- https://github.com/eclipse-sirius/sirius-web/issues/2783[#2783] [diagram] Remove the modules `sirius-components-diagrams-layout-api` and `sirius-components-diagrams-layout` in favor of the frontend based layout API.
As a result, all the APIs relying on this code have been deleted too such as the dead code used to export diagrams on the server or the API for parametric SVGs which was replaced in Reactflow based diagrams.


=== Dependency update

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ describe.skip('/projects/:projectId/edit - Diagram', () => {
cy.getByTestId('Robot-more').click();
cy.getByTestId('treeitem-contextmenu').findByTestId('new-representation').click();

cy.getByTestId('name').clear().type('Topography with auto layout___SPROTTY');
cy.getByTestId('name').clear().type('Topography with auto layout');
cy.getByTestId('representationDescription').click();
cy.getByTestId('Topography with auto layout').click();
cy.getByTestId('create-representation').click();

cy.getByTestId('representation-tab-Topography with auto layout___SPROTTY').should('exist');
cy.getByTestId('representation-tab-Topography with auto layout___SPROTTY').then((tab) => {
cy.getByTestId('representation-tab-Topography with auto layout').should('exist');
cy.getByTestId('representation-tab-Topography with auto layout').then((tab) => {
const representationId = tab[0].dataset.representationid;
cy.wrap(representationId).as('representationId');
});
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/cypress/e2e/project/studio/studio.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ describe('/projects/:projectId/edit - Studio', () => {
cy.getByTestId('representationDescription').click();
cy.get('[data-testid$=" Diagram Description"]').should('exist').click();
cy.getByTestId('name').clear();
cy.getByTestId('name').type('Diagram__SPROTTY');
cy.getByTestId('name').type('Diagram');
cy.getByTestId('create-representation').click();
cy.getByTestId('Diagram').should('exist');
cy.getByTestId('Diagram')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2019, 2023 Obeo.
Copyright (c) 2019, 2024 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
Expand Down Expand Up @@ -87,11 +87,6 @@
<artifactId>sirius-components-collaborative-diagrams</artifactId>
<version>2024.1.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.sirius</groupId>
<artifactId>sirius-components-diagrams-layout</artifactId>
<version>2024.1.1</version>
</dependency>
<dependency>
<groupId>org.eclipse.sirius</groupId>
<artifactId>sirius-components-collaborative-forms</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2019, 2023 Obeo.
* Copyright (c) 2019, 2024 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
Expand Down Expand Up @@ -31,11 +31,11 @@
import org.eclipse.sirius.components.diagrams.ImageNodeStyle;
import org.eclipse.sirius.components.diagrams.InsideLabelLocation;
import org.eclipse.sirius.components.diagrams.NodeType;
import org.eclipse.sirius.components.diagrams.Size;
import org.eclipse.sirius.components.diagrams.description.InsideLabelDescription;
import org.eclipse.sirius.components.diagrams.description.LabelStyleDescription;
import org.eclipse.sirius.components.diagrams.description.NodeDescription;
import org.eclipse.sirius.components.diagrams.description.SynchronizationPolicy;
import org.eclipse.sirius.components.diagrams.layout.incremental.provider.ImageSizeProvider;
import org.eclipse.sirius.components.interpreter.AQLInterpreter;
import org.eclipse.sirius.components.representations.VariableManager;
import org.eclipse.sirius.diagram.business.api.query.ContainerMappingQuery;
Expand Down Expand Up @@ -63,16 +63,13 @@ public class AbstractNodeMappingConverter {

private final IModelOperationHandlerSwitchProvider modelOperationHandlerSwitchProvider;

private final ImageSizeProvider imageSizeProvider;

public AbstractNodeMappingConverter(IObjectService objectService, IEditService editService, IIdentifierProvider identifierProvider,
ISemanticCandidatesProviderFactory semanticCandidatesProviderFactory, IModelOperationHandlerSwitchProvider modelOperationHandlerSwitchProvider, ImageSizeProvider imageSizeService) {
ISemanticCandidatesProviderFactory semanticCandidatesProviderFactory, IModelOperationHandlerSwitchProvider modelOperationHandlerSwitchProvider) {
this.objectService = Objects.requireNonNull(objectService);
this.editService = Objects.requireNonNull(editService);
this.identifierProvider = Objects.requireNonNull(identifierProvider);
this.semanticCandidatesProviderFactory = Objects.requireNonNull(semanticCandidatesProviderFactory);
this.modelOperationHandlerSwitchProvider = Objects.requireNonNull(modelOperationHandlerSwitchProvider);
this.imageSizeProvider = Objects.requireNonNull(imageSizeService);
}

public NodeDescription convert(AbstractNodeMapping abstractNodeMapping, AQLInterpreter interpreter, Map<String, NodeDescription> id2NodeDescriptions) {
Expand Down Expand Up @@ -117,7 +114,7 @@ public NodeDescription convert(AbstractNodeMapping abstractNodeMapping, AQLInter
}
return result;
};
AbstractNodeMappingSizeProvider sizeProvider = new AbstractNodeMappingSizeProvider(interpreter, abstractNodeMapping, this.imageSizeProvider);
Function<VariableManager, Size> sizeProvider = variableManager -> Size.UNDEFINED;

String domainClass = abstractNodeMapping.getDomainClass();
String semanticCandidatesExpression = abstractNodeMapping.getSemanticCandidatesExpression();
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit 7b7aef8

Please sign in to comment.