diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee-panel.component.ts b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee-panel.component.ts index bd50beef31..bca84bc8a3 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee-panel.component.ts +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee-panel.component.ts @@ -65,6 +65,8 @@ export class AlarmAssigneePanelComponent implements OnInit, AfterViewInit, OnDe assigneeId?: string; + reassigned: boolean = false; + selectUserFormGroup: FormGroup; @ViewChild('userInput', {static: true}) userInput: ElementRef; @@ -130,12 +132,18 @@ export class AlarmAssigneePanelComponent implements OnInit, AfterViewInit, OnDe assign(user: User): void { this.alarmService.assignAlarm(this.alarmId, user.id.id, {ignoreLoading: true}).subscribe( - () => this.overlayRef.dispose()); + () => { + this.reassigned = true; + this.overlayRef.dispose() + }); } unassign(): void { this.alarmService.unassignAlarm(this.alarmId, {ignoreLoading: true}).subscribe( - () => this.overlayRef.dispose()); + () => { + this.reassigned = true; + this.overlayRef.dispose() + }); } fetchUsers(searchText?: string): Observable> { diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html index e0bec8088d..dd4c8ee1d9 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.html @@ -16,14 +16,15 @@ --> -
- - alarm.assignee - - - {{ getUserInitials(alarm.assignee) }} - - account_circle - arrow_drop_down - -
+ + alarm.assignee + + + {{ getUserInitials(alarm.assignee) }} + + account_circle + arrow_drop_down + diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.ts b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.ts index a66ff6e070..1fb1d3f689 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.ts +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-assignee.component.ts @@ -124,7 +124,7 @@ export class AlarmAssigneeComponent { config.hasBackdrop = true; const connectedPosition: ConnectedPosition = { originX: 'center', - originY: 'center', + originY: 'bottom', overlayX: 'center', overlayY: 'top' }; diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.html b/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.html index 4d0527841f..ac2bb73d05 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.html +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-comment.component.html @@ -55,7 +55,7 @@
-
+
{{ displayDataElement.commentText }} @@ -70,8 +70,7 @@ *ngIf="!displayDataElement.edit; else commentEditing" (mouseenter)="onCommentMouseEnter(displayDataElement.commentId, i)" (mouseleave)="onCommentMouseLeave(i)"> -
{{ getUserInitials(displayDataElement.displayName) }}
@@ -91,7 +90,7 @@
{{ displayDataElement.commentText }}
-
- + - + alarm.show-more diff --git a/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts b/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts index dbae21ca5d..9b67da4b71 100644 --- a/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts +++ b/ui-ngx/src/app/modules/home/components/alarm/alarm-table-config.ts @@ -53,7 +53,8 @@ import { Authority } from '@shared/models/authority.enum'; import { ChangeDetectorRef, Injector, StaticProvider, ViewContainerRef } from '@angular/core'; import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay'; import { - ALARM_ASSIGNEE_PANEL_DATA, AlarmAssigneePanelComponent, + ALARM_ASSIGNEE_PANEL_DATA, + AlarmAssigneePanelComponent, AlarmAssigneePanelData } from '@home/components/alarm/alarm-assignee-panel.component'; import { ComponentPortal } from '@angular/cdk/portal'; @@ -282,8 +283,13 @@ export class AlarmTableConfig extends EntityTableConfig } ]; const injector = Injector.create({parent: this.viewContainerRef.injector, providers}); - overlayRef.attach(new ComponentPortal(AlarmAssigneePanelComponent, - this.viewContainerRef, injector)).onDestroy(() => this.updateData()); + const componentRef = overlayRef.attach(new ComponentPortal(AlarmAssigneePanelComponent, + this.viewContainerRef, injector)); + componentRef.onDestroy(() => { + if (componentRef.instance.reassigned) { + this.updateData() + } + }); } }