Browse Source
Merge pull request #14297 from mtsymbarov-del/fix/notification-recipients-duplicate-ids
Fix deleted user IDs remaining in Notification recipient user list
pull/14365/head
Vladyslav Prykhodko
7 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
10 additions and
7 deletions
-
ui-ngx/src/app/modules/home/pages/notification/recipient/recipient-notification-dialog.component.html
-
ui-ngx/src/app/shared/components/entity/entity-list.component.ts
|
|
|
@ -92,6 +92,7 @@ |
|
|
|
<ng-container *ngSwitchCase="notificationTargetConfigType.USER_LIST"> |
|
|
|
<tb-entity-list |
|
|
|
required |
|
|
|
syncIdsWithDB |
|
|
|
formControlName="usersIds" |
|
|
|
[entityType]="entityType.USER" |
|
|
|
labelText="{{ 'user.user-list' | translate }}" |
|
|
|
|
|
|
|
@ -209,16 +209,18 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, OnChan |
|
|
|
this.searchText = ''; |
|
|
|
if (value != null && value.length > 0) { |
|
|
|
this.modelValue = [...value]; |
|
|
|
this.entityService.getEntities(this.entityType, value).subscribe( |
|
|
|
(entities) => { |
|
|
|
this.entities = entities; |
|
|
|
this.entityService.getEntities(this.entityType, value) |
|
|
|
.subscribe(resolvedEntities => { |
|
|
|
this.entities = resolvedEntities; |
|
|
|
this.entityListFormGroup.get('entities').setValue(this.entities); |
|
|
|
if (this.syncIdsWithDB && this.modelValue.length !== entities.length) { |
|
|
|
this.modelValue = entities.map(entity => entity.id.id); |
|
|
|
if (this.syncIdsWithDB && this.modelValue.length !== this.entities.length) { |
|
|
|
this.modelValue = this.entities.map(entity => entity.id.id); |
|
|
|
if (!this.modelValue.length) { |
|
|
|
this.modelValue = null; |
|
|
|
} |
|
|
|
this.propagateChange(this.modelValue); |
|
|
|
} |
|
|
|
} |
|
|
|
); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
this.entities = []; |
|
|
|
this.entityListFormGroup.get('entities').setValue(this.entities); |
|
|
|
|