diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc
index 26689b11be..4d63cbb9fb 100644
--- a/CHANGELOG.adoc
+++ b/CHANGELOG.adoc
@@ -182,6 +182,7 @@ In other scenarios, the default creation position border remains the eastern one
- https://github.com/eclipse-sirius/sirius-web/issues/2785[#2785] [gantt] Add cypress tests
- https://github.com/eclipse-sirius/sirius-web/issues/3225[#3225] [sirius-web] The confirmation dialog on delete does not propose anymore the option allowing to "Disable this confirmation dialog" when the local storage is not available.
- https://github.com/eclipse-sirius/sirius-web/issues/3246[#3246] [view] Make the `ViewRepresentationDescriptionSearchService` independent from specific representations
+- https://github.com/eclipse-sirius/sirius-web/issues/3220[#3220] [deck] Add documentation
== v2024.1.0
diff --git a/doc/specifier/images/deck-card.png b/doc/specifier/images/deck-card.png
new file mode 100644
index 0000000000..648f61c6cd
Binary files /dev/null and b/doc/specifier/images/deck-card.png differ
diff --git a/doc/specifier/images/deck-description-overview.png b/doc/specifier/images/deck-description-overview.png
new file mode 100644
index 0000000000..6d47787359
Binary files /dev/null and b/doc/specifier/images/deck-description-overview.png differ
diff --git a/doc/specifier/images/deck-lane.png b/doc/specifier/images/deck-lane.png
new file mode 100644
index 0000000000..6a563539cf
Binary files /dev/null and b/doc/specifier/images/deck-lane.png differ
diff --git a/doc/specifier/images/deck-overview.png b/doc/specifier/images/deck-overview.png
new file mode 100644
index 0000000000..bef05620be
Binary files /dev/null and b/doc/specifier/images/deck-overview.png differ
diff --git a/doc/specifier/representation-deck.adoc b/doc/specifier/representation-deck.adoc
new file mode 100644
index 0000000000..ad61cc773c
--- /dev/null
+++ b/doc/specifier/representation-deck.adoc
@@ -0,0 +1,132 @@
+# Deck representation description
+
+This chapter explains how to configure a `Deck` representation in the `View` model.
+
+A `Deck` representation is composed with many `Lanes` containing many `Cards`.
+Each `Lane` and `Card` is associated with a semantic element that is an object of the model represented by a `Deck` representation.
+
+image::images/deck-overview.png[Deck representation overview]
+
+## Deck description
+
+To define how your model is represented with a `Deck` representation, the specifier needs to create a `DeckDescription` in the `View` model.
+
+image::images/deck-description-overview.png[Deck description overview]
+
+* `Name` : A name that helps the specifier to know what the DeckDescription is about
+* `Domain Type`: Type of the object on which it is possible to create the representation
+* `Precondition Expression`: An expression that determine if it is possible to create the representation
+* `Title Expression`: The initial name of the representation once created
+
+### Deck style
+
+It is possible to define the *background color* of the `Deck` representation by adding a `StyleDescription` in the `DeckDescription`.
+
+In addition, adding a `ConditionalStyleDescription` allows to override the style if the `Condition` expression returns `true`.
+You may add multiple `ConditionalStyleDescription`.
+
+## Lane description
+
+The `LaneDescription` is used to define the lanes.
+
+image::images/deck-lane.png[Deck lane]
+
+* `Semantic Candidates Expression`: An expression that returns one or more semantic elements.
+Each semantic element will be represented by a lane.
+** `self` variable is the semantic element associated with the `Deck`.
+* `Title Expression`: An expression that defines the title of the lane
+** `self` variable is a semantic element among the list returned by the `Semantic Candidates Expression`
+* `Label Expression`: An expression that defines the label of the lane
+* `Is Collapsible Expression`: An boolean expression.
+If true, it is possible to collapse the lane hence hiding all the contained cards.
+
+### Lane style
+
+It is possible to define the style of the lane by adding a `StyleDescription` in the `LaneDescription`.
+The customizable attributes are
+
+* Font Size
+* Italic, Bold, Underline and Strike Through
+* The text color
+* The background color of the lane
+
+In addition, adding a `ConditionalStyleDescription` allows to override the style if the `Condition` expression returns `true`.
+You may add multiple `ConditionalStyleDescription`
+
+## Card description
+
+The `CardDescription` is used to define the card inside a lane.
+
+image::images/deck-card.png[Deck card]
+
+* `Semantic Candidates Expression`: An expression that returns one or more semantic elements.
+Each semantic element will be represented by a `Card`.
+** `self` variable is the semantic element associated with the `Lane`
+* `Title Expression`: An expression that defines the title of the card
+** `self` variable is a semantic element among the list returned by the `Semantic Candidates Expression`.
+* `Label Expression`: An expression that defines the label of the card
+* `Description Expression`: An expression that defines the description of the card
+
+### Card style
+
+As for `LaneDescription`, it is possible to define the style of the card by adding a `StyleDescription` or one or more `ConditionalStyleDescription` in the `CardDescription`.
+
+## Tools
+
+Many tools can be configured for `Lane` and `Card`.
+By default, a tool does nothing.
+A tool provides access to variables useful in the context of the tool and executes the operations associated with the tool.
+Typical operation:
+
+* `Change Context`: It allows to change the `self` value.
+But typically this operation is useful if you just want to call a java service that will implement the tool behavior.
+* `Create Instance`: Creates a semantic object and add it in the defined feature of the `self` semantic element
+* `Set Value`: Sets the value on a given feature on `self` semantic element
+* `Delete Element`
+* etc
+
+### Lane tools
+
+* `Lane Drop Tool`:
+This tool defines the behavior when dragging and dropping a lane before or after another lane.
+Available variables:
+** `self`: The semantic element associated with the dropped lane
+** `index`: The new index of the dropped lane.
+First position corresponds to zero and last position corresponds to the number of lanes.
+
+
+* `Edit Lane Tool`: This tool defines the behavior when the title of a lane is changed.
+Available variables:
+** `self`: The semantic element associated with the dropped lane
+** `newTitle`: The new value of the title.
+
+### Card tools
+
+* `Create Card Tool`: This tool defines the behavior for the button to add a card.
+Available variables:
+** `self`: The semantic element associated with the lane
+** `title`: The value of the title.
+** `description`: The value of the description.
+** `label`: The value of the label.
+
+* `Edit Card Tool`: This tool defines the behavior when the title, description or label of a card is changed.
+Available variables:
+** `self`: The semantic element associated with the dropped lane.
+** `newTitle`: The new value of the title.
+** `newDescription`: The new value of the description.
+** `newLabel`: The new value of the label.
+
+* `Delete Card Tool`: This tool defines the behavior for the delete button on a card.
+Available variables:
+** `self`: The semantic element associated with the card
+
+* `Card Drop Tool`: This tool defines the behavior when dragging and dropping a card among cards of the same or other lane.
+Available variables:
+** `self`: The semantic object associated with the card
+** `oldLane`: The initial lane from which the card is dragged
+** `oldLaneTarget`: The semantic object associated with the initial lane
+** `newLane`: The lane where the card is dropped
+** `newLaneTarget`: The semantic object associated with the new lane
+** `index`: Index of the card among the cards of the new lane.
+First position corresponds to zero and last position corresponds to the number of cards in the lane.
+
diff --git a/doc/user/images/deck-overview.png b/doc/user/images/deck-overview.png
new file mode 100644
index 0000000000..bef05620be
Binary files /dev/null and b/doc/user/images/deck-overview.png differ
diff --git a/doc/user/images/deck-show-hide.png b/doc/user/images/deck-show-hide.png
new file mode 100644
index 0000000000..bff9e17626
Binary files /dev/null and b/doc/user/images/deck-show-hide.png differ
diff --git a/doc/user/images/deck-toolbar.png b/doc/user/images/deck-toolbar.png
new file mode 100644
index 0000000000..75774dd35f
Binary files /dev/null and b/doc/user/images/deck-toolbar.png differ
diff --git a/doc/user/representation-deck.adoc b/doc/user/representation-deck.adoc
new file mode 100644
index 0000000000..fdc47c60c9
--- /dev/null
+++ b/doc/user/representation-deck.adoc
@@ -0,0 +1,46 @@
+# Deck representation
+
+A `Deck` representation is composed with many `Lanes` containing many `Cards`
+Each `Lane` and `Card` is associated to a semantic element that is an object of the model represented by a `Deck` representation.
+
+image::images/deck-overview.png[Deck representation overview]
+
+## Deck Toolbar
+
+image::images/deck-toolbar.png[Deck Toolbar]
+
+* `Toggle full screen mode` : It allows to display the representation in full screen
+* `Fit to screen`: Adjust the zoom level to the size of the editor
+* `Zoom in`
+* `Zoom out`
+* `Reset zoom`: Set the zoom level to default
+* `Share`: Provide an URL that reaches directly the current Deck representation
+
+## Selection
+
+When selecting a `Lane` or a `Card`, the associated semantic element is selected in the `Explorer` and its properties are displayed in `Details`.
+
+## Edition
+
+To edit text area of a `Lane` or a `Card` first select and then click in the text area.
+You can also press `F2` to edit the title. Then you can press `Tab` key to edit next fields.
+
+The `Lane` editable attributes:
+
+* `Title`
+
+The `Card` editable attributes:
+
+* `Title`
+* `Description`
+* `Label`
+
+## Show/Hide cards
+
+image:images/deck-show-hide.png[Show/Hide Cards]
+
+You have the ability to show/hide individual cards or hide the whole cards of a lane using the expand button.
+
+## Moving lanes and cards
+
+According to how the `View` model has been configured, you can update the model by *dragging and dropping* Lane or Cards.
diff --git a/integration-tests/cypress/workbench/Deck.ts b/integration-tests/cypress/workbench/Deck.ts
index 0ec8194aab..3e6b7c5f76 100644
--- a/integration-tests/cypress/workbench/Deck.ts
+++ b/integration-tests/cypress/workbench/Deck.ts
@@ -140,7 +140,7 @@ export class Deck {
{ condition, backgroundColor, color, italic, bold, underline, strikeThrough, fontSize }: ElementStyleProps
) {
const details = new Details();
- const objectName = `${condition ? 'Conditional Styles Conditional Deck' : 'Style'} Element Description Style`;
+ const objectName = `${condition ? 'Conditional Style' : 'Style'} Description`;
cy.createChildObject(elementName, objectName);
details.openReferenceWidgetOptions('Background Color');
details.selectReferenceWidgetOption(backgroundColor);
@@ -162,7 +162,7 @@ export class Deck {
public createDeckRepresentationtyle(elementName: string, backgroundColor: string, condition?: string) {
const details = new Details();
- const objectName = `${condition ? 'Conditional Styles Conditional Deck' : 'Style'} Description Style`;
+ const objectName = `${condition ? 'Conditional Style' : 'Style'} Description`;
cy.createChildObject(elementName, objectName);
details.openReferenceWidgetOptions('Background Color');
details.selectReferenceWidgetOption(backgroundColor);
diff --git a/integration-tests/cypress/workbench/Gantt.ts b/integration-tests/cypress/workbench/Gantt.ts
index 80a98e2f38..bc70be17b5 100644
--- a/integration-tests/cypress/workbench/Gantt.ts
+++ b/integration-tests/cypress/workbench/Gantt.ts
@@ -80,7 +80,7 @@ export class GanttTestHelper {
}
/**
- * Creates the Deck Task Sample view from the stereotype.
+ * Creates the Gantt Task Sample view from the stereotype.
* @returns the created studio project id.
*/
public initGanttView(): Cypress.Chainable {
diff --git a/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/CardComponent.java b/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/CardComponent.java
index 8e12d06ea6..f2bcde29ea 100644
--- a/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/CardComponent.java
+++ b/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/CardComponent.java
@@ -71,7 +71,7 @@ private Element doRender(VariableManager childVariableManager) {
DeckElementStyle style = cardDescription.styleProvider().apply(childVariableManager);
Optional optionalPreviousCard = this.props.previousCards().stream()
- .filter(card -> card.targetObjectId().equals(targetObjectId))
+ .filter(card -> card.descriptionId().equals(cardDescription.id()) && card.targetObjectId().equals(targetObjectId))
.findFirst();
String cardId = optionalPreviousCard.map(Card::id).orElse(UUID.randomUUID().toString());
boolean visible = optionalPreviousCard.map(this::computeVisibility).orElse(true);
diff --git a/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/LaneComponent.java b/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/LaneComponent.java
index 5e16e82ac5..907199b0a4 100644
--- a/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/LaneComponent.java
+++ b/packages/deck/backend/sirius-components-deck/src/main/java/org/eclipse/sirius/components/deck/renderer/component/LaneComponent.java
@@ -71,7 +71,9 @@ private Element doRender(VariableManager childVariableManager) {
String title = laneDescription.titleProvider().apply(childVariableManager);
String label = laneDescription.labelProvider().apply(childVariableManager);
- Optional optionalPreviousLane = this.props.previousLanes().stream().filter(lane -> lane.targetObjectId().equals(targetObjectId)).findFirst();
+ Optional optionalPreviousLane = this.props.previousLanes().stream()
+ .filter(lane -> lane.descriptionId().equals(laneDescription.id()) && lane.targetObjectId().equals(targetObjectId))
+ .findFirst();
String laneId = optionalPreviousLane.map(Lane::id).orElse(UUID.randomUUID().toString());
List previousCards = optionalPreviousLane.map(Lane::cards).orElse(List.of());
List childrenElements = this.getChildren(childVariableManager, laneDescription, laneId, previousCards);
diff --git a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java
index bf35aef89c..06bda82ad0 100644
--- a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java
+++ b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskExampleBuilder.java
@@ -21,6 +21,8 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.sirius.components.task.Company;
+import org.eclipse.sirius.components.task.KeyResult;
+import org.eclipse.sirius.components.task.Objective;
import org.eclipse.sirius.components.task.Person;
import org.eclipse.sirius.components.task.Project;
import org.eclipse.sirius.components.task.Task;
@@ -253,36 +255,36 @@ private Project createOKRProject(Person paul, Person peter) {
Project okrProject = TaskFactory.eINSTANCE.createProject();
okrProject.setName("OKR Project Dev");
- List okrTags = this.createOKRTags();
- okrProject.getOwnedTags().addAll(okrTags);
+ Objective objectiveAppicationRunning = TaskFactory.eINSTANCE.createObjective();
+ objectiveAppicationRunning.setName("Have the application running");
+
+ KeyResult keyResultDevCompleted = TaskFactory.eINSTANCE.createKeyResult();
+ keyResultDevCompleted.setName("Dev completed");
+ keyResultDevCompleted.setDescription("The development is completed");
Task idea = TaskFactory.eINSTANCE.createTask();
idea.setName(IDEA);
idea.setStartTime(Instant.parse(DATE_2023_12_10T08_30_00Z));
idea.setEndTime(Instant.parse(DATE_2023_12_11T17_30_00Z));
idea.setProgress(50);
- idea.getTags().add(okrTags.get(0));
Task spec = TaskFactory.eINSTANCE.createTask();
spec.setName(SPECIFICATION);
spec.setStartTime(Instant.parse(DATE_2023_12_11T08_30_00Z));
spec.setEndTime(Instant.parse(DATE_2023_12_12T17_30_00Z));
spec.setProgress(50);
spec.getDependencies().add(idea);
- spec.getTags().add(okrTags.get(0));
Task development = TaskFactory.eINSTANCE.createTask();
development.setName(DEVELOPMENT);
development.setStartTime(Instant.parse(DATE_2023_12_13T08_30_00Z));
development.setEndTime(Instant.parse(DATE_2023_12_16T17_30_00Z));
development.getDependencies().add(spec);
- development.getTags().add(okrTags.get(1));
Task codeDev = TaskFactory.eINSTANCE.createTask();
codeDev.setName(CODE_DEVELOPMENT);
codeDev.setStartTime(Instant.parse(DATE_2023_12_13T08_30_00Z));
codeDev.setEndTime(Instant.parse(DATE_2023_12_15T17_30_00Z));
codeDev.getAssignedPersons().add(peter);
- codeDev.getTags().add(okrTags.get(2));
Task review = TaskFactory.eINSTANCE.createTask();
review.setName(REVIEW);
@@ -290,16 +292,23 @@ private Project createOKRProject(Person paul, Person peter) {
review.setEndTime(Instant.parse(DATE_2023_12_16T17_30_00Z));
development.getSubTasks().addAll(List.of(codeDev, review));
codeDev.getAssignedPersons().add(paul);
- review.getTags().add(okrTags.get(3));
- Task release = TaskFactory.eINSTANCE.createTask();
- release.setName(RELEASE);
- release.setStartTime(Instant.parse(DATE_2023_12_18T08_30_00Z));
- release.setEndTime(Instant.parse(DATE_2023_12_18T08_30_00Z));
- release.getTags().add(okrTags.get(3));
+ keyResultDevCompleted.getSubTasks().addAll(List.of(idea, spec, development));
+
+ KeyResult keyResultTestsOK = TaskFactory.eINSTANCE.createKeyResult();
+ keyResultTestsOK.setName("Tests passed");
+ keyResultTestsOK.setDescription("The tests are all passed");
+
+ Task manualsTest = TaskFactory.eINSTANCE.createTask();
+ manualsTest.setName("Manual Test Campaign");
+ Task automaticTests = TaskFactory.eINSTANCE.createTask();
+ manualsTest.setName("Automatic Test Checks");
+
+ keyResultTestsOK.getSubTasks().addAll(List.of(manualsTest, automaticTests));
+ objectiveAppicationRunning.getOwnedKeyResults().addAll(List.of(keyResultDevCompleted, keyResultTestsOK));
+ okrProject.getOwnedObjectives().addAll(List.of(objectiveAppicationRunning));
- okrProject.getOwnedTasks().addAll(List.of(idea, spec, development, release));
return okrProject;
}
@@ -314,17 +323,6 @@ private List createDailyTags() {
return tags;
}
- private List createOKRTags() {
- List tags = new ArrayList<>();
- for (int i = 0; i <= 4; i++) {
- TaskTag tag = TaskFactory.eINSTANCE.createTaskTag();
- tag.setPrefix("OKR");
- tag.setSuffix(String.format("Objective #%s", i));
- tags.add(tag);
- }
- return tags;
- }
-
private List createKanbanTags() {
List tags = new ArrayList<>();
TaskTag tag = TaskFactory.eINSTANCE.createTaskTag();
diff --git a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskStereotypeDescriptionRegistryConfigurer.java b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskStereotypeDescriptionRegistryConfigurer.java
index c4fce7ee44..c2f8fa36d0 100644
--- a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskStereotypeDescriptionRegistryConfigurer.java
+++ b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/TaskStereotypeDescriptionRegistryConfigurer.java
@@ -33,7 +33,7 @@ public class TaskStereotypeDescriptionRegistryConfigurer implements IStereotypeD
private static final UUID TASK_EXAMPLE_ID = UUID.nameUUIDFromBytes("task_example".getBytes());
- private static final String TASK_EXAMPLE_LABEL = "Task model example";
+ private static final String TASK_EXAMPLE_LABEL = "Task Model Sample";
private static final String TIMER_NAME = "siriusweb_stereotype_load";
diff --git a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java
index 231e31cc5b..971dd69d5e 100644
--- a/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java
+++ b/packages/starters/backend/sirius-components-task-starter/src/main/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilder.java
@@ -12,6 +12,8 @@
*******************************************************************************/
package org.eclipse.sirius.components.task.starter.configuration.view;
+import java.util.Arrays;
+
import org.eclipse.sirius.components.view.ChangeContext;
import org.eclipse.sirius.components.view.CreateInstance;
import org.eclipse.sirius.components.view.DeleteElement;
@@ -45,6 +47,12 @@ public class ViewDeckDescriptionBuilder {
private static final String DESCRIPTION = "description";
+ private static final String AQL_SELF = "aql:self";
+
+ private static final String AQL_SELF_NAME = "aql:self.name";
+
+ private static final String AQL_SELF_DESCRIPTION = "aql:self.description";
+
private final DeckBuilders deckBuilders;
private final ViewBuilders viewBuilders;
@@ -69,15 +77,6 @@ private void createDailyDeckDescription(View view) {
view.getDescriptions().add(deckDescription);
}
- private void createOKRDeckDescription(View view) {
- DeckDescription deckDescription = this.createDeckDescription("OKR");
- LaneDescription laneDescription = this.createLaneDescription("OKR");
- CardDescription cardDescription = this.createCardDescription();
- deckDescription.getLaneDescriptions().add(laneDescription);
- laneDescription.getOwnedCardDescriptions().add(cardDescription);
- view.getDescriptions().add(deckDescription);
- }
-
private void createKanbanDeckDescription(View view) {
DeckDescription deckDescription = this.createDeckDescription("Kanban");
LaneDescription laneDescription = this.createLaneDescription("Kanban");
@@ -87,15 +86,29 @@ private void createKanbanDeckDescription(View view) {
view.getDescriptions().add(deckDescription);
}
+ private void createOKRDeckDescription(View view) {
+ DeckDescription deckDescription = this.deckBuilders.newDeckDescription()
+ .name("Deck OKR Representation")
+ .domainType("task::Project")
+ .titleExpression("New OKR Representation")
+ .build();
+
+ LaneDescription objectiveLaneDescription = this.createObjectiveLaneDescription();
+ LaneDescription keyResultLaneDescription = this.createKeyResultLaneDescription();
+ LaneDescription taskLaneDescription = this.createInitiativeLaneDescription();
+ deckDescription.getLaneDescriptions().addAll(Arrays.asList(objectiveLaneDescription, keyResultLaneDescription, taskLaneDescription));
+ view.getDescriptions().add(deckDescription);
+ }
+
private CardDescription createCardDescription() {
EditCardTool editCardTool = this.createEditCardTool();
DeleteCardTool deleteCardTool = this.createDeleteCardTool();
return this.deckBuilders.newCardDescription()
.name("Card Description")
.semanticCandidatesExpression("aql:self.getTasksWithTag()")
- .titleExpression("aql:self.name")
+ .titleExpression(AQL_SELF_NAME)
.labelExpression("aql:self.computeTaskDurationDays()")
- .descriptionExpression("aql:self.description")
+ .descriptionExpression(AQL_SELF_DESCRIPTION)
.editTool(editCardTool)
.deleteTool(deleteCardTool)
.build();
@@ -118,6 +131,72 @@ private LaneDescription createLaneDescription(String prefix) {
.build();
}
+ private LaneDescription createObjectiveLaneDescription() {
+ EditCardTool editCardTool = this.createEditCardTool();
+ DeleteCardTool deleteCardTool = this.createDeleteCardTool();
+ CardDescription cardDescription = this.deckBuilders.newCardDescription()
+ .name("Objectives Card")
+ .semanticCandidatesExpression("aql:self.ownedObjectives")
+ .titleExpression(AQL_SELF_NAME)
+ .labelExpression("")
+ .descriptionExpression(AQL_SELF_DESCRIPTION)
+ .editTool(editCardTool)
+ .deleteTool(deleteCardTool)
+ .build();
+
+ return this.deckBuilders.newLaneDescription()
+ .name("Objectives")
+ .semanticCandidatesExpression(AQL_SELF)
+ .labelExpression("")
+ .titleExpression("Objectives")
+ .ownedCardDescriptions(cardDescription)
+ .build();
+ }
+
+ private LaneDescription createKeyResultLaneDescription() {
+ EditCardTool editCardTool = this.createEditCardTool();
+ DeleteCardTool deleteCardTool = this.createDeleteCardTool();
+ CardDescription cardDescription = this.deckBuilders.newCardDescription()
+ .name("KeyResults Card")
+ .semanticCandidatesExpression("aql:self.eAllContents(task::KeyResult)")
+ .titleExpression(AQL_SELF_NAME)
+ .labelExpression("aql:self.eContainer().name")
+ .descriptionExpression(AQL_SELF_DESCRIPTION)
+ .editTool(editCardTool)
+ .deleteTool(deleteCardTool)
+ .build();
+
+ return this.deckBuilders.newLaneDescription()
+ .name("Key Results")
+ .semanticCandidatesExpression(AQL_SELF)
+ .labelExpression("")
+ .titleExpression("Key Results")
+ .ownedCardDescriptions(cardDescription)
+ .build();
+ }
+
+ private LaneDescription createInitiativeLaneDescription() {
+ EditCardTool editCardTool = this.createEditCardTool();
+ DeleteCardTool deleteCardTool = this.createDeleteCardTool();
+ CardDescription cardDescription = this.deckBuilders.newCardDescription()
+ .name("Initiatives Card")
+ .semanticCandidatesExpression("aql:self.eAllContents(task::Task)")
+ .titleExpression(AQL_SELF_NAME)
+ .labelExpression("aql:self.eContainer(task::KeyResult).name")
+ .descriptionExpression(AQL_SELF_DESCRIPTION)
+ .editTool(editCardTool)
+ .deleteTool(deleteCardTool)
+ .build();
+
+ return this.deckBuilders.newLaneDescription()
+ .name("Initiatives")
+ .semanticCandidatesExpression(AQL_SELF)
+ .labelExpression("")
+ .titleExpression("Initiatives")
+ .ownedCardDescriptions(cardDescription)
+ .build();
+ }
+
private EditLaneTool createEditLaneTool() {
SetValue setValue = this.viewBuilders.newSetValue()
.featureName("suffix")
@@ -187,7 +266,7 @@ private CreateCardTool createCardTool() {
Let let = this.viewBuilders.newLet()
.variableName("tag")
- .valueExpression("aql:self")
+ .valueExpression(AQL_SELF)
.children(projectChangeContext)
.build();
diff --git a/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilderTests.java b/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilderTests.java
new file mode 100644
index 0000000000..16dda667d0
--- /dev/null
+++ b/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewDeckDescriptionBuilderTests.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.components.task.starter.configuration.view;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.eclipse.sirius.components.view.View;
+import org.eclipse.sirius.components.view.ViewFactory;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test used to validate the builder of the "Deck" view description.
+ *
+ * @author frouene
+ */
+class ViewDeckDescriptionBuilderTests {
+
+ @Test
+ public void testRepresentationDescriptions() {
+ View view = ViewFactory.eINSTANCE.createView();
+ new ViewDeckDescriptionBuilder().addRepresentationDescriptions(view);
+
+ assertThat(view.getDescriptions()).hasSize(3);
+ assertThat(view.getDescriptions()).anySatisfy(desc -> assertThat(desc.getName()).isEqualTo("Deck Daily Representation"));
+ assertThat(view.getDescriptions()).anySatisfy(desc -> assertThat(desc.getName()).isEqualTo("Deck OKR Representation"));
+ assertThat(view.getDescriptions()).anySatisfy(desc -> assertThat(desc.getName()).isEqualTo("Deck Kanban Representation"));
+ }
+
+}
diff --git a/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewGanttDescriptionBuilderTests.java b/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewGanttDescriptionBuilderTests.java
new file mode 100644
index 0000000000..1f46670c04
--- /dev/null
+++ b/packages/starters/backend/sirius-components-task-starter/src/test/java/org/eclipse/sirius/components/task/starter/configuration/view/ViewGanttDescriptionBuilderTests.java
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 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
+ * https://www.eclipse.org/legal/epl-2.0/
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.sirius.components.task.starter.configuration.view;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.eclipse.sirius.components.view.View;
+import org.eclipse.sirius.components.view.ViewFactory;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Test used to validate the builder of the "Gantt" view description.
+ *
+ * @author frouene
+ */
+class ViewGanttDescriptionBuilderTests {
+
+ @Test
+ public void testRepresentationDescriptions() {
+ View view = ViewFactory.eINSTANCE.createView();
+ new ViewGanttDescriptionBuilder().addRepresentationDescription(view);
+ assertThat(view.getDescriptions()).hasSize(1);
+ assertThat(view.getDescriptions()).anySatisfy(desc -> assertThat(desc.getName()).isEqualTo("Gantt Representation"));
+ }
+
+}
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDropToolBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDropToolBuilder.java
index f4449d174d..f768ddbb6d 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDropToolBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CardDropToolBuilder.java
@@ -51,15 +51,6 @@ public CardDropToolBuilder name(java.lang.String value) {
this.getCardDropTool().setName(value);
return this;
}
- /**
- * Setter for PreconditionExpression.
- *
- * @generated
- */
- public CardDropToolBuilder preconditionExpression(java.lang.String value) {
- this.getCardDropTool().setPreconditionExpression(value);
- return this;
- }
/**
* Setter for Body.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CreateCardToolBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CreateCardToolBuilder.java
index 1cd9010cad..183fc0bfe9 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CreateCardToolBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/CreateCardToolBuilder.java
@@ -51,15 +51,6 @@ public CreateCardToolBuilder name(java.lang.String value) {
this.getCreateCardTool().setName(value);
return this;
}
- /**
- * Setter for PreconditionExpression.
- *
- * @generated
- */
- public CreateCardToolBuilder preconditionExpression(java.lang.String value) {
- this.getCreateCardTool().setPreconditionExpression(value);
- return this;
- }
/**
* Setter for Body.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckDescriptionBuilder.java
index c0855e7669..1bcdd8c9a7 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckDescriptionBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckDescriptionBuilder.java
@@ -90,16 +90,6 @@ public DeckDescriptionBuilder laneDescriptions(org.eclipse.sirius.components.vie
return this;
}
- /**
- * Setter for BackgroundColor.
- *
- * @generated
- */
- public DeckDescriptionBuilder backgroundColor(org.eclipse.sirius.components.view.UserColor value) {
- this.getDeckDescription().setBackgroundColor(value);
- return this;
- }
-
/**
* Setter for LaneDropTool.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java
index ae322580c3..12a46ad8d2 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckElementDescriptionBuilder.java
@@ -26,15 +26,6 @@ public abstract class DeckElementDescriptionBuilder {
*/
protected abstract org.eclipse.sirius.components.view.deck.DeckElementDescription getDeckElementDescription();
- /**
- * Setter for Name.
- *
- * @generated
- */
- public DeckElementDescriptionBuilder name(java.lang.String value) {
- this.getDeckElementDescription().setName(value);
- return this;
- }
/**
* Setter for SemanticCandidatesExpression.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckToolBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckToolBuilder.java
index 143773c4f4..6d8ccd784d 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckToolBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeckToolBuilder.java
@@ -35,15 +35,6 @@ public DeckToolBuilder name(java.lang.String value) {
this.getDeckTool().setName(value);
return this;
}
- /**
- * Setter for PreconditionExpression.
- *
- * @generated
- */
- public DeckToolBuilder preconditionExpression(java.lang.String value) {
- this.getDeckTool().setPreconditionExpression(value);
- return this;
- }
/**
* Setter for Body.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeleteCardToolBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeleteCardToolBuilder.java
index 4b712f4586..36e3cec269 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeleteCardToolBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/DeleteCardToolBuilder.java
@@ -51,15 +51,6 @@ public DeleteCardToolBuilder name(java.lang.String value) {
this.getDeleteCardTool().setName(value);
return this;
}
- /**
- * Setter for PreconditionExpression.
- *
- * @generated
- */
- public DeleteCardToolBuilder preconditionExpression(java.lang.String value) {
- this.getDeleteCardTool().setPreconditionExpression(value);
- return this;
- }
/**
* Setter for Body.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditCardToolBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditCardToolBuilder.java
index d1509e19e2..014acff0cf 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditCardToolBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditCardToolBuilder.java
@@ -51,15 +51,6 @@ public EditCardToolBuilder name(java.lang.String value) {
this.getEditCardTool().setName(value);
return this;
}
- /**
- * Setter for PreconditionExpression.
- *
- * @generated
- */
- public EditCardToolBuilder preconditionExpression(java.lang.String value) {
- this.getEditCardTool().setPreconditionExpression(value);
- return this;
- }
/**
* Setter for Body.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditLaneToolBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditLaneToolBuilder.java
index ba8d3e7698..936709e088 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditLaneToolBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/EditLaneToolBuilder.java
@@ -51,15 +51,6 @@ public EditLaneToolBuilder name(java.lang.String value) {
this.getEditLaneTool().setName(value);
return this;
}
- /**
- * Setter for PreconditionExpression.
- *
- * @generated
- */
- public EditLaneToolBuilder preconditionExpression(java.lang.String value) {
- this.getEditLaneTool().setPreconditionExpression(value);
- return this;
- }
/**
* Setter for Body.
*
diff --git a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDropToolBuilder.java b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDropToolBuilder.java
index 58046d85ca..4a49ad6c54 100644
--- a/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDropToolBuilder.java
+++ b/packages/view/backend/sirius-components-view-builder/src/main/java/org/eclipse/sirius/components/view/builder/generated/LaneDropToolBuilder.java
@@ -51,15 +51,6 @@ public LaneDropToolBuilder name(java.lang.String value) {
this.getLaneDropTool().setName(value);
return this;
}
- /**
- * Setter for PreconditionExpression.
- *
- * @generated
- */
- public LaneDropToolBuilder preconditionExpression(java.lang.String value) {
- this.getLaneDropTool().setPreconditionExpression(value);
- return this;
- }
/**
* Setter for Body.
*
diff --git a/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java
index c4c80c2556..7c3d44d808 100644
--- a/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java
+++ b/packages/view/backend/sirius-components-view-deck-edit/src/main/java/org/eclipse/sirius/components/view/deck/provider/CardDescriptionItemProvider.java
@@ -52,11 +52,23 @@ public List getPropertyDescriptors(Object object) {
if (this.itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);
+ this.addNamePropertyDescriptor(object);
this.addDescriptionExpressionPropertyDescriptor(object);
}
return this.itemPropertyDescriptors;
}
+ /**
+ * This adds a property descriptor for the Name feature.
+ *
+ * @generated
+ */
+ protected void addNamePropertyDescriptor(Object object) {
+ this.itemPropertyDescriptors.add(this.createItemPropertyDescriptor(((ComposeableAdapterFactory) this.adapterFactory).getRootAdapterFactory(), this.getResourceLocator(),
+ this.getString("_UI_CardDescription_name_feature"), this.getString("_UI_PropertyDescriptor_description", "_UI_CardDescription_name_feature", "_UI_CardDescription_type"),
+ DeckPackage.Literals.CARD_DESCRIPTION__NAME, true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
+ }
+
/**
* This adds a property descriptor for the Description Expression feature.
@@ -144,6 +156,7 @@ public void notifyChanged(Notification notification) {
this.updateChildren(notification);
switch (notification.getFeatureID(CardDescription.class)) {
+ case DeckPackage.CARD_DESCRIPTION__NAME:
case DeckPackage.CARD_DESCRIPTION__DESCRIPTION_EXPRESSION:
this.fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
@@ -174,18 +187,10 @@ protected void collectNewChildDescriptors(Collection