Skip to content

Commit

Permalink
Merge pull request #871 from utmstack/bugfix/v10.5.12/870-bug-error-o…
Browse files Browse the repository at this point in the history
…n-server-when-sorting-by-severity

fix: error on server when sorting by severity column in threat Management/Alerts view
  • Loading branch information
c3s4rfred authored Oct 29, 2024
2 parents 70e5488 + e111f82 commit 6e581f1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# UTMStack 10.5.12 Release Notes
# UTMStack 10.5.13 Release Notes
## Bugfix
- Implemented validation checks during the user deletion process to prevent the deletion of the last admin user. This ensures that at least one admin user remains in the system, maintaining the integrity of the authentication process.
- Error on server when sorting by severity column in threat Management/Alerts view.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ import {AlertManagementService} from '../shared/services/alert-management.servic
import {AlertTagService} from '../shared/services/alert-tag.service';
import {getCurrentAlertStatus, getStatusName} from '../shared/util/alert-util-function';
import {CheckEmailConfigService, ParamShortType} from '../../../shared/services/util/check-email-config.service';
import {Subject} from "rxjs";
import {takeUntil} from "rxjs/operators";

@Component({
selector: 'app-alert-view',
Expand Down Expand Up @@ -102,28 +104,24 @@ export class AlertViewComponent implements OnInit, OnDestroy {
refreshingAlert = false;
firstLoad = true;
tags: AlertTags[];
destroy$ = new Subject<void>();

constructor(private elasticDataService: ElasticDataService,
private modalService: NgbModal,
private utmToastService: UtmToastService,
private translate: TranslateService,
private alertServiceManagement: AlertManagementService,
private alertFiltersBehavior: AlertFiltersBehavior,
private updateStatusServiceBehavior: AlertStatusBehavior,
private activatedRoute: ActivatedRoute,
public router: Router,
private newAlertBehavior: NewAlertBehavior,
private alertUpdateTagBehavior: AlertUpdateTagBehavior,
private alertDataTypeBehavior: AlertDataTypeBehavior,
private alertTagService: AlertTagService,
private spinner: NgxSpinnerService,
private checkEmailConfigService: CheckEmailConfigService) {
// this.tableWidth = this.pageWidth - 300;
}

ngOnDestroy(): void {
}

ngOnInit() {
this.checkEmailConfigService.check(ParamShortType.Alert);
this.setInitialWidth();
Expand Down Expand Up @@ -166,7 +164,9 @@ export class AlertViewComponent implements OnInit, OnDestroy {
this.alertFiltersBehavior.$filters.next(this.filters);
}
});
this.newAlertBehavior.$alertChange.subscribe(newAlerts => {
this.newAlertBehavior.$alertChange
.pipe(takeUntil(this.destroy$))
.subscribe(newAlerts => {
if (newAlerts && newAlerts !== 0) {
this.incomingAlert = newAlerts;
}
Expand Down Expand Up @@ -318,6 +318,7 @@ export class AlertViewComponent implements OnInit, OnDestroy {
this.refreshingAlert = false;
},
(res: HttpResponse<any>) => {
this.utmToastService.showError('Error', 'An error occurred while listing the alerts. Please try again later.');
}
);
}
Expand Down Expand Up @@ -549,4 +550,9 @@ export class AlertViewComponent implements OnInit, OnDestroy {
const modal = this.modalService.open(IrCreateRuleComponent, {size: 'lg', centered: true});
modal.componentInstance.alert = alert;
}

ngOnDestroy(): void {
this.destroy$.next();
this.destroy$.complete();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const ALERT_FIELDS: UtmFieldType[] = [
{
label: 'Severity',
field: ALERT_SEVERITY_FIELD_LABEL,
type: ElasticDataTypesEnum.NUMBER,
type: ElasticDataTypesEnum.STRING,
visible: true,
},
{
Expand Down
2 changes: 1 addition & 1 deletion version.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 10.5.12
version: 10.5.13

0 comments on commit 6e581f1

Please sign in to comment.