Browse Source
Merge pull request #11976 from maxunbearable/fix/4807-alarm-comment-trim
Added trim spaces for alarm comments
pull/11990/head
Igor Kulikov
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
11 additions and
3 deletions
-
ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.html
-
ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.ts
|
|
|
@ -173,7 +173,7 @@ |
|
|
|
<button mat-icon-button |
|
|
|
type="button" |
|
|
|
matSuffix |
|
|
|
*ngIf="getAlarmCommentFormControl().value" |
|
|
|
*ngIf="getAlarmCommentValue()" |
|
|
|
(click)="saveComment()"> |
|
|
|
<mat-icon color="primary"> |
|
|
|
send |
|
|
|
|
|
|
|
@ -156,7 +156,7 @@ export class AlarmCommentComponent implements OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
saveComment(): void { |
|
|
|
const commentInputValue: string = this.getAlarmCommentFormControl().value; |
|
|
|
const commentInputValue: string = this.getAlarmCommentValue(); |
|
|
|
if (commentInputValue) { |
|
|
|
const comment: AlarmComment = { |
|
|
|
alarmId: { |
|
|
|
@ -174,7 +174,7 @@ export class AlarmCommentComponent implements OnInit { |
|
|
|
} |
|
|
|
|
|
|
|
saveEditedComment(commentId: string): void { |
|
|
|
const commentEditInputValue: string = this.getAlarmCommentEditFormControl().value; |
|
|
|
const commentEditInputValue: string = this.getAlarmCommentEditValue(); |
|
|
|
if (commentEditInputValue) { |
|
|
|
const editedComment: AlarmComment = this.getAlarmCommentById(commentId); |
|
|
|
editedComment.comment.text = commentEditInputValue; |
|
|
|
@ -277,6 +277,14 @@ export class AlarmCommentComponent implements OnInit { |
|
|
|
return this.alarmCommentFormGroup.get('alarmCommentEdit'); |
|
|
|
} |
|
|
|
|
|
|
|
getAlarmCommentValue(): string { |
|
|
|
return this.alarmCommentFormGroup.get('alarmComment').value.trim(); |
|
|
|
} |
|
|
|
|
|
|
|
private getAlarmCommentEditValue(): string { |
|
|
|
return this.alarmCommentFormGroup.get('alarmCommentEdit').value.trim(); |
|
|
|
} |
|
|
|
|
|
|
|
private clearCommentInput(): void { |
|
|
|
this.getAlarmCommentFormControl().patchValue(''); |
|
|
|
} |
|
|
|
|