diff --git a/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.html b/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.html index b755e02d8b..784f13d3f4 100644 --- a/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.html +++ b/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.html @@ -24,7 +24,7 @@
- {{ queuesControl.value.name }} + {{ getTitle(queuesControl.value.name) }}
diff --git a/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts b/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts index 45a7d87eca..aa5325e974 100644 --- a/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts +++ b/ui-ngx/src/app/modules/home/components/profile/queue/tenant-profile-queues.component.ts @@ -56,6 +56,7 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid tenantProfileQueuesFormGroup: FormGroup; newQueue = false; + idMap = []; private requiredValue: boolean; get required(): boolean { @@ -116,7 +117,13 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid } const queuesControls: Array = []; if (queues) { - queues.forEach((queue) => { + queues.forEach((queue, index) => { + if (!queue.id) { + if (!this.idMap[index]) { + this.idMap.push(guid()); + } + queue.id = this.idMap[index]; + } queuesControls.push(this.fb.control(queue, [Validators.required])); }); } @@ -140,6 +147,7 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid public removeQueue(index: number) { (this.tenantProfileQueuesFormGroup.get('queues') as FormArray).removeAt(index); + this.idMap.splice(index, 1); } public addQueue() { @@ -166,6 +174,7 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid description: '' } }; + this.idMap.push(queue.id); this.newQueue = true; const queuesArray = this.tenantProfileQueuesFormGroup.get('queues') as FormArray; queuesArray.push(this.fb.control(queue, [])); @@ -175,6 +184,10 @@ export class TenantProfileQueuesComponent implements ControlValueAccessor, Valid } } + getTitle(value): string { + return this.utils.customTranslation(value, value); + } + public validate(c: AbstractControl): ValidationErrors | null { return this.tenantProfileQueuesFormGroup.valid ? null : { queues: { diff --git a/ui-ngx/src/app/modules/home/components/queue/queue-form.component.ts b/ui-ngx/src/app/modules/home/components/queue/queue-form.component.ts index cb2cf06b88..bb86b1edcb 100644 --- a/ui-ngx/src/app/modules/home/components/queue/queue-form.component.ts +++ b/ui-ngx/src/app/modules/home/components/queue/queue-form.component.ts @@ -159,9 +159,6 @@ export class QueueFormComponent implements ControlValueAccessor, OnInit, OnDestr if (isDefinedAndNotNull(this.modelValue)) { this.queueFormGroup.patchValue(this.modelValue, {emitEvent: false}); this.submitStrategyTypeChanged(); - if (!this.modelValue.name) { - this.queueFormGroup.get('name').enable({emitEvent: false}); - } } if (!this.disabled && !this.queueFormGroup.valid) { this.updateModel(); diff --git a/ui-ngx/src/app/modules/home/pages/tenant-profile/tenant-profiles-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/tenant-profile/tenant-profiles-table-config.resolver.ts index d9f7efc602..cf6686d78f 100644 --- a/ui-ngx/src/app/modules/home/pages/tenant-profile/tenant-profiles-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/tenant-profile/tenant-profiles-table-config.resolver.ts @@ -86,12 +86,7 @@ export class TenantProfilesTableConfigResolver implements Resolve this.translate.instant('tenant-profile.delete-tenant-profiles-text'); this.config.entitiesFetchFunction = pageLink => this.tenantProfileService.getTenantProfiles(pageLink); - this.config.loadEntity = id => this.tenantProfileService.getTenantProfile(id.id).pipe( - map(tenantProfile => ({ - ...tenantProfile, - profileData: {...tenantProfile.profileData, queueConfiguration: this.addId(tenantProfile.profileData.queueConfiguration)}, - })) - ); + this.config.loadEntity = id => this.tenantProfileService.getTenantProfile(id.id); this.config.saveEntity = tenantProfile => this.tenantProfileService.saveTenantProfile(tenantProfile); this.config.deleteEntity = id => this.tenantProfileService.deleteTenantProfile(id.id); this.config.onEntityAction = action => this.onTenantProfileAction(action); @@ -100,18 +95,6 @@ export class TenantProfilesTableConfigResolver implements Resolve { - value.id = guid(); - queuesWithId.push(value); - }); - return queuesWithId; - } - return null; - } - resolve(): EntityTableConfig { this.config.tableTitle = this.translate.instant('tenant-profile.tenant-profiles');