Skip to content

Commit

Permalink
[SYNCOPE-1846] - Fixed a bug that always displayed the same panel for…
Browse files Browse the repository at this point in the history
… creating relationships, preventing the creation of more than one relationship at a time. Fixed a console issue occurring after deleting a relationship.
  • Loading branch information
TatoniMatteo committed Dec 9, 2024
1 parent 77dd1ec commit 56507da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ protected void populateItem(final ListItem<RelationshipTO> relationshipItem) {
@Override
public void onClick(final AjaxRequestTarget target, final RelationshipTO modelObject) {
relationships.remove(modelObject);
relationshipsList.remove(relationshipItem);
target.add(RelationshipViewPanel.this);
}
}, ActionLink.ActionType.DELETE, AnyEntitlement.UPDATE.getFor(anyTO.getType()), true).hideLabel();
Expand Down Expand Up @@ -133,12 +134,12 @@ private void buildRowLabels(

row.add(new Label("relationship", relationshipTO.getType()));
Label leftEnd = new Label("left_end", isLeftRelation
? String.format("%s %s", anyTO.getType() , anyName)
? String.format("%s %s", anyTO.getType(), anyName)
: String.format("%s %s", relationshipTO.getOtherEndType(), relationshipTO.getOtherEndName()));

Label rightEnd = new Label("right_end", isLeftRelation
? String.format("%s %s", relationshipTO.getOtherEndType(), relationshipTO.getOtherEndName())
: String.format("%s %s", anyTO.getType() , anyName));
: String.format("%s %s", anyTO.getType(), anyName));

if (anyTO.getKey() != null && anyTO.getKey().equals(relationshipTO.getOtherEndKey())) {
setBold(leftEnd, rightEnd);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public class Relationships extends WizardStep implements ICondition {

protected final AnyTO anyTO;

protected final Specification specification;

protected final PageReference pageRef;

public Relationships(final AnyWrapper<?> modelObject, final PageReference pageRef) {
Expand All @@ -110,7 +108,6 @@ public Relationships(final AnyWrapper<?> modelObject, final PageReference pageRe
}

this.anyTO = modelObject.getInnerObject();
this.specification = new Specification();
this.pageRef = pageRef;

// ------------------------
Expand Down Expand Up @@ -148,7 +145,7 @@ protected Fragment getViewFragment() {
public void onClick(final AjaxRequestTarget target, final RelationshipTO ignore) {
Fragment addFragment = new Fragment("relationships", "addFragment", Relationships.this);
addOrReplace(addFragment);
addFragment.add(specification.setRenderBodyOnly(true));
addFragment.add(new Specification().setRenderBodyOnly(true));
target.add(Relationships.this);
}
}, ActionType.CREATE, AnyEntitlement.UPDATE.getFor(anyTO.getType())).hideLabel();
Expand Down

0 comments on commit 56507da

Please sign in to comment.