diff --git a/ui-ngx/src/app/core/http/firmware.service.ts b/ui-ngx/src/app/core/http/firmware.service.ts index 8c3249aee6..b1919a2fa4 100644 --- a/ui-ngx/src/app/core/http/firmware.service.ts +++ b/ui-ngx/src/app/core/http/firmware.service.ts @@ -22,7 +22,7 @@ import { Observable } from 'rxjs'; import { PageData } from '@shared/models/page/page-data'; import { Firmware, FirmwareInfo, FirmwareType } from '@shared/models/firmware.models'; import { catchError, map, mergeMap } from 'rxjs/operators'; -import { deepClone, isDefinedAndNotNull } from '@core/utils'; +import { deepClone } from '@core/utils'; @Injectable({ providedIn: 'root' diff --git a/ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.ts b/ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.ts index 751415bcce..a3aeafbd5e 100644 --- a/ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.ts +++ b/ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.ts @@ -47,7 +47,7 @@ export class FirmwareAutocompleteComponent implements ControlValueAccessor, OnIn firmwareFormGroup: FormGroup; - modelValue: string | null; + modelValue: string | EntityId | null; @Input() type = FirmwareType.FIRMWARE; @@ -182,8 +182,8 @@ export class FirmwareAutocompleteComponent implements ControlValueAccessor, OnIn if (firmwareId !== '') { this.entityService.getEntity(EntityType.FIRMWARE, firmwareId, {ignoreLoading: true, ignoreErrors: true}).subscribe( (entity) => { - this.modelValue = entity.id.id; - this.firmwareFormGroup.get('firmwareId').patchValue(entity); + this.modelValue = this.useFullEntityId ? entity.id : entity.id.id; + this.firmwareFormGroup.get('firmwareId').patchValue(entity, {emitEvent: false}); }, () => { this.modelValue = null;