|
|
@ -122,6 +122,9 @@ export class EntitySelectComponent implements ControlValueAccessor, OnInit, Afte |
|
|
|
|
|
|
|
|
writeValue(value: EntityId | null): void { |
|
|
writeValue(value: EntityId | null): void { |
|
|
if (value != null) { |
|
|
if (value != null) { |
|
|
|
|
|
if (value.id === NULL_UUID) { |
|
|
|
|
|
value.id = null; |
|
|
|
|
|
} |
|
|
this.modelValue = value; |
|
|
this.modelValue = value; |
|
|
this.entitySelectFormGroup.get('entityType').patchValue(value.entityType, {emitEvent: true}); |
|
|
this.entitySelectFormGroup.get('entityType').patchValue(value.entityType, {emitEvent: true}); |
|
|
this.entitySelectFormGroup.get('entityId').patchValue(value, {emitEvent: true}); |
|
|
this.entitySelectFormGroup.get('entityId').patchValue(value, {emitEvent: true}); |
|
|
@ -146,6 +149,8 @@ export class EntitySelectComponent implements ControlValueAccessor, OnInit, Afte |
|
|
|| this.modelValue.entityType === AliasEntityType.CURRENT_USER |
|
|
|| this.modelValue.entityType === AliasEntityType.CURRENT_USER |
|
|
|| this.modelValue.entityType === AliasEntityType.CURRENT_USER_OWNER) { |
|
|
|| this.modelValue.entityType === AliasEntityType.CURRENT_USER_OWNER) { |
|
|
this.modelValue.id = NULL_UUID; |
|
|
this.modelValue.id = NULL_UUID; |
|
|
|
|
|
} else if (this.modelValue.entityType === AliasEntityType.CURRENT_CUSTOMER && !this.modelValue.id) { |
|
|
|
|
|
this.modelValue.id = NULL_UUID; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (this.modelValue.entityType && this.modelValue.id) { |
|
|
if (this.modelValue.entityType && this.modelValue.id) { |
|
|
|