Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ It has long been unused by Sirius Web itself (since the transition to MUI).
- https://github.com/eclipse-syson/syson/issues/2306[#2306] [diagrams] Fixed an error when trying to rename a constraint displayed as a list item through direct edit.
- https://github.com/eclipse-syson/syson/issues/2318[#2318] [diagrams] Direct edit on a constraint label now ignores the expression part (`{ ... }`) if present in the new text.
- https://github.com/eclipse-syson/syson/issues/2331[#2331] [diagrams] Fix the broken `New Interface` tool icon.
- https://github.com/eclipse-syson/syson/issues/2320[#2320] [diagrams] Add an explicit warning message when user tries to reconnect one Actor's edge to another Actor.

=== Improvements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,23 @@ public Element reconnectSourceNestedActorEdge(Element self, Element newSource, E
return otherEnd;
}

/**
* Reconnects the target of a nested actor edge (the Actor side of the edge).
* This service is only used because edge preconditions are not taken into account.
*
* @param self
* the current UseCase or Requirement
* @return the given self
*/
public Element reconnectTargetNestedActorEdge(Element self) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please always add javadoc on public methods

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

// due to https://github.com/eclipse-sirius/sirius-web/issues/2930 we cannot prevent the user to do the reconnect,
// so we just warn him/her that this is not possible.
String errorMessage = "An Actor cannot be disconnected from its UseCase or its Requirement element";
this.logger.warn(errorMessage);
this.feedbackMessageService.addFeedbackMessage(new Message(errorMessage, MessageLevel.WARNING));
return self;
}

/**
* Reconnects the source of a nested stakeholder edge.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,17 @@ protected ChangeContextBuilder getSourceReconnectToolBody() {

@Override
protected ChangeContextBuilder getTargetReconnectToolBody() {
// Because of https://github.com/eclipse-sirius/sirius-web/issues/2930, it is not possible to prevent user to do the reconnection.
return this.viewBuilderHelper.newChangeContext()
.expression(ServiceMethod.of0(ViewToolService::reconnectTargetNestedActorEdge).aql(AQLConstants.EDGE_SEMANTIC_ELEMENT));
}

@Override
protected String getTargetReconnectToolPreconditionExpression() {
// It is not possible to reconnect the target (actor) of this edge. This would mean that the existing actor is
// not contained in a UseCase/Requirement anymore.
return this.viewBuilderHelper.newChangeContext();
// Once https://github.com/eclipse-sirius/sirius-web/issues/2930 is fixed, this precondition could be evaluated.
return "aql:false";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ Now, the label dynamically adapts based on whether the `ConcernUsage` or `Constr
*** Elements without a name and an owned reference subsetting display only the reference subsetting name.
*** Elements without a reference subsetting display their name.
** Fix the broken `New Interface` tool icon.
** Add an explicit warning message when user tries to reconnect one `Actor` 's graphical edge to another `Actor`.

== Improvements

Expand Down
Loading