Skip to content

Commit

Permalink
[1952] Fix regression on View-based Forms creation
Browse files Browse the repository at this point in the history
Bug: #1952
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
  • Loading branch information
pcdavid authored and sbegaudeau committed May 9, 2023
1 parent 4042453 commit cd3e39f
Show file tree
Hide file tree
Showing 21 changed files with 642 additions and 96 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.adoc
Expand Up @@ -13,6 +13,7 @@

- https://github.com/eclipse-sirius/sirius-components/issues/1897[1897] [diagram] ToolSection are not using records
- https://github.com/eclipse-sirius/sirius-components/issues/1616[#1616] [core] Use Java records for all our payloads
- https://github.com/eclipse-sirius/sirius-components/issues/1848[#1848] [project] Remove the frontend dependency to `uuid` in favor of `crypto.randomUUID`
- https://github.com/eclipse-sirius/sirius-components/issues/1907[#1907] [view] The management of colors is changing, it is not possible anymore to use color directly represented by a string in the _styleDescription_.
All the colors are now defined in a new palette object _ColorPalette_ with the properties _name_ and _value_.
A view can define as many _ColorPalette_ as desired.
Expand All @@ -24,13 +25,12 @@ In the _styleDescription_, the definition of a color are now a select list of al
- https://github.com/eclipse-sirius/sirius-components/issues/265[#265] [core] Switch to the latest release of AQL


- https://github.com/eclipse-sirius/sirius-components/issues/1848[#1848] [project] Remove the frontend dependency to `uuid` in favor of `crypto.randomUUID`

=== Bug fixes

- https://github.com/eclipse-sirius/sirius-components/issues/1304[#1304] [tree] Fix an issue where dropping an element from the tree to a diagram used the current selection instead of the dragged tree item.
- https://github.com/eclipse-sirius/sirius-components/issues/1839[#1839] [view] Remove default AQL expression on Create Edge and Create Node since they did not work anymore.
- https://github.com/eclipse-sirius/sirius-components/issues/1940[#1940] [sirius-web] Remove duplicated spring-boot-starter-test dependency in sirius-web-sample-application
- https://github.com/eclipse-sirius/sirius-components/issues/1952[#1952] [view] Fix a regression introduced in 2023.4.0 where View-based Forms could no longer be instanciated

=== New Features

Expand Down
Expand Up @@ -43,6 +43,7 @@
import org.eclipse.sirius.web.sample.papaya.view.operationalanalysis.OperationalActorNodeDescriptionProvider;
import org.eclipse.sirius.web.sample.papaya.view.operationalanalysis.OperationalEntityNodeDescriptionProvider;
import org.eclipse.sirius.web.sample.papaya.view.operationalanalysis.OperationalPerimeterNodeDescriptionProvider;
import org.eclipse.sirius.web.sample.papaya.view.overviewform.OverviewFormProvider;

/**
* Used to create the test view.
Expand Down Expand Up @@ -125,6 +126,9 @@ public View getView() {
var classDiagramDescription = new ClassDiagramDescriptionProvider().create(colorProvider);
view.getDescriptions().add(classDiagramDescription);

var overviewFormDescription = new OverviewFormProvider().create(colorProvider);
view.getDescriptions().add(overviewFormDescription);

return view;
}

Expand Down
@@ -0,0 +1,41 @@
/*******************************************************************************
* Copyright (c) 2023 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.sirius.web.sample.papaya.view.overviewform;

import org.eclipse.sirius.components.view.RepresentationDescription;
import org.eclipse.sirius.components.view.ViewFactory;
import org.eclipse.sirius.web.sample.papaya.view.IColorProvider;
import org.eclipse.sirius.web.sample.papaya.view.IRepresentationDescriptionProvider;

/**
* Used to create the description of the overview form.
*
* @author sbegaudeau
*/
public class OverviewFormProvider implements IRepresentationDescriptionProvider {
@Override
public RepresentationDescription create(IColorProvider colorProvider) {
var formDescription = ViewFactory.eINSTANCE.createFormDescription();
formDescription.setDomainType("papaya_core::Root");
formDescription.setName("Overview Form");

var groupDescription = ViewFactory.eINSTANCE.createGroupDescription();
groupDescription.setName("Group");
groupDescription.setSemanticCandidatesExpression("aql:self");
groupDescription.setLabelExpression("Root");

formDescription.getGroups().add(groupDescription);

return formDescription;
}
}

0 comments on commit cd3e39f

Please sign in to comment.