Fix Bug 2121: NG-UI uses unmaintained Chokidar version
- Upgraded Angular from 11 to 14 version to remove chokidar
unmaintained version.
- Changed linting tool tslint to eslint for angular 14 as tslint
is depreacted after angular 12
- Resolved linting issues from code
Change-Id: I00e908ab651db0f080e0d18a9d1c9711f4e36b91
Signed-off-by: SANDHYA.JS <sandhya.j@tataelxsi.co.in>
diff --git a/src/app/utilities/change-password/ChangePasswordComponent.ts b/src/app/utilities/change-password/ChangePasswordComponent.ts
index a2036ff..4c6aa5a 100644
--- a/src/app/utilities/change-password/ChangePasswordComponent.ts
+++ b/src/app/utilities/change-password/ChangePasswordComponent.ts
@@ -59,6 +59,7 @@
/** Lifecyle Hooks the trigger before component is instantiate @public */
public ngOnInit(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(AddEditUserComponent, { backdrop: 'static', keyboard: false });
modalRef.componentInstance.userID = localStorage.getItem('user_id');
if (this.editType === 'changePassword') {
@@ -72,5 +73,4 @@
}).catch((err: Error): void => { // catch error
});
}
-
}
diff --git a/src/app/utilities/change-password/ChangePasswordModule.ts b/src/app/utilities/change-password/ChangePasswordModule.ts
index bd64f9e..6c0524a 100644
--- a/src/app/utilities/change-password/ChangePasswordModule.ts
+++ b/src/app/utilities/change-password/ChangePasswordModule.ts
@@ -32,8 +32,7 @@
@NgModule({
imports: [CommonModule, TranslateModule, FormsModule, ReactiveFormsModule, NgSelectModule, LoaderModule],
declarations: [AddEditUserComponent],
- exports: [AddEditUserComponent],
- entryComponents: [AddEditUserComponent]
+ exports: [AddEditUserComponent]
})
/** Exporting a class @exports ChangePasswordModule */
export class ChangePasswordModule {
diff --git a/src/app/utilities/clone-package/ClonePackageComponent.ts b/src/app/utilities/clone-package/ClonePackageComponent.ts
index 125a726..02db8d8 100644
--- a/src/app/utilities/clone-package/ClonePackageComponent.ts
+++ b/src/app/utilities/clone-package/ClonePackageComponent.ts
@@ -163,7 +163,6 @@
url: this.endPoint,
httpOptions: { headers: apiHeader }
};
- // tslint:disable-next-line: completed-docs
this.restService.postResource(apiURLHeader, content).subscribe((result: { id: string }): void => {
this.activeModal.close(modalData);
this.isLoadingResults = false;
diff --git a/src/app/utilities/compose-packages/ComposePackages.ts b/src/app/utilities/compose-packages/ComposePackages.ts
index c621215..6f2a031 100644
--- a/src/app/utilities/compose-packages/ComposePackages.ts
+++ b/src/app/utilities/compose-packages/ComposePackages.ts
@@ -34,7 +34,7 @@
import { SharedService } from 'SharedService';
/** This is added globally by the tar.js library */
-// tslint:disable-next-line: no-any
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const Tar: any;
/**
@@ -46,6 +46,7 @@
styleUrls: ['./ComposePackages.scss']
})
/** Exporting a class @exports ComposePackages */
+// eslint-disable-next-line @angular-eslint/component-class-suffix
export class ComposePackages implements OnInit {
/** Invoke service injectors @public */
public injector: Injector;
@@ -148,7 +149,7 @@
}
const descriptor: string = this.packageYaml(this.params.page);
try {
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const tar: any = new Tar();
const out: Uint8Array = tar.append(this.packagesForm.value.name + '/' + this.packagesForm.value.name + '.yaml',
descriptor, { type: '0' });
@@ -166,7 +167,6 @@
url: this.endPoint,
httpOptions: { headers: this.headers }
};
- // tslint:disable-next-line: completed-docs
this.restService.postResource(apiURLHeader, packageContent).subscribe((result: { id: string }): void => {
this.isLoadingResults = false;
this.activeModal.close();
diff --git a/src/app/utilities/confirmation-topology/ConfirmationTopologyComponent.ts b/src/app/utilities/confirmation-topology/ConfirmationTopologyComponent.ts
index a1a79b9..de9dac2 100644
--- a/src/app/utilities/confirmation-topology/ConfirmationTopologyComponent.ts
+++ b/src/app/utilities/confirmation-topology/ConfirmationTopologyComponent.ts
@@ -98,5 +98,4 @@
};
this.activeModal.close(modalData);
}
-
}
diff --git a/src/app/utilities/dragDropUpload/DragDirective.ts b/src/app/utilities/dragDropUpload/DragDirective.ts
index 735ac7c..d052b3f 100644
--- a/src/app/utilities/dragDropUpload/DragDirective.ts
+++ b/src/app/utilities/dragDropUpload/DragDirective.ts
@@ -31,7 +31,6 @@
* Creating Directive
* @Directive for handling the files.
*/
-// tslint:disable-next-line:export-name
@Directive({
selector: '[appDrag]'
})
@@ -77,6 +76,7 @@
const files: FileHandle[] = [];
Array.from(evt.dataTransfer.files).forEach((listFiles: File, index: number) => {
const file: File = listFiles;
+ // eslint-disable-next-line @microsoft/sdl/no-angular-bypass-sanitizer
const url: SafeUrl = this.sanitizer.bypassSecurityTrustUrl(window.URL.createObjectURL(file));
files.push({ file, url });
});
diff --git a/src/app/utilities/edit-packages/EditPackagesComponent.ts b/src/app/utilities/edit-packages/EditPackagesComponent.ts
index e38d3cf..42998b8 100644
--- a/src/app/utilities/edit-packages/EditPackagesComponent.ts
+++ b/src/app/utilities/edit-packages/EditPackagesComponent.ts
@@ -90,6 +90,7 @@
/** options @public */
public options: {} = {
+ // eslint-disable-next-line no-invalid-this
mode: this.modeDefault,
showCursorWhenSelecting: true,
autofocus: true,
@@ -172,9 +173,7 @@
Accept: 'text/plain',
'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0'
});
- // 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.pacakgeType = this.activatedRoute.snapshot.paramMap.get('type');
this.generateURLPath();
}
@@ -254,9 +253,13 @@
(packageType !== 'netslice') ? 'PAGE.NSPACKAGE.EDITPACKAGES.UPDATEDSUCCESSFULLY' : 'PAGE.NETSLICE.UPDATEDSUCCESSFULLY'));
if (showgraph) {
if (packageType === 'nsd') {
- this.router.navigate(['/packages/ns/compose/' + this.paramsID]).catch();
+ this.router.navigate(['/packages/ns/compose/' + this.paramsID]).catch((): void => {
+ // Catch Navigation Error
+ });
} else if (packageType === 'vnf') {
- this.router.navigate(['/packages/vnf/compose/' + this.paramsID]).catch();
+ this.router.navigate(['/packages/vnf/compose/' + this.paramsID]).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
this.getEditFileData();
@@ -301,14 +304,15 @@
this.restService.getResource(this.getUpdateURL + '/' + this.paramsID + '/' + this.getFileContentType, httpOptions)
.subscribe((nsData: NSDDetails[]) => {
const getJson: string = jsyaml.load(nsData.toString(), { json: true });
- //tslint:disable-next-line:no-string-literal
this.defaults['text/x-yaml'] = nsData.toString();
this.defaults['text/json'] = JSON.stringify(getJson, null, '\t');
this.isLoadingResults = false;
}, (error: ERRORDATA) => {
error.error = typeof error.error === 'string' ? jsyaml.load(error.error) : error.error;
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');
}
diff --git a/src/app/utilities/loader/LoaderComponent.ts b/src/app/utilities/loader/LoaderComponent.ts
index ee8cab8..4190a7d 100644
--- a/src/app/utilities/loader/LoaderComponent.ts
+++ b/src/app/utilities/loader/LoaderComponent.ts
@@ -46,5 +46,4 @@
this.getMessage = '';
}
}
-
}
diff --git a/src/app/utilities/loader/LoaderModule.ts b/src/app/utilities/loader/LoaderModule.ts
index ba81b6a..e235be0 100644
--- a/src/app/utilities/loader/LoaderModule.ts
+++ b/src/app/utilities/loader/LoaderModule.ts
@@ -35,7 +35,7 @@
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- // Empty Block
+ constructor() {
+ //Empty
}
}
diff --git a/src/app/utilities/netslice-instances-action/NetsliceInstancesActionComponent.ts b/src/app/utilities/netslice-instances-action/NetsliceInstancesActionComponent.ts
index 0e528a8..ab7d51f 100644
--- a/src/app/utilities/netslice-instances-action/NetsliceInstancesActionComponent.ts
+++ b/src/app/utilities/netslice-instances-action/NetsliceInstancesActionComponent.ts
@@ -69,6 +69,7 @@
/** Shows information using modalservice @public */
public infoNetSliceInstance(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.instanceID,
page: 'net-slice-instance',
@@ -78,13 +79,16 @@
/** Delete NetSlice Instance packages @public */
public deleteNetSliceInstance(forceAction: boolean): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.componentInstance.params = {forceDeleteType: forceAction};
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** History of operations for an Instanace @public */
public historyOfOperations(): void {
diff --git a/src/app/utilities/netslice-packages-action/NetslicePackagesActionComponent.ts b/src/app/utilities/netslice-packages-action/NetslicePackagesActionComponent.ts
index 8be5f50..78e6e51 100644
--- a/src/app/utilities/netslice-packages-action/NetslicePackagesActionComponent.ts
+++ b/src/app/utilities/netslice-packages-action/NetslicePackagesActionComponent.ts
@@ -71,16 +71,20 @@
/** Delete NetSliceTemplate packages @public */
public deleteNetSliceTemplate(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, {backdrop: 'static'});
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Shows information using modalservice @public */
public infoNetSlice(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.instanceID,
page: 'net-slice-package',
@@ -97,6 +101,7 @@
/** Instantiate Net Slice using modalservice @public */
public instantiateNetSlice(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(InstantiateNetSliceTemplateComponent, { backdrop: 'static' });
}
}
diff --git a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html
index 3ac6a60..517dbde 100644
--- a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html
+++ b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.html
@@ -29,7 +29,7 @@
<i class="far fa-trash-alt icons"></i>
</button>
<div class="btn-group" placement="bottom-right" ngbDropdown display="dynamic" container="body">
- <button type="button" class="btn btn-primary" ngbDropdownToggle placement="top" container="body" [disabled]="operationalStatus === 'failed' || configStatus === 'failed'" ngbTooltip="{{'VIMACTION' | translate}}">
+ <button type="button" class="btn btn-primary" ngbDropdownToggle placement="top" container="body" [disabled]="operationalStatus === 'failed' || configStatus === 'failed'|| k8sStatus" ngbTooltip="{{'VIMACTION' | translate}}">
<i class="fas fa-desktop"></i>
</button>
<div class="dropdown-menu list-action-dropdown" ngbDropdownMenu>
diff --git a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts
index 5f9d5e3..ea7fa61 100644
--- a/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts
+++ b/src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts
@@ -18,6 +18,7 @@
/**
* @file NS InstancesAction Component
*/
+import { isNullOrUndefined } from 'util';
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Injector } from '@angular/core';
import { Router } from '@angular/router';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
@@ -36,7 +37,6 @@
import { SharedService } from 'SharedService';
import { ShowInfoComponent } from 'ShowInfoComponent';
import { StartStopRebuildComponent } from 'StartStopRebuildComponent';
-import { isNullOrUndefined } from 'util';
import { VerticalScalingComponent } from 'VerticalScalingComponent';
import { VmMigrationComponent } from 'VmMigrationComponent';
import { DF, VDU, VNFD } from 'VNFDModel';
@@ -66,6 +66,9 @@
/** Operational Status Check @public */
public operationalStatus: string;
+ /** CNF Status Check @public */
+ public k8sStatus: boolean = false;
+
/** get Admin Details @public */
public getAdminDetails: {};
@@ -106,6 +109,7 @@
private cd: ChangeDetectorRef;
/** Set timeout @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private timeOut: number = 100;
constructor(injector: Injector) {
@@ -127,12 +131,27 @@
this.operationalStatus = this.value.OperationalStatus;
this.instanceID = this.value.identifier;
this.getAdminDetails = this.value.adminDetails;
+ for (const key of Object.keys(this.getAdminDetails)) {
+ if (key === 'deployed') {
+ // eslint-disable-next-line security/detect-object-injection
+ const adminData: {} = this.getAdminDetails[key];
+ for (const k8sData of Object.keys(adminData)) {
+ if (k8sData === 'K8s') {
+ // eslint-disable-next-line security/detect-object-injection
+ if (adminData[k8sData].length !== 0) {
+ this.k8sStatus = true;
+ }
+ }
+ }
+ }
+ }
this.isShowOperationalDashboard = !isNullOrUndefined(this.value.vcaStatus) ?
Object.keys(this.value.vcaStatus).length === 0 && typeof this.value.vcaStatus === 'object' : true;
}
/** Shows information using modalservice @public */
public infoNs(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.instanceID,
page: 'ns-instance',
@@ -142,13 +161,16 @@
/** Delete NS Instanace @public */
public deleteNSInstance(forceAction: boolean): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.componentInstance.params = { forceDeleteType: forceAction };
modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** History of operations for an Instanace @public */
@@ -167,6 +189,7 @@
/** Exec NS Primitive @public */
public execNSPrimitiveModal(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(NSPrimitiveComponent, { backdrop: 'static' }).componentInstance.params = {
memberIndex: this.value.memberIndex,
nsConfig: this.value.nsConfig,
@@ -186,6 +209,7 @@
if (vduData['monitoring-parameter'] !== undefined && vduData['monitoring-parameter'].length > 0) {
this.isLoadingNSInstanceAction = false;
const location: string = environment.GRAFANA_URL + '/' + this.instanceID + '/osm-ns-metrics-metrics';
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
window.open(location);
} else {
this.isLoadingNSInstanceAction = false;
@@ -246,6 +270,7 @@
/** Open the scaling pop-up @public */
public openScaling(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ScalingComponent, { backdrop: 'static' });
modalRef.componentInstance.params = {
id: this.instanceID,
@@ -258,11 +283,14 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** To open VM Migration in NS Instances */
public openVmMigration(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(VmMigrationComponent, { backdrop: 'static' });
modalRef.componentInstance.params = {
id: this.instanceID
@@ -271,11 +299,14 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** To open the Ns Update pop-up */
public openNsUpdate(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(NsUpdateComponent, { backdrop: 'static' });
modalRef.componentInstance.params = {
id: this.instanceID
@@ -284,11 +315,14 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** To open the Start, Stop & Rebuild pop-up */
public openStart(actionType: string): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(StartStopRebuildComponent, { backdrop: 'static' });
modalRef.componentInstance.params = {
id: this.instanceID
@@ -305,11 +339,14 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** To open the vertical Scaling pop-up */
public openVerticalScaling(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(VerticalScalingComponent, { backdrop: 'static' });
modalRef.componentInstance.params = {
id: this.instanceID
@@ -318,7 +355,9 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
diff --git a/src/app/utilities/ns-packages-action/NsPackagesActionComponent.ts b/src/app/utilities/ns-packages-action/NsPackagesActionComponent.ts
index 18f3e5a..a673e15 100644
--- a/src/app/utilities/ns-packages-action/NsPackagesActionComponent.ts
+++ b/src/app/utilities/ns-packages-action/NsPackagesActionComponent.ts
@@ -89,6 +89,7 @@
private cd: ChangeDetectorRef;
/** Set timeout @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private timeOut: number = 1000;
constructor(injector: Injector) {
@@ -114,17 +115,21 @@
/** Instantiate NS using modalservice @public */
public instantiateNS(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(InstantiateNsComponent, { backdrop: 'static' });
}
/** Delete NS Package @public */
public deleteNSPackage(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Set instance for NSD Edit @public */
@@ -136,6 +141,7 @@
/** list out all the file content of a descriptors @public */
public showContent(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowContentComponent, { backdrop: 'static' }).componentInstance.params = { id: this.nsdID, page: 'nsd' };
}
@@ -182,12 +188,15 @@
/** Clone NS Packages @public */
public cloneNSPackage(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const cloneModal: NgbModalRef = this.modalService.open(ClonePackageComponent, { backdrop: 'static' });
cloneModal.componentInstance.params = { id: this.nsdID, page: 'nsd', name: this.nsdName };
cloneModal.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
diff --git a/src/app/utilities/ns-update/NsUpdateComponent.ts b/src/app/utilities/ns-update/NsUpdateComponent.ts
index 80773e2..b33bfc4 100644
--- a/src/app/utilities/ns-update/NsUpdateComponent.ts
+++ b/src/app/utilities/ns-update/NsUpdateComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Ns Update Component
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -29,7 +30,6 @@
import { NSUPDATE, TERMINATEVNF } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VNFD } from 'VNFDModel';
import { VNFInstanceDetails } from 'VNFInstanceModel';
import { WarningComponent } from 'WarningComponent';
@@ -160,12 +160,15 @@
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';
const assignMemberIndex: {} = {
+ // eslint-disable-next-line security/detect-object-injection
id: resVNF[memberIndex],
+ // eslint-disable-next-line security/detect-object-injection
vnfinstanceId: resVNF[vnfinstanceID]
};
this.memberVnfIndex.push(assignMemberIndex);
@@ -187,12 +190,15 @@
let memberIndexFilteredData: {}[] = [];
const memberIndex: string = 'MemberIndex';
memberIndexFilteredData = this.nsIdFilteredData.filter((vnfdData: {}[]): boolean =>
+ // eslint-disable-next-line security/detect-object-injection
vnfdData[memberIndex] === this.memberIndexValue);
const vnfId: string = 'VNFID';
const selectedvnfId: string = 'VNFD';
this.selectedVnf = memberIndexFilteredData;
for (const data of memberIndexFilteredData) {
+ // eslint-disable-next-line security/detect-object-injection
this.vnfID = data[vnfId];
+ // eslint-disable-next-line security/detect-object-injection
this.selectedvnfId = data[selectedvnfId];
}
}
@@ -238,6 +244,7 @@
if (this.nsUpdateForm.value.updateType === 'CHANGE_VNFPKG') {
this.checkVersion();
} else {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(WarningComponent, { backdrop: 'static' });
modalRef.componentInstance.heading = this.translateService.instant('TERMINATEVNF');
modalRef.componentInstance.confirmationMessage = this.translateService.instant('TERMINATEVNFCONTENT');
@@ -246,8 +253,9 @@
if (result.message === CONFIGCONSTANT.done) {
this.onSubmit();
}
- }).catch((): void => { //empty
- });
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
this.isLoadingResults = false;
}
@@ -272,11 +280,14 @@
let vnfIdFilteredData: {}[] = [];
const vnfID: string = 'VNFID';
const version: string = 'version';
+ // eslint-disable-next-line security/detect-object-injection
vnfIdFilteredData = vnfDetails.filter((vnfdData: {}[]): boolean => vnfdData[vnfID] === this.vnfID);
for (const data of vnfIdFilteredData) {
+ // eslint-disable-next-line security/detect-object-injection
this.vnfversion = data[version];
}
if (this.version === this.vnfversion) {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(WarningComponent, { backdrop: 'static' });
modalRef.componentInstance.heading = this.translateService.instant('UPDATENS');
modalRef.componentInstance.confirmationMessage = this.translateService.instant('GENERICCONTENT');
@@ -289,6 +300,7 @@
}
);
} else {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(WarningComponent, { backdrop: 'static' });
modalRef.componentInstance.heading = this.translateService.instant('REDEPLOY');
modalRef.componentInstance.confirmationMessage = this.translateService.instant('REDEPLOYCONTENT');
@@ -323,7 +335,9 @@
};
this.restService.postResource(apiURLHeader, nsUpdatePayload).subscribe((result: {}): void => {
this.activeModal.close(modalData);
- this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch();
+ this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'post');
this.isLoadingResults = false;
@@ -344,6 +358,7 @@
/** Used to get the AbstractControl of controlName passed @private */
private getFormControl(controlName: string): AbstractControl {
+ // eslint-disable-next-line security/detect-object-injection
return this.nsUpdateForm.controls[controlName];
}
}
diff --git a/src/app/utilities/osm-repositories-action/OsmRepositoriesActionComponent.ts b/src/app/utilities/osm-repositories-action/OsmRepositoriesActionComponent.ts
index 1f3523d..ed56040 100644
--- a/src/app/utilities/osm-repositories-action/OsmRepositoriesActionComponent.ts
+++ b/src/app/utilities/osm-repositories-action/OsmRepositoriesActionComponent.ts
@@ -68,16 +68,20 @@
/** Delete OSM Repository @public */
public deleteOsmRepository(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Edit a osm repo @public */
public editOsmrepo(id: string): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(OsmRepoCreateUpdateComponent, { backdrop: 'static' });
modalRef.componentInstance.createupdateType = 'Edit';
modalRef.componentInstance.osmrepoid = id;
@@ -85,6 +89,8 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
diff --git a/src/app/utilities/page-per-row/PagePerRow.ts b/src/app/utilities/page-per-row/PagePerRow.ts
index 6794bfc..4d7f58e 100644
--- a/src/app/utilities/page-per-row/PagePerRow.ts
+++ b/src/app/utilities/page-per-row/PagePerRow.ts
@@ -29,11 +29,13 @@
* @Component takes PagePerRow.html as template url
*/
@Component({
+ // eslint-disable-next-line @angular-eslint/component-selector
selector: 'page-per-row',
templateUrl: './PagePerRow.html',
styleUrls: ['./PagePerRow.scss']
})
/** Exporting a class @exports PagePerRow */
+// eslint-disable-next-line @angular-eslint/component-class-suffix
export class PagePerRow {
/** To inject services @public */
public injector: Injector;
diff --git a/src/app/utilities/page-per-row/PagePerRowModule.ts b/src/app/utilities/page-per-row/PagePerRowModule.ts
index e5b8a29..66d62cb 100644
--- a/src/app/utilities/page-per-row/PagePerRowModule.ts
+++ b/src/app/utilities/page-per-row/PagePerRowModule.ts
@@ -36,7 +36,7 @@
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- // Empty Block
- }
+ constructor() {
+ //Empty
+ }
}
diff --git a/src/app/utilities/page-reload/PageReload.ts b/src/app/utilities/page-reload/PageReload.ts
index 0ea3c3c..f63d59d 100644
--- a/src/app/utilities/page-reload/PageReload.ts
+++ b/src/app/utilities/page-reload/PageReload.ts
@@ -26,11 +26,13 @@
* @Component takes PageReload.html as template url
*/
@Component({
+ // eslint-disable-next-line @angular-eslint/component-selector
selector: 'page-reload',
templateUrl: './PageReload.html',
styleUrls: ['./PageReload.scss']
})
/** Exporting a class @exports PageReload */
+// eslint-disable-next-line @angular-eslint/component-class-suffix
export class PageReload {
/** To inject services @public */
public injector: Injector;
diff --git a/src/app/utilities/page-reload/PageReloadModule.ts b/src/app/utilities/page-reload/PageReloadModule.ts
index 56c35fd..983f939 100644
--- a/src/app/utilities/page-reload/PageReloadModule.ts
+++ b/src/app/utilities/page-reload/PageReloadModule.ts
@@ -37,7 +37,7 @@
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- // Empty Block
- }
+ constructor() {
+ //Empty
+ }
}
diff --git a/src/app/utilities/pdu-instances-action/PDUInstancesActionComponent.ts b/src/app/utilities/pdu-instances-action/PDUInstancesActionComponent.ts
index 8cfb6cf..3c32488 100644
--- a/src/app/utilities/pdu-instances-action/PDUInstancesActionComponent.ts
+++ b/src/app/utilities/pdu-instances-action/PDUInstancesActionComponent.ts
@@ -69,16 +69,20 @@
/** Delete PDU Instances @public */
public deletePDUInstance(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, {backdrop: 'static'});
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Shows PDU Instances information using modalservice @public */
public showInfo(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.pduInstanceID,
page: 'pdu-instances',
diff --git a/src/app/utilities/project-link/ProjectLinkComponent.ts b/src/app/utilities/project-link/ProjectLinkComponent.ts
index 35c5b2c..5f956f2 100644
--- a/src/app/utilities/project-link/ProjectLinkComponent.ts
+++ b/src/app/utilities/project-link/ProjectLinkComponent.ts
@@ -47,6 +47,7 @@
/** Check the project is present for the user @public */
public isPresent: boolean = false;
/** Set timeout @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private timeOut: number = 10;
/** Instance of the rest service @private */
private restService: RestService;
@@ -77,5 +78,4 @@
}, this.timeOut);
});
}
-
}
diff --git a/src/app/utilities/projects-action/ProjectsActionComponent.ts b/src/app/utilities/projects-action/ProjectsActionComponent.ts
index 207d90c..4f9738f 100644
--- a/src/app/utilities/projects-action/ProjectsActionComponent.ts
+++ b/src/app/utilities/projects-action/ProjectsActionComponent.ts
@@ -57,22 +57,28 @@
/** Delete project @public */
public projectDelete(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Edit project @public */
public projectEdit(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ProjectCreateUpdateComponent, { size: 'lg', backdrop: 'static' });
modalRef.componentInstance.projectType = 'Edit';
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
diff --git a/src/app/utilities/roles-action/RolesActionComponent.ts b/src/app/utilities/roles-action/RolesActionComponent.ts
index 5b4d85b..50eb279 100644
--- a/src/app/utilities/roles-action/RolesActionComponent.ts
+++ b/src/app/utilities/roles-action/RolesActionComponent.ts
@@ -61,12 +61,15 @@
/** Delete Role click handler @public */
public deleteRole(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Edit Role click handler @public */
@@ -75,5 +78,4 @@
// Catch Navigation Error
});
}
-
}
diff --git a/src/app/utilities/scaling/ScalingComponent.ts b/src/app/utilities/scaling/ScalingComponent.ts
index 111c3b8..ff5ec06 100644
--- a/src/app/utilities/scaling/ScalingComponent.ts
+++ b/src/app/utilities/scaling/ScalingComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Scaling Component
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -29,7 +30,6 @@
import { DF as NSDF, VNFPROFILE } from 'NSDModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { DF, SCALING, VNFD } from 'VNFDModel';
/**
@@ -185,7 +185,9 @@
};
this.restService.postResource(apiURLHeader, scalingPayload).subscribe((result: {}): void => {
this.activeModal.close(modalData);
- this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch();
+ this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'post');
this.isLoadingResults = false;
@@ -194,6 +196,7 @@
/** Used to get the AbstractControl of controlName passed @private */
private getFormControl(controlName: string): AbstractControl {
+ // eslint-disable-next-line security/detect-object-injection
return this.scalingForm.controls[controlName];
}
}
diff --git a/src/app/utilities/sdn-controller-action/SDNControllerActionComponent.ts b/src/app/utilities/sdn-controller-action/SDNControllerActionComponent.ts
index cbf3fc1..01796b8 100644
--- a/src/app/utilities/sdn-controller-action/SDNControllerActionComponent.ts
+++ b/src/app/utilities/sdn-controller-action/SDNControllerActionComponent.ts
@@ -65,6 +65,7 @@
/** Show SDN Controller Information @public */
public showSDNControllerInfo(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(SDNControllerInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.sdnID,
page: 'sdn-controller'
@@ -73,11 +74,14 @@
/** Delete SDN Controller @public */
public deleteSDNController(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
diff --git a/src/app/utilities/show-info/ShowInfoComponent.ts b/src/app/utilities/show-info/ShowInfoComponent.ts
index 0fb22e7..015d50c 100644
--- a/src/app/utilities/show-info/ShowInfoComponent.ts
+++ b/src/app/utilities/show-info/ShowInfoComponent.ts
@@ -81,6 +81,7 @@
/** variables to hold options of editor @public */
public options: {} = {
+ // eslint-disable-next-line no-invalid-this
mode: this.modeDefault,
showCursorWhenSelecting: true,
autofocus: true,
diff --git a/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts b/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts
index 4b0afe0..bde04ba 100644
--- a/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts
+++ b/src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts
@@ -18,6 +18,7 @@
/**
* @file StartStopRebuild Component
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -28,7 +29,6 @@
import { StartStopRebuild } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { DF, VNFD } from 'VNFDModel';
import { VDUR, VNFInstanceDetails } from 'VNFInstanceModel';
@@ -135,12 +135,15 @@
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';
const assignMemberIndex: {} = {
+ // eslint-disable-next-line security/detect-object-injection
id: resVNF[memberIndex],
+ // eslint-disable-next-line security/detect-object-injection
vnfinstanceId: resVNF[vnfinstanceID]
};
this.memberVnfIndex.push(assignMemberIndex);
@@ -164,7 +167,9 @@
this.instanceId = id;
this.selectedvnfId = vnfInstanceDetail['vnfd-ref'];
const VDU: string = 'vdur';
+ // eslint-disable-next-line security/detect-object-injection
if (vnfInstanceDetail[VDU] !== undefined) {
+ // eslint-disable-next-line security/detect-object-injection
vnfInstanceDetail[VDU].forEach((vdu: VDUR): void => {
const vnfInstanceDataObj: {} =
{
@@ -178,6 +183,7 @@
const vduName: string = 'VDU';
this.vduId = this.vdu.filter((vdu: {}, index: number, self: {}[]): {} =>
index === self.findIndex((t: {}): {} => (
+ // eslint-disable-next-line security/detect-object-injection
t[vduName] === vdu[vduName]
))
);
@@ -193,6 +199,7 @@
/** Getting count-index by filtering id */
public getCountIndex(id: string): void {
const VDU: string = 'VDU';
+ // eslint-disable-next-line security/detect-object-injection
this.countIndex = this.vdu.filter((vnfdData: {}[]): boolean => vnfdData[VDU] === id);
}
@@ -279,7 +286,9 @@
};
this.restService.postResource(apiURLHeader, startPayload).subscribe((result: {}): void => {
this.activeModal.close(modalData);
- this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch();
+ this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'post');
this.isLoadingResults = false;
@@ -288,6 +297,7 @@
/** Used to get the AbstractControl of controlName passed @private */
private getFormControl(controlName: string): AbstractControl {
+ // eslint-disable-next-line security/detect-object-injection
return this.startForm.controls[controlName];
}
}
diff --git a/src/app/utilities/switch-project/SwitchProjectComponent.ts b/src/app/utilities/switch-project/SwitchProjectComponent.ts
index dffb63a..f3dffcb 100644
--- a/src/app/utilities/switch-project/SwitchProjectComponent.ts
+++ b/src/app/utilities/switch-project/SwitchProjectComponent.ts
@@ -134,7 +134,9 @@
if (this.router.url.includes('history-operations')) {
this.router.navigate(['/instances/ns']).then((): void => {
location.reload();
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
} else {
location.reload();
}
diff --git a/src/app/utilities/users-action/UsersActionComponent.ts b/src/app/utilities/users-action/UsersActionComponent.ts
index 1d8e895..cb0b462 100644
--- a/src/app/utilities/users-action/UsersActionComponent.ts
+++ b/src/app/utilities/users-action/UsersActionComponent.ts
@@ -61,16 +61,20 @@
/** Delete User Account @public */
public deleteUser(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Edit User Account @public */
public editUserModal(editType: string): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(AddEditUserComponent, { backdrop: 'static' });
modalRef.componentInstance.userID = this.value.identifier;
if (editType === 'editPassword') {
@@ -84,11 +88,14 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Edit User Account @public */
public projectRolesModal(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ProjectRoleComponent, { backdrop: 'static' });
modalRef.componentInstance.userID = this.value.identifier;
modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.EDITPROJECTROLEMAPPING');
@@ -96,6 +103,8 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
diff --git a/src/app/utilities/vertical-scaling/VerticalScalingComponent.ts b/src/app/utilities/vertical-scaling/VerticalScalingComponent.ts
index 949506a..4d96f8a 100644
--- a/src/app/utilities/vertical-scaling/VerticalScalingComponent.ts
+++ b/src/app/utilities/vertical-scaling/VerticalScalingComponent.ts
@@ -18,6 +18,7 @@
/**
* @file VerticalScaling Component
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -30,7 +31,6 @@
import { VerticalScaling } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VDUR, VNFInstanceDetails } from 'VNFInstanceModel';
/**
@@ -67,7 +67,7 @@
public nsIdFilteredData: {}[] = [];
/** Form valid on submit trigger @public */
public submitted: boolean = false;
- /** Contains vduId @public */
+ /** Contains vduId @public */
public vduId: {};
/** Items for countIndex @public */
public countIndex: {}[];
@@ -139,12 +139,15 @@
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';
const assignMemberIndex: {} = {
+ // eslint-disable-next-line security/detect-object-injection
id: resVNF[memberIndex],
+ // eslint-disable-next-line security/detect-object-injection
vnfinstanceId: resVNF[vnfinstanceID]
};
this.memberVnfIndex.push(assignMemberIndex);
@@ -168,7 +171,9 @@
this.instanceId = id;
this.selectedvnfId = vnfInstanceDetail['vnfd-ref'];
const VDU: string = 'vdur';
+ // eslint-disable-next-line security/detect-object-injection
if (vnfInstanceDetail[VDU] !== undefined) {
+ // eslint-disable-next-line security/detect-object-injection
vnfInstanceDetail[VDU].forEach((vdu: VDUR): void => {
const vnfInstanceDataObj: {} =
{
@@ -182,6 +187,7 @@
const vduName: string = 'VDU';
this.vduId = this.vdu.filter((vdu: {}, index: number, self: {}[]): {} =>
index === self.findIndex((t: {}): {} => (
+ // eslint-disable-next-line security/detect-object-injection
t[vduName] === vdu[vduName]
))
);
@@ -196,6 +202,7 @@
/** Getting count-index by filtering id */
public getCountIndex(id: string): void {
const VDU: string = 'VDU';
+ // eslint-disable-next-line security/detect-object-injection
this.countIndex = this.vdu.filter((vnfdData: {}[]): boolean => vnfdData[VDU] === id);
}
@@ -235,7 +242,9 @@
};
this.restService.postResource(apiURLHeader, scalingPayload).subscribe((result: {}): void => {
this.activeModal.close(modalData);
- this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch();
+ this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'post');
this.isLoadingResults = false;
@@ -244,6 +253,7 @@
/** Used to get the AbstractControl of controlName passed @private */
private getFormControl(controlName: string): AbstractControl {
+ // eslint-disable-next-line security/detect-object-injection
return this.scalingForm.controls[controlName];
}
}
diff --git a/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts
index ffa0340..e3657ad 100644
--- a/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts
+++ b/src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts
@@ -76,12 +76,15 @@
/** Delete VIM Account @public */
public deleteVIMAccount(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, {backdrop: 'static'});
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** On navigate to Info VimAccount @public */
@@ -105,6 +108,7 @@
/** Show VIM Resources Data @public */
public showVIMResources(vimDetails: VimAccountDetails): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ResourcesOverviewComponent, {backdrop: 'static'});
modalRef.componentInstance.resourcesData = vimDetails;
}
diff --git a/src/app/utilities/vm-migration/VmMigrationComponent.ts b/src/app/utilities/vm-migration/VmMigrationComponent.ts
index 7ac8af0..e53ea11 100644
--- a/src/app/utilities/vm-migration/VmMigrationComponent.ts
+++ b/src/app/utilities/vm-migration/VmMigrationComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Vm Migration Component
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -28,7 +29,6 @@
import { VMMIGRATION } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VDUR, VNFInstanceDetails } from 'VNFInstanceModel';
/**
@@ -65,7 +65,7 @@
public instanceId: string;
/** Form valid on submit trigger @public */
public submitted: boolean = false;
- /** Contains vduId @public */
+ /** Contains vduId @public */
public vduId: {};
/** Items for countIndex @public */
public countIndex: {}[];
@@ -129,12 +129,15 @@
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';
const assignMemberIndex: {} = {
+ // eslint-disable-next-line security/detect-object-injection
id: resVNF[memberIndex],
+ // eslint-disable-next-line security/detect-object-injection
vnfinstanceId: resVNF[vnfinstanceID]
};
this.memberVnfIndex.push(assignMemberIndex);
@@ -159,7 +162,9 @@
subscribe((vnfInstanceDetail: VNFInstanceDetails[]): void => {
this.selectedvnfId = vnfInstanceDetail['vnfd-ref'];
const VDU: string = 'vdur';
+ // eslint-disable-next-line security/detect-object-injection
if (vnfInstanceDetail[VDU] !== undefined) {
+ // eslint-disable-next-line security/detect-object-injection
vnfInstanceDetail[VDU].forEach((vdu: VDUR): void => {
const vnfInstanceDataObj: {} =
{
@@ -173,6 +178,7 @@
const vduName: string = 'VDU';
this.vduId = this.vdu.filter((vdu: {}, index: number, self: {}[]): {} =>
index === self.findIndex((t: {}): {} => (
+ // eslint-disable-next-line security/detect-object-injection
t[vduName] === vdu[vduName]
))
);
@@ -187,6 +193,7 @@
/** Getting count-index by filtering id */
public getCountIndex(id: string): void {
const VDU: string = 'VDU';
+ // eslint-disable-next-line security/detect-object-injection
this.countIndex = this.vdu.filter((vnfdData: {}[]): boolean => vnfdData[VDU] === id);
}
@@ -217,7 +224,6 @@
};
}
this.migrationInitialization(migrationPayload);
-
}
/** Initialize the Vm Migration operation @public */
@@ -232,7 +238,9 @@
};
this.restService.postResource(apiURLHeader, migrationPayload).subscribe((result: {}): void => {
this.activeModal.close(modalData);
- this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch();
+ this.router.navigate(['/instances/ns/history-operations/' + this.params.id]).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'post');
this.isLoadingResults = false;
@@ -241,6 +249,7 @@
/** Used to get the AbstractControl of controlName passed @private */
private getFormControl(controlName: string): AbstractControl {
+ // eslint-disable-next-line security/detect-object-injection
return this.migrationForm.controls[controlName];
}
}
diff --git a/src/app/utilities/vnf-instances-action/VNFInstancesActionComponent.ts b/src/app/utilities/vnf-instances-action/VNFInstancesActionComponent.ts
index d3a95f2..0cc2284 100644
--- a/src/app/utilities/vnf-instances-action/VNFInstancesActionComponent.ts
+++ b/src/app/utilities/vnf-instances-action/VNFInstancesActionComponent.ts
@@ -58,6 +58,7 @@
/** Shows information using modalservice @public */
public infoVNF(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.instanceID,
page: 'vnf-instance',
diff --git a/src/app/utilities/vnf-packages-action/VNFPackagesActionComponent.ts b/src/app/utilities/vnf-packages-action/VNFPackagesActionComponent.ts
index cd0d2dc..14b5ec0 100644
--- a/src/app/utilities/vnf-packages-action/VNFPackagesActionComponent.ts
+++ b/src/app/utilities/vnf-packages-action/VNFPackagesActionComponent.ts
@@ -86,6 +86,7 @@
private cd: ChangeDetectorRef;
/** Set timeout @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private timeOut: number = 1000;
constructor(injector: Injector) {
@@ -113,12 +114,15 @@
/** Delete VNF packages @public */
public deleteVNFPackage(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Set instance for NSD Edit @public */
@@ -132,6 +136,7 @@
/** list out all the file content of a descriptors @public */
public showContent(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowContentComponent, { backdrop: 'static' }).componentInstance.params = { id: this.vnfID, page: 'vnfd' };
}
@@ -164,7 +169,9 @@
/** Compose VNF Packages @public */
public composeVNFPackages(): void {
- this.router.navigate(['/packages/vnf/compose/', this.vnfID]).catch();
+ this.router.navigate(['/packages/vnf/compose/', this.vnfID]).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Change the detaction @public */
@@ -176,12 +183,15 @@
/** Clone NS Packages @public */
public cloneVNFPackage(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const cloneModal: NgbModalRef = this.modalService.open(ClonePackageComponent, { backdrop: 'static' });
cloneModal.componentInstance.params = { id: this.vnfID, page: 'vnfd', name: this.vnfName };
cloneModal.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
diff --git a/src/app/utilities/wim-accounts-action/WIMAccountsActionComponent.ts b/src/app/utilities/wim-accounts-action/WIMAccountsActionComponent.ts
index 0769863..d5f3ebd 100644
--- a/src/app/utilities/wim-accounts-action/WIMAccountsActionComponent.ts
+++ b/src/app/utilities/wim-accounts-action/WIMAccountsActionComponent.ts
@@ -65,6 +65,7 @@
/** Show WIM account information @public */
public showWIMAccountInfo(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(WIMAccountInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.wimID,
page: 'wim-accounts'
@@ -73,11 +74,14 @@
/** Delete WIM Account @public */
public deleteWIMAccount(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(DeleteComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}