/**
* @file NS History Of Operations Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Router } from '@angular/router';
/** Lifecyle Hooks the trigger before component is instantiate @public */
public ngOnInit(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.paramsID = this.activatedRoute.snapshot.paramMap.get('id');
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.paramsType = this.activatedRoute.snapshot.paramMap.get('type');
if (this.paramsType === 'ns') {
this.historyURL = environment.NSHISTORYOPERATIONS_URL + '/?nsInstanceId=' + this.paramsID;
}
/** show information methods modal with ns history info */
public showInformation(event: MessageEvent): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: event.data.id,
page: this.page,
/** generateData initiate the ns-instance list @private */
private generateData(): void {
this.isLoadingResults = true;
- this.restService.getResource(this.historyURL).subscribe((nsdInstancesData: {}[]) => {
+ this.restService.getResource(this.historyURL).subscribe((nsdInstancesData: {}[]): void => {
this.nsAndnstInstanceData = [];
- nsdInstancesData.forEach((nsdAndnstInstanceData: NSDInstanceData) => {
+ nsdInstancesData.forEach((nsdAndnstInstanceData: NSDInstanceData): void => {
+ let scaleType: string = '';
+ if (!isNullOrUndefined(nsdAndnstInstanceData.operationParams.scaleVnfData)) {
+ scaleType = ' (' + nsdAndnstInstanceData.operationParams.scaleVnfData.scaleVnfType + ')';
+ }
const nsAndnstDataObj: {} = {
id: nsdAndnstInstanceData.id,
- type: nsdAndnstInstanceData.lcmOperationType,
+ type: nsdAndnstInstanceData.lcmOperationType + scaleType,
state: nsdAndnstInstanceData.operationState,
startTime: this.sharedService.convertEpochTime(nsdAndnstInstanceData.startTime),
statusEnteredTime: this.sharedService.convertEpochTime(nsdAndnstInstanceData.statusEnteredTime)
} else {
this.checkDataClass = 'dataTables_empty';
}
- this.dataSource.load(this.nsAndnstInstanceData).then((data: {}) => {
+ this.dataSource.load(this.nsAndnstInstanceData).then((data: {}): void => {
//empty block
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
this.isLoadingResults = false;
- }, (error: ERRORDATA) => {
+ }, (error: ERRORDATA): void => {
this.isLoadingResults = false;
if (error.error.status === HttpStatus.NOT_FOUND || error.error.status === HttpStatus.UNAUTHORIZED) {
- this.router.navigateByUrl('404', { skipLocationChange: true }).catch();
+ this.router.navigateByUrl('404', { skipLocationChange: true }).catch((): void => {
+ // Catch Navigation Error
+ });
} else {
this.restService.handleError(error, 'get');
}