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
parent
commit
f7bcada750
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 1
      ui-ngx/src/app/modules/home/pages/notification/recipient/recipient-notification-dialog.component.html
  2. 16
      ui-ngx/src/app/shared/components/entity/entity-list.component.ts

1
ui-ngx/src/app/modules/home/pages/notification/recipient/recipient-notification-dialog.component.html

@ -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 }}"

16
ui-ngx/src/app/shared/components/entity/entity-list.component.ts

@ -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);

Loading…
Cancel
Save