diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index a62af32025..d21ad1540f 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -35,6 +35,7 @@ An absent/empty candidates expression now simply means the widget is empty. - https://github.com/eclipse-sirius/sirius-components/issues/2067[#2064] [view] Enable completion support and other text field customizations for custom widgets - https://github.com/eclipse-sirius/sirius-components/issues/2092[#2092] [form] Fix support for help expressions on the _FlexboxContainer_ widget - https://github.com/eclipse-sirius/sirius-components/issues/2088[#2088] [tree] Fix initial value of the tree filter bar +- https://github.com/eclipse-sirius/sirius-components/issues/2133[#2133] [workbench] Fix NPE in Related Elements view === New Features diff --git a/integration-tests/cypress/e2e/project/edit/related-elements-view.cy.js b/integration-tests/cypress/e2e/project/edit/related-elements-view.cy.js new file mode 100644 index 0000000000..12738fc84c --- /dev/null +++ b/integration-tests/cypress/e2e/project/edit/related-elements-view.cy.js @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2023 Obeo. + * This program and the accompanying materials + * are made available under the erms 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 + *******************************************************************************/ + +/** + * This test suite will be used to validate the proper lifecycle of our application. + * + * For that, we will open and close in various ways several representations and we will evaluate if we have + * the proper number of representations and if they behave properly. + */ +describe('/projects/:projectId/edit - Related ELements View', () => { + beforeEach(() => { + cy.deleteAllProjects(); + cy.createProject('Cypress Project').then((res) => { + const projectId = res.body.data.createProject.project.id; + cy.wrap(projectId).as('projectId'); + const robot_flow_id = 'c26b6086-b444-3ee6-b8cd-9a4fde5956a7'; + + cy.createDocument(projectId, robot_flow_id, 'robot').then(() => { + cy.visit(`/projects/${projectId}/edit`); + }); + }); + }); + + it('can open the related elements view', function () { + cy.getByTestId('robot').dblclick(); + cy.getByTestId('Robot').dblclick(); + cy.getByTestId('viewselector-Related Elements').click(); + cy.getByTestId('view-Related Elements').within(() => { + cy.getByTestId('form').should('exist'); + }); + }); +}); diff --git a/packages/sirius-web/backend/sirius-web-services/src/main/java/org/eclipse/sirius/web/services/relatedelements/DefaultRelatedElementsDescriptionProvider.java b/packages/sirius-web/backend/sirius-web-services/src/main/java/org/eclipse/sirius/web/services/relatedelements/DefaultRelatedElementsDescriptionProvider.java index be50fb40e5..123b076926 100644 --- a/packages/sirius-web/backend/sirius-web-services/src/main/java/org/eclipse/sirius/web/services/relatedelements/DefaultRelatedElementsDescriptionProvider.java +++ b/packages/sirius-web/backend/sirius-web-services/src/main/java/org/eclipse/sirius/web/services/relatedelements/DefaultRelatedElementsDescriptionProvider.java @@ -62,9 +62,6 @@ public FormDescription getFormDescription() { // @formatter:off Function targetObjectIdProvider = variableManager -> variableManager.get(VariableManager.SELF, Object.class) - .filter(self -> self instanceof List) - .map(self -> (List) self) - .flatMap(self -> self.stream().findFirst()) .map(this.objectService::getId) .orElse(null);