Skip to content

Commit

Permalink
Merge pull request #469 from lvydra/HAL-1722
Browse files Browse the repository at this point in the history
[HAL-1722] Only latest applied patch can be rolled back
  • Loading branch information
hpehl committed Jun 8, 2021
2 parents 2e90f48 + a203e73 commit 3da85b7
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ public String getTitle() {
public List<ItemAction<ModelNode>> actions() {

List<ItemAction<ModelNode>> actions = new ArrayList<>();
actions.add(new ItemAction.Builder<ModelNode>()
.title(resources.constants().rollback())
.handler(item1 -> rollback(item1.get(PATCH_ID).asString()))
.constraint(Constraint.executable(PATCHING_TEMPLATE, ROLLBACK_OPERATION))
.build());

if (item.equals(getCurrentItems().get(0))) {
actions.add(new ItemAction.Builder<ModelNode>()
.title(resources.constants().rollback())
.handler(item1 -> rollback(item1.get(PATCH_ID).asString()))
.constraint(Constraint.executable(PATCHING_TEMPLATE, ROLLBACK_OPERATION))
.build());
}

return actions;
}
Expand Down

0 comments on commit 3da85b7

Please sign in to comment.