X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fapp%2Fvim-accounts%2Fvim-account-details%2FVimAccountDetailsComponent.ts;h=ac0b5020646c13dbe3c28850d19c78e276f00b11;hb=refs%2Ftags%2Frelease-v14.0-start;hp=71455f5dcf7c7a11b2d7d6f7ddf4e1333bf1af09;hpb=3b4814aa2d3dec621dadb52f058ba95a3dc3a86a;p=osm%2FNG-UI.git diff --git a/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts b/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts index 71455f5..ac0b502 100644 --- a/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts +++ b/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts @@ -267,7 +267,8 @@ export class VimAccountDetailsComponent implements OnInit { type: vimAccountData.vim_type, operationalState: vimAccountData._admin.operationalState, description: vimAccountData.description, - instancesData: this.nsData + instancesData: this.nsData, + resources: vimAccountData.resources !== undefined ? vimAccountData.resources : null }; } @@ -309,7 +310,7 @@ export class VimAccountDetailsComponent implements OnInit { this.nsData = []; this.restService.getResource(environment.NSDINSTANCES_URL).subscribe((nsdInstancesData: NSInstanceDetails[]) => { const nsRunningInstancesData: NSInstanceDetails[] = nsdInstancesData.filter((instancesData: NSInstanceDetails) => - instancesData['operational-status'] === this.nsinstancesoperationalStateRunning); + instancesData['operational-status'] === this.nsinstancesoperationalStateRunning); this.nsData = nsRunningInstancesData; resolve(true); }, (error: ERRORDATA) => { @@ -331,7 +332,8 @@ export class VimAccountDetailsComponent implements OnInit { }), view: new View({ center: fromLonLat([CONSTANTNUMBER.osmapviewlong, CONSTANTNUMBER.osmapviewlat]), - zoom: 3 + zoom: 3, + minZoom: 1.5 }) }); } @@ -350,7 +352,9 @@ export class VimAccountDetailsComponent implements OnInit { private arrayOfLocation(): void { this.getLocation = []; this.locationData.filter((item: VimAccountDetails) => { + // eslint-disable-next-line no-prototype-builtins if (item.hasOwnProperty('config')) { + // eslint-disable-next-line no-prototype-builtins if (item.config.hasOwnProperty('location')) { this.getLocation.push({ name: item.name, location: item.config.location, id: item._id }); } @@ -359,10 +363,12 @@ export class VimAccountDetailsComponent implements OnInit { if (this.getLocation !== []) { this.getLocation.filter((loc: GetLocation) => { if (loc.location !== '') { - const getLatLong: string[] = loc.location.split(','); - this.lng = +getLatLong[CONSTANTNUMBER.splitLongitude]; - this.lat = +getLatLong[CONSTANTNUMBER.splitLatitude]; - this.addMarker(getLatLong[0], loc.id, loc.name); + if (loc.location !== ',,') { + const getLatLong: string[] = loc.location.split(','); + this.lng = +getLatLong[CONSTANTNUMBER.splitLongitude]; + this.lat = +getLatLong[CONSTANTNUMBER.splitLatitude]; + this.addMarker(getLatLong[0], loc.id, loc.name); + } } }); } @@ -425,12 +431,10 @@ export class VimAccountDetailsComponent implements OnInit { } /** Add a click handler to the map to render the popup. @private */ private markerClickEvent(closer: HTMLElement, overlay: Overlay): void { - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any this.map.on('singleclick', (evt: any) => { const feature: Feature = this.map.forEachFeatureAtPixel(evt.pixel, - (f: Feature) => { - return f; - }); + (f: Feature) => f); if (feature) { this.setCoordinates(feature, overlay); } else { @@ -445,14 +449,14 @@ export class VimAccountDetailsComponent implements OnInit { }; } /** Set the coordinates point if the feature is available @private */ - // tslint:disable-next-line: no-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any private setCoordinates(feature: any, overlay: Overlay): void { this.popupData = ''; - this.popupData += '