From 687b4feb03f1b54b01097aa3ba39b3e31b833c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Tue, 9 Jun 2026 11:50:28 -0600 Subject: [PATCH] fix[frontend](alerts): properly handle update alerts errors --- .../alert-action-select/alert-action-select.component.ts | 5 ++++- .../components/alert-complete/alert-complete.component.ts | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/data-management/alert-management/shared/components/alert-action-select/alert-action-select.component.ts b/frontend/src/app/data-management/alert-management/shared/components/alert-action-select/alert-action-select.component.ts index 7fcf92eff..7415b064f 100644 --- a/frontend/src/app/data-management/alert-management/shared/components/alert-action-select/alert-action-select.component.ts +++ b/frontend/src/app/data-management/alert-management/shared/components/alert-action-select/alert-action-select.component.ts @@ -164,7 +164,6 @@ export class AlertActionSelectComponent implements OnInit, OnDestroy { const alert = this.alert; this.changing = true; if (status === AlertStatusEnum.COMPLETED || status === AlertStatusEnum.COMPLETED_AS_FALSE_POSITIVE) { - console.log('status', status); const modalRef = this.modalService.open(AlertCompleteComponent, {centered: true}); modalRef.componentInstance.alertsIDs = [alert.id]; modalRef.componentInstance.canCreateRule = true; @@ -184,6 +183,7 @@ export class AlertActionSelectComponent implements OnInit, OnDestroy { this.syncIncidentAlertStatus([this.alert.id], status); } else { this.changing = false; + this.utmToastService.showError('Error', 'An error occurred while changing the alert status. Please try again later.'); } }); } else { @@ -192,6 +192,9 @@ export class AlertActionSelectComponent implements OnInit, OnDestroy { this.changing = false; this.alertUpdateHistoryBehavior.$refreshHistory.next(true); this.syncIncidentAlertStatus([this.alert.id], status); + }, () => { + this.changing = false; + this.utmToastService.showError('Error', 'An error occurred while changing the alert status. Please try again later.'); }); } } diff --git a/frontend/src/app/data-management/alert-management/shared/components/alert-complete/alert-complete.component.ts b/frontend/src/app/data-management/alert-management/shared/components/alert-complete/alert-complete.component.ts index 87881bbfb..0f01ffff5 100644 --- a/frontend/src/app/data-management/alert-management/shared/components/alert-complete/alert-complete.component.ts +++ b/frontend/src/app/data-management/alert-management/shared/components/alert-complete/alert-complete.component.ts @@ -58,7 +58,10 @@ export class AlertCompleteComponent implements OnInit { this.statusChange.emit('success'); this.activeModal.close(); this.creating = false; - }); + },_err=>{ + this.creating = false; + this.statusChange.emit('failed'); +}); } createRule() {