Skip to content

Commit

Permalink
fix(spa-deployment): fix initial units and alert groups can be selected
Browse files Browse the repository at this point in the history
  • Loading branch information
timonmasberg committed Jul 20, 2024
1 parent b8f291b commit 89c0466
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,16 @@ export class AlertGroupSelectionsComponent {
private readonly cd = inject(ChangeDetectorRef);

removeAlertGroup(index: number): void {
const formValue = this.formArray().at(index).value;

// unmark assigned units of the alert group and the alert group itself
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
for (const unit of formValue.assignedUnits!) {
this.possibleUnitSelectionsService?.unmarkAsSelected(unit);
}
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.possibleAlertGroupSelectionsService.unmarkAsSelected(
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
this.formArray().at(index).value.alertGroup!,
formValue.alertGroup!,
);
this.formArray().removeAt(index);
}
Expand Down

0 comments on commit 89c0466

Please sign in to comment.