From 73a09f79d21ad036f27f91bce025af35ccd53103 Mon Sep 17 00:00:00 2001 From: Maksym Tsymbarov Date: Tue, 23 Dec 2025 13:05:00 +0200 Subject: [PATCH] Simplified logic --- .../home/components/alarm/alarm-comment.component.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.ts b/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.ts index 220a49210d..6d426cdcd0 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.ts +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.ts @@ -154,22 +154,20 @@ export class AlarmCommentComponent implements OnInit { private parseSystemComment(alarm: AlarmCommentInfo): string { const subTypeKey = alarm.comment?.subtype; - const alarmComment = deepClone(alarm.comment); if (subTypeKey && AlarmMessage[subTypeKey]) { + const alarmComment = deepClone(alarm.comment); const translationKey = AlarmMessage[subTypeKey]; if (alarmComment?.newSeverity) { - const newSeverityKey = + alarmComment.newSeverity = (alarmSeverityTranslations.has(alarmComment.newSeverity) - ? alarmSeverityTranslations.get(alarmComment.newSeverity) + ? this.translate.instant(alarmSeverityTranslations.get(alarmComment.newSeverity)) : alarmComment.newSeverity) as AlarmSeverity; - alarmComment.newSeverity = this.translate.instant(newSeverityKey); } if (alarmComment?.oldSeverity) { - const oldSeverityKey = + alarmComment.oldSeverity = (alarmSeverityTranslations.has(alarmComment.oldSeverity) - ? alarmSeverityTranslations.get(alarmComment.oldSeverity) + ? this.translate.instant(alarmSeverityTranslations.get(alarmComment.oldSeverity)) : alarmComment.oldSeverity) as AlarmSeverity; - alarmComment.oldSeverity = this.translate.instant(oldSeverityKey); } return this.translate.instant(translationKey, alarmComment); }