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/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
+ });
}
/**