Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1952] Fix regression on View-based Forms creation #1953

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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;
}
}