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