Fix Bug 2121: NG-UI uses unmaintained Chokidar version 73/13273/3
authorSANDHYA.JS <sandhya.j@tataelxsi.co.in>
Tue, 25 Apr 2023 18:29:41 +0000 (23:59 +0530)
committerSANDHYA.JS <sandhya.j@tataelxsi.co.in>
Mon, 22 May 2023 10:58:53 +0000 (16:28 +0530)
- 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>
145 files changed:
.eslintrc.json [new file with mode: 0644]
.gitignore
angular.json
build-debpkg.sh
package.json
src/.eslintrc.json [new file with mode: 0644]
src/app/AppComponent.ts
src/app/AppModule.ts
src/app/approutes.module.ts
src/app/dashboard/DashboardComponent.ts
src/app/dashboard/DashboardModule.ts
src/app/instances/InstancesComponent.ts
src/app/instances/InstancesModule.ts
src/app/instances/netslice-instances/NetsliceInstancesComponent.ts
src/app/instances/ns-history-operations/HistoryOperationsComponent.ts
src/app/instances/ns-instances/NSInstancesComponent.ts
src/app/instances/ns-primitive/NSPrimitiveComponent.ts
src/app/instances/ns-topology/NSTopologyComponent.ts
src/app/instances/pdu-instances/PDUInstancesComponent.ts
src/app/instances/pdu-instances/add-pdu-instances/AddPDUInstancesComponent.ts
src/app/instances/vnf-instances/VNFInstancesComponent.ts
src/app/instances/vnf-instances/vnf-link/VNFLinkComponent.ts
src/app/k8s/K8sComponent.ts
src/app/k8s/K8sModule.ts
src/app/k8s/k8s-action/K8sActionComponent.ts
src/app/k8s/k8s-add-cluster/K8sAddClusterComponent.ts
src/app/k8s/k8s-add-repo/K8sAddRepoComponent.ts
src/app/k8s/k8scluster/K8sClusterComponent.ts
src/app/k8s/k8srepository/K8sRepositoryComponent.ts
src/app/layouts/breadcrumb/BreadcrumbComponent.ts
src/app/layouts/header/HeaderComponent.ts
src/app/layouts/sidebar/SidebarComponent.ts
src/app/login/LoginComponent.ts
src/app/operational-view/OperationalViewComponent.ts
src/app/operational-view/operational-view-app-actions/OperationalViewAppActionsComponent.ts
src/app/operational-view/operational-view-app-configs/OperationalViewAppConfigsComponent.ts
src/app/operational-view/operational-view-app-executed-actions/OperationalViewAppExecutedActionsComponent.ts
src/app/osm-repositories/OsmRepositoriesComponent.ts
src/app/osm-repositories/OsmRepositoriesModule.ts
src/app/osm-repositories/osm-repositories-details/OsmRepositoriesDetailsComponent.ts
src/app/packages/PackagesComponent.ts
src/app/packages/PackagesModule.ts
src/app/packages/instantiate-net-slice-template/InstantiateNetSliceTemplateComponent.ts
src/app/packages/instantiate-ns/InstantiateNsComponent.ts
src/app/packages/ns-packages/NSPackagesComponent.ts
src/app/packages/ns-packages/ns-composer/NSComposerComponent.ts
src/app/packages/ns-packages/vnf-composer/VNFComposerComponent.ts
src/app/packages/vnf-packages/VNFPackagesComponent.ts
src/app/page-not-found/PageNotFoundComponent.ts
src/app/projects/ProjectsComponent.ts
src/app/projects/ProjectsModule.ts
src/app/projects/project-create-update/ProjectCreateUpdateComponent.ts
src/app/roles/RolesComponent.ts
src/app/roles/RolesModule.ts
src/app/roles/roles-create-edit/RolesCreateEditComponent.ts
src/app/roles/roles-details/RolesDetailsComponent.ts
src/app/sdn-controller/SDNControllerComponent.ts
src/app/sdn-controller/SDNControllerModule.ts
src/app/sdn-controller/sdn-controller-details/SDNControllerDetailsComponent.ts
src/app/user-settings/UserSettingsComponent.ts
src/app/users/UsersComponent.ts
src/app/users/UsersModule.ts
src/app/users/add-user/AddEditUserComponent.ts
src/app/users/project-role/ProjectRoleComponent.ts
src/app/users/user-details/UserDetailsComponent.ts
src/app/utilities/change-password/ChangePasswordComponent.ts
src/app/utilities/change-password/ChangePasswordModule.ts
src/app/utilities/clone-package/ClonePackageComponent.ts
src/app/utilities/compose-packages/ComposePackages.ts
src/app/utilities/confirmation-topology/ConfirmationTopologyComponent.ts
src/app/utilities/dragDropUpload/DragDirective.ts
src/app/utilities/edit-packages/EditPackagesComponent.ts
src/app/utilities/loader/LoaderComponent.ts
src/app/utilities/loader/LoaderModule.ts
src/app/utilities/netslice-instances-action/NetsliceInstancesActionComponent.ts
src/app/utilities/netslice-packages-action/NetslicePackagesActionComponent.ts
src/app/utilities/ns-instances-action/NSInstancesActionComponent.html
src/app/utilities/ns-instances-action/NSInstancesActionComponent.ts
src/app/utilities/ns-packages-action/NsPackagesActionComponent.ts
src/app/utilities/ns-update/NsUpdateComponent.ts
src/app/utilities/osm-repositories-action/OsmRepositoriesActionComponent.ts
src/app/utilities/page-per-row/PagePerRow.ts
src/app/utilities/page-per-row/PagePerRowModule.ts
src/app/utilities/page-reload/PageReload.ts
src/app/utilities/page-reload/PageReloadModule.ts
src/app/utilities/pdu-instances-action/PDUInstancesActionComponent.ts
src/app/utilities/project-link/ProjectLinkComponent.ts
src/app/utilities/projects-action/ProjectsActionComponent.ts
src/app/utilities/roles-action/RolesActionComponent.ts
src/app/utilities/scaling/ScalingComponent.ts
src/app/utilities/sdn-controller-action/SDNControllerActionComponent.ts
src/app/utilities/show-info/ShowInfoComponent.ts
src/app/utilities/start-stop-rebuild/StartStopRebuildComponent.ts
src/app/utilities/switch-project/SwitchProjectComponent.ts
src/app/utilities/users-action/UsersActionComponent.ts
src/app/utilities/vertical-scaling/VerticalScalingComponent.ts
src/app/utilities/vim-accounts-action/VimAccountsActionComponent.ts
src/app/utilities/vm-migration/VmMigrationComponent.ts
src/app/utilities/vnf-instances-action/VNFInstancesActionComponent.ts
src/app/utilities/vnf-packages-action/VNFPackagesActionComponent.ts
src/app/utilities/wim-accounts-action/WIMAccountsActionComponent.ts
src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.html
src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.scss
src/app/vim-accounts/Resources-Overview/ResourcesOverviewComponent.ts
src/app/vim-accounts/Resources-Overview/SharedModule.ts
src/app/vim-accounts/VimAccountsComponent.ts
src/app/vim-accounts/VimAccountsModule.ts
src/app/vim-accounts/info-vim/InfoVimComponent.ts
src/app/vim-accounts/new-vimaccount/NewVimaccountComponent.ts
src/app/vim-accounts/vim-account-details/VimAccountDetailsComponent.ts
src/app/wim-accounts/WIMAccountsComponent.ts
src/app/wim-accounts/WIMAccountsModule.ts
src/app/wim-accounts/new-wim-account/NewWIMAccountComponent.ts
src/app/wim-accounts/wim-account-details/WIMAccountDetailsComponent.ts
src/assets/i18n/de.json
src/assets/i18n/en.json
src/assets/i18n/es.json
src/assets/i18n/pt.json
src/assets/scss/app.scss
src/assets/scss/mixins/_rem.scss
src/assets/scss/style.scss
src/assets/scss/variable.scss
src/directive/GoToTopDirective.ts
src/environments/environment.prod.ts
src/environments/environment.ts
src/models/CommonModel.ts
src/models/NSDModel.ts
src/models/NSInstanceModel.ts
src/models/NetworkSliceModel.ts
src/models/OperationalModel.ts
src/models/VNFDModel.ts
src/models/VimAccountModel.ts
src/polyfills.ts
src/services/AuthGuardService.ts
src/services/AuthInterceptorService.ts
src/services/AuthenticationService.ts
src/services/DataService.ts
src/services/DeviceCheckService.ts
src/services/ProjectService.ts
src/services/RestService.ts
src/services/SharedService.ts
src/test.ts
src/tslint.json [deleted file]
tsconfig.json
tslint.json [deleted file]

diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644 (file)
index 0000000..1e17cd7
--- /dev/null
@@ -0,0 +1,293 @@
+{
+    "root": true,
+    "ignorePatterns": [
+        "package.json"
+    ],
+    "overrides": [
+        {
+            "files": [
+                "*.ts"
+            ],
+            "parser": "@typescript-eslint/parser",
+            "parserOptions": {
+                "project": [
+                    "**/tsconfig.json"
+                ],
+                "createDefaultProgram": true
+            },
+            "env": {
+                "browser": true,
+                "es6": true
+            },
+            "extends": [
+                "plugin:@angular-eslint/ng-cli-compat",
+                "plugin:@angular-eslint/ng-cli-compat--formatting-add-on",
+                "plugin:@angular-eslint/template/process-inline-templates",
+                "plugin:@typescript-eslint/recommended",
+                "plugin:@typescript-eslint/recommended-requiring-type-checking",
+                "plugin:@microsoft/sdl/required",
+                "plugin:@microsoft/sdl/typescript",
+                "plugin:jsx-a11y/recommended",
+                "plugin:security/recommended",
+                "eslint:recommended",
+                "plugin:node/recommended-module"
+            ],
+            "plugins": [
+                "eslint-plugin-jest",
+                "eslint-plugin-no-null",
+                "jsdoc",
+                "@microsoft/sdl",
+                "jsx-a11y",
+                "security",
+                "deprecation",
+                "lodash",
+                "prefer-arrow"
+            ],
+            "rules": {
+                "@typescript-eslint/await-thenable": "error",
+                "@typescript-eslint/consistent-type-definitions": "error",
+                "@typescript-eslint/explicit-member-accessibility": [
+                    "off",
+                    {
+                        "accessibility": "explicit"
+                    }
+                ],
+                "@typescript-eslint/no-empty-function": "error",
+                "@typescript-eslint/no-explicit-any": "warn",
+                "@typescript-eslint/no-floating-promises": "warn",
+                "@typescript-eslint/no-for-in-array": "error",
+                "@typescript-eslint/no-inferrable-types": "off",
+                "@typescript-eslint/no-parameter-properties": "error",
+                "@typescript-eslint/no-require-imports": "error",
+                "@typescript-eslint/no-unnecessary-qualifier": "error",
+                "@typescript-eslint/no-var-requires": "error",
+                "@typescript-eslint/promise-function-async": "error",
+                "@typescript-eslint/restrict-plus-operands": "off",
+                "@typescript-eslint/strict-boolean-expressions": "off",
+                "@typescript-eslint/triple-slash-reference": "error",
+                "@typescript-eslint/type-annotation-spacing": "off",
+                "arrow-parens": [
+                    "error",
+                    "always"
+                ],
+                "brace-style": [
+                    "off",
+                    "off"
+                ],
+                "comma-dangle": "error",
+                "complexity": "error",
+                "default-case": "error",
+                "id-blacklist": "error",
+                "import/no-default-export": "error",
+                "import/order": [
+                    "error",
+                    {
+                        "alphabetize": {
+                            "order": "asc",
+                            "caseInsensitive": true
+                        }
+                    }
+                ],
+                "jest/no-focused-tests": "error",
+                "linebreak-style": "off",
+                "max-classes-per-file": [
+                    "error",
+                    3
+                ],
+                "max-lines": [
+                    "error",
+                    {
+                        "max": 1000,
+                        "skipComments": true,
+                        "skipBlankLines": true
+                    }
+                ],
+                "no-constant-condition": "error",
+                "no-control-regex": "error",
+                "no-empty": "error",
+                "no-extra-semi": "error",
+                "no-invalid-regexp": "error",
+                "no-invalid-this": "error",
+                "no-multi-str": "error",
+                "no-multiple-empty-lines": "error",
+                "no-null/no-null": "off",
+                "no-octal": "error",
+                "no-octal-escape": "error",
+                "no-redeclare": "error",
+                "no-regex-spaces": "error",
+                "no-sparse-arrays": "error",
+                "no-void": "error",
+                "space-before-function-paren": "off",
+                "valid-typeof": "error",
+                "require-jsdoc": [
+                    "error",
+                    {
+                        "require": {
+                            "FunctionDeclaration": true,
+                            "MethodDefinition": false,
+                            "ClassDeclaration": false,
+                            "ArrowFunctionExpression": false,
+                            "FunctionExpression": false
+                        }
+                    }
+                ],
+                "max-statements": [
+                    "error",
+                    100
+                ],
+                "max-len": [
+                    "error",
+                    500
+                ],
+                "@microsoft/sdl/no-cookies": "error",
+                "@typescript-eslint/no-dynamic-delete": "error",
+                "@microsoft/sdl/no-msapp-exec-unsafe": "error",
+                "@microsoft/sdl/no-winjs-html-unsafe": "error",
+                "constructor-super": "error",
+                "padded-blocks": [
+                    "error",
+                    "never"
+                ],
+                "func-style": "error",
+                "@microsoft/sdl/no-insecure-url": [
+                    "error",
+                    {
+                        "blocklist": [
+                            "^(http|ftp):\\/\\/",
+                            "^https:\\/\\/www\\.disallow-example\\.com"
+                        ],
+                        "exceptions": [
+                            "^http:\\/\\/schemas\\.microsoft\\.com\\/\\/?.*"
+                        ]
+                    }
+                ],
+                "@microsoft/sdl/no-insecure-random": "off",
+                "@microsoft/sdl/no-inner-html": "error",
+                "@microsoft/sdl/no-html-method": "error",
+                "@typescript-eslint/no-implied-eval": "error",
+                "no-undef-init": "error",
+                "no-with": "error",
+                "security/detect-non-literal-require": "error",
+                "security/detect-possible-timing-attacks": "error",
+                "@typescript-eslint/no-array-constructor": "error",
+                "@typescript-eslint/method-signature-style": "error",
+                "jsx-a11y/anchor-is-valid": [
+                    "off",
+                    {
+                        "components": [
+                            "Link"
+                        ],
+                        "specialLink": [
+                            "hrefLeft",
+                            "hrefRight"
+                        ],
+                        "aspects": [
+                            "noHref",
+                            "invalidHref",
+                            "preferButton"
+                        ]
+                    }
+                ],
+                "jsx-a11y/aria-unsupported-elements": "error",
+                "jsx-a11y/no-static-element-interactions": "error",
+                "jsx-a11y/alt-text": "error",
+                "jsx-a11y/lang": "error",
+                "jsx-a11y/aria-props": "error",
+                "jsx-a11y/aria-proptypes": "error",
+                "jsx-a11y/aria-role": "error",
+                "jsx-a11y/role-has-required-aria-props": "error",
+                "jsx-a11y/role-supports-aria-props": "error",
+                "jsx-a11y/tabindex-no-positive": "error",
+                "react/jsx-no-target-blank": "error",
+                "@microsoft/sdl/react-iframe-missing-sandbox": "error",
+                "react/no-danger": "error",
+                "react/jsx-curly-spacing": "error",
+                "react/no-unused-state": "error",
+                "lodash/chaining": "error",
+                "@typescript-eslint/ban-types": "off",
+                "deprecation/deprecation": "warn",
+                "@typescript-eslint/naming-convention": [
+                    "warn",
+                    {
+                        "selector": "variableLike",
+                        "format": null
+                    }
+                ],
+                "@typescript-eslint/member-ordering": [
+                    "error",
+                    {
+                        "default": [
+                            "field"
+                        ]
+                    }
+                ],
+                "@typescript-eslint/no-unsafe-member-access": "off",
+                "@typescript-eslint/no-unused-vars": "off",
+                "no-unused-vars": "off",
+                "no-unsafe-finally": "error",
+                "jsdoc/newline-after-description": [
+                    "warn",
+                    "never"
+                ],
+                "@typescript-eslint/unbound-method": "off",
+                "no-underscore-dangle": "off",
+                "no-magic-numbers": "off",
+                "@typescript-eslint/no-magic-numbers": [
+                    "warn",
+                    {
+                        "ignore": [
+                            -1,
+                            0,
+                            1
+                        ],
+                        "ignoreArrayIndexes": true,
+                        "ignoreDefaultValues": true
+                    }
+                ],
+                "@typescript-eslint/no-unsafe-assignment": "off",
+                "prefer-arrow/prefer-arrow-functions": [
+                    "warn",
+                    {
+                        "disallowPrototype": true,
+                        "singleReturnOnly": false,
+                        "classPropertiesAllowed": false
+                    }
+                ],
+                "@angular-eslint/use-lifecycle-interface": "off",
+                "security/detect-non-literal-fs-filename": "error",
+                "@typescript-eslint/no-unsafe-call": "off",
+                "@typescript-eslint/no-unsafe-return": "off",
+                "security/detect-unsafe-regex": "off",
+                "security/detect-non-literal-regexp": "error",
+                "no-console": "error",
+                "sort-keys": "off",
+                "node/no-deprecated-api": [
+                    "warn",
+                    {
+                        "ignoreModuleItems": [
+                            "util.isNullOrUndefined"
+                        ]
+                    }
+                ],
+                "node/no-missing-import": [
+                    "off"
+                ],
+                "@typescript-eslint/member-delimiter-style": "off",
+                "node/no-unsupported-features/node-builtins": [
+                    "off"
+                ],
+                "security/detect-object-injection": "warn"
+            }
+        },
+        {
+            "files": [
+                "*.html"
+            ],
+            "extends": [
+                "plugin:@angular-eslint/template/recommended",
+                "plugin:node/recommended-module"
+            ],
+            "rules": {}
+        }
+    ]
+}
index 3ff03e0..ed13e3d 100644 (file)
@@ -48,6 +48,7 @@ speed-measure-plugin.json
 .history/*
 
 # misc
+/.angular/cache
 /.sass-cache
 /connect.lock
 /coverage
index a8eb6a6..60abb89 100644 (file)
@@ -10,7 +10,6 @@
             "prefix": "app",
             "schematics": {
                 "@schematics/angular:component": {
-                    "styleext": "scss",
                     "style": "scss"
                 }
             },
                         "main": "src/main.ts",
                         "polyfills": "src/polyfills.ts",
                         "tsConfig": "src/tsconfig.app.json",
+                        "allowedCommonJsDependencies": [
+                            "chart.js",
+                            "ng-sidebar",
+                            "@ctrl/ngx-codemirror",
+                            "rbush",
+                            "lodash",
+                            "jsonpath",
+                            "codemirror",
+                            "pako",
+                            "js-untar",
+                            "util",
+                            "http-status-codes",
+                            "js-yaml"
+                        ],
                         "assets": [
                             "src/favicon.ico",
                             "src/assets"
                         ],
                         "scripts": [
                             "src/assets/js/tar.js"
-                        ]
+                        ],
+                        "stylePreprocessorOptions": {
+                            "includePaths": [
+                                "node_modules/"
+                            ]
+                        }
                     },
                     "configurations": {
                         "production": {
                         ]
                     }
                 },
+                "e2e": {
+                    "builder": "@cypress/schematic:cypress",
+                    "options": {
+                        "devServerTarget": "osm:serve",
+                        "watch": true,
+                        "headless": false,
+                        "configFile": "e2e//cypress.config.js"
+                    },
+                    "configurations": {
+                        "production": {
+                            "devServerTarget": "osm:serve:production"
+                        }
+                    }
+                },
                 "lint": {
-                    "builder": "@angular-devkit/build-angular:tslint",
+                    "builder": "@angular-eslint/builder:lint",
                     "options": {
-                        "tsConfig": [
-                            "src/tsconfig.app.json",
-                            "src/tsconfig.spec.json"
-                        ],
-                        "exclude": [
-                            "**/node_modules/**"
+                        "lintFilePatterns": [
+                            "src/**/*.ts",
+                            "src/**/*.html"
                         ]
                     }
                 }
             "prefix": "",
             "architect": {
                 "e2e": {
-                    "builder": "@angular-devkit/build-angular:protractor",
+                    "builder": "@cypress/schematic:cypress",
                     "options": {
-                        "protractorConfig": "e2e/protractor.conf.js",
-                        "devServerTarget": "osm:serve"
+                        "devServerTarget": "osm-e2e:serve",
+                        "watch": true,
+                        "headless": false,
+                        "configFile": "e2e//cypress.config.js"
                     },
                     "configurations": {
                         "production": {
-                            "devServerTarget": "osm:serve:production"
+                            "devServerTarget": "osm-e2e:serve:production"
                         }
                     }
-                },
-                "lint": {
-                    "builder": "@angular-devkit/build-angular:tslint",
-                    "options": {
-                        "tsConfig": "e2e/tsconfig.e2e.json",
-                        "exclude": [
-                            "**/node_modules/**"
-                        ]
-                    }
                 }
             }
         }
     },
-    "defaultProject": "osm"
+    "cli": {
+        "schematicCollections": [
+            "@angular-eslint/schematics"
+        ]
+    }
 }
\ No newline at end of file
index 75ffeca..6101635 100755 (executable)
@@ -16,7 +16,7 @@
 
 
 PKG_DIRECTORIES="nginx src"
-PKG_FILES="angular.json .browserslistrc CONTRIBUTING.md package.json proxy.conf.json tsconfig.json tslint.json LICENSE README.md"
+PKG_FILES=".eslintrc.json angular.json .browserslistrc CONTRIBUTING.md package.json proxy.conf.json tsconfig.json LICENSE README.md"
 MDG_NAME=ngui
 DEB_INSTALL=debian/osm-${MDG_NAME}.install
 export DEBEMAIL="gerardo.garciadeblas@telefonica.com"
index 3f16dec..d4b4cb4 100644 (file)
@@ -1,55 +1,58 @@
 {
   "name": "osm",
-  "version": "9.0.0",
+  "version": "14.0.0",
+  "engines": {
+    "node": ">=14.0.0"
+  },
   "scripts": {
     "ng": "ng",
     "start": "ng serve",
-    "build": "ng build --prod --aot",
+    "build": "ng build --configuration production --aot",
     "test": "ng test",
-    "lint": "tslint --type-check --project tsconfig.json -c tslint.json",
+    "lint": "eslint --ext ts,tsx .",
     "e2e": "ng e2e",
     "proxy": "ng serve --proxy-config proxy.conf.json"
   },
   "private": true,
   "dependencies": {
     "@akveo/ng2-completer": "^9.0.1",
-    "@angular/animations": "~11.0.2",
-    "@angular/cdk": "^7.3.7",
-    "@angular/common": "~11.0.2",
-    "@angular/compiler": "~11.0.2",
-    "@angular/core": "~11.0.2",
+    "@angular/animations": "^14.2.12",
+    "@angular/cdk": "^13.3.9",
+    "@angular/common": "^14.2.12",
+    "@angular/compiler": "^14.2.12",
+    "@angular/core": "^14.2.12",
     "@angular/flex-layout": "^9.0.0-beta.29",
-    "@angular/forms": "~11.0.2",
-    "@angular/localize": "^11.0.2",
-    "@angular/platform-browser": "~11.0.2",
-    "@angular/platform-browser-dynamic": "~11.0.2",
-    "@angular/router": "~11.0.2",
-    "@ctrl/ngx-codemirror": "^2.2.1",
+    "@angular/forms": "^14.2.12",
+    "@angular/localize": "^14.2.12",
+    "@angular/platform-browser": "^14.2.12",
+    "@angular/platform-browser-dynamic": "^14.2.12",
+    "@angular/router": "^14.2.12",
+    "@ctrl/ngx-codemirror": "^5.1.1",
     "@fortawesome/fontawesome-free": "^5.13.0",
-    "@ng-bootstrap/ng-bootstrap": "^5.3.0",
-    "@ng-idle/core": "^8.0.0-beta.4",
-    "@ng-idle/keepalive": "^8.0.0-beta.4",
-    "@ng-select/ng-select": "^3.7.3",
-    "@ngx-translate/core": "^12.1.2",
+    "@ng-bootstrap/ng-bootstrap": "^11.0.1",
+    "@ng-idle/core": "^11.0.3",
+    "@ng-idle/keepalive": "^11.0.3",
+    "@ng-select/ng-select": "^8.0.0",
+    "@ngx-translate/core": "^13.0.0",
     "@ngx-translate/http-loader": "^4.0.0",
     "@nomadreservations/ngx-codemirror": "^2.0.0",
     "@types/d3": "^5.7.2",
     "@types/js-yaml": "^3.12.1",
     "@types/jsonpath": "^0.2.0",
     "@types/ol": "^5.3.5",
-    "angular-notifier": "^6.0.1",
-    "bootstrap": "^4.4.1",
-    "chart.js": "^2.8.0",
-    "chartjs-plugin-labels": "^1.1.0",
+    "angular-notifier": "^9.1.0",
+    "bootstrap": "^4.6.2",
+    "chart.js": "^3.9.1",
+    "chartjs-plugin-datalabels": "^2.2.0",
     "codemirror": "^5.51.0",
-    "core-js": "^2.5.4",
+    "core-js": "^3.27.2",
     "d3": "^5.9.2",
     "http-status-codes": "^1.3.2",
     "js-untar": "^2.0.0",
     "js-yaml": "^3.13.1",
     "jsonpath": "^1.0.2",
     "ng-sidebar": "~9.2.0",
-    "ng2-charts": "^2.4.2",
+    "ng2-charts": "^3.0.0-rc.7",
     "ng2-file-upload": "^1.3.0",
     "ng2-smart-table": "~1.6.0",
     "ol": "^5.3.3",
     "rxjs": "^6.5.4",
     "rxjs-compat": "^6.5.5",
     "stream": "0.0.2",
-    "tslib": "^2.0.0",
-    "web-animations-js": "^2.3.2",
-    "zone.js": "~0.10.0"
+    "tslib": "^2.5.0",
+    "util": "^0.12.4",
+    "zone.js": "~0.11.8",
+    "@popperjs/core": "~2.10.1"
   },
   "devDependencies": {
-    "@angular-devkit/build-angular": "^0.1100.2",
-    "@angular/cli": "~11.0.2",
-    "@angular/compiler-cli": "~11.0.2",
-    "@angular/language-service": "~11.0.2",
-    "@types/jasmine": "~3.6.0",
+    "@angular-devkit/build-angular": "^14.2.10",
+    "@angular-eslint/builder": "13.5.0",
+    "@angular-eslint/eslint-plugin": "13.5.0",
+    "@angular-eslint/eslint-plugin-template": "13.5.0",
+    "@angular-eslint/schematics": "13.5.0",
+    "@angular-eslint/template-parser": "13.5.0",
+    "@angular/cli": "^14.2.10",
+    "@angular/compiler-cli": "^14.2.12",
+    "@angular/language-service": "^14.2.12",
+    "@cypress/schematic": "^2.3.0",
+    "@microsoft/eslint-plugin-sdl": "~0.2.0",
+    "@types/jasmine": "~3.10.0",
     "@types/jasminewd2": "~2.0.3",
     "@types/jquery": "^3.3.31",
     "@types/node": "^8.10.59",
-    "codelyzer": "^6.0.0",
-    "jasmine-core": "~3.6.0",
+    "@typescript-eslint/eslint-plugin": "4.28.2",
+    "@typescript-eslint/parser": "4.28.2",
+    "cypress": "^12.10.0",
+    "eslint": "^7.26.0",
+    "eslint-plugin-compat": "~4.0.2",
+    "eslint-plugin-deprecation": "~1.3.2",
+    "eslint-plugin-import": "~2.26.0",
+    "eslint-plugin-jest": "~27.1.5",
+    "eslint-plugin-jsdoc": "~39.6.2",
+    "eslint-plugin-jsx-a11y": "~6.6.1",
+    "eslint-plugin-lodash": "~7.4.0",
+    "eslint-plugin-no-null": "~1.0.2",
+    "eslint-plugin-prefer-arrow": "~1.2.3",
+    "eslint-plugin-security": "~1.5.0",
+    "jasmine-core": "~4.0.0",
     "jasmine-spec-reporter": "~5.0.0",
-    "karma": "~5.0.0",
+    "karma": "~6.3.0",
     "karma-chrome-launcher": "~3.1.0",
-    "karma-coverage-istanbul-reporter": "~3.0.2",
+    "karma-coverage": "~2.1.0",
     "karma-jasmine": "~4.0.0",
-    "karma-jasmine-html-reporter": "^1.5.0",
+    "karma-jasmine-html-reporter": "~1.7.0",
     "ng2-completer": "^3.0.3",
-    "node-sass": "^5.0.0",
-    "protractor": "~7.0.0",
+    "sass": "^1.58.0",
     "ts-node": "~7.0.0",
-    "tslint": "~6.1.0",
-    "tslint-html-report": "^2.0.3",
-    "tslint-microsoft-contrib": "^6.1.1",
-    "typescript": "~4.0.5"
+    "typescript": "~4.6.2"
   }
 }
diff --git a/src/.eslintrc.json b/src/.eslintrc.json
new file mode 100644 (file)
index 0000000..9c4ba8c
--- /dev/null
@@ -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
index 04ad8d8..4567671 100644 (file)
 /**
  * @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
index 5244bb2..8a4ebaf 100644 (file)
@@ -25,44 +25,34 @@ import { FormsModule, ReactiveFormsModule } from '@angular/forms';
 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 { PageNotFoundComponent } from 'PageNotFound';
 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 { VNFLinkComponent } from 'VNFLinkComponent';
 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 @@ const customNotifierOptions: NotifierOptions = {
         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 @@ export class AppModule {
 /**
  * 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 @@ export function HttpLoaderFactory(http: HttpClient): TranslateHttpLoader {
 /**
  * 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');
index e75416e..537dc94 100644 (file)
@@ -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 @@ export const appRoutes: Routes = [
         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]
index b3e48e4..23e928f 100644 (file)
 /**
  * @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 { Observable, Subscription } from 'rxjs';
 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 @@ export class DashboardComponent implements OnInit {
     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 @@ export class DashboardComponent implements OnInit {
     /** 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 @@ export class DashboardComponent implements OnInit {
                     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 @@ export class DashboardComponent implements OnInit {
         if (this.vimList.length === 0) {
             this.vimListData = null;
         }
-
     }
 
     /** Get Selected VIM details @public */
index 82b27c0..19aae28 100644 (file)
@@ -30,7 +30,7 @@ import { NgSelectModule } from '@ng-select/ng-select';
 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 @@ const routes: Routes = [
  */
 @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 */
index fe46d8c..4186078 100644 (file)
@@ -49,7 +49,9 @@ export class InstancesComponent {
     /** 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
+            });
         }
     }
 }
index 18c733c..0d41509 100644 (file)
@@ -138,23 +138,14 @@ const routes: Routes = [
         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
+      }
 }
index 3b9564a..e04fc20 100644 (file)
@@ -138,12 +138,15 @@ export class NetsliceInstancesComponent implements OnInit {
 
     /** 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 @@ export class NetsliceInstancesComponent implements OnInit {
             }
             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;
index 7f268d1..afbefdb 100644 (file)
@@ -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 { RestService } from 'RestService';
 import { Subscription } from 'rxjs';
 import { SharedService } from 'SharedService';
 import { ShowInfoComponent } from 'ShowInfoComponent';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
@@ -130,9 +130,7 @@ export class HistoryOperationsComponent implements OnInit {
 
   /** 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 @@ export class HistoryOperationsComponent implements OnInit {
   }
   /** 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 @@ export class HistoryOperationsComponent implements OnInit {
       }
       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');
       }
index c44fa9b..5cc5519 100644 (file)
@@ -255,7 +255,9 @@ export class NSInstancesComponent implements OnInit {
             }
             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 @@ export class NSInstancesComponent implements OnInit {
 
     /** 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
+        });
     }
 
     /**
index bcce057..8f39a20 100644 (file)
@@ -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 { KDUPRIMITIVELEVEL, NSData, VDUPRIMITIVELEVEL, VNFPROFILE } from 'NSDMod
 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 @@ export class NSPrimitiveComponent implements OnInit {
             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 @@ export class NSPrimitiveComponent implements OnInit {
     }
     /** 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];
     }
 }
index 668f251..8981e26 100644 (file)
@@ -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 @@ export class NSTopologyComponent {
   /** 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 @@ export class NSTopologyComponent {
   /** 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 @@ export class NSTopologyComponent {
    * 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 @@ export class NSTopologyComponent {
       }, (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 @@ export class NSTopologyComponent {
     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 @@ export class NSTopologyComponent {
     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 @@ export class NSTopologyComponent {
       .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)
index 20b44df..5c25279 100644 (file)
@@ -159,7 +159,9 @@ export class PDUInstancesComponent implements OnInit, OnDestroy {
             }
             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 @@ export class PDUInstancesComponent implements OnInit, OnDestroy {
 
     /** 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
+        });
     }
 
     /**
index 644b83d..2efe244 100644 (file)
@@ -145,13 +145,11 @@ export class AddPDUInstancesComponent implements OnInit {
 
     /** 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());
     }
index fdfe9fa..90bb6fe 100644 (file)
@@ -160,7 +160,9 @@ export class VNFInstancesComponent implements OnInit {
             }
             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;
index 15ea6ff..b582774 100644 (file)
@@ -42,5 +42,4 @@ export class VNFLinkComponent implements OnInit {
   public ngOnInit(): void {
     //empty
   }
-
 }
index 5427a8f..07aa901 100644 (file)
@@ -49,8 +49,9 @@ export class K8sComponent {
   /** 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
+    });
     }
   }
-
 }
index 51f27b2..14d8165 100644 (file)
@@ -96,8 +96,7 @@ const routes: Routes = [
     K8sAddRepoComponent
   ],
   providers: [DataService],
-  schemas: [CUSTOM_ELEMENTS_SCHEMA],
-  entryComponents: [K8sActionComponent, K8sAddClusterComponent, K8sAddRepoComponent]
+  schemas: [CUSTOM_ELEMENTS_SCHEMA]
 })
 /** Exporting a class @exports K8sModule */
 export class K8sModule {
index a524277..f68eff6 100644 (file)
@@ -75,12 +75,15 @@ export class K8sActionComponent{
 
   /** 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 @@ export class K8sActionComponent{
       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,
index aa33193..bad533f 100644 (file)
@@ -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 { environment } from 'environment';
 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 @@ export class K8sAddClusterComponent implements OnInit {
     // 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 @@ export class K8sAddClusterComponent implements OnInit {
     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 @@ export class K8sAddClusterComponent implements OnInit {
     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 @@ export class K8sAddClusterComponent implements OnInit {
     this.fileInputCredentialsLabel.nativeElement.innerText = files[0].name;
     this.fileInputCredentials.nativeElement.value = null;
   }
-
 }
index c8b96bb..700a0c3 100644 (file)
@@ -130,5 +130,4 @@ export class K8sAddRepoComponent implements OnInit {
       this.restService.handleError(error, 'post');
     });
   }
-
 }
index 7ab7583..88a4fb6 100644 (file)
@@ -180,12 +180,15 @@ export class K8sClusterComponent implements OnInit, OnDestroy {
 
   /** 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 @@ export class K8sClusterComponent implements OnInit, OnDestroy {
       this.isLoadingResults = false;
     });
   }
-
 }
index 1b6c9f7..a9626d2 100644 (file)
@@ -141,12 +141,15 @@ export class K8sRepositoryComponent implements OnInit, OnDestroy {
 
   /** 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 @@ export class K8sRepositoryComponent implements OnInit, OnDestroy {
   }
 
   /** 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 @@ export class K8sRepositoryComponent implements OnInit, OnDestroy {
       this.isLoadingResults = false;
     });
   }
-
 }
index e273cda..2b7ca54 100644 (file)
 /**
  * @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 @@ export class BreadcrumbComponent implements OnInit {
   /** 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 @@ export class BreadcrumbComponent implements OnInit {
       return this.translateService.instant('PAGE.DASHBOARD.NETSLICEINSTANCE');
     }
   }
-
 }
index b496ff1..9b4fca6 100644 (file)
@@ -120,6 +120,7 @@ export class HeaderComponent implements OnInit {
 
     /** 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' });
     }
 }
index 9cae634..c328778 100644 (file)
 /**
  * @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 @@ export class SidebarComponent implements OnInit {
     }
     /** 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();
index 8c6f5a3..fae3d20 100644 (file)
@@ -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 { AuthenticationService } from 'AuthenticationService';
 import { RestService } from 'RestService';
 import { Observable } from 'rxjs';
 import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
index ae2a13c..edb972a 100644 (file)
@@ -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 { Observable } from 'rxjs';
 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 @@ export class OperationalViewComponent implements OnInit {
     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 @@ export class OperationalViewComponent implements OnInit {
      * 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 @@ export class OperationalViewComponent implements OnInit {
         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 @@ export class OperationalViewComponent implements OnInit {
             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 @@ export class OperationalViewComponent implements OnInit {
         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 @@ export class OperationalViewComponent implements OnInit {
     }
     /** 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 };
     }
index 5a4f48e..acee5ed 100644 (file)
 /**
  * @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 @@ export class OperationalViewAppActionsComponent implements OnInit {
       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]
         }));
     }
index 1e1b453..4d40d2c 100644 (file)
 /**
  * @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 @@ export class OperationalViewAppConfigsComponent implements OnInit {
       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
         }));
     }
index af39f79..d761653 100644 (file)
 /**
  * @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
index 5f42eee..4c85f8c 100644 (file)
@@ -49,7 +49,9 @@ export class OsmRepositoriesComponent{
   /** 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
+    });
     }
   }
 }
index 20901e4..a630f5d 100644 (file)
@@ -62,16 +62,12 @@ const routes: Routes = [
 /**
  * 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 */
index 3415484..f249470 100644 (file)
@@ -167,13 +167,16 @@ export class OsmRepositoriesDetailsComponent implements OnInit {
 
   /** 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 @@ export class OsmRepositoriesDetailsComponent implements OnInit {
       });
       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;
index eb9991d..6dcf10e 100644 (file)
@@ -49,7 +49,9 @@ export class PackagesComponent{
     /** 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
+            });
         }
     }
 }
index e6c6628..5a8ea2e 100644 (file)
@@ -117,8 +117,7 @@ const routes: Routes = [
     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 {
index 330edf8..fb0abda 100644 (file)
@@ -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 { NetworkSliceData } from 'NetworkSliceModel';
 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 @@ export class InstantiateNetSliceTemplateComponent implements OnInit {
       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 @@ export class InstantiateNetSliceTemplateComponent implements OnInit {
       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 @@ export class InstantiateNetSliceTemplateComponent implements OnInit {
         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 @@ export class InstantiateNetSliceTemplateComponent implements OnInit {
     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 @@ export class InstantiateNetSliceTemplateComponent implements OnInit {
       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 @@ export class InstantiateNetSliceTemplateComponent implements OnInit {
       } 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') {
index 1043f9a..e0798d1 100644 (file)
@@ -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 * as jsyaml from 'js-yaml';
 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 @@ export class InstantiateNsComponent implements OnInit {
       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 @@ export class InstantiateNsComponent implements OnInit {
       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 @@ export class InstantiateNsComponent implements OnInit {
       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 @@ export class InstantiateNsComponent implements OnInit {
     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 @@ export class InstantiateNsComponent implements OnInit {
       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 @@ export class InstantiateNsComponent implements OnInit {
       } 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') {
index 7302ea4..8960497 100644 (file)
@@ -246,6 +246,7 @@ export class NSPackagesComponent implements OnInit {
     }
     /** 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' };
     }
 
index d771123..8d28f3a 100644 (file)
@@ -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 @@ import {
 } from 'NSDModel';
 import { RestService } from 'RestService';
 import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
 import { VNFD, VNFData } from 'VNFDModel';
 
 /**
@@ -124,31 +124,31 @@ export class NSComposerComponent {
   /** 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 @@ export class NSComposerComponent {
   /** 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 @@ export class NSComposerComponent {
   }
   /** 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 @@ export class NSComposerComponent {
     });
   }
   /** 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 @@ export class NSComposerComponent {
   }
   /** 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 @@ export class NSComposerComponent {
       if (result) {
         // empty
       }
-    }).catch();
+    }).catch((): void => {
+      // Catch Navigation Error
+  });
   }
   /** Event to freeze the animation @public */
   public onFreeze(): void {
@@ -459,7 +461,9 @@ export class NSComposerComponent {
       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 @@ export class NSComposerComponent {
       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 @@ export class NSComposerComponent {
       .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 @@ export class NSComposerComponent {
       .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 @@ export class NSComposerComponent {
       .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 @@ export class NSComposerComponent {
       });
     }
     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 @@ export class NSComposerComponent {
         } else {
           this.deselectPath();
         }
-      }).catch();
+      }).catch((): void => {
+        // Catch Navigation Error
+    });
     } else {
       this.deselectPath();
       this.notifierService.notify('error', this.translateService.instant('ERROR'));
@@ -819,6 +830,7 @@ export class NSComposerComponent {
   }
   /** 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 @@ export class NSComposerComponent {
     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 @@ export class NSComposerComponent {
   }
   /** 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 @@ export class NSComposerComponent {
       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 @@ export class NSComposerComponent {
   }
   /** 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 @@ export class NSComposerComponent {
       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 @@ export class NSComposerComponent {
       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 @@ export class NSComposerComponent {
                 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 @@ export class NSComposerComponent {
           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 @@ export class NSComposerComponent {
     });
   }
   /** 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)
index 55c5070..eabd2b7 100644 (file)
@@ -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 @@ export class VNFComposerComponent {
   /** 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 @@ export class VNFComposerComponent {
   /** 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 @@ export class VNFComposerComponent {
    * 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 @@ export class VNFComposerComponent {
       }, (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 @@ export class VNFComposerComponent {
     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 @@ export class VNFComposerComponent {
   }
   /** 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 @@ export class VNFComposerComponent {
       if (result) {
         // empty
       }
-    }).catch();
+    }).catch((): void => {
+      // Catch Navigation Error
+  });
   }
   /** Event to freeze the animation @public */
   public onFreeze(): void {
@@ -562,7 +569,7 @@ export class VNFComposerComponent {
       .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 @@ export class VNFComposerComponent {
       .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 @@ export class VNFComposerComponent {
       .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 @@ export class VNFComposerComponent {
       .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 @@ export class VNFComposerComponent {
   }
   /** 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 @@ export class VNFComposerComponent {
                     }
                   ]
                 });
+                // eslint-disable-next-line security/detect-object-injection
                 this.vnfdPackageDetails['ext-cpd'][index] = {
                   id: extcpd.id,
                   'int-cpd': {
@@ -882,7 +891,7 @@ export class VNFComposerComponent {
     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 @@ export class VNFComposerComponent {
     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 @@ export class VNFComposerComponent {
       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 @@ export class VNFComposerComponent {
             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 @@ export class VNFComposerComponent {
           }
         } 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 @@ export class VNFComposerComponent {
     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();
index 8169782..fc85d71 100644 (file)
@@ -238,6 +238,7 @@ export class VNFPackagesComponent implements OnInit {
     }
     /** 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' };
     }
 
index ef515ec..2842f0e 100644 (file)
@@ -38,5 +38,4 @@ export class PageNotFoundComponent implements OnInit {
     public ngOnInit(): void {
         //donothing
     }
-
 }
index 052e639..982421e 100644 (file)
@@ -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 { ProjectsActionComponent } from 'ProjectsAction';
 import { RestService } from 'RestService';
 import { Subscription } from 'rxjs';
 import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
@@ -146,13 +146,16 @@ export class ProjectsComponent implements OnInit, OnDestroy {
 
     /** 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 @@ export class ProjectsComponent implements OnInit, OnDestroy {
             });
             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;
index 16147b9..22bbc27 100644 (file)
@@ -52,7 +52,6 @@ const routes: Routes = [
 /**
  * Creating @NgModule component for Modules
  */
-// tslint:disable-next-line: no-stateless-class
 @NgModule({
     imports: [
         FormsModule,
@@ -75,9 +74,6 @@ const routes: Routes = [
     ],
     providers: [
         DataService
-    ],
-    entryComponents: [
-        ProjectCreateUpdateComponent
     ]
 })
 /** Exporting a class @exports ProjectsModule */
index bb1207a..9f8cc83 100644 (file)
@@ -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 { ProjectData, ProjectDetails, QUOTAITEM, QUOTA_ITEMS } from 'ProjectMode
 import { ProjectService } from 'ProjectService';
 import { RestService } from 'RestService';
 import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
@@ -245,6 +245,7 @@ export class ProjectCreateUpdateComponent implements OnInit {
 
     /** 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];
     }
 
index 82f20b4..49819b4 100644 (file)
@@ -51,8 +51,9 @@ export class RolesComponent {
   /** 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
+    });
     }
   }
-
 }
index 88e1225..1e2c7ff 100644 (file)
@@ -75,8 +75,7 @@ const routes: Routes = [
 @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
index 0419c5f..87e1b86 100644 (file)
@@ -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 * as jsonpath from 'jsonpath';
 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 @@ export class RolesCreateEditComponent implements OnInit {
     };
     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 @@ export class RolesCreateEditComponent implements OnInit {
     };
     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 @@ export class RolesCreateEditComponent implements OnInit {
       }
       this.viewMode = 'text';
     }
-
   }
 
   /** Generate role permission post data @private */
@@ -282,6 +285,7 @@ export class RolesCreateEditComponent implements OnInit {
         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 @@ export class RolesCreateEditComponent implements OnInit {
 
   /** 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 @@ export class RolesCreateEditComponent implements OnInit {
         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 @@ export class RolesCreateEditComponent implements OnInit {
     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 @@ export class RolesCreateEditComponent implements OnInit {
       });
     });
   }
-
 }
index 89affae..9c2e3e3 100644 (file)
@@ -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 { RolesActionComponent } from 'RolesAction';
 import { RoleData, RoleDetails } from 'RolesModel';
 import { Subscription } from 'rxjs';
 import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
@@ -159,7 +159,9 @@ export class RolesDetailsComponent implements OnInit {
       });
       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 @@ export class RolesDetailsComponent implements OnInit {
   public ngOnDestroy(): void {
     this.generateDataSub.unsubscribe();
   }
-
 }
index 661882c..247553a 100644 (file)
@@ -49,7 +49,9 @@ export class SDNControllerComponent {
     /** 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
+            });
         }
     }
 }
index 6da4a5c..9b2f523 100644 (file)
@@ -68,7 +68,6 @@ const routes: Routes = [
         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 @@ export class SDNControllerModule {
     /**
      * Lifecyle Hooks the trigger before component is instantiate
      */
-    public ngOnInit(): void {
-        //Empty Class
-    }
+     constructor() {
+        //Empty
+      }
 }
index 589f13e..ef2f350 100644 (file)
@@ -206,12 +206,15 @@ export class SDNControllerDetailsComponent implements OnInit, OnDestroy {
 
     /** 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 @@ export class SDNControllerDetailsComponent implements OnInit, OnDestroy {
             }
             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;
         });
     }
-
 }
index 19b525f..5212eb5 100644 (file)
@@ -83,10 +83,8 @@ export class UserSettingsComponent implements OnInit {
         });
         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');
         }
     }
index 178b979..b14c2e7 100644 (file)
@@ -49,7 +49,9 @@ export class UsersComponent {
     /** 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
+            });
         }
     }
 }
index 8b5f316..2294886 100644 (file)
@@ -63,15 +63,14 @@ const routes: Routes = [
         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
+      }
 }
index 0e9456a..076cfba 100644 (file)
@@ -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 { APIURLHEADER, ERRORDATA, LOGINPARAMS, MODALCLOSERESPONSEDATA, TYPESECTI
 import { environment } from 'environment';
 import { RestService } from 'RestService';
 import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
@@ -265,6 +265,7 @@ export class AddEditUserComponent implements OnInit {
 
     /** 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];
     }
 
index 600cecd..3a7e612 100644 (file)
@@ -141,7 +141,6 @@ export class ProjectRoleComponent implements OnInit {
 
     /** 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 @@ export class ProjectRoleComponent implements OnInit {
     /** 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 @@ export class ProjectRoleComponent implements OnInit {
 
     /** 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);
     }
index aede6e2..ba24454 100644 (file)
@@ -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 { Subscription } from 'rxjs';
 import { SharedService } from 'SharedService';
 import { UserData, UserDetail } from 'UserModel';
 import { UsersActionComponent } from 'UsersActionComponent';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
@@ -146,6 +146,7 @@ export class UserDetailsComponent implements OnInit, OnDestroy {
 
   /** 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 @@ export class UserDetailsComponent implements OnInit, OnDestroy {
       if (result) {
         this.sharedService.callData();
       }
-    }).catch();
+    }).catch((): void => {
+      // Catch Navigation Error
+    });
   }
 
   /** smart table listing manipulation @private */
@@ -206,7 +209,9 @@ export class UserDetailsComponent implements OnInit, OnDestroy {
       }
       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;
index a2036ff..4c6aa5a 100644 (file)
@@ -59,6 +59,7 @@ export class ChangePasswordComponent implements OnInit {
 
     /** 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 @@ export class ChangePasswordComponent implements OnInit {
         }).catch((err: Error): void => { // catch error
         });
     }
-
 }
index bd64f9e..6c0524a 100644 (file)
@@ -32,8 +32,7 @@ import { LoaderModule } from 'LoaderModule';
 @NgModule({
     imports: [CommonModule, TranslateModule, FormsModule, ReactiveFormsModule, NgSelectModule, LoaderModule],
     declarations: [AddEditUserComponent],
-    exports: [AddEditUserComponent],
-    entryComponents: [AddEditUserComponent]
+    exports: [AddEditUserComponent]
 })
 /** Exporting a class @exports ChangePasswordModule */
 export class ChangePasswordModule {
index 125a726..02db8d8 100644 (file)
@@ -163,7 +163,6 @@ export class ClonePackageComponent implements OnInit {
           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;
index c621215..6f2a031 100644 (file)
@@ -34,7 +34,7 @@ import { RestService } from 'RestService';
 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 @@ declare const Tar: any;
   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 @@ export class ComposePackages implements OnInit {
       }
       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 @@ export class ComposePackages implements OnInit {
       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();
index 735ac7c..d052b3f 100644 (file)
@@ -31,7 +31,6 @@ export interface FileHandle {
  * Creating Directive
  * @Directive for handling the files.
  */
-// tslint:disable-next-line:export-name
 @Directive({
   selector: '[appDrag]'
 })
@@ -77,6 +76,7 @@ export class DragDirective {
     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 });
     });
index e38d3cf..42998b8 100644 (file)
@@ -90,6 +90,7 @@ export class EditPackagesComponent implements OnInit {
 
   /** options @public */
   public options: {} = {
+    // eslint-disable-next-line no-invalid-this
     mode: this.modeDefault,
     showCursorWhenSelecting: true,
     autofocus: true,
@@ -172,9 +173,7 @@ export class EditPackagesComponent implements OnInit {
       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 @@ export class EditPackagesComponent implements OnInit {
         (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 @@ export class EditPackagesComponent implements OnInit {
     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');
         }
index ee8cab8..4190a7d 100644 (file)
@@ -46,5 +46,4 @@ export class LoaderComponent implements OnInit {
       this.getMessage = '';
     }
   }
-
 }
index ba81b6a..e235be0 100644 (file)
@@ -35,7 +35,7 @@ export class LoaderModule {
   /**
    * Lifecyle Hooks the trigger before component is instantiate
    */
-  public ngOnInit(): void {
-    // Empty Block
+   constructor() {
+    //Empty
   }
 }
index 0e528a8..ab7d51f 100644 (file)
@@ -69,6 +69,7 @@ export class NetsliceInstancesActionComponent {
 
     /** 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 @@ export class NetsliceInstancesActionComponent {
 
     /** 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 {
index 8be5f50..78e6e51 100644 (file)
@@ -71,16 +71,20 @@ export class NetslicePackagesActionComponent {
 
     /** 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 @@ export class NetslicePackagesActionComponent {
 
     /** 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' });
     }
 }
index 3ac6a60..517dbde 100644 (file)
@@ -29,7 +29,7 @@ Author: KUMARAN M (kumaran.m@tataelxsi.co.in), RAJESH S (rajesh.s@tataelxsi.co.i
         <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>
index 5f9d5e3..ea7fa61 100644 (file)
@@ -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 { ScalingComponent } from 'ScalingComponent';
 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 @@ export class NSInstancesActionComponent {
   /** 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 @@ export class NSInstancesActionComponent {
   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 @@ export class NSInstancesActionComponent {
     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 @@ export class NSInstancesActionComponent {
 
   /** 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 @@ export class NSInstancesActionComponent {
 
   /** 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 @@ export class NSInstancesActionComponent {
               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 @@ export class NSInstancesActionComponent {
 
   /** 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 @@ export class NSInstancesActionComponent {
       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 @@ export class NSInstancesActionComponent {
       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 @@ export class NSInstancesActionComponent {
       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 @@ export class NSInstancesActionComponent {
       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 @@ export class NSInstancesActionComponent {
       if (result) {
         this.sharedService.callData();
       }
-    }).catch();
+    }).catch((): void => {
+      // Catch Navigation Error
+  });
   }
 
   /**
index 18f3e5a..a673e15 100644 (file)
@@ -89,6 +89,7 @@ export class NsPackagesActionComponent {
   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 @@ export class NsPackagesActionComponent {
 
   /** 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 @@ export class NsPackagesActionComponent {
 
   /** 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 @@ export class NsPackagesActionComponent {
 
   /** 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
+  });
   }
 }
index 80773e2..b33bfc4 100644 (file)
@@ -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 { environment } from 'environment';
 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 @@ export class NsUpdateComponent implements OnInit {
                 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 @@ export class NsUpdateComponent implements OnInit {
         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 @@ export class NsUpdateComponent implements OnInit {
         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 @@ export class NsUpdateComponent implements OnInit {
                 if (result.message === CONFIGCONSTANT.done) {
                     this.onSubmit();
                 }
-            }).catch((): void => { //empty
-             });
+            }).catch((): void => {
+                // Catch Navigation Error
+            });
         }
         this.isLoadingResults = false;
     }
@@ -272,11 +280,14 @@ export class NsUpdateComponent implements OnInit {
                 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 @@ export class NsUpdateComponent implements OnInit {
                      }
                     );
                 } 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 @@ export class NsUpdateComponent implements OnInit {
         };
         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 @@ export class NsUpdateComponent implements OnInit {
 
     /** 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];
     }
 }
index 1f3523d..ed56040 100644 (file)
@@ -68,16 +68,20 @@ export class OsmRepositoriesActionComponent implements OnInit {
 
   /** 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 @@ export class OsmRepositoriesActionComponent implements OnInit {
       if (result) {
         this.sharedService.callData();
       }
-    }).catch();
+    }).catch((): void => {
+      // Catch Navigation Error
+  });
   }
 }
index 6794bfc..4d7f58e 100644 (file)
@@ -29,11 +29,13 @@ import { SharedService } from 'SharedService';
  * @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;
index e5b8a29..66d62cb 100644 (file)
@@ -36,7 +36,7 @@ export class PagePerRowModule {
     /**
      * Lifecyle Hooks the trigger before component is instantiate
      */
-    public ngOnInit(): void {
-        // Empty Block
-    }
+     constructor() {
+        //Empty
+      }
 }
index 0ea3c3c..f63d59d 100644 (file)
@@ -26,11 +26,13 @@ import { SharedService } from 'SharedService';
  * @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;
index 56c35fd..983f939 100644 (file)
@@ -37,7 +37,7 @@ export class PageReloadModule {
     /**
      * Lifecyle Hooks the trigger before component is instantiate
      */
-    public ngOnInit(): void {
-        // Empty Block
-    }
+     constructor() {
+        //Empty
+      }
 }
index 8cfb6cf..3c32488 100644 (file)
@@ -69,16 +69,20 @@ export class PDUInstancesActionComponent {
 
     /** 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',
index 35c5b2c..5f956f2 100644 (file)
@@ -47,6 +47,7 @@ export class ProjectLinkComponent implements OnInit {
   /** 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 @@ export class ProjectLinkComponent implements OnInit {
       }, this.timeOut);
     });
   }
-
 }
index 207d90c..4f9738f 100644 (file)
@@ -57,22 +57,28 @@ export class ProjectsActionComponent {
 
     /** 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
+        });
     }
 }
index 5b4d85b..50eb279 100644 (file)
@@ -61,12 +61,15 @@ export class RolesActionComponent {
 
   /** 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 @@ export class RolesActionComponent {
       // Catch Navigation Error
     });
   }
-
 }
index 111c3b8..ff5ec06 100644 (file)
@@ -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 { environment } from 'environment';
 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 @@ export class ScalingComponent implements OnInit {
         };
         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 @@ export class ScalingComponent implements OnInit {
 
     /** 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];
     }
 }
index cbf3fc1..01796b8 100644 (file)
@@ -65,6 +65,7 @@ export class SDNControllerActionComponent {
 
     /** 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 @@ export class SDNControllerActionComponent {
 
     /** 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
+        });
     }
 }
index 0fb22e7..015d50c 100644 (file)
@@ -81,6 +81,7 @@ export class ShowInfoComponent implements OnInit {
 
   /** variables to hold options of editor @public */
   public options: {} = {
+    // eslint-disable-next-line no-invalid-this
     mode: this.modeDefault,
     showCursorWhenSelecting: true,
     autofocus: true,
index 4b0afe0..bde04ba 100644 (file)
@@ -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 { environment } from 'environment';
 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 @@ export class StartStopRebuildComponent implements OnInit {
                 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 @@ export class StartStopRebuildComponent implements OnInit {
                     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 @@ export class StartStopRebuildComponent implements OnInit {
                         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 @@ export class StartStopRebuildComponent implements OnInit {
     /** 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 @@ export class StartStopRebuildComponent implements OnInit {
         };
         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 @@ export class StartStopRebuildComponent implements OnInit {
 
     /** 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];
     }
 }
index dffb63a..f3dffcb 100644 (file)
@@ -134,7 +134,9 @@ export class SwitchProjectComponent implements OnInit {
           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();
           }
index 1d8e895..cb0b462 100644 (file)
@@ -61,16 +61,20 @@ export class UsersActionComponent {
 
     /** 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 @@ export class UsersActionComponent {
             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 @@ export class UsersActionComponent {
             if (result) {
                 this.sharedService.callData();
             }
-        }).catch();
+        }).catch((): void => {
+            // Catch Navigation Error
+        });
     }
 }
index 949506a..4d96f8a 100644 (file)
@@ -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 { environment } from 'environment';
 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 @@ export class VerticalScalingComponent implements OnInit {
     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 @@ export class VerticalScalingComponent implements OnInit {
                 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 @@ export class VerticalScalingComponent implements OnInit {
                     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 @@ export class VerticalScalingComponent implements OnInit {
                         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 @@ export class VerticalScalingComponent implements OnInit {
     /** 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 @@ export class VerticalScalingComponent implements OnInit {
         };
         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 @@ export class VerticalScalingComponent implements OnInit {
 
     /** 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];
     }
 }
index ffa0340..e3657ad 100644 (file)
@@ -76,12 +76,15 @@ export class VimAccountsActionComponent implements OnInit {
 
     /** 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 @@ export class VimAccountsActionComponent implements OnInit {
 
     /** 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;
     }
index 7ac8af0..e53ea11 100644 (file)
@@ -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 { environment } from 'environment';
 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 @@ export class VmMigrationComponent implements OnInit {
     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 @@ export class VmMigrationComponent implements OnInit {
                 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 @@ export class VmMigrationComponent implements OnInit {
                 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 @@ export class VmMigrationComponent implements OnInit {
                         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 @@ export class VmMigrationComponent implements OnInit {
     /** 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 @@ export class VmMigrationComponent implements OnInit {
             };
         }
         this.migrationInitialization(migrationPayload);
-
     }
 
     /** Initialize the Vm Migration operation @public */
@@ -232,7 +238,9 @@ export class VmMigrationComponent implements OnInit {
         };
         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 @@ export class VmMigrationComponent implements OnInit {
 
     /** 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];
     }
 }
index d3a95f2..0cc2284 100644 (file)
@@ -58,6 +58,7 @@ export class VNFInstancesActionComponent {
 
     /** 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',
index cd0d2dc..14b5ec0 100644 (file)
@@ -86,6 +86,7 @@ export class VNFPackagesActionComponent {
   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 @@ export class VNFPackagesActionComponent {
 
   /** 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 @@ export class VNFPackagesActionComponent {
 
   /** 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 @@ export class VNFPackagesActionComponent {
 
   /** 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 @@ export class VNFPackagesActionComponent {
 
   /** 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
+  });
   }
 }
index 0769863..d5f3ebd 100644 (file)
@@ -65,6 +65,7 @@ export class WIMAccountsActionComponent {
 
     /** 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 @@ export class WIMAccountsActionComponent {
 
     /** 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
+        });
     }
 }
index 483fc0b..8c75d25 100644 (file)
@@ -35,14 +35,14 @@ Author: SANDHYA JS (sandhya.j@tataelxsi.co.in)
                 <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>
index 721e8ad..1ffd10c 100644 (file)
@@ -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 {
index 2d21ade..11d48d7 100644 (file)
  */
 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 @@ export class ResourcesOverviewComponent implements OnChanges {
     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 @@ export class ResourcesOverviewComponent implements OnChanges {
         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 @@ export class ResourcesOverviewComponent implements OnChanges {
             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 @@ export class ResourcesOverviewComponent implements OnChanges {
      * @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}]
         };
     }
     /**
index 1b365f3..5f4d726 100644 (file)
 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 {
index 9951cfc..b7e930c 100644 (file)
@@ -50,7 +50,9 @@ export class VimAccountsComponent {
     /** 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
+            });
         }
     }
 }
index c646857..df86659 100644 (file)
@@ -83,8 +83,7 @@ const routes: Routes = [
         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 {
index 952c1dc..b89a1b9 100644 (file)
@@ -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 { DataService } from 'DataService';
 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 @@ export class InfoVimComponent implements OnInit {
    * 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 @@ export class InfoVimComponent implements OnInit {
       .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');
         }
index daa9332..a57b782 100644 (file)
@@ -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 { environment } from 'environment';
 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 @@ export class NewVimaccountComponent implements OnInit {
 
   /** options @public */
   public options: {} = {
+    // eslint-disable-next-line no-invalid-this
     mode: this.modeDefault,
     showCursorWhenSelecting: true,
     autofocus: true,
@@ -208,6 +209,7 @@ export class NewVimaccountComponent implements OnInit {
       } 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 @@ export class NewVimaccountComponent implements OnInit {
       }
 
       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];
         }
       });
index f580e8a..ac0b502 100644 (file)
@@ -352,7 +352,9 @@ export class VimAccountDetailsComponent implements OnInit {
     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 @@ export class VimAccountDetailsComponent implements OnInit {
     }
     /** 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 @@ export class VimAccountDetailsComponent implements OnInit {
         };
     }
     /** 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>';
index 5914f30..4a46bd7 100644 (file)
@@ -49,7 +49,9 @@ export class WIMAccountsComponent {
     /** 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
+            });
         }
     }
 }
index 088502f..407bafd 100644 (file)
@@ -67,8 +67,7 @@ const routes: Routes = [
         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 {
index 5b8e29a..65ae937 100644 (file)
@@ -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 { environment } from 'environment';
 import * as jsyaml from 'js-yaml';
 import { RestService } from 'RestService';
 import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
 
 /**
  * Creating component
@@ -169,7 +169,6 @@ export class NewWIMAccountComponent implements OnInit {
     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') {
index b1d16f7..927e54e 100644 (file)
@@ -195,12 +195,15 @@ export class WIMAccountDetailsComponent implements OnInit, OnDestroy {
 
     /** 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 @@ export class WIMAccountDetailsComponent implements OnInit, OnDestroy {
             }
             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;
index dc1d2a0..5070068 100644 (file)
             "DETAILS": "SDN-Controller-Details"
         },
         "USERS": {
-            "CREATEUSER": "Gebruiker aanmaken",
+            "CREATEUSER": "Nieuwe gebruiker",
             "NEWUSER": "Neuer Benutzer",
             "USERNAME": "Nutzername",
             "PASSWORD": "Passwort",
             "EXECUTEDSUCCESSFULLY": "NS Primitive Configuration ausgeführt"
         },
         "ROLES": {
-            "CREATEROLE": "Rolle erstellen",
+            "CREATEROLE": "Neue Rolle",
             "ROLE": "Rolle",
             "PERMISSIONS": "Berechtigungen",
             "YAMLPERMISSIONS": "YAML Berechtigungen",
index cb4ac32..659c0f5 100644 (file)
             "DETAILS": "SDN Controller Details"
         },
         "USERS": {
-            "CREATEUSER": "Create User",
+            "CREATEUSER": "New User",
             "NEWUSER": "New User",
             "USERNAME": "User Name",
             "PASSWORD": "Password",
             "EXECUTEDSUCCESSFULLY": "Executed NS Primitive Configuration"
         },
         "ROLES": {
-            "CREATEROLE": "Create Role",
+            "CREATEROLE": "New Role",
             "ROLE": "Role",
             "PERMISSIONS": "Permissions",
             "YAMLPERMISSIONS": "YAML Permissions",
index e4331c4..f8dfce6 100644 (file)
             "DETAILS": "Detalles del controlador SDN"
         },
         "USERS": {
-            "CREATEUSER": "Crear usuario",
+            "CREATEUSER": "Nuevo usuario",
             "NEWUSER": "Nuevo usuario",
             "USERNAME": "Nombre de usuario",
             "PASSWORD": "Contraseña",
             "EXECUTEDSUCCESSFULLY": "Ejecutada NS Configuración primitiva"
         },
         "ROLES": {
-            "CREATEROLE": "Crear rol",
+            "CREATEROLE": "Nuevo rol",
             "ROLE": "Rol",
             "PERMISSIONS": "Permisos",
             "YAMLPERMISSIONS": "YAML Permisos",
index 160ef8d..a37d187 100644 (file)
             "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",
             "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",
index 2e2eb92..cb96c93 100644 (file)
  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 @@ body {
   }
   .resources-chart-popover {
     max-width: 60% !important;
+    width: 600px !important;
     @include font-family("Roboto");
     .popover-body {
       max-height: 60vh;
index 960132a..4abd417 100644 (file)
@@ -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);
index d39843b..0fb1c39 100644 (file)
  */
 /*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
index 6a274ce..3af9d3b 100644 (file)
@@ -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 @@ $grayish-red: #c1bfbf !default;
 $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 @@ $h3-font-size: 24px !default;
 $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
index 67cdc96..06a2462 100644 (file)
@@ -32,6 +32,7 @@ import { SharedService } from 'SharedService';
 /** 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 @@ export class GoToTopDirective {
    * 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 @@ export class GoToTopDirective {
       this.sharedService.showGotoTop = false;
     }
   }
-
 }
index 440bfd1..9ab1c1f 100644 (file)
@@ -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 @@ const ASSETS_PATH: string = 'assets/';
 /** 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',
index e3acd4f..bd45964 100644 (file)
@@ -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 @@ const ASSETS_PATH: string = 'assets/';
 /** 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',
index a33e6f3..ed35029 100644 (file)
@@ -23,7 +23,7 @@ import { VNFD } from 'VNFDModel';
 /**
  * @file  Model for Commonly used information.
  */
-// tslint:disable: completed-docs
+/* eslint-disable */
 /**
  * handle count @enum
  */
@@ -198,7 +198,6 @@ export interface BREADCRUMBITEM {
 }
 /** 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 */
index 48e7387..f8b3d9d 100644 (file)
@@ -18,7 +18,6 @@
 /**
  * @file  Model for NSD related information.
  */
-// tslint:disable: completed-docs
 import { VNFDAdminDetails } from './VNFDModel';
 
 /** Interface for NSData */
index 66294cf..12ce977 100644 (file)
@@ -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 ROAdmin {
 }
 
 /** Interface for _Admin */
-// tslint:disable-next-line:class-name
 interface _Admin {
     'projects_write': string[];
     deployed: DeployedAdmin;
@@ -114,7 +113,6 @@ export interface NSD {
 }
 
 /** Interface for _AdminDetails */
-// tslint:disable-next-line:class-name
 export interface _AdminDetails {
     usageState: string;
     projects_write: string[];
index eda0b92..baa79be 100644 (file)
@@ -76,7 +76,6 @@ interface NetsliceVld {
     id: string;
     'nss-connection-point-ref': NssConnectionPointRef[];
     'mgmt-network': boolean;
-    // tslint:disable-next-line:no-reserved-keywords
     type: string;
 }
 
index 79f248e..14de20b 100644 (file)
@@ -20,7 +20,6 @@
  * @file  Model for Operational view JUJU information.
  */
 
-// tslint:disable: completed-docs
 
 /** Interface for the VCASTATUS */
 export interface VCASTATUS {
index 339dd02..6eafe39 100644 (file)
@@ -18,7 +18,6 @@
 /**
  * @file  Model for VNFD related information.
  */
-// tslint:disable: completed-docs
 /** Interface for Project */
 export interface ProjectModel {
     project_id: string;
index 159b2c9..4337276 100644 (file)
@@ -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 RESOURCESDATA {
 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 {
index 9d349d1..0d0c045 100644 (file)
@@ -38,17 +38,7 @@ import '@angular/localize/init';
 
 /***************************************************************************************************
  * 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 'web-animations-js';  // Run `npm install --save web-animations-js`.
  */
 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
  */
index 2effeca..512705f 100644 (file)
@@ -45,6 +45,7 @@ export class AuthGuardService implements CanActivate {
      * 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 @@ export class AuthGuardService implements CanActivate {
                 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;
                 }
index 8c5a9d7..d2166e3 100644 (file)
@@ -66,11 +66,11 @@ export class AuthInterceptorService implements HttpInterceptor {
      * @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 @@ export class AuthInterceptorService implements HttpInterceptor {
     }
 
     /** 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({
index 0399c59..5eda6f9 100644 (file)
@@ -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 { APIURLHEADER, ERRORDATA } from 'CommonModel';
 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 @@ export class AuthenticationService {
         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 @@ export class AuthenticationService {
         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
+            });
         }
     }
 }
index e64c34c..0e3be87 100644 (file)
@@ -32,6 +32,7 @@ export class DataService {
     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 {
index 98ab2fc..cf4d5dd 100644 (file)
@@ -38,12 +38,12 @@ export class DeviceCheckService {
 
     /** 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);
index c22f33a..4206ea4 100644 (file)
@@ -108,6 +108,7 @@ export class ProjectService {
     /** 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 };
     }
index 708d91b..bea559a 100644 (file)
@@ -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 { NotifierService } from 'angular-notifier';
 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 @@ export class RestService {
      * @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') {
index d5c561d..53078b5 100644 (file)
@@ -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 * as pako from 'pako';
 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 @@ export class SharedService {
     @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 @@ export class SharedService {
     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 @@ export class SharedService {
     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 @@ export class SharedService {
             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 @@ export class SharedService {
         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 @@ export class SharedService {
     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 @@ export class SharedService {
                 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 @@ export class SharedService {
                 }
             }, (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 @@ export class SharedService {
     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);
                 }
index cf21bef..c191cf8 100644 (file)
@@ -26,19 +26,19 @@ import {
 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 (file)
index 52e2c1a..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-    "extends": "../tslint.json",
-    "rules": {
-        "directive-selector": [
-            true,
-            "attribute",
-            "app",
-            "camelCase"
-        ],
-        "component-selector": [
-            true,
-            "element",
-            "app",
-            "kebab-case"
-        ]
-    }
-}
index 0965b55..b0a4495 100644 (file)
@@ -2,6 +2,7 @@
     "compileOnSave": false,
     "compilerOptions": {
         "resolveJsonModule": true,
+        "allowSyntheticDefaultImports": true,
         "baseUrl": ".",
         "downlevelIteration": true,
         "outDir": "./dist/out-tsc",
@@ -12,7 +13,7 @@
         "emitDecoratorMetadata": true,
         "experimentalDecorators": true,
         "importHelpers": true,
-        "target": "es5",
+        "target": "es2020",
         "types": [
           "node"
         ],
diff --git a/tslint.json b/tslint.json
deleted file mode 100644 (file)
index 62ff200..0000000
+++ /dev/null
@@ -1,299 +0,0 @@
-{
-    "linterOptions" : {
-        "exclude" : [
-          "package.json"
-        ]
-      },
-    "defaultSeverity": "error",
-    "rules": {
-        "insecure-random": false,
-        "no-banned-terms": true,
-        "no-cookies": true,
-        "no-delete-expression": true,
-        "no-disable-auto-sanitization": true,
-        "no-document-domain": true,
-        "no-document-write": true,
-        "no-eval": true,
-        "no-exec-script": true,
-        "no-function-constructor-with-string-args": true,
-        "no-http-string": [
-            true,
-            "http://www.example.com/?.*",
-            "http://www.examples.com/?.*"
-        ],
-        "no-inner-html": true,
-        "no-octal-literal": true,
-        "no-reserved-keywords": true,
-        "deprecation": {
-          "severity": "warning"
-        },
-        "no-string-based-set-immediate": true,
-        "no-string-based-set-interval": true,
-        "no-string-based-set-timeout": true,
-        "non-literal-require": true,
-        "possible-timing-attack": true,
-        "react-anchor-blank-noopener": true,
-        "react-iframe-missing-sandbox": true,
-        "react-no-dangerous-html": true,
-        "forin": true,
-        "jquery-deferred-must-complete": true,
-        "label-position": true,
-        "mocha-avoid-only": true,
-        "mocha-no-side-effect-code": true,
-        "no-any": true,
-        "no-arg": true,
-        "no-backbone-get-set-outside-model": true,
-        "no-bitwise": true,
-        "no-conditional-assignment": true,
-        "no-console": false,
-        "no-constant-condition": true,
-        "no-control-regex": true,
-        "no-debugger": true,
-        "no-duplicate-case": true,
-        "no-duplicate-variable": true,
-        "no-empty": true,
-        "no-increment-decrement": true,
-        "no-invalid-regexp": true,
-        "no-invalid-this": true,
-        "no-jquery-raw-elements": true,
-        "no-misused-new": true,
-        "no-regex-spaces": true,
-        "no-sparse-arrays": true,
-        "no-stateless-class": true,
-        "no-string-literal": true,
-        "no-string-throw": true,
-        "no-unnecessary-bind": true,
-        "no-unnecessary-initializer": true,
-        "no-unnecessary-override": true,
-        "no-unsafe-finally": true,
-        "no-unused-expression": true,
-        "no-with-statement": true,
-        "promise-must-complete": true,
-        "radix": true,
-        "react-this-binding-issue": true,
-        "react-unused-props-and-state": true,
-        "switch-default": true,
-        "triple-equals": [
-            true,
-            "allow-null-check"
-        ],
-        "use-isnan": true,
-        "use-named-parameter": true,
-        "valid-typeof": true,
-        "adjacent-overload-signatures": true,
-        "array-type": [
-            true,
-            "array"
-        ],
-        "arrow-parens": true,
-        "callable-types": true,
-        "chai-prefer-contains-to-index-of": true,
-        "chai-vague-errors": true,
-        "class-name": true,
-        "comment-format": true,
-        "export-name": true,
-        "function-name": true,
-        "import-name": true,
-        "interface-name": false,
-        "jsdoc-format": true,
-        "max-classes-per-file": [
-            true,
-            3
-        ],
-        "max-file-line-count": true,
-        "max-func-body-length": [
-            true,
-            100,
-            {
-                "ignore-parameters-to-function-regex": "describe"
-            }
-        ],
-        "max-line-length": [
-            true,
-            140
-        ],
-        "member-access": true,
-        "member-ordering": [
-            true,
-            {
-                "order": "fields-first"
-            }
-        ],
-        "missing-jsdoc": true,
-        "mocha-unneeded-done": true,
-        "new-parens": true,
-        "no-construct": true,
-        "no-default-export": true,
-        "no-empty-interface": true,
-        "no-for-in": true,
-        "no-function-expression": true,
-        "no-inferrable-types": false,
-        "no-multiline-string": true,
-        "no-null-keyword": false,
-        "no-parameter-properties": true,
-        "no-relative-imports": false,
-        "no-require-imports": true,
-        "no-shadowed-variable": true,
-        "no-typeof-undefined": true,
-        "no-unnecessary-field-initialization": true,
-        "no-unnecessary-local-variable": true,
-        "no-var-keyword": true,
-        "no-var-requires": true,
-        "no-var-self": true,
-        "object-literal-sort-keys": false,
-        "one-variable-per-declaration": true,
-        "only-arrow-functions": [
-            true,
-            "allow-declarations",
-            "allow-named-functions"
-        ],
-        "ordered-imports": true,
-        "prefer-array-literal": true,
-        "prefer-const": true,
-        "prefer-for-of": true,
-        "prefer-method-signature": true,
-        "typedef": [
-            true,
-            "call-signature",
-            "arrow-call-signature",
-            "parameter",
-            "arrow-parameter",
-            "property-declaration",
-            "variable-declaration",
-            "member-variable-declaration"
-        ],
-        "underscore-consistent-invocation": true,
-        "unified-signatures": true,
-        "variable-name": true,
-        "react-a11y-anchors": true,
-        "react-a11y-aria-unsupported-elements": true,
-        "react-a11y-event-has-role": true,
-        "react-a11y-image-button-has-alt": true,
-        "react-a11y-img-has-alt": true,
-        "react-a11y-lang": true,
-        "react-a11y-meta": true,
-        "react-a11y-props": true,
-        "react-a11y-proptypes": true,
-        "react-a11y-role": true,
-        "react-a11y-role-has-required-aria-props": true,
-        "react-a11y-role-supports-aria-props": true,
-        "react-a11y-tabindex-no-positive": true,
-        "react-a11y-titles": true,
-        "align": [
-            true,
-            "statements"
-        ],
-        "curly": true,
-        "eofline": true,
-        "import-spacing": true,
-        "indent": [
-            true,
-            "spaces"
-        ],
-        "linebreak-style": false,
-        "no-consecutive-blank-lines": true,
-        "no-empty-line-after-opening-brace": true,
-        "no-trailing-whitespace": true,
-        "no-unnecessary-semicolons": true,
-        "object-literal-key-quotes": [
-            true,
-            "as-needed"
-        ],
-        "one-line": [
-            false
-        ],
-        "quotemark": [
-            true,
-            "single"
-        ],
-        "react-tsx-curly-spacing": true,
-        "semicolon": [
-            true,
-            "always"
-        ],
-        "trailing-comma": [
-            true,
-            {
-                "singleline": "never",
-                "multiline": "never"
-            }
-        ],
-        "typedef-whitespace": false,
-        "whitespace": [
-            true,
-            "check-branch",
-            "check-decl",
-            "check-operator",
-            "check-separator",
-            "check-type"
-        ],
-        "ban": false,
-        "cyclomatic-complexity": true,
-        "file-header": false,
-        "import-blacklist": false,
-        "interface-over-type-literal": true,
-        "no-internal-module": true,
-        "no-magic-numbers": true,
-        "no-mergeable-namespace": false,
-        "no-namespace": true,
-        "no-reference": true,
-        "no-unexternalized-strings": true,
-        "object-literal-shorthand": true,
-        "no-angle-bracket-type-assertion": true,
-        "prefer-type-cast": false,
-        "space-before-function-paren": false,
-        "missing-optional-annotation": false,
-        "no-duplicate-parameter-names": false,
-        "no-empty-interfaces": true,
-        "no-missing-visibility-modifiers": false,
-        "no-multiple-var-decl": false,
-        "no-switch-case-fall-through": true,
-        "typeof-compare": true,
-        "no-inferred-empty-object-type": true,
-        "await-promise": true,
-        "no-floating-promises": true,
-        "no-for-in-array": true,
-        "promise-function-async": true,
-        "completed-docs": [
-            true,
-            {
-                "classes": {
-                    "visibilities": ["all"]
-                },
-                "enums": {
-                    "visibilities": ["all"]
-                },
-                "functions": {
-                    "visibilities": ["all"]
-                },
-                "interfaces": {
-                    "visibilities": ["all"]
-                },
-                "methods": {
-                    "locations": ["all"],
-                    "privacies": ["all"]
-                },
-                "namespaces": {
-                    "visibilities": ["all"]
-                },
-                "properties": {
-                    "locations": ["all"],
-                    "privacies": ["all"]
-                },
-                "types": {
-                    "visibilities": ["all"]
-                },
-                "variables": {
-                    "visibilities": ["all"]
-                }
-            }
-        ],
-        "no-unnecessary-qualifier": true,
-        "no-void-expression": true,
-        "strict-boolean-expressions": [true, "allow-null-union"],
-        // The following produce too much noise with untyped or not-sufficiently typed libraries
-        "restrict-plus-operands": false,
-        "no-unsafe-any": false
-    },
-    "rulesDirectory": ["./node_modules/tslint-microsoft-contrib/"]
-}