Browse Source

UI: Improvement firmware autocomplete

pull/4602/head
Vladyslav_Prykhodko 5 years ago
parent
commit
a3bd6efa24
  1. 2
      ui-ngx/src/app/core/http/firmware.service.ts
  2. 6
      ui-ngx/src/app/shared/components/firmware/firmware-autocomplete.component.ts

2
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'

6
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;

Loading…
Cancel
Save