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/.eslintrc.json b/src/.eslintrc.json
new file mode 100644
index 0000000..9c4ba8c
--- /dev/null
+++ b/src/.eslintrc.json
@@ -0,0 +1,16 @@
+{
+ "extends": "../.eslintrc.json",
+ "rules": {
+ "no-restricted-syntax": [
+ "error",
+ "ForInStatement"
+ ],
+ "@typescript-eslint/array-type": [
+ "error",
+ {
+ "default": "array"
+ }
+ ]
+ }
+ }
+
\ No newline at end of file
diff --git a/src/app/AppComponent.ts b/src/app/AppComponent.ts
index 04ad8d8..4567671 100644
--- a/src/app/AppComponent.ts
+++ b/src/app/AppComponent.ts
@@ -19,13 +19,13 @@
/**
* @file App Components
*/
+import { isNullOrUndefined } from 'util';
import { Component, HostListener, Injector } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { DEFAULT_INTERRUPTSOURCES, Idle } from '@ng-idle/core';
import { AuthenticationService } from 'AuthenticationService';
import { DeviceCheckService } from 'DeviceCheckService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
diff --git a/src/app/AppModule.ts b/src/app/AppModule.ts
index 5244bb2..8a4ebaf 100644
--- a/src/app/AppModule.ts
+++ b/src/app/AppModule.ts
@@ -25,44 +25,34 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { RouterModule } from '@angular/router';
+import { CodemirrorModule } from '@ctrl/ngx-codemirror';
import { NgbModule } from '@ng-bootstrap/ng-bootstrap';
+import { NgIdleKeepaliveModule } from '@ng-idle/keepalive';
+import { NgSelectModule } from '@ng-select/ng-select';
import { TranslateLoader, TranslateModule, TranslateService } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { NotifierModule, NotifierOptions } from 'angular-notifier';
-import { AuthInterceptorService } from 'AuthInterceptorService';
-import { HeaderComponent } from 'HeaderComponent';
-import { LayoutComponent } from 'LayoutComponent';
-import { Ng2SmartTableModule } from 'ng2-smart-table';
-import { RestService } from 'RestService';
-import { SidebarComponent } from 'SidebarComponent';
-import { AppComponent } from './AppComponent';
-
-import { appRoutes } from './approutes.module';
-
-import { DataService } from 'DataService';
-import { ProjectService } from 'ProjectService';
-import { SharedService } from 'SharedService';
-
-import { CodemirrorModule } from '@ctrl/ngx-codemirror';
-import { NgSelectModule } from '@ng-select/ng-select';
-
-import { NgIdleKeepaliveModule } from '@ng-idle/keepalive';
import { AuthenticationService } from 'AuthenticationService';
import { AuthGuardService } from 'AuthGuardService';
+import { AuthInterceptorService } from 'AuthInterceptorService';
import { BreadcrumbComponent } from 'BreadCrumb';
import { ChangePasswordComponent } from 'ChangePasswordComponent';
import { ChangePasswordModule } from 'ChangePasswordModule';
import { ComposePackages } from 'ComposePackages';
import { ConfirmationTopologyComponent } from 'ConfirmationTopology';
+import { DataService } from 'DataService';
import { DeleteComponent } from 'DeleteComponent';
import { DeviceCheckService } from 'DeviceCheckService';
import { GoToTopDirective } from 'GoToTopDirective';
+import { HeaderComponent } from 'HeaderComponent';
import { InstantiateNetSliceTemplateComponent } from 'InstantiateNetSliceTemplate';
import { InstantiateNsComponent } from 'InstantiateNs';
+import { LayoutComponent } from 'LayoutComponent';
import { LoaderModule } from 'LoaderModule';
import { LoginComponent } from 'LoginComponent';
import { NetsliceInstancesActionComponent } from 'NetsliceInstancesActionComponent';
import { NetslicePackagesActionComponent } from 'NetslicePackagesAction';
+import { Ng2SmartTableModule } from 'ng2-smart-table';
import { NSInstancesActionComponent } from 'NSInstancesActionComponent';
import { NsPackagesActionComponent } from 'NsPackagesAction';
import { NsUpdateComponent } from 'NsUpdateComponent';
@@ -70,10 +60,14 @@
import { PDUInstancesActionComponent } from 'PDUInstancesActionComponent';
import { ProjectLinkComponent } from 'ProjectLinkComponent';
import { ProjectsActionComponent } from 'ProjectsAction';
+import { ProjectService } from 'ProjectService';
+import { RestService } from 'RestService';
import { ScalingComponent } from 'ScalingComponent';
import { SDNControllerActionComponent } from 'SDNControllerActionComponent';
import { SharedModule } from 'SharedModule';
+import { SharedService } from 'SharedService';
import { ShowInfoComponent } from 'ShowInfoComponent';
+import { SidebarComponent } from 'SidebarComponent';
import { StartStopRebuildComponent } from 'StartStopRebuildComponent';
import { SwitchProjectComponent } from 'SwitchProjectComponent';
import { UsersActionComponent } from 'UsersActionComponent';
@@ -86,6 +80,8 @@
import { VNFPackagesActionComponent } from 'VNFPackagesAction';
import { WarningComponent } from 'WarningComponent';
import { WIMAccountsActionComponent } from 'WIMAccountsAction';
+import { AppComponent } from './AppComponent';
+import { appRoutes } from './approutes.module';
/**
* Custom angular notifier options
@@ -185,39 +181,7 @@
SharedService,
DeviceCheckService
],
- bootstrap: [AppComponent],
- entryComponents: [
- VNFPackagesActionComponent,
- NsPackagesActionComponent,
- NSInstancesActionComponent,
- VNFInstancesActionComponent,
- VNFLinkComponent,
- NetsliceInstancesActionComponent,
- BreadcrumbComponent,
- DeleteComponent,
- NetslicePackagesActionComponent,
- UsersActionComponent,
- VimAccountsActionComponent,
- ProjectsActionComponent,
- ProjectLinkComponent,
- UserSettingsComponent,
- ShowInfoComponent,
- InstantiateNetSliceTemplateComponent,
- InstantiateNsComponent,
- ConfirmationTopologyComponent,
- ComposePackages,
- WIMAccountsActionComponent,
- PDUInstancesActionComponent,
- SDNControllerActionComponent,
- SwitchProjectComponent,
- ScalingComponent,
- ChangePasswordComponent,
- VmMigrationComponent,
- NsUpdateComponent,
- WarningComponent,
- StartStopRebuildComponent,
- VerticalScalingComponent
- ]
+ bootstrap: [AppComponent]
})
/** Exporting a class @exports AppModule */
@@ -229,7 +193,7 @@
/**
* HttpLoaderFactory is for translate service of the application.
*/
-// tslint:disable:function-name
+/* eslint-disable */
export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
const now: number = new Date().getTime();
return new TranslateHttpLoader(http, './assets/i18n/', '.json?locale=' + now);
@@ -237,9 +201,8 @@
/**
* HttpLoaderFactory is for translate service of the application.
*/
-// tslint:disable:function-name
export function appInitializerFactory(translate: TranslateService, injector: Injector): Object {
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
return async (): Promise<any> => {
await injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
translate.setDefaultLang('en');
diff --git a/src/app/approutes.module.ts b/src/app/approutes.module.ts
index e75416e..537dc94 100644
--- a/src/app/approutes.module.ts
+++ b/src/app/approutes.module.ts
@@ -15,6 +15,7 @@
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
*/
+/* eslint-disable @typescript-eslint/no-explicit-any */
/**
* @file Routing Module
*/
@@ -38,77 +39,77 @@
children: [
{
path: '',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./dashboard/DashboardModule')
.then((m: typeof import('./dashboard/DashboardModule')) => m.DashboardModule),
canActivate: [AuthGuardService]
},
{
path: 'packages',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./packages/PackagesModule')
.then((m: typeof import('./packages/PackagesModule')) => m.PackagesModule),
canActivate: [AuthGuardService]
},
{
path: 'instances',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./instances/InstancesModule')
.then((m: typeof import('./instances/InstancesModule')) => m.InstancesModule),
canActivate: [AuthGuardService]
},
{
path: 'vim',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./vim-accounts/VimAccountsModule')
.then((m: typeof import('./vim-accounts/VimAccountsModule')) => m.VimAccountsModule),
canActivate: [AuthGuardService]
},
{
path: 'wim',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./wim-accounts/WIMAccountsModule')
.then((m: typeof import('./wim-accounts/WIMAccountsModule')) => m.WIMAccountsModule),
canActivate: [AuthGuardService]
},
{
path: 'sdn',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./sdn-controller/SDNControllerModule')
.then((m: typeof import('./sdn-controller/SDNControllerModule')) => m.SDNControllerModule),
canActivate: [AuthGuardService]
},
{
path: 'users',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./users/UsersModule')
.then((m: typeof import('./users/UsersModule')) => m.UsersModule),
canActivate: [AuthGuardService]
},
{
path: 'projects',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./projects/ProjectsModule')
.then((m: typeof import('./projects/ProjectsModule')) => m.ProjectsModule),
canActivate: [AuthGuardService]
},
{
path: 'roles',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./roles/RolesModule')
.then((m: typeof import('./roles/RolesModule')) => m.RolesModule),
canActivate: [AuthGuardService]
},
{
path: 'k8s',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./k8s/K8sModule')
.then((m: typeof import('./k8s/K8sModule')) => m.K8sModule),
canActivate: [AuthGuardService]
},
{
path: 'repos',
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
loadChildren: async (): Promise<any> => import('./osm-repositories/OsmRepositoriesModule')
.then((m: typeof import('./osm-repositories/OsmRepositoriesModule')) => m.OsmRepositoriesModule),
canActivate: [AuthGuardService]
diff --git a/src/app/dashboard/DashboardComponent.ts b/src/app/dashboard/DashboardComponent.ts
index b3e48e4..23e928f 100644
--- a/src/app/dashboard/DashboardComponent.ts
+++ b/src/app/dashboard/DashboardComponent.ts
@@ -18,12 +18,14 @@
/**
* @file Dashboard Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { NotifierService } from 'angular-notifier';
import { AuthenticationService } from 'AuthenticationService';
-import { Chart } from 'chart.js';
-import 'chartjs-plugin-labels';
+import { Chart, ChartType, LineController, LineElement, PointElement, LinearScale, Title, ChartEvent, ActiveElement } from 'chart.js';
+import ChartDataLabels from 'chartjs-plugin-datalabels';
+Chart.register(LineController, LineElement, PointElement, LinearScale, Title, ChartDataLabels);
import { ERRORDATA, TYPESECTION, VIM_TYPES } from 'CommonModel';
import { environment } from 'environment';
import { NSDDetails } from 'NSDModel';
@@ -35,7 +37,6 @@
import { SDNControllerModel } from 'SDNControllerModel';
import { SharedService } from 'SharedService';
import { ProjectRoleMappings, UserDetail } from 'UserModel';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
import { VNFInstanceDetails } from 'VNFInstanceModel';
@@ -172,12 +173,15 @@
private createdTimes: string[] = [];
/** Contains slice limit const @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private sliceLimit: number = 10;
/** Contians hour converter @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private hourConverter: number = 3600;
/** Converter used to round off time to one decimal point @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private converter: number = 10;
/** Notifier service to popup notification @private */
@@ -321,7 +325,7 @@
/** Prepare and sketch NS instance chart */
public drawNsChart(): void {
this.charts = new Chart('canvas', {
- type: 'bar',
+ type: 'bar' as ChartType,
data: {
labels: this.nsRunningInstance,
datasets: [{
@@ -329,46 +333,48 @@
label: this.translateService.instant('NOOFHOURS'),
borderColor: this.backgroundColor,
fill: false,
- backgroundColor: this.backgroundColor
+ backgroundColor: this.backgroundColor,
+ hoverBackgroundColor: this.backgroundColor
}]
},
options: {
layout: {
padding: {
- top: 20
+ top: 25
}
},
- hover: {
- onHover(evt: Event, item: {}): void {
- const el: HTMLElement = document.getElementById('canvas');
- el.style.cursor = item[0] ? 'pointer' : 'default';
- }
+ animation: false,
+ // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
+ onHover(event: ChartEvent, item: ActiveElement[], chart: Chart): void {
+ const el: HTMLElement = document.getElementById('canvas');
+ el.style.cursor = item[0] ? 'pointer' : 'default';
},
plugins: {
- labels: {
- // render 'label', 'value', 'percentage', 'image' or custom function, default is 'percentage'
- render: 'value'
+ legend: { display: false },
+ datalabels: {
+ anchor: 'end',
+ align: 'top',
+ font: {
+ weight: 'bold'
+ }
}
},
- legend: { display: false },
scales: {
- xAxes: [{
+ x: {
display: true,
- scaleLabel: {
+ title: {
display: true,
- labelString: this.translateService.instant('NSINSTANCES')
+ text: this.translateService.instant('NSINSTANCES')
}
- }],
- yAxes: [{
- ticks: {
- beginAtZero: true
- },
+ },
+ y: {
+ beginAtZero: true,
display: true,
- scaleLabel: {
+ title: {
display: true,
- labelString: this.translateService.instant('NOOFHOURS')
+ text: this.translateService.instant('NOOFHOURS')
}
- }]
+ }
}
}
});
@@ -412,7 +418,6 @@
if (this.vimList.length === 0) {
this.vimListData = null;
}
-
}
/** Get Selected VIM details @public */
diff --git a/src/app/dashboard/DashboardModule.ts b/src/app/dashboard/DashboardModule.ts
index 82b27c0..19aae28 100644
--- a/src/app/dashboard/DashboardModule.ts
+++ b/src/app/dashboard/DashboardModule.ts
@@ -30,7 +30,7 @@
import { TranslateModule } from '@ngx-translate/core';
import { DashboardComponent } from 'DashboardComponent';
import { LoaderModule } from 'LoaderModule';
-import { ChartsModule } from 'ng2-charts';
+import { NgChartsModule } from 'ng2-charts';
import { SharedModule } from 'SharedModule';
/** To halndle project information */
@@ -53,7 +53,7 @@
*/
@NgModule({
imports: [FormsModule, CommonModule, HttpClientModule, FlexLayoutModule, TranslateModule, NgSelectModule,
- ChartsModule, RouterModule.forChild(routes), NgbModule, LoaderModule, SharedModule],
+ NgChartsModule, RouterModule.forChild(routes), NgbModule, LoaderModule, SharedModule],
declarations: [DashboardComponent]
})
/** Exporting a class @exports DashboardModule */
diff --git a/src/app/instances/InstancesComponent.ts b/src/app/instances/InstancesComponent.ts
index fe46d8c..4186078 100644
--- a/src/app/instances/InstancesComponent.ts
+++ b/src/app/instances/InstancesComponent.ts
@@ -49,7 +49,9 @@
/** Return to list NS Package List */
public redirectToList(getURL: string): void {
if (getURL === '/instances') {
- this.router.navigate(['/instances/ns']).catch();
+ this.router.navigate(['/instances/ns']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/app/instances/InstancesModule.ts b/src/app/instances/InstancesModule.ts
index 18c733c..0d41509 100644
--- a/src/app/instances/InstancesModule.ts
+++ b/src/app/instances/InstancesModule.ts
@@ -138,23 +138,14 @@
NetsliceInstancesComponent, HistoryOperationsComponent, NSTopologyComponent, NSPrimitiveComponent, OperationalViewComponent,
OperationalViewAppConfigsComponent, OperationalViewAppActionsComponent, OperationalViewAppExecutedActionsComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
- providers: [DataService],
- entryComponents: [
- NSPrimitiveComponent,
- AddPDUInstancesComponent,
- OperationalViewAppConfigsComponent,
- OperationalViewAppActionsComponent,
- OperationalViewAppExecutedActionsComponent
- ]
+ providers: [DataService]
})
/** Exporting a class @exports InstancesModule */
export class InstancesModule {
- /** Resolves state-less class */
- private instancesModule: string;
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- this.instancesModule = '';
- }
+ constructor() {
+ //Empty
+ }
}
diff --git a/src/app/instances/netslice-instances/NetsliceInstancesComponent.ts b/src/app/instances/netslice-instances/NetsliceInstancesComponent.ts
index 3b9564a..e04fc20 100644
--- a/src/app/instances/netslice-instances/NetsliceInstancesComponent.ts
+++ b/src/app/instances/netslice-instances/NetsliceInstancesComponent.ts
@@ -138,12 +138,15 @@
/** Instantiate Net Slice using modalservice @public */
public instantiateNetSlice(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(InstantiateNetSliceTemplateComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.generateData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Generate smart table row title and filters @public */
@@ -267,7 +270,9 @@
}
this.dataSource.load(this.nstInstanceData).then((data: {}) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
diff --git a/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts b/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts
index 7f268d1..afbefdb 100644
--- a/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts
+++ b/src/app/instances/ns-history-operations/HistoryOperationsComponent.ts
@@ -18,6 +18,7 @@
/**
* @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';
@@ -33,7 +34,6 @@
import { Subscription } from 'rxjs';
import { SharedService } from 'SharedService';
import { ShowInfoComponent } from 'ShowInfoComponent';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -130,9 +130,7 @@
/** 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;
@@ -215,6 +213,7 @@
}
/** 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,
@@ -256,12 +255,16 @@
}
this.dataSource.load(this.nsAndnstInstanceData).then((data: {}): void => {
//empty block
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
this.isLoadingResults = false;
}, (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');
}
diff --git a/src/app/instances/ns-instances/NSInstancesComponent.ts b/src/app/instances/ns-instances/NSInstancesComponent.ts
index c44fa9b..5cc5519 100644
--- a/src/app/instances/ns-instances/NSInstancesComponent.ts
+++ b/src/app/instances/ns-instances/NSInstancesComponent.ts
@@ -255,7 +255,9 @@
}
this.dataSource.load(this.nsInstanceData).then((data: {}): void => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA): void => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
@@ -275,12 +277,15 @@
/** Instantiate NS using modalservice @public */
public instantiateNS(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(InstantiateNsComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA): void => {
if (result) {
this.generateData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
diff --git a/src/app/instances/ns-primitive/NSPrimitiveComponent.ts b/src/app/instances/ns-primitive/NSPrimitiveComponent.ts
index bcce057..8f39a20 100644
--- a/src/app/instances/ns-primitive/NSPrimitiveComponent.ts
+++ b/src/app/instances/ns-primitive/NSPrimitiveComponent.ts
@@ -18,6 +18,7 @@
/**
* @file NS Instance Primitive Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { AbstractControl, FormArray, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
@@ -30,7 +31,6 @@
import { NSPrimitiveParams } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { CONFIGPRIMITIVE, DF, VDUCONFIG, VDUPROFILE, VNFCONFIG, VNFD } from 'VNFDModel';
import { VNFInstanceDetails } from 'VNFInstanceModel';
@@ -217,19 +217,19 @@
primitive_params: this.objectPrimitiveParams
};
if (this.primitiveType === 'VNF_Primitive') {
- // tslint:disable-next-line: no-string-literal
+ // eslint-disable-next-line @typescript-eslint/dot-notation
primitiveParamsPayLoads['member_vnf_index'] = this.primitiveForm.value.member_vnf_index;
}
if (this.primitiveType === 'VDU_Primitive') {
- // tslint:disable-next-line: no-string-literal
+ // eslint-disable-next-line @typescript-eslint/dot-notation
primitiveParamsPayLoads['member_vnf_index'] = this.primitiveForm.value.member_vnf_index;
- // tslint:disable-next-line: no-string-literal
+ // eslint-disable-next-line @typescript-eslint/dot-notation
primitiveParamsPayLoads['vdu_id'] = this.primitiveForm.value.vdu_id;
}
if (this.primitiveType === 'KDU_Primitive') {
- // tslint:disable-next-line: no-string-literal
+ // eslint-disable-next-line @typescript-eslint/dot-notation
primitiveParamsPayLoads['member_vnf_index'] = this.primitiveForm.value.member_vnf_index;
- // tslint:disable-next-line: no-string-literal
+ // eslint-disable-next-line @typescript-eslint/dot-notation
primitiveParamsPayLoads['kdu_name'] = this.primitiveForm.value.kdu_name;
}
const apiURLHeader: APIURLHEADER = {
@@ -439,6 +439,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.primitiveForm.controls[controlName];
}
}
diff --git a/src/app/instances/ns-topology/NSTopologyComponent.ts b/src/app/instances/ns-topology/NSTopologyComponent.ts
index 668f251..8981e26 100644
--- a/src/app/instances/ns-topology/NSTopologyComponent.ts
+++ b/src/app/instances/ns-topology/NSTopologyComponent.ts
@@ -18,7 +18,7 @@
/**
* @file NS Topology Component
*/
-/* tslint:disable:no-increment-decrement */
+/* eslint-disable */
import { Component, ElementRef, Injector, ViewChild, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Router } from '@angular/router';
@@ -87,22 +87,22 @@
/** Holds the NS Id @private */
private nsIdentifier: string;
/** Contains SVG attributes @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private svg: any;
/** Contains forced node animations @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private force: any;
/** Contains path information of the node */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private path: any;
/** Contains node network @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private network: any;
/** Contains node square @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private square: any;
/** Contains node circle @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private circle: any;
/** Contains the NS information @private */
private nsData: NSInstanceDetails;
@@ -123,13 +123,13 @@
/** Set timeout @private */
private TIMEOUT: number = 2000;
/** Rendered nodes represent vnf @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gSquare: any;
/** Rendered nodes represent network @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gNetwork: any;
/** Rendered nodes represent network @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gCircle: any;
/** Service holds the router information @private */
private router: Router;
@@ -146,7 +146,6 @@
* Lifecyle Hooks the trigger before component is instantiate @public
*/
public ngOnInit(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.nsIdentifier = this.activatedRoute.snapshot.paramMap.get('id');
this.generateData();
}
@@ -238,7 +237,9 @@
}, (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');
}
@@ -411,7 +412,7 @@
this.square.exit().remove();
this.network.exit().remove();
this.circle.exit().remove();
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const gPath: any = this.path.enter().append('svg:path').attr('class', 'link');
this.getgSquare();
this.getgNetwork();
@@ -422,12 +423,12 @@
this.circle = this.gCircle.merge(this.circle);
}
/** Events handles when Shift Click to perform create cp @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private singleClick(nodeSelected: any, d: COMPOSERNODES): void {
this.selectNodeExclusive(nodeSelected, d);
}
/** Selected nodes @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private selectNodeExclusive(nodeSelected: any, d: COMPOSERNODES): void {
const alreadyIsActive: boolean = nodeSelected.select('#' + d.selectorId).classed(this.activeClass);
this.deselectAllNodes();
@@ -513,7 +514,7 @@
.text((d: COMPOSERNODES): string => d.name);
}
/** drag event @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private onDragDrop(): any {
return d3.drag().filter(this.dragFilter)
.on('start', this.dragstarted)
diff --git a/src/app/instances/pdu-instances/PDUInstancesComponent.ts b/src/app/instances/pdu-instances/PDUInstancesComponent.ts
index 20b44df..5c25279 100644
--- a/src/app/instances/pdu-instances/PDUInstancesComponent.ts
+++ b/src/app/instances/pdu-instances/PDUInstancesComponent.ts
@@ -159,7 +159,9 @@
}
this.dataSource.load(this.pduInstanceData).then((data: {}) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
@@ -179,13 +181,16 @@
/** Add PDU Instance modal using modalservice @public */
public addPDUInstanceModal(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(AddPDUInstancesComponent, { backdrop: 'static' });
modalRef.componentInstance.title = this.translateService.instant('PAGE.PDUINSTANCE.NEWPDUINSTANCE');
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.generateData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
diff --git a/src/app/instances/pdu-instances/add-pdu-instances/AddPDUInstancesComponent.ts b/src/app/instances/pdu-instances/add-pdu-instances/AddPDUInstancesComponent.ts
index 644b83d..2efe244 100644
--- a/src/app/instances/pdu-instances/add-pdu-instances/AddPDUInstancesComponent.ts
+++ b/src/app/instances/pdu-instances/add-pdu-instances/AddPDUInstancesComponent.ts
@@ -145,13 +145,11 @@
/** Handle FormArray Controls @public */
public getControls(): AbstractControl[] {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
return (this.pduInstancesForm.get('interfaces') as FormArray).controls;
}
/** Push all primitive params on user's action @public */
public createInterfaces(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.pduInterfaces = this.pduInstancesForm.get('interfaces') as FormArray;
this.pduInterfaces.push(this.interfacesBuilder());
}
diff --git a/src/app/instances/vnf-instances/VNFInstancesComponent.ts b/src/app/instances/vnf-instances/VNFInstancesComponent.ts
index fdfe9fa..90bb6fe 100644
--- a/src/app/instances/vnf-instances/VNFInstancesComponent.ts
+++ b/src/app/instances/vnf-instances/VNFInstancesComponent.ts
@@ -160,7 +160,9 @@
}
this.dataSource.load(this.vnfInstanceData).then((data: {}) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
diff --git a/src/app/instances/vnf-instances/vnf-link/VNFLinkComponent.ts b/src/app/instances/vnf-instances/vnf-link/VNFLinkComponent.ts
index 15ea6ff..b582774 100644
--- a/src/app/instances/vnf-instances/vnf-link/VNFLinkComponent.ts
+++ b/src/app/instances/vnf-instances/vnf-link/VNFLinkComponent.ts
@@ -42,5 +42,4 @@
public ngOnInit(): void {
//empty
}
-
}
diff --git a/src/app/k8s/K8sComponent.ts b/src/app/k8s/K8sComponent.ts
index 5427a8f..07aa901 100644
--- a/src/app/k8s/K8sComponent.ts
+++ b/src/app/k8s/K8sComponent.ts
@@ -49,8 +49,9 @@
/** Return to list NS Package List */
public redirectToList(getURL: string): void {
if (getURL === '/k8s') {
- this.router.navigate(['/k8s/cluster']).catch();
+ this.router.navigate(['/k8s/cluster']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
-
}
diff --git a/src/app/k8s/K8sModule.ts b/src/app/k8s/K8sModule.ts
index 51f27b2..14d8165 100644
--- a/src/app/k8s/K8sModule.ts
+++ b/src/app/k8s/K8sModule.ts
@@ -96,8 +96,7 @@
K8sAddRepoComponent
],
providers: [DataService],
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- entryComponents: [K8sActionComponent, K8sAddClusterComponent, K8sAddRepoComponent]
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
/** Exporting a class @exports K8sModule */
export class K8sModule {
diff --git a/src/app/k8s/k8s-action/K8sActionComponent.ts b/src/app/k8s/k8s-action/K8sActionComponent.ts
index a524277..f68eff6 100644
--- a/src/app/k8s/k8s-action/K8sActionComponent.ts
+++ b/src/app/k8s/k8s-action/K8sActionComponent.ts
@@ -75,12 +75,15 @@
/** Delete User Account @public */
public deleteK8s(pageType: string): 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 */
@@ -94,6 +97,7 @@
pageName = 'k8s-cluster';
title = 'PAGE.K8S.K8SCLUSTERDETAILS';
}
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ShowInfoComponent, { backdrop: 'static' }).componentInstance.params = {
id: this.instanceID,
page: pageName,
diff --git a/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.ts b/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.ts
index aa33193..bad533f 100644
--- a/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.ts
+++ b/src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.ts
@@ -18,6 +18,7 @@
/**
* @file K8sAddClusterComponent.ts.
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -29,7 +30,6 @@
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
* Creating Component
@@ -209,6 +209,7 @@
// Transform Map to json object
const jsonDMObject: {} = {};
this.deploymentMethodsSubmit.forEach((value: boolean, key: string): void => {
+ // eslint-disable-next-line security/detect-object-injection
jsonDMObject[key] = value;
});
@@ -232,7 +233,6 @@
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'json').then((fileContent: string): void => {
const getNetsJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.k8sclusterForm.get('nets').setValue(JSON.stringify(getNetsJson));
}).catch((err: string): void => {
if (err === 'typeError') {
@@ -255,7 +255,6 @@
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'yaml').then((fileContent: string): void => {
const getCredentialsJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.k8sclusterForm.get('credentials').setValue(JSON.stringify(getCredentialsJson));
}).catch((err: string): void => {
if (err === 'typeError') {
@@ -272,5 +271,4 @@
this.fileInputCredentialsLabel.nativeElement.innerText = files[0].name;
this.fileInputCredentials.nativeElement.value = null;
}
-
}
diff --git a/src/app/k8s/k8s-add-repo/K8sAddRepoComponent.ts b/src/app/k8s/k8s-add-repo/K8sAddRepoComponent.ts
index c8b96bb..700a0c3 100644
--- a/src/app/k8s/k8s-add-repo/K8sAddRepoComponent.ts
+++ b/src/app/k8s/k8s-add-repo/K8sAddRepoComponent.ts
@@ -130,5 +130,4 @@
this.restService.handleError(error, 'post');
});
}
-
}
diff --git a/src/app/k8s/k8scluster/K8sClusterComponent.ts b/src/app/k8s/k8scluster/K8sClusterComponent.ts
index 7ab7583..88a4fb6 100644
--- a/src/app/k8s/k8scluster/K8sClusterComponent.ts
+++ b/src/app/k8s/k8scluster/K8sClusterComponent.ts
@@ -180,12 +180,15 @@
/** Compose new K8s Cluster Accounts @public */
public addK8sCluster(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(K8sAddClusterComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
@@ -232,5 +235,4 @@
this.isLoadingResults = false;
});
}
-
}
diff --git a/src/app/k8s/k8srepository/K8sRepositoryComponent.ts b/src/app/k8s/k8srepository/K8sRepositoryComponent.ts
index 1b6c9f7..a9626d2 100644
--- a/src/app/k8s/k8srepository/K8sRepositoryComponent.ts
+++ b/src/app/k8s/k8srepository/K8sRepositoryComponent.ts
@@ -141,12 +141,15 @@
/** Compose new K8s Repo Accounts @public */
public addK8sRepo(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(K8sAddRepoComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
@@ -157,7 +160,6 @@
}
/** Generate nsData object from loop and return for the datasource @public */
- // tslint:disable-next-line: typedef
public generateK8sRepoData(k8sRepodata: K8SREPODATA): K8SREPODATADISPLAY {
return {
name: k8sRepodata.name,
@@ -194,5 +196,4 @@
this.isLoadingResults = false;
});
}
-
}
diff --git a/src/app/layouts/breadcrumb/BreadcrumbComponent.ts b/src/app/layouts/breadcrumb/BreadcrumbComponent.ts
index e273cda..2b7ca54 100644
--- a/src/app/layouts/breadcrumb/BreadcrumbComponent.ts
+++ b/src/app/layouts/breadcrumb/BreadcrumbComponent.ts
@@ -18,13 +18,13 @@
/**
* @file Bread Crumb component.
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { Title } from '@angular/platform-browser';
import { ActivatedRoute, NavigationEnd, Router, RouterEvent, UrlSegment } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { BREADCRUMBITEM } from 'CommonModel';
import { filter, startWith } from 'rxjs/operators';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -72,6 +72,7 @@
/** Lifecyle Hooks the trigger before component is instantiate @public */
public ngOnInit(): void {
this.router.events
+ // eslint-disable-next-line deprecation/deprecation
.pipe(filter((event: RouterEvent) => event instanceof NavigationEnd), startWith(undefined))
.subscribe(() => this.menuItems = this.createBreadcrumbs(this.activatedRoute.root));
}
@@ -153,5 +154,4 @@
return this.translateService.instant('PAGE.DASHBOARD.NETSLICEINSTANCE');
}
}
-
}
diff --git a/src/app/layouts/header/HeaderComponent.ts b/src/app/layouts/header/HeaderComponent.ts
index b496ff1..9b4fca6 100644
--- a/src/app/layouts/header/HeaderComponent.ts
+++ b/src/app/layouts/header/HeaderComponent.ts
@@ -120,6 +120,7 @@
/** Implementation of model for UserSettings options.@public */
public userSettings(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(UserSettingsComponent, { backdrop: 'static' });
}
}
diff --git a/src/app/layouts/sidebar/SidebarComponent.ts b/src/app/layouts/sidebar/SidebarComponent.ts
index 9cae634..c328778 100644
--- a/src/app/layouts/sidebar/SidebarComponent.ts
+++ b/src/app/layouts/sidebar/SidebarComponent.ts
@@ -19,10 +19,10 @@
/**
* @file Sidebar Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { DeviceCheckService } from 'DeviceCheckService';
import { MENU_ITEMS, MENUITEMS } from 'src/models/MenuModel';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -133,6 +133,7 @@
}
/** Hide / Show Menus based on the clicking in the menus @public */
public checkAndCloseSideBar(childExists: boolean): void {
+ // eslint-disable-next-line deprecation/deprecation
event.stopPropagation();
if (this.isMobile$ && !childExists) {
this.sideBarOpenClose();
diff --git a/src/app/login/LoginComponent.ts b/src/app/login/LoginComponent.ts
index 8c6f5a3..fae3d20 100644
--- a/src/app/login/LoginComponent.ts
+++ b/src/app/login/LoginComponent.ts
@@ -19,6 +19,7 @@
/**
* @file Page for Login component
*/
+import { isNullOrUndefined } from 'util';
import { HttpErrorResponse } from '@angular/common/http';
import { Component, Injector, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -27,7 +28,6 @@
import { RestService } from 'RestService';
import { Observable } from 'rxjs';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
diff --git a/src/app/operational-view/OperationalViewComponent.ts b/src/app/operational-view/OperationalViewComponent.ts
index ae2a13c..edb972a 100644
--- a/src/app/operational-view/OperationalViewComponent.ts
+++ b/src/app/operational-view/OperationalViewComponent.ts
@@ -1,3 +1,4 @@
+/* eslint-disable security/detect-object-injection */
/*
Copyright 2020 TATA ELXSI
@@ -19,6 +20,7 @@
/**
* @file Page for Operational View Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
@@ -35,7 +37,6 @@
import { Subscription } from 'rxjs';
import { map } from 'rxjs/operators';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
* @Component takes OperationalViewComponent.html as template url
@@ -77,19 +78,22 @@
public timeOutDefaultSeconds: number = CONSTANTNUMBER.timeOutDefaultSeconds;
/** variables contains minimum seconds for the timeout @public */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
public minSeconds: number = 5;
/** variables contains maximum seconds for the timeout @public */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
public maxSeconds: number = 60;
/** variables contains timer calculation value of milliseconds @public */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
public timeDefaultCal: number = 1000;
/** variables contains timeout @public */
public timeOut: number;
/** Set the timer button @public */
- // tslint:disable-next-line: no-magic-numbers
+ // eslint-disable-next-line no-magic-numbers
public setSeconds: SETTIMER[] = SET_TIMER;
/** Instance of subscriptions @private */
@@ -118,7 +122,6 @@
* Lifecyle Hooks the trigger before component is instantiate
*/
public ngOnInit(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.instancesID = this.activatedRoute.snapshot.paramMap.get('id');
this.generateData();
this.generateDataSub = this.sharedService.dataEvent.subscribe((): void => { this.generateData(); });
@@ -186,9 +189,7 @@
if (liveData) {
NSURL = NSURL + '?vcaStatusRefresh=true';
}
- return this.restService.getResource(NSURL).pipe(map((operationalList: VCASTATUS): VCADETAILS => {
- return this.vcaDetailsData(operationalList, liveData, timeOutSeconds);
- }));
+ return this.restService.getResource(NSURL).pipe(map((operationalList: VCASTATUS): VCADETAILS => this.vcaDetailsData(operationalList, liveData, timeOutSeconds)));
}
/**
* Form the VCA Details for each NS Instances
@@ -235,7 +236,9 @@
list.vcaStatus[key].units = vcaUnits;
list.vcaStatus[key].applications = vcaApplication;
list.vcaStatus[key].machines = vcaMachines;
+ // eslint-disable-next-line no-self-assign
list.vcaStatus[key].relations = list.vcaStatus[key].relations;
+ // eslint-disable-next-line no-self-assign
list.vcaStatus[key].model = list.vcaStatus[key].model;
const getEachModelData: SETMODELS = this.assignVCAStatusOfEachModel(list.vcaStatus[key]);
setModels.push(getEachModelData);
@@ -258,7 +261,9 @@
Object.keys(applicationData).forEach((applicationKey: string): void => {
const charmSplitlist: string[] = applicationData[applicationKey].charm.split('/');
const status: string = applicationData[applicationKey].status.status;
+ // eslint-disable-next-line deprecation/deprecation
const charm: string = charmSplitlist[1].substr(0, charmSplitlist[1].lastIndexOf('-'));
+ // eslint-disable-next-line deprecation/deprecation
const store: string = charmSplitlist[0].substr(0, charmSplitlist[0].lastIndexOf(':'));
applicationData[applicationKey].app_id = applicationKey;
applicationData[applicationKey].charm = charm;
@@ -298,16 +303,19 @@
}
/** Show the Config list in modal using modalservice @public */
public showExecutedActionsList(executeActionsList: EXECUTEDACTIONS[]): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(OperationalViewAppExecutedActionsComponent, { size: 'xl', backdrop: 'static' })
.componentInstance.params = { executedActions: executeActionsList };
}
/** Show the Config list in modal using modalservice @public */
public showConfigList(configList: object): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(OperationalViewAppConfigsComponent, { size: 'xl', backdrop: 'static' })
.componentInstance.params = { configs: configList };
}
/** Show the Config list in modal using modalservice @public */
public showActionsList(actionsList: object): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(OperationalViewAppActionsComponent, { size: 'xl', backdrop: 'static' })
.componentInstance.params = { actions: actionsList };
}
diff --git a/src/app/operational-view/operational-view-app-actions/OperationalViewAppActionsComponent.ts b/src/app/operational-view/operational-view-app-actions/OperationalViewAppActionsComponent.ts
index 5a4f48e..acee5ed 100644
--- a/src/app/operational-view/operational-view-app-actions/OperationalViewAppActionsComponent.ts
+++ b/src/app/operational-view/operational-view-app-actions/OperationalViewAppActionsComponent.ts
@@ -19,10 +19,10 @@
/**
* @file Page for Operational View App actions Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { URLPARAMS } from 'CommonModel';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
* @Component takes OperationalViewAppActionsComponent.html as template url
@@ -60,6 +60,7 @@
this.actionsData = Object.keys(this.params.actions).map((key: string): Object => (
{
actions: key,
+ // eslint-disable-next-line security/detect-object-injection
description: this.params.actions[key]
}));
}
diff --git a/src/app/operational-view/operational-view-app-configs/OperationalViewAppConfigsComponent.ts b/src/app/operational-view/operational-view-app-configs/OperationalViewAppConfigsComponent.ts
index 1e1b453..4d40d2c 100644
--- a/src/app/operational-view/operational-view-app-configs/OperationalViewAppConfigsComponent.ts
+++ b/src/app/operational-view/operational-view-app-configs/OperationalViewAppConfigsComponent.ts
@@ -19,10 +19,10 @@
/**
* @file Page for Operational View App configs Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { URLPARAMS } from 'CommonModel';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
* @Component takes OperationalViewAppConfigsComponent.html as template url
@@ -60,10 +60,15 @@
this.configData = Object.keys(this.params.configs).map((key: string): Object => (
{
name: key,
+ // eslint-disable-next-line security/detect-object-injection
default: this.params.configs[key].default,
+ // eslint-disable-next-line security/detect-object-injection
description: this.params.configs[key].description,
+ // eslint-disable-next-line security/detect-object-injection
source: this.params.configs[key].source,
+ // eslint-disable-next-line security/detect-object-injection
type: this.params.configs[key].type,
+ // eslint-disable-next-line security/detect-object-injection
value: this.params.configs[key].value
}));
}
diff --git a/src/app/operational-view/operational-view-app-executed-actions/OperationalViewAppExecutedActionsComponent.ts b/src/app/operational-view/operational-view-app-executed-actions/OperationalViewAppExecutedActionsComponent.ts
index af39f79..d761653 100644
--- a/src/app/operational-view/operational-view-app-executed-actions/OperationalViewAppExecutedActionsComponent.ts
+++ b/src/app/operational-view/operational-view-app-executed-actions/OperationalViewAppExecutedActionsComponent.ts
@@ -19,11 +19,11 @@
/**
* @file Page for Operational View App Executed actions Component
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
import { URLPARAMS } from 'CommonModel';
import { EXECUTEDACTIONS } from 'OperationalModel';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
* @Component takes OperationalViewAppExecutedActionsComponent.html as template url
diff --git a/src/app/osm-repositories/OsmRepositoriesComponent.ts b/src/app/osm-repositories/OsmRepositoriesComponent.ts
index 5f42eee..4c85f8c 100644
--- a/src/app/osm-repositories/OsmRepositoriesComponent.ts
+++ b/src/app/osm-repositories/OsmRepositoriesComponent.ts
@@ -49,7 +49,9 @@
/** Return to osm Repo Details list */
public redirectToList(getURL: string): void {
if (getURL === '/repos') {
- this.router.navigate(['/repos/details']).catch();
+ this.router.navigate(['/repos/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/app/osm-repositories/OsmRepositoriesModule.ts b/src/app/osm-repositories/OsmRepositoriesModule.ts
index 20901e4..a630f5d 100644
--- a/src/app/osm-repositories/OsmRepositoriesModule.ts
+++ b/src/app/osm-repositories/OsmRepositoriesModule.ts
@@ -62,16 +62,12 @@
/**
* Creating @NgModule component for Modules
*/
-// tslint:disable-next-line: no-stateless-class
@NgModule({
imports: [FormsModule, ReactiveFormsModule, CommonModule, HttpClientModule, TranslateModule,
RouterModule.forChild(routes), NgbModule, PagePerRowModule, Ng2SmartTableModule, LoaderModule, PageReloadModule, NgSelectModule],
declarations: [OsmRepositoriesComponent, OsmRepositoriesDetailsComponent, OsmRepositoriesActionComponent, OsmRepoCreateUpdateComponent],
providers: [
DataService
- ],
- entryComponents: [
- OsmRepoCreateUpdateComponent
]
})
/** Exporting a class @exports OsmRepositoriesModule */
diff --git a/src/app/osm-repositories/osm-repositories-details/OsmRepositoriesDetailsComponent.ts b/src/app/osm-repositories/osm-repositories-details/OsmRepositoriesDetailsComponent.ts
index 3415484..f249470 100644
--- a/src/app/osm-repositories/osm-repositories-details/OsmRepositoriesDetailsComponent.ts
+++ b/src/app/osm-repositories/osm-repositories-details/OsmRepositoriesDetailsComponent.ts
@@ -167,13 +167,16 @@
/** Create a osm repo @public */
public addOsmrepo(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(OsmRepoCreateUpdateComponent, { backdrop: 'static' });
modalRef.componentInstance.createupdateType = 'Add';
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.generateData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
@@ -194,7 +197,9 @@
});
this.dataSource.load(this.osmRepoData).then((data: boolean) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
diff --git a/src/app/packages/PackagesComponent.ts b/src/app/packages/PackagesComponent.ts
index eb9991d..6dcf10e 100644
--- a/src/app/packages/PackagesComponent.ts
+++ b/src/app/packages/PackagesComponent.ts
@@ -49,7 +49,9 @@
/** Return to list NS Package List */
public redirectToList(getURL: string): void {
if (getURL === '/packages') {
- this.router.navigate(['/packages/ns']).catch();
+ this.router.navigate(['/packages/ns']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/app/packages/PackagesModule.ts b/src/app/packages/PackagesModule.ts
index e6c6628..5a8ea2e 100644
--- a/src/app/packages/PackagesModule.ts
+++ b/src/app/packages/PackagesModule.ts
@@ -117,8 +117,7 @@
declarations: [PackagesComponent, NSPackagesComponent, VNFPackagesComponent, NetsliceTemplateComponent,
DragDirective, ShowContentComponent, NSComposerComponent, VNFComposerComponent, EditPackagesComponent, ClonePackageComponent],
providers: [DataService],
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- entryComponents: [ShowContentComponent, ClonePackageComponent]
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
/** Exporting a class @exports PackagesModule */
export class PackagesModule {
diff --git a/src/app/packages/instantiate-net-slice-template/InstantiateNetSliceTemplateComponent.ts b/src/app/packages/instantiate-net-slice-template/InstantiateNetSliceTemplateComponent.ts
index 330edf8..fb0abda 100644
--- a/src/app/packages/instantiate-net-slice-template/InstantiateNetSliceTemplateComponent.ts
+++ b/src/app/packages/instantiate-net-slice-template/InstantiateNetSliceTemplateComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Instantiate NS Modal Component.
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -33,7 +34,6 @@
import { NSICREATEPARAMS } from 'NSDModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
* Creating component
@@ -193,7 +193,6 @@
delete this.netSliceInstantiateForm.value.ssh_keys;
} else {
this.copySSHKey = JSON.parse(JSON.stringify(this.netSliceInstantiateForm.value.ssh_keys));
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.netSliceInstantiateForm.get('ssh_keys').setValue(this.copySSHKey);
}
if (isNullOrUndefined(this.netSliceInstantiateForm.value.config) || this.netSliceInstantiateForm.value.config === '') {
@@ -203,12 +202,14 @@
if (validJSON) {
this.netSliceInstantiateForm.value.config = JSON.parse(this.netSliceInstantiateForm.value.config);
Object.keys(this.netSliceInstantiateForm.value.config).forEach((item: string) => {
+ // eslint-disable-next-line security/detect-object-injection
this.netSliceInstantiateForm.value[item] = this.netSliceInstantiateForm.value.config[item];
});
delete this.netSliceInstantiateForm.value.config;
} else {
const getConfigJson: string = jsyaml.load(this.netSliceInstantiateForm.value.config, { json: true });
Object.keys(getConfigJson).forEach((item: string) => {
+ // eslint-disable-next-line security/detect-object-injection
this.netSliceInstantiateForm.value[item] = getConfigJson[item];
});
delete this.netSliceInstantiateForm.value.config;
@@ -225,11 +226,12 @@
this.isLoadingResults = false;
this.notifierService.notify('success', this.netSliceInstantiateForm.value.nsiName +
this.translateService.instant('PAGE.NETSLICE.CREATEDSUCCESSFULLY'));
- this.router.navigate(['/instances/netslice']).catch();
+ this.router.navigate(['/instances/netslice']).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'post');
if (!isNullOrUndefined(this.copySSHKey)) {
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.netSliceInstantiateForm.get('ssh_keys').setValue(this.copySSHKey);
}
this.isLoadingResults = false;
@@ -241,7 +243,6 @@
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'pub').then((fileContent: string): void => {
const getSSHJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.netSliceInstantiateForm.get('ssh_keys').setValue(getSSHJson);
}).catch((err: string): void => {
if (err === 'typeError') {
@@ -266,7 +267,6 @@
if (fileFormat === 'yaml' || fileFormat === 'yml') {
this.sharedService.getFileString(files, 'yaml').then((fileContent: string): void => {
const getConfigJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.netSliceInstantiateForm.get('config').setValue(JSON.stringify(getConfigJson));
}).catch((err: string): void => {
if (err === 'typeError') {
@@ -280,7 +280,6 @@
} else if (fileFormat === 'json') {
this.sharedService.getFileString(files, 'json').then((fileContent: string): void => {
const getConfigJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.netSliceInstantiateForm.get('config').setValue(JSON.stringify(getConfigJson));
}).catch((err: string): void => {
if (err === 'typeError') {
diff --git a/src/app/packages/instantiate-ns/InstantiateNsComponent.ts b/src/app/packages/instantiate-ns/InstantiateNsComponent.ts
index 1043f9a..e0798d1 100644
--- a/src/app/packages/instantiate-ns/InstantiateNsComponent.ts
+++ b/src/app/packages/instantiate-ns/InstantiateNsComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Instantiate NS Modal Component.
*/
+import { isNullOrUndefined } from 'util';
import { Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
@@ -31,7 +32,6 @@
import { NSCREATEPARAMS, NSData, NSDDetails } from 'NSDModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
@@ -186,7 +186,6 @@
delete this.instantiateForm.value.ssh_keys;
} else {
this.copySSHKey = JSON.parse(JSON.stringify(this.instantiateForm.value.ssh_keys));
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.instantiateForm.get('ssh_keys').setValue([this.copySSHKey]);
}
if (isNullOrUndefined(this.instantiateForm.value.config) || this.instantiateForm.value.config === '') {
@@ -196,12 +195,14 @@
if (validJSON) {
this.instantiateForm.value.config = JSON.parse(this.instantiateForm.value.config);
Object.keys(this.instantiateForm.value.config).forEach((item: string) => {
+ // eslint-disable-next-line security/detect-object-injection
this.instantiateForm.value[item] = this.instantiateForm.value.config[item];
});
delete this.instantiateForm.value.config;
} else {
const getConfigJson: string = jsyaml.load(this.instantiateForm.value.config, { json: true });
Object.keys(getConfigJson).forEach((item: string) => {
+ // eslint-disable-next-line security/detect-object-injection
this.instantiateForm.value[item] = getConfigJson[item];
});
delete this.instantiateForm.value.config;
@@ -215,12 +216,13 @@
this.activeModal.close(modalData);
this.notifierService.notify('success', this.instantiateForm.value.nsName +
this.translateService.instant('PAGE.NSINSTANCE.CREATEDSUCCESSFULLY'));
- this.router.navigate(['/instances/ns']).catch();
+ this.router.navigate(['/instances/ns']).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.isLoadingResults = false;
this.restService.handleError(error, 'post');
if (!isNullOrUndefined(this.copySSHKey)) {
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.instantiateForm.get('ssh_keys').setValue(this.copySSHKey);
}
});
@@ -231,7 +233,6 @@
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'pub').then((fileContent: string): void => {
const getSSHJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.instantiateForm.get('ssh_keys').setValue(getSSHJson);
}).catch((err: string): void => {
if (err === 'typeError') {
@@ -255,7 +256,6 @@
const fileFormat: string = this.sharedService.fetchFileExtension(files).toLocaleLowerCase();
if (fileFormat === 'yaml' || fileFormat === 'yml') {
this.sharedService.getFileString(files, 'yaml').then((fileContent: string): void => {
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.instantiateForm.get('config').setValue(fileContent);
}).catch((err: string): void => {
if (err === 'typeError') {
@@ -269,7 +269,6 @@
} else if (fileFormat === 'json') {
this.sharedService.getFileString(files, 'json').then((fileContent: string): void => {
const getConfigJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.instantiateForm.get('config').setValue(JSON.stringify(getConfigJson));
}).catch((err: string): void => {
if (err === 'typeError') {
diff --git a/src/app/packages/ns-packages/NSPackagesComponent.ts b/src/app/packages/ns-packages/NSPackagesComponent.ts
index 7302ea4..8960497 100644
--- a/src/app/packages/ns-packages/NSPackagesComponent.ts
+++ b/src/app/packages/ns-packages/NSPackagesComponent.ts
@@ -246,6 +246,7 @@
}
/** Handle compose new ns package method @public */
public composeNSPackage(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ComposePackages, { backdrop: 'static' }).componentInstance.params = { page: 'ns-package' };
}
diff --git a/src/app/packages/ns-packages/ns-composer/NSComposerComponent.ts b/src/app/packages/ns-packages/ns-composer/NSComposerComponent.ts
index d771123..8d28f3a 100644
--- a/src/app/packages/ns-packages/ns-composer/NSComposerComponent.ts
+++ b/src/app/packages/ns-packages/ns-composer/NSComposerComponent.ts
@@ -18,6 +18,7 @@
/**
* @file NS Compose Component
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, ElementRef, Injector, ViewChild, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
@@ -43,7 +44,6 @@
} from 'NSDModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VNFD, VNFData } from 'VNFDModel';
/**
@@ -124,31 +124,31 @@
/** Contains sidebar open status @public */
public sideBarOpened: boolean = false;
/** Contains SVG attributes @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private svg: any;
/** Contains the Drag line */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private dragLine: any;
/** Contains VL node @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private vlNode: any;
/** Contains VNFD node @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private vnfdnode: any;
/** Contains CP node @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private cpnode: any;
/** Rendered nodes represent VL @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gvlNode: any;
/** Rendered nodes represent VL @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gvnfdNode: any;
/** Rendered nodes represent VL @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gcpNode: any;
/** Contains forced node animations @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private force: any;
/** Contains all the selected node @private */
private selectedNode: COMPOSERNODES[] = [];
@@ -161,7 +161,7 @@
/** Contains the VNFD copy @private */
private vnfdCopy: string;
/** Contains path information of the node */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private path: any;
/** Contains the node information @private */
private nodes: COMPOSERNODES[] = [];
@@ -209,7 +209,6 @@
}
/** Lifecyle Hooks the trigger before component is instantiated @public */
public ngOnInit(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.identifier = this.activatedRoute.snapshot.paramMap.get('id');
this.generateData();
this.headers = new HttpHeaders({
@@ -219,7 +218,7 @@
});
}
/** Events handles at drag on D3 region @public */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
public drag(ev: any): void {
if (ev.target.id === 'vl') {
ev.dataTransfer.setData('text', ev.target.id);
@@ -385,6 +384,7 @@
}
/** Show Info @public */
public showInfo(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ConfirmationTopologyComponent, { backdrop: 'static' });
modalRef.componentInstance.topologyType = 'Info';
modalRef.componentInstance.topologytitle = this.translateService.instant('PAGE.TOPOLOGY.INFO');
@@ -392,7 +392,9 @@
if (result) {
// empty
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Event to freeze the animation @public */
public onFreeze(): void {
@@ -459,7 +461,9 @@
this.separateAndCreatenode();
}, (error: ERRORDATA): void => {
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');
}
@@ -535,16 +539,20 @@
resultVLC['constituent-cpd-id'].forEach((resultCCI: CCI): void => {
this.vnfdCopy = resultVLC['virtual-link-profile-id'];
this.connectionPoint = resVNF.id + ':' + resultCCI['constituent-base-element-id'] + index + ':' + resultCCI['constituent-cpd-id'];
- const connectionPointPos: number = this.nodes.map((e: COMPOSERNODES): string => { return e.id; }).indexOf(this.connectionPoint);
- const nsdPos: number = this.nodes.map((e: COMPOSERNODES): string => { return e.id; }).indexOf(this.nsdCopy);
- const vnfdPos: number = this.nodes.map((e: COMPOSERNODES): string => { return e.id; }).indexOf(this.vnfdCopy);
+ const connectionPointPos: number = this.nodes.map((e: COMPOSERNODES): string => e.id).indexOf(this.connectionPoint);
+ const nsdPos: number = this.nodes.map((e: COMPOSERNODES): string => e.id).indexOf(this.nsdCopy);
+ const vnfdPos: number = this.nodes.map((e: COMPOSERNODES): string => e.id).indexOf(this.vnfdCopy);
this.links.push(
{
+ // eslint-disable-next-line security/detect-object-injection
source: this.nodes[connectionPointPos],
+ // eslint-disable-next-line security/detect-object-injection
target: this.nodes[nsdPos]
},
{
+ // eslint-disable-next-line security/detect-object-injection
source: this.nodes[connectionPointPos],
+ // eslint-disable-next-line security/detect-object-injection
target: this.nodes[vnfdPos]
});
});
@@ -681,7 +689,7 @@
.attr('x', graphContainerAttr.imageX)
.attr('y', graphContainerAttr.imageY)
.call(this.onDragDrop())
- .attr('id', (d: COMPOSERNODES): string => { return d.selectorId; })
+ .attr('id', (d: COMPOSERNODES): string => d.selectorId)
.attr('class', 'node').attr('width', graphContainerAttr.nodeWidth).attr('height', graphContainerAttr.nodeHeight)
.attr('xlink:href', 'assets/images/VL.svg')
.on('mousedown', (d: COMPOSERNODES): void => { this.mouseDown(d); })
@@ -703,7 +711,7 @@
.attr('x', graphContainerAttr.imageX)
.attr('y', graphContainerAttr.imageY)
.call(this.onDragDrop())
- .attr('id', (d: COMPOSERNODES): string => { return d.selectorId; })
+ .attr('id', (d: COMPOSERNODES): string => d.selectorId)
.attr('class', 'node').attr('width', graphContainerAttr.nodeWidth).attr('height', graphContainerAttr.nodeHeight)
.attr('xlink:href', 'assets/images/VNFD.svg')
.on('mousedown', (d: COMPOSERNODES): void => { this.mouseDown(d); })
@@ -725,7 +733,7 @@
.attr('x', graphContainerAttr.imageX)
.attr('y', graphContainerAttr.imageY)
.call(this.onDragDrop())
- .attr('id', (d: COMPOSERNODES): string => { return d.selectorId; })
+ .attr('id', (d: COMPOSERNODES): string => d.selectorId)
.attr('class', 'node').attr('width', graphContainerAttr.nodeWidth).attr('height', graphContainerAttr.nodeHeight)
.attr('xlink:href', 'assets/images/CP.svg')
.on('mousedown', (d: COMPOSERNODES): void => { this.mouseDown(d); })
@@ -767,6 +775,7 @@
});
}
if (this.vlName !== undefined && this.setVnfdName !== undefined && this.setVnfdConnectionPointRef !== undefined) {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ConfirmationTopologyComponent, { backdrop: 'static' });
modalRef.componentInstance.topologyType = 'Add';
modalRef.componentInstance.cpDetails = this.getVNFSelectedData['ext-cpd'];
@@ -785,7 +794,9 @@
} else {
this.deselectPath();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
} else {
this.deselectPath();
this.notifierService.notify('error', this.translateService.instant('ERROR'));
@@ -819,6 +830,7 @@
}
/** Events handles when mousedown click it will capture the selected node data @private */
private mouseDown(d: COMPOSERNODES): void {
+ // eslint-disable-next-line deprecation/deprecation
event.preventDefault();
if (d3.event.ctrlKey) { return; }
if (d3.event.shiftKey) {
@@ -895,12 +907,12 @@
this.isShowCPDetails = cpDetails;
}
/** Events handles when Shift Click to perform create cp @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private singleClick(nodeSelected: any, d: COMPOSERNODES): void {
this.selectNodeExclusive(nodeSelected, d);
}
/** Selected nodes @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private selectNodeExclusive(nodeSeleced: any, d: COMPOSERNODES): void {
const alreadyIsActive: boolean = nodeSeleced.select('#' + d.selectorId).classed(this.activeClass);
this.deselectAllNodes();
@@ -949,6 +961,7 @@
}
/** Get confirmation Before Deleting the Link in Topology @private */
private getDeleteLinkConfirmation(d: Tick): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ConfirmationTopologyComponent, { backdrop: 'static' });
modalRef.componentInstance.topologyType = 'Delete';
modalRef.componentInstance.topologyname = this.translateService.instant('PAGE.TOPOLOGY.LINK') + ' - ' + d.source.id;
@@ -957,7 +970,9 @@
if (result) {
this.doubleClickLink(d);
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Events handles when Double Click to Delete the link @private */
private doubleClickLink(d: Tick): void {
@@ -995,6 +1010,7 @@
}
/** Get confirmation Before Deleting the Node in Topology @private */
private getDeleteConfirmation(d: COMPOSERNODES): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ConfirmationTopologyComponent, { backdrop: 'static' });
modalRef.componentInstance.topologyType = 'Delete';
modalRef.componentInstance.topologyname = d.name;
@@ -1009,7 +1025,9 @@
if (result) {
this.doubleClick(d);
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Events handles when Double Click to Delete @private */
private doubleClick(d: COMPOSERNODES): void {
@@ -1018,7 +1036,7 @@
if (res.id === d.id) {
if (deletedNode.type === 'vld') {
/** Remove the virtual-link-desc related to VL */
- const pos: number = this.nsData['virtual-link-desc'].map((e: VLD): string => { return e.id; }).indexOf(d.id);
+ const pos: number = this.nsData['virtual-link-desc'].map((e: VLD): string => e.id).indexOf(d.id);
this.nsData['virtual-link-desc'].splice(pos, 1);
/** Remove the virtual-link-connectivity between VL and VNFD */
this.nsData.df.forEach((resultDF: DF): void => {
@@ -1032,6 +1050,7 @@
if (getVLArray.length > 0) {
getVLArray.forEach((removeIndex: number): void => {
const index: string = removeIndex.toString();
+ // eslint-disable-next-line security/detect-object-injection
resVNF['virtual-link-connectivity'].splice(resVNF['virtual-link-connectivity'][index], 1);
});
}
@@ -1043,19 +1062,13 @@
this.nsData.df.forEach((resultDF: DF): void => {
if (resultDF['vnf-profile'] !== undefined) {
/** Remove the vnf-profile related to VNFD */
- const posVNF: number = resultDF['vnf-profile'].findIndex((e: VNFPROFILE): boolean => {
- return e['vnfd-id'] === d.name && e.id === d.nodeIndex;
- });
+ const posVNF: number = resultDF['vnf-profile'].findIndex((e: VNFPROFILE): boolean => e['vnfd-id'] === d.name && e.id === d.nodeIndex);
resultDF['vnf-profile'].splice(posVNF, 1);
/** Check the VNFD exists in any vnf-profile */
- const isVNFDExists: boolean = resultDF['vnf-profile'].some((e: VNFPROFILE): boolean => {
- return e['vnfd-id'] === d.name;
- });
+ const isVNFDExists: boolean = resultDF['vnf-profile'].some((e: VNFPROFILE): boolean => e['vnfd-id'] === d.name);
/** If VNFD not exists in the vnf-profile remove from vnfd-id */
if (!isVNFDExists) {
- const posVNFD: number = this.nsData['vnfd-id'].findIndex((e: string): boolean => {
- return e === d.name;
- });
+ const posVNFD: number = this.nsData['vnfd-id'].findIndex((e: string): boolean => e === d.name);
this.nsData['vnfd-id'].splice(posVNFD, 1);
}
}
@@ -1090,7 +1103,7 @@
});
}
/** drag event @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private onDragDrop(): any {
return d3.drag().filter(this.dragFilter)
.on('start', this.dragstarted)
diff --git a/src/app/packages/ns-packages/vnf-composer/VNFComposerComponent.ts b/src/app/packages/ns-packages/vnf-composer/VNFComposerComponent.ts
index 55c5070..eabd2b7 100644
--- a/src/app/packages/ns-packages/vnf-composer/VNFComposerComponent.ts
+++ b/src/app/packages/ns-packages/vnf-composer/VNFComposerComponent.ts
@@ -18,6 +18,7 @@
/**
* @file VNFComposerComponent
*/
+ import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, ElementRef, Injector, ViewChild, ViewEncapsulation } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
@@ -73,30 +74,30 @@
/** Contains sidebar open status @public */
public sideBarOpened: boolean = false;
/** Contains SVG attributes @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private svg: any;
/** Contains forced node animations @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private force: any;
/** Contains the Drag line */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private dragLine: any;
/** Contains id of the node @private */
private identifier: string;
/** Contains path information of the node */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private path: any;
/** Contains node network @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private network: any;
/** Contains node network @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private virutualDeploymentUnit: any;
/** Contains node connectionPoint @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private connectionPoint: any;
/** Contains node intConnectionPoint @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private intConnectionPoint: any;
/** Contains the node information @private */
private nodes: COMPOSERNODES[] = [];
@@ -117,16 +118,16 @@
/** Contains tranlsate instance @private */
private translateService: TranslateService;
/** Rendered nodes represent network @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gNetwork: any;
/** Rendered nodes represent VDU @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gVirutualDeploymentUnit: any;
/** Rendered nodes represent connection point @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gConnectionPoint: any;
/** Rendered nodes represent internal connection point @private */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private gIntConnectionPoint: any;
/** Contains all the information about VNF Details @private */
private vnfdPackageDetails: VNFD;
@@ -172,7 +173,6 @@
* Lifecyle Hooks the trigger before component is instantiate
*/
public ngOnInit(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.identifier = this.activatedRoute.snapshot.paramMap.get('id');
this.generateData();
this.headers = new HttpHeaders({
@@ -208,7 +208,9 @@
}, (error: ERRORDATA): void => {
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');
}
@@ -225,7 +227,7 @@
this.vnfdInfo.provider = vnfdPackageDetails.provider;
}
/** Events handles at drag on D3 region @public */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any
public drag(ev: any): void {
ev.dataTransfer.setData('text', ev.target.id);
}
@@ -409,10 +411,13 @@
}
/** Edit topology @public */
public onEdit(): void {
- this.router.navigate(['/packages/vnf/edit/', this.identifier]).catch();
+ this.router.navigate(['/packages/vnf/edit/', this.identifier]).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Show Info @public */
public showInfo(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ConfirmationTopologyComponent, { backdrop: 'static' });
modalRef.componentInstance.topologyType = 'Info';
modalRef.componentInstance.topologytitle = this.translateService.instant('PAGE.TOPOLOGY.INFO');
@@ -420,7 +425,9 @@
if (result) {
// empty
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Event to freeze the animation @public */
public onFreeze(): void {
@@ -562,7 +569,7 @@
.attr('x', graphContainerAttr.imageX)
.attr('y', graphContainerAttr.imageY)
.call(this.onDragDrop())
- .attr('id', (d: COMPOSERNODES): string => { return d.id; })
+ .attr('id', (d: COMPOSERNODES): string => d.id)
.attr('class', 'node').attr('width', graphContainerAttr.nodeWidth).attr('height', graphContainerAttr.nodeHeight)
.attr('xlink:href', 'assets/images/INTVL.svg')
.on('mousedown', (d: COMPOSERNODES): void => { this.mouseDown(d); })
@@ -584,7 +591,7 @@
.attr('x', graphContainerAttr.imageX)
.attr('y', graphContainerAttr.imageY)
.call(this.onDragDrop())
- .attr('id', (d: COMPOSERNODES): string => { return d.id; })
+ .attr('id', (d: COMPOSERNODES): string => d.id)
.attr('class', 'node').attr('width', graphContainerAttr.nodeWidth).attr('height', graphContainerAttr.nodeHeight)
.attr('xlink:href', 'assets/images/VDU.svg')
.on('mousedown', (d: COMPOSERNODES): void => { this.mouseDown(d); })
@@ -606,7 +613,7 @@
.attr('x', graphContainerAttr.imageX)
.attr('y', graphContainerAttr.imageY)
.call(this.onDragDrop())
- .attr('id', (d: COMPOSERNODES): string => { return d.id; })
+ .attr('id', (d: COMPOSERNODES): string => d.id)
.attr('class', 'node').attr('width', graphContainerAttr.nodeWidth).attr('height', graphContainerAttr.nodeHeight)
.attr('xlink:href', 'assets/images/CP-VNF.svg')
.on('mousedown', (d: COMPOSERNODES): void => { this.mouseDown(d); })
@@ -628,7 +635,7 @@
.attr('x', graphContainerAttr.imageX)
.attr('y', graphContainerAttr.imageY)
.call(this.onDragDrop())
- .attr('id', (d: COMPOSERNODES): string => { return d.id; })
+ .attr('id', (d: COMPOSERNODES): string => d.id)
.attr('class', 'node').attr('width', graphContainerAttr.nodeWidth).attr('height', graphContainerAttr.nodeHeight)
.attr('xlink:href', 'assets/images/INTCP.svg')
.on('mousedown', (d: COMPOSERNODES): void => { this.mouseDown(d); })
@@ -716,6 +723,7 @@
}
/** Events handles when mousedown click it will capture the selected node data @private */
private mouseDown(d: COMPOSERNODES): void {
+ // eslint-disable-next-line deprecation/deprecation
event.preventDefault();
if (d3.event.ctrlKey) { return; }
if (d3.event.shiftKey) {
@@ -828,6 +836,7 @@
}
]
});
+ // eslint-disable-next-line security/detect-object-injection
this.vnfdPackageDetails['ext-cpd'][index] = {
id: extcpd.id,
'int-cpd': {
@@ -882,7 +891,7 @@
this.mouseupNode = null;
}
/** drag event @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private onDragDrop(): any {
return d3.drag().filter(this.dragFilter)
.on('start', this.dragstarted)
@@ -915,12 +924,13 @@
this.dragLine.classed('hidden', true).attr('d', 'M0,0L0,0');
}
/** Events handles when Shift Click to perform create cp @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private singleClick(nodeSelected: any, d: COMPOSERNODES): void {
this.selectedNode(nodeSelected, d);
}
/** Get confirmation Before Deleting the Node in Topology @private */
private getDeleteNodeConfirmation(d: COMPOSERNODES): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(ConfirmationTopologyComponent, { backdrop: 'static' });
modalRef.componentInstance.topologyType = 'Delete';
modalRef.componentInstance.topologyname = d.name;
@@ -937,11 +947,12 @@
if (result) {
this.deleteNode(d);
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Delete nodes @private */
private deleteNode(d: COMPOSERNODES): void {
- // tslint:disable-next-line: max-func-body-length
this.nodes.forEach((node: VNFD): void => {
if (node.id === d.id) {
if (d.type === 'cp') {
@@ -963,9 +974,7 @@
if (getRelatedVDUCPD !== undefined && getRelatedVDUID !== undefined) {
this.vnfdPackageDetails.vdu.forEach((vdu: VDU): void => {
if (vdu.id === getRelatedVDUID) {
- const posINTCPD: number = vdu['int-cpd'].findIndex((intCPD: VDUINTCPD): boolean => {
- return intCPD.id === getRelatedVDUCPD;
- });
+ const posINTCPD: number = vdu['int-cpd'].findIndex((intCPD: VDUINTCPD): boolean => intCPD.id === getRelatedVDUCPD);
if (posINTCPD !== -1) {
vdu['int-cpd'].splice(posINTCPD, 1);
}
@@ -975,26 +984,20 @@
}
} else if (d.type === 'intcp') {
this.vnfdPackageDetails.vdu.forEach((vdu: VDU): void => {
- const posINTCPD: number = vdu['int-cpd'].findIndex((intCPD: VDUINTCPD): boolean => {
- return intCPD.id === d.id;
- });
+ const posINTCPD: number = vdu['int-cpd'].findIndex((intCPD: VDUINTCPD): boolean => intCPD.id === d.id);
if (posINTCPD !== -1) {
vdu['int-cpd'].splice(posINTCPD, 1);
}
});
} else if (d.type === 'intvl') {
- const posINTVLD: number = this.vnfdPackageDetails['int-virtual-link-desc'].findIndex((intVLD: IVLD): boolean => {
- return intVLD.id === d.id;
- });
+ const posINTVLD: number = this.vnfdPackageDetails['int-virtual-link-desc'].findIndex((intVLD: IVLD): boolean => intVLD.id === d.id);
if (posINTVLD !== -1) {
this.vnfdPackageDetails['int-virtual-link-desc'].splice(posINTVLD, 1);
}
if (this.vnfdPackageDetails.vdu !== undefined) {
this.vnfdPackageDetails.vdu.forEach((vduDetails: VDU): void => {
if (vduDetails['int-cpd'] !== undefined) {
- const newVDUintCPDArray: VDUINTCPD[] = vduDetails['int-cpd'].filter((item: VDUINTCPD): boolean => {
- return item['int-virtual-link-desc'] !== undefined ? item['int-virtual-link-desc'] !== d.id ? true : false : true;
- });
+ const newVDUintCPDArray: VDUINTCPD[] = vduDetails['int-cpd'].filter((item: VDUINTCPD): boolean => item['int-virtual-link-desc'] !== undefined ? item['int-virtual-link-desc'] !== d.id ? true : false : true);
vduDetails['int-cpd'] = newVDUintCPDArray;
}
});
@@ -1039,7 +1042,7 @@
this.notifierService.notify('warning', this.translateService.instant('PAGE.VNFPACKAGE.VNFCOMPOSE.YOUCANNOTDELETELINK'));
}
/** Selected nodes @private */
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
private selectedNode(nodeSeleced: any, d: COMPOSERNODES): void {
const alreadyIsActive: boolean = nodeSeleced.select('#' + d.id).classed(this.activeNode);
this.deselectAllNodes();
diff --git a/src/app/packages/vnf-packages/VNFPackagesComponent.ts b/src/app/packages/vnf-packages/VNFPackagesComponent.ts
index 8169782..fc85d71 100644
--- a/src/app/packages/vnf-packages/VNFPackagesComponent.ts
+++ b/src/app/packages/vnf-packages/VNFPackagesComponent.ts
@@ -238,6 +238,7 @@
}
/** Handle compose new ns package method @public */
public composeVNFPackage(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(ComposePackages, { backdrop: 'static' }).componentInstance.params = { page: 'vnf-package' };
}
diff --git a/src/app/page-not-found/PageNotFoundComponent.ts b/src/app/page-not-found/PageNotFoundComponent.ts
index ef515ec..2842f0e 100644
--- a/src/app/page-not-found/PageNotFoundComponent.ts
+++ b/src/app/page-not-found/PageNotFoundComponent.ts
@@ -38,5 +38,4 @@
public ngOnInit(): void {
//donothing
}
-
}
diff --git a/src/app/projects/ProjectsComponent.ts b/src/app/projects/ProjectsComponent.ts
index 052e639..982421e 100644
--- a/src/app/projects/ProjectsComponent.ts
+++ b/src/app/projects/ProjectsComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Project details Component.
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';
@@ -32,7 +33,6 @@
import { RestService } from 'RestService';
import { Subscription } from 'rxjs';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -146,13 +146,16 @@
/** Modal service to initiate the project add @private */
public projectAdd(): 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 = 'Add';
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.generateData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** smart table listing manipulation @private */
@@ -197,7 +200,9 @@
});
this.dataSource.load(this.projectData).then((data: boolean) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
diff --git a/src/app/projects/ProjectsModule.ts b/src/app/projects/ProjectsModule.ts
index 16147b9..22bbc27 100644
--- a/src/app/projects/ProjectsModule.ts
+++ b/src/app/projects/ProjectsModule.ts
@@ -52,7 +52,6 @@
/**
* Creating @NgModule component for Modules
*/
-// tslint:disable-next-line: no-stateless-class
@NgModule({
imports: [
FormsModule,
@@ -75,9 +74,6 @@
],
providers: [
DataService
- ],
- entryComponents: [
- ProjectCreateUpdateComponent
]
})
/** Exporting a class @exports ProjectsModule */
diff --git a/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts b/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts
index bb1207a..9f8cc83 100644
--- a/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts
+++ b/src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Project Add Modal
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
@@ -30,7 +31,6 @@
import { ProjectService } from 'ProjectService';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -245,6 +245,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.projectForm.controls[controlName];
}
diff --git a/src/app/roles/RolesComponent.ts b/src/app/roles/RolesComponent.ts
index 82f20b4..49819b4 100644
--- a/src/app/roles/RolesComponent.ts
+++ b/src/app/roles/RolesComponent.ts
@@ -51,8 +51,9 @@
/** Return to role datails list */
public redirectToList(getURL: string): void {
if (getURL === '/roles') {
- this.router.navigate(['/roles/details']).catch();
+ this.router.navigate(['/roles/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
-
}
diff --git a/src/app/roles/RolesModule.ts b/src/app/roles/RolesModule.ts
index 88e1225..1e2c7ff 100644
--- a/src/app/roles/RolesModule.ts
+++ b/src/app/roles/RolesModule.ts
@@ -75,8 +75,7 @@
@NgModule({
imports: [FormsModule, ReactiveFormsModule, CommonModule, HttpClientModule, TranslateModule,
RouterModule.forChild(routes), NgbModule, PagePerRowModule, Ng2SmartTableModule, LoaderModule, PageReloadModule],
- declarations: [RolesComponent, RolesDetailsComponent, RolesActionComponent, RolesCreateEditComponent],
- entryComponents: [RolesActionComponent]
+ declarations: [RolesComponent, RolesDetailsComponent, RolesActionComponent, RolesCreateEditComponent]
})
/**
* AppModule is the Root module for application
diff --git a/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts b/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts
index 0419c5f..87e1b86 100644
--- a/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts
+++ b/src/app/roles/roles-create-edit/RolesCreateEditComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Roles Create and Edit Component
*/
+import { isNullOrUndefined } from 'util';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Component, Injector, Input, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -30,7 +31,6 @@
import { RestService } from 'RestService';
import { Permission, PermissionGroup, RoleConfig, RoleData } from 'RolesModel';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -191,7 +191,9 @@
};
this.restService.postResource(apiURLHeader, postData).subscribe(() => {
this.notifierService.notify('success', this.translateService.instant('PAGE.ROLES.CREATEDSUCCESSFULLY'));
- this.router.navigate(['/roles/details']).catch();
+ this.router.navigate(['/roles/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.isLoadingResults = false;
this.restService.handleError(error, 'post');
@@ -229,7 +231,9 @@
};
this.restService.patchResource(apiURLHeader, postData).subscribe(() => {
this.notifierService.notify('success', this.translateService.instant('PAGE.ROLES.UPDATEDSUCCESSFULLY'));
- this.router.navigate(['/roles/details']).catch();
+ this.router.navigate(['/roles/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.isLoadingResults = false;
this.restService.handleError(error, 'patch');
@@ -254,7 +258,6 @@
}
this.viewMode = 'text';
}
-
}
/** Generate role permission post data @private */
@@ -282,6 +285,7 @@
this.roleForm.value.permissions = this.roleForm.value.permissions.replace(/'/g, '"');
const rolePermission: {} = JSON.parse(this.roleForm.value.permissions);
for (const key of Object.keys(rolePermission)) {
+ // eslint-disable-next-line security/detect-object-injection
if (typeof rolePermission[key] !== 'boolean') {
this.notifierService.notify('error', this.translateService.instant('PAGE.ROLES.ROLEKEYERROR', { roleKey: key }));
return false;
@@ -294,7 +298,6 @@
/** Get role data from NBI based on ID and apply filter @private */
private getRoleData(): void {
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.roleRef = this.activatedRoute.snapshot.paramMap.get('id');
if (!isNullOrUndefined(this.roleRef)) {
this.restService.getResource(environment.ROLES_URL + '/' + this.roleRef).subscribe((data: RoleData) => {
@@ -302,7 +305,9 @@
this.filterRoleData(data.permissions);
this.isLoadingResults = false;
}, (error: ERRORDATA) => {
- this.router.navigate(['/roles/details']).catch();
+ this.router.navigate(['/roles/details']).catch((): void => {
+ // Catch Navigation Error
+ });
this.restService.handleError(error, 'get');
});
}
@@ -313,6 +318,7 @@
Object.keys(permissions).forEach((permission: string) => {
jsonpath.apply(this.rolePermissions, '$..permissions[?(@.operation == "' + permission + '")]', (response: Permission) => {
if (response.operation === permission) {
+ // eslint-disable-next-line security/detect-object-injection
response.value = permissions[permission];
}
return response;
@@ -331,5 +337,4 @@
});
});
}
-
}
diff --git a/src/app/roles/roles-details/RolesDetailsComponent.ts b/src/app/roles/roles-details/RolesDetailsComponent.ts
index 89affae..9c2e3e3 100644
--- a/src/app/roles/roles-details/RolesDetailsComponent.ts
+++ b/src/app/roles/roles-details/RolesDetailsComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Roles Deatils component.
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@@ -30,7 +31,6 @@
import { RoleData, RoleDetails } from 'RolesModel';
import { Subscription } from 'rxjs';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -159,7 +159,9 @@
});
this.dataSource.load(this.roleData).then((data: boolean) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
@@ -188,5 +190,4 @@
public ngOnDestroy(): void {
this.generateDataSub.unsubscribe();
}
-
}
diff --git a/src/app/sdn-controller/SDNControllerComponent.ts b/src/app/sdn-controller/SDNControllerComponent.ts
index 661882c..247553a 100644
--- a/src/app/sdn-controller/SDNControllerComponent.ts
+++ b/src/app/sdn-controller/SDNControllerComponent.ts
@@ -49,7 +49,9 @@
/** Return to list NS Package List */
public redirectToList(getURL: string): void {
if (getURL === '/sdn') {
- this.router.navigate(['/sdn/details']).catch();
+ this.router.navigate(['/sdn/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/app/sdn-controller/SDNControllerModule.ts b/src/app/sdn-controller/SDNControllerModule.ts
index 6da4a5c..9b2f523 100644
--- a/src/app/sdn-controller/SDNControllerModule.ts
+++ b/src/app/sdn-controller/SDNControllerModule.ts
@@ -68,7 +68,6 @@
PagePerRowModule, LoaderModule, PageReloadModule],
declarations: [SDNControllerComponent, SDNControllerDetailsComponent, SDNControllerInfoComponent, NewSDNControllerComponent],
providers: [DataService],
- entryComponents: [SDNControllerInfoComponent, NewSDNControllerComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
/** Exporting a class @exports SDNControllerModule */
@@ -76,7 +75,7 @@
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- //Empty Class
- }
+ constructor() {
+ //Empty
+ }
}
diff --git a/src/app/sdn-controller/sdn-controller-details/SDNControllerDetailsComponent.ts b/src/app/sdn-controller/sdn-controller-details/SDNControllerDetailsComponent.ts
index 589f13e..ef2f350 100644
--- a/src/app/sdn-controller/sdn-controller-details/SDNControllerDetailsComponent.ts
+++ b/src/app/sdn-controller/sdn-controller-details/SDNControllerDetailsComponent.ts
@@ -206,12 +206,15 @@
/** Compose new SDN Controller @public */
public composeSDN(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(NewSDNControllerComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
@@ -237,11 +240,12 @@
}
this.dataSource.load(this.sdnData).then((data: {}) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
});
}
-
}
diff --git a/src/app/user-settings/UserSettingsComponent.ts b/src/app/user-settings/UserSettingsComponent.ts
index 19b525f..5212eb5 100644
--- a/src/app/user-settings/UserSettingsComponent.ts
+++ b/src/app/user-settings/UserSettingsComponent.ts
@@ -83,10 +83,8 @@
});
const setLanguage: string = localStorage.getItem('languageCode');
if (setLanguage !== null && this.validateLanguageList(setLanguage)) {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.usersettingsForm.get('selectedLanguage').setValue(setLanguage);
} else {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.usersettingsForm.get('selectedLanguage').setValue('en');
}
}
diff --git a/src/app/users/UsersComponent.ts b/src/app/users/UsersComponent.ts
index 178b979..b14c2e7 100644
--- a/src/app/users/UsersComponent.ts
+++ b/src/app/users/UsersComponent.ts
@@ -49,7 +49,9 @@
/** Return to list NS Package List */
public redirectToList(getURL: string): void {
if (getURL === '/users') {
- this.router.navigate(['/users/details']).catch();
+ this.router.navigate(['/users/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/app/users/UsersModule.ts b/src/app/users/UsersModule.ts
index 8b5f316..2294886 100644
--- a/src/app/users/UsersModule.ts
+++ b/src/app/users/UsersModule.ts
@@ -63,15 +63,14 @@
FlexLayoutModule, NgSelectModule, NgbModule, RouterModule.forChild(routes), PagePerRowModule, LoaderModule,
PageReloadModule, ChangePasswordModule],
declarations: [UsersComponent, UserDetailsComponent, ProjectRoleComponent],
- providers: [DataService],
- entryComponents: [ProjectRoleComponent]
+ providers: [DataService]
})
/** Exporting a class @exports UsersModule */
export class UsersModule {
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- // Empty Block
- }
+ constructor() {
+ //Empty
+ }
}
diff --git a/src/app/users/add-user/AddEditUserComponent.ts b/src/app/users/add-user/AddEditUserComponent.ts
index 0e9456a..076cfba 100644
--- a/src/app/users/add-user/AddEditUserComponent.ts
+++ b/src/app/users/add-user/AddEditUserComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Add Edit 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 { environment } from 'environment';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -265,6 +265,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.userForm.controls[controlName];
}
diff --git a/src/app/users/project-role/ProjectRoleComponent.ts b/src/app/users/project-role/ProjectRoleComponent.ts
index 600cecd..3a7e612 100644
--- a/src/app/users/project-role/ProjectRoleComponent.ts
+++ b/src/app/users/project-role/ProjectRoleComponent.ts
@@ -141,7 +141,6 @@
/** Handle FormArray Controls @public */
public getControls(): AbstractControl[] {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
return (this.projectRoleForm.get('project_role_mappings') as FormArray).controls;
}
@@ -185,7 +184,6 @@
/** Set all roles and project values to the form @public */
public loadMapping(): void {
this.userDetails.project_role_mappings.forEach((data: ProjectRoleMappings): void => {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.projectRoleFormArray = this.projectRoleForm.get('project_role_mappings') as FormArray;
this.projectRoleFormArray.push(this.projectRoleParamsBuilder);
});
@@ -229,7 +227,6 @@
/** Add extra mapping and set empty project and roles @public */
public addMapping(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.projectRoleFormArray = this.projectRoleForm.get('project_role_mappings') as FormArray;
this.projectRoleFormArray.push(this.projectRoleParamsBuilder);
}
diff --git a/src/app/users/user-details/UserDetailsComponent.ts b/src/app/users/user-details/UserDetailsComponent.ts
index aede6e2..ba24454 100644
--- a/src/app/users/user-details/UserDetailsComponent.ts
+++ b/src/app/users/user-details/UserDetailsComponent.ts
@@ -18,6 +18,7 @@
/**
* @file users details Component.
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnDestroy, OnInit } from '@angular/core';
import { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';
import { TranslateService } from '@ngx-translate/core';
@@ -32,7 +33,6 @@
import { SharedService } from 'SharedService';
import { UserData, UserDetail } from 'UserModel';
import { UsersActionComponent } from 'UsersActionComponent';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -146,6 +146,7 @@
/** on Navigate to Composer Page @public */
public composeUser(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(AddEditUserComponent, { backdrop: 'static' });
modalRef.componentInstance.userTitle = this.translateService.instant('PAGE.USERS.NEWUSER');
modalRef.componentInstance.userType = 'add';
@@ -153,7 +154,9 @@
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** smart table listing manipulation @private */
@@ -206,7 +209,9 @@
}
this.dataSource.load(this.userData).then((data: {}) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
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
+ });
}
}
diff --git a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html
index 483fc0b..8c75d25 100644
--- a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html
+++ b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html
@@ -35,14 +35,14 @@
<div class="col-xs-{{12/showData.length}} col-sm-{{12/showData.length}} col-md-{{12/showData.length}} col-lg-{{12/showData.length}} col-xl-{{12/showData.length}}"
*ngFor="let list of showData.data;let i = index;">
<div class="chartData-card card text-center text-primary">
- <canvas class="my-2"
+ <canvas class="my-2" *ngIf="list.values.total !== 0"
baseChart
- [data]="list.data"
+ [datasets]="list.data"
[labels]="chartLabels"
- [chartType]="chartType"
+ [type]="chartType"
[options]="chartOptions"
[legend]="chartLegend"
- [colors]="list.colorValues">
+ [colors]="list.backgroundColor">
</canvas>
<div class="no-data" *ngIf="list.values.total === 0 || list.values.total === null">
<h4><strong>{{'PAGE.VIMDETAILS.NODATA' | translate}}</strong></h4>
diff --git a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss
index 721e8ad..1ffd10c 100644
--- a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss
+++ b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss
@@ -15,8 +15,8 @@
Author: SANDHYA JS (sandhya.j@tataelxsi.co.in)
*/
-@import "../../../assets/scss/mixins/mixin";
-@import "../../../assets/scss/variable";
+@import "../../../assets/scss/mixins/mixin.scss";
+@import "../../../assets/scss/variable.scss";
.chartData-card {
word-wrap: break-word;
@include box-shadow(0px, 1px, 15px, 0px, rgba(69, 90, 100, 0.1));
@@ -29,7 +29,7 @@
}
.no-data {
margin-bottom: 2.5rem;
- margin-top: -1.5rem;
+ margin-top: 5rem;
}
}
.switch {
diff --git a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.ts b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.ts
index 2d21ade..11d48d7 100644
--- a/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.ts
+++ b/src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.ts
@@ -20,13 +20,13 @@
*/
import { Component, Injector, Input, OnChanges } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
-import { ChartOptions, ChartType } from 'chart.js';
-import 'chartjs-plugin-labels';
+import { ChartOptions, ChartType, Chart } from 'chart.js';
+import ChartDataLabels from 'chartjs-plugin-datalabels';
+Chart.register(ChartDataLabels);
import { CONSTANTNUMBER } from 'CommonModel';
import {
CHARTRANGE,
CHARTVALUES,
- Color,
CONFIGRESOURCESTITLE,
RANGECOLOR,
RESOURCESCHARTDATA,
@@ -50,13 +50,7 @@
public translateService: TranslateService;
/** Chart Options @public */
public chartOptions: ChartOptions = {
- responsive: true,
- plugins: {
- labels: {
- // render 'label', 'value', 'percentage', 'image' or custom function, default is 'percentage'
- render: 'value'
- }
- }
+ responsive: true
};
/** Chart Lables @public */
public chartLabels: String[] = [];
@@ -119,6 +113,7 @@
const range: CHARTRANGE = { percentage: 100, nearlyFull: 75, full: 100 };
getCompute.forEach((key: string): void => {
let usedColor: string = RANGECOLOR.used;
+ // eslint-disable-next-line security/detect-object-injection
const getValuesUsedFree: number[] = Object.values(compute[key]);
const total: number = key === keyValidate ? getValuesUsedFree[0] / CONSTANTNUMBER.oneGB : getValuesUsedFree[0];
const used: number = key === keyValidate ? getValuesUsedFree[1] / CONSTANTNUMBER.oneGB : getValuesUsedFree[1];
@@ -130,7 +125,7 @@
if (usedPercentage === range.full) {
usedColor = RANGECOLOR.full;
}
- getData.push(this.generateChartData(key, { total, used, remaining }, [{ backgroundColor: [usedColor, '#b9bcc3'] }]));
+ getData.push(this.generateChartData(key, { total, used, remaining }, [usedColor, '#b9bcc3'] ));
});
return getData;
}
@@ -140,12 +135,13 @@
* @param setValues CHARTVALUES
* @returns RESOURCESCHARTDATA
*/
- public generateChartData(setTitle: string, setValues: CHARTVALUES, setColor: Color[]): RESOURCESCHARTDATA {
+ public generateChartData(setTitle: string, setValues: CHARTVALUES, setColor: string[]): RESOURCESCHARTDATA {
return {
+ // eslint-disable-next-line security/detect-object-injection
title: CONFIGRESOURCESTITLE[setTitle],
values: this.generateChartDataValues(setValues.total, setValues.used, setValues.remaining),
- data: [setValues.used, setValues.remaining],
- colorValues: setColor
+ data: [{data: [setValues.used, setValues.remaining], backgroundColor: setColor,
+ hoverBackgroundColor: setColor, hoverBorderColor: setColor}]
};
}
/**
diff --git a/src/app/vim-accounts/Resources-Overview/SharedModule.ts b/src/app/vim-accounts/Resources-Overview/SharedModule.ts
index 1b365f3..5f4d726 100644
--- a/src/app/vim-accounts/Resources-Overview/SharedModule.ts
+++ b/src/app/vim-accounts/Resources-Overview/SharedModule.ts
@@ -21,16 +21,15 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { TranslateModule } from '@ngx-translate/core';
-import { ChartsModule } from 'ng2-charts';
+import { NgChartsModule } from 'ng2-charts';
import { ResourcesOverviewComponent } from 'ResourcesOverviewComponent';
/**
* Creating @NgModule component for Modules
*/
@NgModule({
- imports: [CommonModule, TranslateModule, ChartsModule],
+ imports: [CommonModule, TranslateModule, NgChartsModule],
declarations: [ResourcesOverviewComponent],
- exports: [ResourcesOverviewComponent],
- entryComponents: [ResourcesOverviewComponent]
+ exports: [ResourcesOverviewComponent]
})
/** Exporting a class @exports SharedModule */
export class SharedModule {
diff --git a/src/app/vim-accounts/VimAccountsComponent.ts b/src/app/vim-accounts/VimAccountsComponent.ts
index 9951cfc..b7e930c 100644
--- a/src/app/vim-accounts/VimAccountsComponent.ts
+++ b/src/app/vim-accounts/VimAccountsComponent.ts
@@ -50,7 +50,9 @@
/** Return to list NS Package List */
public redirectToList(getURL: string): void {
if (getURL === '/vim') {
- this.router.navigate(['/vim/details']).catch();
+ this.router.navigate(['/vim/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/app/vim-accounts/VimAccountsModule.ts b/src/app/vim-accounts/VimAccountsModule.ts
index c646857..df86659 100644
--- a/src/app/vim-accounts/VimAccountsModule.ts
+++ b/src/app/vim-accounts/VimAccountsModule.ts
@@ -83,8 +83,7 @@
HttpClientModule, NgSelectModule, Ng2SmartTableModule, TranslateModule, RouterModule.forChild(routes), NgbModule,
PagePerRowModule, LoaderModule, PageReloadModule, CodemirrorModule],
declarations: [VimAccountsComponent, InfoVimComponent, VimAccountDetailsComponent, NewVimaccountComponent],
- providers: [DataService],
- entryComponents: [InfoVimComponent]
+ providers: [DataService]
})
/** Exporting a class @exports VimAccountsModule */
export class VimAccountsModule {
diff --git a/src/app/vim-accounts/info-vim/InfoVimComponent.ts b/src/app/vim-accounts/info-vim/InfoVimComponent.ts
index 952c1dc..b89a1b9 100644
--- a/src/app/vim-accounts/info-vim/InfoVimComponent.ts
+++ b/src/app/vim-accounts/info-vim/InfoVimComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Info VIM Page
*/
+import { isNullOrUndefined } from 'util';
import { Component, Injector, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
@@ -26,7 +27,6 @@
import { environment } from 'environment';
import * as HttpStatus from 'http-status-codes';
import { RestService } from 'RestService';
-import { isNullOrUndefined } from 'util';
import { CONFIG, VimAccountDetails, VIMData } from 'VimAccountModel';
/**
@@ -95,7 +95,6 @@
* Lifecyle Hooks the trigger before component is instantiate
*/
public ngOnInit(): void {
- // tslint:disable-next-line:no-backbone-get-set-outside-model
this.paramsID = this.activatedRoute.snapshot.paramMap.get('id');
this.dataService.currentMessage.subscribe((data: VIMData) => {
this.vimId = data.identifier;
@@ -117,29 +116,35 @@
.subscribe((vimAccountsData: VimAccountDetails) => {
this.showDetails(vimAccountsData);
if (!isNullOrUndefined(vimAccountsData.config)) {
- if (vimAccountsData.config.location !== undefined) {
- const locationArr: string[] = vimAccountsData.config.location.split(',');
- if (Array.isArray(locationArr)) {
- vimAccountsData.config.location = locationArr[0];
+ if (vimAccountsData.config.location !== undefined) {
+ const locationArr: string[] = vimAccountsData.config.location.split(',');
+ if (Array.isArray(locationArr)) {
+ vimAccountsData.config.location = locationArr[0];
+ }
}
+ Object.keys(vimAccountsData.config).forEach((key: string) => {
+ // eslint-disable-next-line security/detect-object-injection
+ if (Array.isArray(vimAccountsData.config[key]) || typeof vimAccountsData.config[key] === 'object') {
+ // eslint-disable-next-line security/detect-object-injection
+ vimAccountsData.config[key] = JSON.stringify(vimAccountsData.config[key]);
+ }
+ const keyArr: string[] = key.split('_');
+ if (keyArr.length > 1) {
+ // eslint-disable-next-line security/detect-object-injection
+ vimAccountsData.config[key.split('_').join(' ')] = vimAccountsData.config[key];
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete, security/detect-object-injection
+ delete vimAccountsData.config[key];
+ }
+ });
+ this.configParams = vimAccountsData.config;
}
- Object.keys(vimAccountsData.config).forEach((key: string) => {
- if (Array.isArray(vimAccountsData.config[key]) || typeof vimAccountsData.config[key] === 'object') {
- vimAccountsData.config[key] = JSON.stringify(vimAccountsData.config[key]);
- }
- const keyArr: string[] = key.split('_');
- if (keyArr.length > 1 ) {
- vimAccountsData.config[key.split('_').join(' ')] = vimAccountsData.config[key];
- delete vimAccountsData.config[key];
- }
- });
- this.configParams = vimAccountsData.config;
- }
this.isLoadingResults = false;
}, (error: ERRORDATA) => {
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');
}
diff --git a/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.ts b/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.ts
index daa9332..a57b782 100644
--- a/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.ts
+++ b/src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.ts
@@ -18,6 +18,7 @@
/**
* @file Vim Account Component.
*/
+ import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
@@ -47,7 +48,6 @@
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
@@ -98,6 +98,7 @@
/** options @public */
public options: {} = {
+ // eslint-disable-next-line no-invalid-this
mode: this.modeDefault,
showCursorWhenSelecting: true,
autofocus: true,
@@ -208,6 +209,7 @@
} else {
Object.keys(this.vimNewAccountForm.value.config).forEach((res: string): void => {
if (res !== 'location') {
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete, security/detect-object-injection
delete this.vimNewAccountForm.value.config[res];
}
});
@@ -223,7 +225,9 @@
}
Object.keys(this.vimNewAccountForm.value.config).forEach((res: string): void => {
+ // eslint-disable-next-line security/detect-object-injection
if (isNullOrUndefined(this.vimNewAccountForm.value.config[res]) || this.vimNewAccountForm.value.config[res] === '') {
+ // eslint-disable-next-line @typescript-eslint/no-dynamic-delete, security/detect-object-injection
delete this.vimNewAccountForm.value.config[res];
}
});
diff --git a/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts b/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts
index f580e8a..ac0b502 100644
--- a/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts
+++ b/src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts
@@ -352,7 +352,9 @@
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 });
}
@@ -429,12 +431,10 @@
}
/** 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 {
@@ -449,7 +449,7 @@
};
}
/** 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 += '<h3 class="popover-header">' + feature.values_.vimName + '- (' + feature.values_.location + ')</h3>';
diff --git a/src/app/wim-accounts/WIMAccountsComponent.ts b/src/app/wim-accounts/WIMAccountsComponent.ts
index 5914f30..4a46bd7 100644
--- a/src/app/wim-accounts/WIMAccountsComponent.ts
+++ b/src/app/wim-accounts/WIMAccountsComponent.ts
@@ -49,7 +49,9 @@
/** Return to list NS Package List */
public redirectToList(getURL: string): void {
if (getURL === '/wim') {
- this.router.navigate(['/wim/details']).catch();
+ this.router.navigate(['/wim/details']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/app/wim-accounts/WIMAccountsModule.ts b/src/app/wim-accounts/WIMAccountsModule.ts
index 088502f..407bafd 100644
--- a/src/app/wim-accounts/WIMAccountsModule.ts
+++ b/src/app/wim-accounts/WIMAccountsModule.ts
@@ -67,8 +67,7 @@
PagePerRowModule, LoaderModule, PageReloadModule],
declarations: [WIMAccountsComponent, WIMAccountInfoComponent, WIMAccountDetailsComponent, NewWIMAccountComponent],
providers: [DataService],
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- entryComponents: [WIMAccountInfoComponent, NewWIMAccountComponent]
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
/** Exporting a class @exports WIMAccountsModule */
export class WIMAccountsModule {
diff --git a/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts b/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts
index 5b8e29a..65ae937 100644
--- a/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts
+++ b/src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts
@@ -18,6 +18,7 @@
/**
* @file WIM Account Component.
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Component, ElementRef, Injector, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
@@ -29,7 +30,6 @@
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
@@ -169,7 +169,6 @@
if (files && files.length === 1) {
this.sharedService.getFileString(files, 'yaml').then((fileContent: string): void => {
const getConfigJson: string = jsyaml.load(fileContent, { json: true });
- // tslint:disable-next-line: no-backbone-get-set-outside-model
this.wimNewAccountForm.get('config').setValue(JSON.stringify(getConfigJson));
}).catch((err: string): void => {
if (err === 'typeError') {
diff --git a/src/app/wim-accounts/wim-account-details/WIMAccountDetailsComponent.ts b/src/app/wim-accounts/wim-account-details/WIMAccountDetailsComponent.ts
index b1d16f7..927e54e 100644
--- a/src/app/wim-accounts/wim-account-details/WIMAccountDetailsComponent.ts
+++ b/src/app/wim-accounts/wim-account-details/WIMAccountDetailsComponent.ts
@@ -195,12 +195,15 @@
/** Compose new WIM Accounts @public */
public composeWIM(): void {
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
const modalRef: NgbModalRef = this.modalService.open(NewWIMAccountComponent, { backdrop: 'static' });
modalRef.result.then((result: MODALCLOSERESPONSEDATA) => {
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Generate generateWIMData object from loop and return for the datasource @public */
@@ -237,7 +240,9 @@
}
this.dataSource.load(this.wimData).then((data: {}) => {
this.isLoadingResults = false;
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}, (error: ERRORDATA) => {
this.restService.handleError(error, 'get');
this.isLoadingResults = false;
diff --git a/src/assets/i18n/de.json b/src/assets/i18n/de.json
index dc1d2a0..5070068 100644
--- a/src/assets/i18n/de.json
+++ b/src/assets/i18n/de.json
@@ -306,7 +306,7 @@
"DETAILS": "SDN-Controller-Details"
},
"USERS": {
- "CREATEUSER": "Gebruiker aanmaken",
+ "CREATEUSER": "Nieuwe gebruiker",
"NEWUSER": "Neuer Benutzer",
"USERNAME": "Nutzername",
"PASSWORD": "Passwort",
@@ -436,7 +436,7 @@
"EXECUTEDSUCCESSFULLY": "NS Primitive Configuration ausgeführt"
},
"ROLES": {
- "CREATEROLE": "Rolle erstellen",
+ "CREATEROLE": "Neue Rolle",
"ROLE": "Rolle",
"PERMISSIONS": "Berechtigungen",
"YAMLPERMISSIONS": "YAML Berechtigungen",
diff --git a/src/assets/i18n/en.json b/src/assets/i18n/en.json
index cb4ac32..659c0f5 100644
--- a/src/assets/i18n/en.json
+++ b/src/assets/i18n/en.json
@@ -306,7 +306,7 @@
"DETAILS": "SDN Controller Details"
},
"USERS": {
- "CREATEUSER": "Create User",
+ "CREATEUSER": "New User",
"NEWUSER": "New User",
"USERNAME": "User Name",
"PASSWORD": "Password",
@@ -436,7 +436,7 @@
"EXECUTEDSUCCESSFULLY": "Executed NS Primitive Configuration"
},
"ROLES": {
- "CREATEROLE": "Create Role",
+ "CREATEROLE": "New Role",
"ROLE": "Role",
"PERMISSIONS": "Permissions",
"YAMLPERMISSIONS": "YAML Permissions",
diff --git a/src/assets/i18n/es.json b/src/assets/i18n/es.json
index e4331c4..f8dfce6 100644
--- a/src/assets/i18n/es.json
+++ b/src/assets/i18n/es.json
@@ -306,7 +306,7 @@
"DETAILS": "Detalles del controlador SDN"
},
"USERS": {
- "CREATEUSER": "Crear usuario",
+ "CREATEUSER": "Nuevo usuario",
"NEWUSER": "Nuevo usuario",
"USERNAME": "Nombre de usuario",
"PASSWORD": "Contraseña",
@@ -436,7 +436,7 @@
"EXECUTEDSUCCESSFULLY": "Ejecutada NS Configuración primitiva"
},
"ROLES": {
- "CREATEROLE": "Crear rol",
+ "CREATEROLE": "Nuevo rol",
"ROLE": "Rol",
"PERMISSIONS": "Permisos",
"YAMLPERMISSIONS": "YAML Permisos",
diff --git a/src/assets/i18n/pt.json b/src/assets/i18n/pt.json
index 160ef8d..a37d187 100644
--- a/src/assets/i18n/pt.json
+++ b/src/assets/i18n/pt.json
@@ -306,7 +306,7 @@
"DETAILS": "Detalhes do Controlador SDN"
},
"USERS": {
- "CREATEUSER": "Criar usuário",
+ "CREATEUSER": "Novo usuário",
"NEWUSER": "Novo usuário",
"USERNAME": "Nome de Usuário",
"PASSWORD": "Senha",
@@ -436,7 +436,7 @@
"EXECUTEDSUCCESSFULLY": "Configuração primitiva do NS executada"
},
"ROLES": {
- "CREATEROLE": "Criar função",
+ "CREATEROLE": "Novo função",
"ROLE": "Função",
"PERMISSIONS": "Permissões",
"YAMLPERMISSIONS": "YAML Permissões",
diff --git a/src/assets/scss/app.scss b/src/assets/scss/app.scss
index 2e2eb92..cb96c93 100644
--- a/src/assets/scss/app.scss
+++ b/src/assets/scss/app.scss
@@ -16,9 +16,11 @@
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
*/
/** Styles for the application **/
+@use "sass:math";
+
@import "../../assets/scss/mixins/mixin";
@import "../../assets/scss/variable";
-$customnavbar-padding-x: ($spacer / 0.5) !default;
+$customnavbar-padding-x: math.div($spacer, 0.5) !default;
* {
outline: 0;
}
@@ -266,6 +268,7 @@
}
.resources-chart-popover {
max-width: 60% !important;
+ width: 600px !important;
@include font-family("Roboto");
.popover-body {
max-height: 60vh;
diff --git a/src/assets/scss/mixins/_rem.scss b/src/assets/scss/mixins/_rem.scss
index 960132a..4abd417 100644
--- a/src/assets/scss/mixins/_rem.scss
+++ b/src/assets/scss/mixins/_rem.scss
@@ -20,6 +20,8 @@
* example: @include rem("font-size", 14);
*/
+@use "sass:math";
+
@mixin rem($property, $values...) {
$n: length($values);
$i: 1;
@@ -29,7 +31,7 @@
$itemVal: (nth($values, $i));
@if $itemVal !="auto" {
$pxlist: append($pxlist, $itemVal + px);
- $remlist: append($remlist, ($itemVal / 16) + rem);
+ $remlist: append($remlist, math.div($itemVal, 16) + rem);
}
@else {
$pxlist: append($pxlist, auto);
diff --git a/src/assets/scss/style.scss b/src/assets/scss/style.scss
index d39843b..0fb1c39 100644
--- a/src/assets/scss/style.scss
+++ b/src/assets/scss/style.scss
@@ -17,30 +17,30 @@
*/
/*Roboto Fonts*/
$roboto-font-path: "~roboto-fontface/fonts" !default;
-@import "~roboto-fontface/css/roboto/sass/roboto-fontface-regular";
+@import "../../../node_modules/roboto-fontface/css/roboto/sass/roboto-fontface-regular.scss";
/*Custom mixin*/
@import "mixins/mixin.scss";
/*Theme setup color*/
@import "variable";
/*bootstrap styles*/
-@import "~bootstrap/scss/bootstrap";
+@import "../../../node_modules/bootstrap/scss/bootstrap.scss";
/*Custom theme styles*/
@import "app.scss";
/*Code Mirror styles*/
-@import "~codemirror/lib/codemirror";
-@import "~codemirror/addon/fold/foldgutter";
-@import "~codemirror/theme/neat";
-@import "~codemirror/theme/material";
-@import "~codemirror/addon/dialog/dialog";
-@import "~codemirror/addon/display/fullscreen";
+@import "../../../node_modules/codemirror/lib/codemirror.css";
+@import "../../../node_modules/codemirror/addon/fold/foldgutter.css";
+@import "../../../node_modules/codemirror/theme/neat.css";
+@import "../../../node_modules/codemirror/theme/material.css";
+@import "../../../node_modules/codemirror/addon/dialog/dialog.css";
+@import "../../../node_modules/codemirror/addon/display/fullscreen.css";
/*ng-select styles*/
-@import "~@ng-select/ng-select/themes/default.theme.css";
+@import "../../../node_modules/@ng-select/ng-select/themes/default.theme.css";
/*Angular notifier styles*/
-@import "~angular-notifier/styles/core.scss";
-@import "~angular-notifier/styles/themes/theme-material.scss";
-@import "~angular-notifier/styles/themes/theme-material.scss";
-@import "~angular-notifier/styles/types/type-success.scss";
-@import "~angular-notifier/styles/types/type-error.scss";
-@import "~angular-notifier/styles/types/type-warning.scss";
-@import "~angular-notifier/styles/types/type-default.scss";
-@import "~angular-notifier/styles/types/type-info.scss";
\ No newline at end of file
+@import "../../../node_modules/angular-notifier/styles/core.scss";
+@import "../../../node_modules/angular-notifier/styles/themes/theme-material.scss";
+@import "../../../node_modules/angular-notifier/styles/themes/theme-material.scss";
+@import "../../../node_modules/angular-notifier/styles/types/type-success.scss";
+@import "../../../node_modules/angular-notifier/styles/types/type-error.scss";
+@import "../../../node_modules/angular-notifier/styles/types/type-warning.scss";
+@import "../../../node_modules/angular-notifier/styles/types/type-default.scss";
+@import "../../../node_modules/angular-notifier/styles/types/type-info.scss";
\ No newline at end of file
diff --git a/src/assets/scss/variable.scss b/src/assets/scss/variable.scss
index 6a274ce..3af9d3b 100644
--- a/src/assets/scss/variable.scss
+++ b/src/assets/scss/variable.scss
@@ -15,6 +15,7 @@
Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.in), BARATH KUMAR R (barath.r@tataelxsi.co.in)
*/
+ @use "sass:math";
// Custom Variables
$themecolor: #2962ff;
$theme-light: #fff;
@@ -125,19 +126,19 @@
$white-smoke: #f1f1f1 !default;
$text-muted: $gray-500 !default;
$colors: (
- blue: $blue,
- indigo: $indigo,
- purple: $purple,
- pink: $pink,
- red: $red,
- orange: $orange,
- yellow: $yellow,
- green: $green,
- teal: $teal,
- cyan: $cyan,
- white: $white,
- gray: $gray-600,
- gray-dark: $gray-800
+ "blue": $blue,
+ "indigo": $indigo,
+ "purple": $purple,
+ "pink": $pink,
+ "red": $red,
+ "orange": $orange,
+ "yellow": $yellow,
+ "green": $green,
+ "teal": $teal,
+ "cyan": $cyan,
+ "white": $white,
+ "gray": $gray-600,
+ "gray-dark": $gray-800
);
$primary: $blue !default;
$secondary: $gray-400 !default;
@@ -199,7 +200,7 @@
$h4-font-size: 18px !default;
$h5-font-size: 16px !default;
$h6-font-size: 14px !default;
-$headings-margin-bottom: (1rem / 2) !default;
+$headings-margin-bottom: math.div(1rem, 2) !default;
$headings-font-weight: 400 !default;
$headings-color: inherit !default;
// Breadcrumbs
diff --git a/src/directive/GoToTopDirective.ts b/src/directive/GoToTopDirective.ts
index 67cdc96..06a2462 100644
--- a/src/directive/GoToTopDirective.ts
+++ b/src/directive/GoToTopDirective.ts
@@ -32,6 +32,7 @@
/** Exporting a class @exports GoToTopDirective */
export class GoToTopDirective {
/** To set scroll top position @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private topPosToStartShowing: number = 100;
/** Contains all methods related to shared @private */
@@ -44,6 +45,7 @@
* to listen the scroll event in DOM @public
*/
@HostListener('window:scroll') public enableGotoTop(): void {
+ // eslint-disable-next-line deprecation/deprecation
const scrollPosition: number = Math.max(window.pageYOffset, document.documentElement.scrollTop, document.body.scrollTop);
if (scrollPosition >= this.topPosToStartShowing) {
this.sharedService.showGotoTop = true;
@@ -51,5 +53,4 @@
this.sharedService.showGotoTop = false;
}
}
-
}
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 440bfd1..9ab1c1f 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -22,7 +22,7 @@
* The list of file replacements can be found in `angular.json`.
*/
-import { version } from 'PACKAGEJSON';
+import PACKAGEJSON from 'PACKAGEJSON';
/** OSM_Admin URL @constant */
const OSM_ADMIN_ENDPOINT: string = 'osm/admin/v1/';
@@ -43,16 +43,15 @@
/** OSM Version @constant */
const OSM_VERSION: string = 'osm/version';
/** Grafana End-Point @constant */
-// tslint:disable-next-line: no-http-string
+// eslint-disable-next-line @microsoft/sdl/no-insecure-url
const GRAFANA_ENDPOINT: string = 'http://' + window.location.hostname + ':3000';
/** Exporting a const @exports environment */
-// tslint:disable-next-line: typedef
export const environment = {
production: true,
packageSize: 50,
paginationNumber: 10, //Possible values are 10, 25, 50, 100
- packageVersion: version,
+ packageVersion: PACKAGEJSON.version,
GENERATETOKEN_URL: OSM_ADMIN_ENDPOINT + 'tokens',
PROJECTS_URL: OSM_ADMIN_ENDPOINT + 'projects',
USERS_URL: OSM_ADMIN_ENDPOINT + 'users',
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index e3acd4f..bd45964 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -22,7 +22,7 @@
* The list of file replacements can be found in `angular.json`.
*/
-import { version } from 'PACKAGEJSON';
+import PACKAGEJSON from 'PACKAGEJSON';
/** OSM Admin URL @constant */
const OSM_ADMIN_ENDPOINT: string = 'osm/admin/v1/';
@@ -43,16 +43,15 @@
/** OSM Version @constant */
const OSM_VERSION: string = 'osm/version';
/** Grafana End-Point @constant */
-// tslint:disable-next-line: no-http-string
+// eslint-disable-next-line @microsoft/sdl/no-insecure-url
const GRAFANA_ENDPOINT: string = 'http://' + window.location.hostname + ':3000';
/** Exporting a const @exports environment */
-// tslint:disable-next-line: typedef
export const environment = {
production: false,
packageSize: 50,
paginationNumber: 10, //Possible values are 10, 25, 50, 100
- packageVersion: version,
+ packageVersion: PACKAGEJSON.version,
GENERATETOKEN_URL: OSM_ADMIN_ENDPOINT + 'tokens',
PROJECTS_URL: OSM_ADMIN_ENDPOINT + 'projects',
USERS_URL: OSM_ADMIN_ENDPOINT + 'users',
diff --git a/src/models/CommonModel.ts b/src/models/CommonModel.ts
index a33e6f3..ed35029 100644
--- a/src/models/CommonModel.ts
+++ b/src/models/CommonModel.ts
@@ -23,7 +23,7 @@
/**
* @file Model for Commonly used information.
*/
-// tslint:disable: completed-docs
+/* eslint-disable */
/**
* handle count @enum
*/
@@ -198,7 +198,6 @@
}
/** Interface For the Pagination pager in ng-smarttable */
export interface SMARTTABLECLASS {
- // tslint:disable-next-line: no-reserved-keywords
class: string;
}
/** Constants of the VIM Types */
diff --git a/src/models/NSDModel.ts b/src/models/NSDModel.ts
index 48e7387..f8b3d9d 100644
--- a/src/models/NSDModel.ts
+++ b/src/models/NSDModel.ts
@@ -18,7 +18,6 @@
/**
* @file Model for NSD related information.
*/
-// tslint:disable: completed-docs
import { VNFDAdminDetails } from './VNFDModel';
/** Interface for NSData */
diff --git a/src/models/NSInstanceModel.ts b/src/models/NSInstanceModel.ts
index 66294cf..12ce977 100644
--- a/src/models/NSInstanceModel.ts
+++ b/src/models/NSInstanceModel.ts
@@ -18,7 +18,7 @@
/**
* @file Model for NS Instance related information.
*/
-// tslint:disable: completed-docs
+/* eslint-disable */
import { DF, VLD } from 'NSDModel';
import { VNFDAdminDetails } from 'VNFDModel';
@@ -67,7 +67,6 @@
}
/** Interface for _Admin */
-// tslint:disable-next-line:class-name
interface _Admin {
'projects_write': string[];
deployed: DeployedAdmin;
@@ -114,7 +113,6 @@
}
/** Interface for _AdminDetails */
-// tslint:disable-next-line:class-name
export interface _AdminDetails {
usageState: string;
projects_write: string[];
diff --git a/src/models/NetworkSliceModel.ts b/src/models/NetworkSliceModel.ts
index eda0b92..baa79be 100644
--- a/src/models/NetworkSliceModel.ts
+++ b/src/models/NetworkSliceModel.ts
@@ -76,7 +76,6 @@
id: string;
'nss-connection-point-ref': NssConnectionPointRef[];
'mgmt-network': boolean;
- // tslint:disable-next-line:no-reserved-keywords
type: string;
}
diff --git a/src/models/OperationalModel.ts b/src/models/OperationalModel.ts
index 79f248e..14de20b 100644
--- a/src/models/OperationalModel.ts
+++ b/src/models/OperationalModel.ts
@@ -20,7 +20,6 @@
* @file Model for Operational view JUJU information.
*/
-// tslint:disable: completed-docs
/** Interface for the VCASTATUS */
export interface VCASTATUS {
diff --git a/src/models/VNFDModel.ts b/src/models/VNFDModel.ts
index 339dd02..6eafe39 100644
--- a/src/models/VNFDModel.ts
+++ b/src/models/VNFDModel.ts
@@ -18,7 +18,6 @@
/**
* @file Model for VNFD related information.
*/
-// tslint:disable: completed-docs
/** Interface for Project */
export interface ProjectModel {
project_id: string;
diff --git a/src/models/VimAccountModel.ts b/src/models/VimAccountModel.ts
index 159b2c9..4337276 100644
--- a/src/models/VimAccountModel.ts
+++ b/src/models/VimAccountModel.ts
@@ -18,7 +18,6 @@
/**
* @file Model for VimAccount Details related information.
*/
-// tslint:disable: completed-docs
import { NSInstanceDetails } from 'NSInstanceModel';
/** Interface for VimAccountDetails */
export interface VimAccountDetails {
@@ -146,8 +145,14 @@
export interface RESOURCESCHARTDATA {
title: string;
values: CHARTVALUES;
+ data: CHARTDATA[];
+}
+/** Interface common use for the Chart */
+export interface CHARTDATA {
data: number[];
- colorValues: Color[];
+ backgroundColor?: string[] | string;
+ hoverBackgroundColor?: string[] | string;
+ hoverBorderColor?: string[] | string;
}
/** Interface common use for the Chart */
export interface CHARTVALUES {
diff --git a/src/polyfills.ts b/src/polyfills.ts
index 9d349d1..0d0c045 100644
--- a/src/polyfills.ts
+++ b/src/polyfills.ts
@@ -38,17 +38,7 @@
/***************************************************************************************************
* BROWSER POLYFILLS
- */
-
-/** IE10 and IE11 requires the following for NgClass support on SVG elements */
-// import 'classlist.js'; // Run `npm install --save classlist.js`.
-
-/**
- * Web Animations `@angular/platform-browser/animations`
- * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
- * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
- */
-import 'web-animations-js'; // Run `npm install --save web-animations-js`.
+ */ // Run `npm install --save web-animations-js`.
/**
* By default, zone.js will patch all possible macroTask and DomEvents
@@ -79,6 +69,11 @@
*/
import 'zone.js'; // Included with Angular CLI.
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+(window as any).process = {
+ env: { DEBUG: undefined }
+ };
+
/***************************************************************************************************
* APPLICATION IMPORTS
*/
diff --git a/src/services/AuthGuardService.ts b/src/services/AuthGuardService.ts
index 2effeca..512705f 100644
--- a/src/services/AuthGuardService.ts
+++ b/src/services/AuthGuardService.ts
@@ -45,6 +45,7 @@
* Returns Observable<boolean> if authorized @public
*/
public canActivate(next: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean> {
+ // eslint-disable-next-line deprecation/deprecation
return combineLatest(
this.authService.isLoggedIn,
this.authService.isChangePassword
@@ -53,7 +54,9 @@
if (changePassword || isLoggedIn) {
return true;
} else {
- this.router.navigate(['/login']).catch();
+ this.router.navigate(['/login']).catch((): void => {
+ // Catch Navigation Error
+ });
this.authService.destoryToken();
return false;
}
diff --git a/src/services/AuthInterceptorService.ts b/src/services/AuthInterceptorService.ts
index 8c5a9d7..d2166e3 100644
--- a/src/services/AuthInterceptorService.ts
+++ b/src/services/AuthInterceptorService.ts
@@ -66,11 +66,11 @@
* @param next
*/
public intercept(req: HttpRequest<{}>, next: HttpHandler): Observable<HttpSentEvent |
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
HttpHeaderResponse | HttpProgressEvent | HttpResponse<{}> | HttpUserEvent<any> | any> {
const idToken: string = localStorage.getItem('id_token');
const excludedUrl: string[] = ['osm/admin/v1/tokens', 'assets/i18n/', 'osm/version'];
- if (excludedUrl.some((x: string): boolean => { return req.url.includes(x); })) { return next.handle(req); }
+ if (excludedUrl.some((x: string): boolean => req.url.includes(x))) { return next.handle(req); }
if (idToken.length > 0) {
this.setHeader(req, idToken);
return next.handle(this.clonedReq).pipe(
@@ -85,7 +85,7 @@
}
/** Set header options @public */
- // tslint:disable-next-line:no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
public setHeader(req: HttpRequest<any>, idToken: string): void {
if (req.body !== null && req.body.byteLength !== null) {
this.clonedReq = req.clone({
diff --git a/src/services/AuthenticationService.ts b/src/services/AuthenticationService.ts
index 0399c59..5eda6f9 100644
--- a/src/services/AuthenticationService.ts
+++ b/src/services/AuthenticationService.ts
@@ -18,6 +18,7 @@
/**
* @file Auth service
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Injectable, Injector } from '@angular/core';
import { Router } from '@angular/router';
@@ -27,7 +28,6 @@
import { environment } from 'environment';
import { BehaviorSubject, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
-import { isNullOrUndefined } from 'util';
import { ProjectModel } from '../models/VNFDModel';
import { RestService } from './RestService';
@@ -196,7 +196,9 @@
localStorage.setItem('token_state', null);
localStorage.setItem('osmVersion', osmVersion);
this.idle.stop();
- this.router.navigate(['login']).catch();
+ this.router.navigate(['login']).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
* Logout the user & clearing the token.
@@ -225,7 +227,9 @@
if (window.location.pathname === '/changepassword' && localStorage.getItem('username') !== null) {
window.history.back();
} else if (window.location.pathname === '/' && localStorage.getItem('firstLogin') === 'true') {
- this.router.navigate(['/login']).catch();
+ this.router.navigate(['/login']).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
}
diff --git a/src/services/DataService.ts b/src/services/DataService.ts
index e64c34c..0e3be87 100644
--- a/src/services/DataService.ts
+++ b/src/services/DataService.ts
@@ -32,6 +32,7 @@
public messageSource: BehaviorSubject<{}> = new BehaviorSubject<{}>({});
/** current message @public */
+ // eslint-disable-next-line no-invalid-this
public currentMessage: Observable<{}> = this.messageSource.asObservable();
/** change message function @public */
public changeMessage(message: {}): void {
diff --git a/src/services/DeviceCheckService.ts b/src/services/DeviceCheckService.ts
index 98ab2fc..cf4d5dd 100644
--- a/src/services/DeviceCheckService.ts
+++ b/src/services/DeviceCheckService.ts
@@ -38,12 +38,12 @@
/** Return the Device type @public */
public checkDeviceType(): void {
- if (navigator.userAgent.match(/Android/i)
- || navigator.userAgent.match(/webOS/i)
- || navigator.userAgent.match(/iPhone/i)
- || navigator.userAgent.match(/iPod/i)
- || navigator.userAgent.match(/BlackBerry/i)
- || navigator.userAgent.match(/Windows Phone/i)) {
+ if ((/Android/i.exec(navigator.userAgent))
+ || (/webOS/i.exec(navigator.userAgent))
+ || (/iPhone/i.exec(navigator.userAgent))
+ || (/iPod/i.exec(navigator.userAgent))
+ || (/BlackBerry/i.exec(navigator.userAgent))
+ || (/Windows Phone/i.exec(navigator.userAgent))) {
this.isMobile$.next(true);
} else {
this.isMobile$.next(false);
diff --git a/src/services/ProjectService.ts b/src/services/ProjectService.ts
index c22f33a..4206ea4 100644
--- a/src/services/ProjectService.ts
+++ b/src/services/ProjectService.ts
@@ -108,6 +108,7 @@
/** Toggle projects on selection @public */
public switchProjectModal(list: ProjectData): void {
const username: string = localStorage.getItem('username');
+ // eslint-disable-next-line security/detect-non-literal-fs-filename
this.modalService.open(SwitchProjectComponent, { backdrop: 'static' })
.componentInstance.params = { projectID: list.project, username };
}
diff --git a/src/services/RestService.ts b/src/services/RestService.ts
index 708d91b..bea559a 100644
--- a/src/services/RestService.ts
+++ b/src/services/RestService.ts
@@ -20,6 +20,7 @@
* @file Provider for REST Service
*/
+import { isNullOrUndefined } from 'util';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
@@ -28,7 +29,6 @@
import { APIURLHEADER, ERRORDATA } from 'CommonModel';
import * as HttpStatus from 'http-status-codes';
import { Observable } from 'rxjs';
-import { isNullOrUndefined } from 'util';
/**
* An Injectable is a class adorned with the @Injectable decorator function.
@@ -133,7 +133,6 @@
* @param error The error response reecieved from API call.
* @param method The http request method.
*/
- // tslint:disable-next-line: cyclomatic-complexity
public handleError(err: ERRORDATA, method?: string): void {
if (err.error.status === HttpStatus.UNAUTHORIZED) {
if (method !== 'get') {
diff --git a/src/services/SharedService.ts b/src/services/SharedService.ts
index d5c561d..53078b5 100644
--- a/src/services/SharedService.ts
+++ b/src/services/SharedService.ts
@@ -18,6 +18,7 @@
/**
* @file Provider for Shared Service
*/
+import { isNullOrUndefined } from 'util';
import { HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { EventEmitter, Injectable, Output } from '@angular/core';
import { FormArray, FormGroup } from '@angular/forms';
@@ -42,10 +43,9 @@
import { RestService } from 'RestService';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
-import { isNullOrUndefined } from 'util';
/** 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;
/**
@@ -61,34 +61,32 @@
@Output() public dataEvent: EventEmitter<{}> = new EventEmitter<{}>();
/** Variables to hold regexp pattern for URL */
- // tslint:disable-next-line: max-line-length
public REGX_URL_PATTERN: RegExp = new RegExp(/^(http?|ftp|https):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.[a-zA-Z0-9]{2,15})(:((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4})))*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/);
/** Variables to hold regexp pattern for IP Address */
public REGX_IP_PATTERN: RegExp = new RegExp(/^(?:(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(\.(?!$)|$)){4}$/);
/** Variables to hold regexp pattern for Port Number */
- // tslint:disable-next-line: max-line-length
public REGX_PORT_PATTERN: RegExp = new RegExp(/^((6553[0-5])|(655[0-2][0-9])|(65[0-4][0-9]{2})|(6[0-4][0-9]{3})|([1-5][0-9]{4})|([0-5]{0,5})|([0-9]{1,4}))$/);
/** Variables to hold regexp pattern for DPID */
public REGX_DPID_PATTERN: RegExp = new RegExp(/^[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){7}$/);
/** Variable to hold regexp pattern for password */
- // tslint:disable-next-line: max-line-length
public REGX_PASSWORD_PATTERN: RegExp = new RegExp(/^.*(?=.{8,})((?=.*[!@#$%^&*()\-_=+{};:,<.>]){1})(?=.*\d)((?=.*[a-z]){1})((?=.*[A-Z]){1}).*$/);
/** Variables to hold regexp pattern for Latitude */
public REGX_LAT_PATTERN: RegExp = new RegExp(/^(\+|-)?(?:90(?:(?:\.0{1,6})?)|(?:[0-9]|[1-8][0-9])(?:(?:\.[0-9]{1,15})?))$/);
/** Variables to hold regexp pattern for Longitude */
- // tslint:disable-next-line: max-line-length
public REGX_LONG_PATTERN: RegExp = new RegExp(/^(\+|-)?(?:180(?:(?:\.0{1,6})?)|(?:[0-9]|[1-9][0-9]|1[0-7][0-9])(?:(?:\.[0-9]{1,15})?))$/);
/** Variables to hold maxlength for the description @public */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
public MAX_LENGTH_DESCRIPTION: number = 500;
/** Variables to hold maxlength for the name @public */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
public MAX_LENGTH_NAME: number = 50;
/** FormGroup instance added to the form @ html @public */
@@ -101,12 +99,15 @@
public osmVersion: string;
/** express number for time manupulation -2 */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private epochTimeMinus2: number = -2;
/** express number for time manupulation 1000 */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private epochTime1000: number = 1000;
/** Random string generator length */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private randomStringLength: number = 4;
/** Instance of the rest service @private */
@@ -116,9 +117,11 @@
private router: Router;
/** Random color string generator length @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private colorStringLength: number = 256;
/** Check for the root directory @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private directoryCount: number = 2;
/** Contains tranlsate instance @private */
@@ -142,7 +145,9 @@
const hours: number = date.getHours();
const minutes: string = '0' + date.getMinutes();
const seconds: string = '0' + date.getSeconds();
+ // eslint-disable-next-line deprecation/deprecation
return month + '-' + day + '-' + year + ' ' + hours + ':' + minutes.substr(this.epochTimeMinus2) + ':'
+ // eslint-disable-next-line deprecation/deprecation
+ seconds.substr(this.epochTimeMinus2);
}
return this.translateService.instant('NODATE');
@@ -153,8 +158,10 @@
const downloadLink: HTMLAnchorElement = document.createElement('a');
downloadLink.href = window.URL.createObjectURL(new Blob(binaryData, { type: filetype }));
if (name !== undefined) {
- if (window.navigator.msSaveOrOpenBlob) {
- window.navigator.msSaveBlob(new Blob(binaryData, { type: filetype }), 'OSM_Export_' + name + '.tar.gz');
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const newVariable: any = window.navigator;
+ if (newVariable.msSaveOrOpenBlob) {
+ newVariable.msSaveBlob(new Blob(binaryData, { type: filetype }), 'OSM_Export_' + name + '.tar.gz');
} else {
downloadLink.setAttribute('download', 'OSM_Export_' + name + '.tar.gz');
document.body.appendChild(downloadLink);
@@ -172,7 +179,6 @@
public randomString(): string {
const chars: string = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
let result: string = '';
- // tslint:disable-next-line:no-increment-decrement
for (let randomStringRef: number = this.randomStringLength; randomStringRef > 0; --randomStringRef) {
result += chars[Math.floor(Math.random() * chars.length)];
}
@@ -209,7 +215,7 @@
environment.VNFPACKAGES_URL + '/' + packageInfo.id + '/package_content';
this.restService.getResource(apiUrl, httpOptions).subscribe((response: ArrayBuffer): void => {
try {
- // tslint:disable-next-line: no-any
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
const tar: any = new Tar();
const originalInput: Uint8Array = pako.inflate(response, { to: 'Uint8Array' });
untar(originalInput.buffer).then((extractedFiles: TARSETTINGS[]): void => {
@@ -239,7 +245,9 @@
}
}, (error: HttpErrorResponse): void => {
if (error.status === HttpStatus.NOT_FOUND || 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');
reject('');
@@ -273,8 +281,9 @@
public cleanForm(formGroup: FormGroup, formName?: String): void {
Object.keys(formGroup.controls).forEach((key: string) => {
if ((!isNullOrUndefined((formGroup.get(key) as FormArray | FormGroup).controls)) && key !== 'config') {
- // tslint:disable-next-line: no-shadowed-variable
+ // eslint-disable-next-line @typescript-eslint/no-shadow
for (const { item, index } of (formGroup.get(key).value).map((item: {}, index: number) => ({ item, index }))) {
+ // eslint-disable-next-line security/detect-object-injection
const newFormGroup: FormGroup = (formGroup.get(key) as FormArray).controls[index] as FormGroup;
this.cleanForm(newFormGroup);
}
diff --git a/src/test.ts b/src/test.ts
index cf21bef..c191cf8 100644
--- a/src/test.ts
+++ b/src/test.ts
@@ -26,19 +26,19 @@
import 'zone.js/dist/zone-testing';
/** const variable require */
-// tslint:disable:no-reserved-keywords
-// tslint:disable-next-line:no-any
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
- platformBrowserDynamicTesting()
+ platformBrowserDynamicTesting(), {
+ teardown: { destroyAfterEach: false }
+}
);
/** const variable context */
// Then we find all the tests.
-// tslint:disable-next-line:typedef
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
diff --git a/src/tslint.json b/src/tslint.json
deleted file mode 100644
index 52e2c1a..0000000
--- a/src/tslint.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{
- "extends": "../tslint.json",
- "rules": {
- "directive-selector": [
- true,
- "attribute",
- "app",
- "camelCase"
- ],
- "component-selector": [
- true,
- "element",
- "app",
- "kebab-case"
- ]
- }
-}