X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=src%2Fapp%2Futilities%2Fstart-stop-rebuild%2FStartStopRebuildComponent.ts;h=994012913da49a819085c49bebeabe0ee0e4afb9;hb=c7e646225214c583463c859f267d314fb04e829e;hp=bde04ba3482a71f19e1ca5a2e2c3770b66f2caeb;hpb=eb9c4821d274756d96dce7bb60c3a7c70f18fbc2;p=osm%2FNG-UI.git diff --git a/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts b/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts index bde04ba..9940129 100644 --- a/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts +++ b/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts @@ -30,7 +30,7 @@ import { StartStopRebuild } from 'NSInstanceModel'; import { RestService } from 'RestService'; import { SharedService } from 'SharedService'; import { DF, VNFD } from 'VNFDModel'; -import { VDUR, VNFInstanceDetails } from 'VNFInstanceModel'; +import { InstanceData, VDUR, VNFInstanceDetails } from 'VNFInstanceModel'; /** * Creating component @@ -121,30 +121,35 @@ export class StartStopRebuildComponent implements OnInit { /** Getting MemberVnfIndex using VNFInstances API @public */ public getMemberVnfIndex(): void { + this.isLoadingResults = true; const vnfInstanceData: {}[] = []; this.restService.getResource(environment.VNFINSTANCES_URL).subscribe((vnfInstancesData: VNFInstanceDetails[]): void => { vnfInstancesData.forEach((vnfData: VNFInstanceDetails): void => { + const vnfdRef: string = 'vnfd-ref'; + const memberIndex: string = 'member-vnf-index-ref'; + const nsrId: string = 'nsr-id-ref'; + const vnfId: string = 'vnfd-id'; const vnfDataObj: {} = { - VNFD: vnfData['vnfd-ref'], + // eslint-disable-next-line security/detect-object-injection + VNFD: vnfData[vnfdRef], VNFInstanceId: vnfData._id, - MemberIndex: vnfData['member-vnf-index-ref'], - NS: vnfData['nsr-id-ref'], - VNFID: vnfData['vnfd-id'] + // eslint-disable-next-line security/detect-object-injection + MemberIndex: vnfData[memberIndex], + // eslint-disable-next-line security/detect-object-injection + NS: vnfData[nsrId], + // eslint-disable-next-line security/detect-object-injection + VNFID: vnfData[vnfId] }; vnfInstanceData.push(vnfDataObj); }); const nsId: string = 'NS'; // eslint-disable-next-line security/detect-object-injection this.nsIdFilteredData = vnfInstanceData.filter((vnfdData: {}[]): boolean => vnfdData[nsId] === this.params.id); - this.nsIdFilteredData.forEach((resVNF: {}[]): void => { - const memberIndex: string = 'MemberIndex'; - const vnfinstanceID: string = 'VNFInstanceId'; + this.nsIdFilteredData.forEach((resVNF: InstanceData): void => { const assignMemberIndex: {} = { - // eslint-disable-next-line security/detect-object-injection - id: resVNF[memberIndex], - // eslint-disable-next-line security/detect-object-injection - vnfinstanceId: resVNF[vnfinstanceID] + id: resVNF.MemberIndex, + vnfinstanceId: resVNF.VNFInstanceId }; this.memberVnfIndex.push(assignMemberIndex); }); @@ -175,7 +180,6 @@ export class StartStopRebuildComponent implements OnInit { { 'count-index': vdu['count-index'], VDU: vdu['vdu-id-ref'] - }; vnfInstanceData.push(vnfInstanceDataObj); });