Commit a121df1d44fb5ff6d65186209780847853a71d40

Authored by Igor Kulikov
1 parent 10ddb5f8

Fix entity select component for current customer

... ... @@ -122,6 +122,9 @@ export class EntitySelectComponent implements ControlValueAccessor, OnInit, Afte
122 122
123 123 writeValue(value: EntityId | null): void {
124 124 if (value != null) {
  125 + if (value.id === NULL_UUID) {
  126 + value.id = null;
  127 + }
125 128 this.modelValue = value;
126 129 this.entitySelectFormGroup.get('entityType').patchValue(value.entityType, {emitEvent: true});
127 130 this.entitySelectFormGroup.get('entityId').patchValue(value, {emitEvent: true});
... ... @@ -146,6 +149,8 @@ export class EntitySelectComponent implements ControlValueAccessor, OnInit, Afte
146 149 || this.modelValue.entityType === AliasEntityType.CURRENT_USER
147 150 || this.modelValue.entityType === AliasEntityType.CURRENT_USER_OWNER) {
148 151 this.modelValue.id = NULL_UUID;
  152 + } else if (this.modelValue.entityType === AliasEntityType.CURRENT_CUSTOMER && !this.modelValue.id) {
  153 + this.modelValue.id = NULL_UUID;
149 154 }
150 155
151 156 if (this.modelValue.entityType && this.modelValue.id) {
... ...