--- /dev/null
+{
+ "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": {}
+ }
+ ]
+}
.history/*
# misc
+/.angular/cache
/.sass-cache
/connect.lock
/coverage
"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
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"
{
"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"
}
}
--- /dev/null
+{
+ "extends": "../.eslintrc.json",
+ "rules": {
+ "no-restricted-syntax": [
+ "error",
+ "ForInStatement"
+ ],
+ "@typescript-eslint/array-type": [
+ "error",
+ {
+ "default": "array"
+ }
+ ]
+ }
+ }
+
\ No newline at end of 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
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';
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';
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
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 */
/**
* 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);
/**
* 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');
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
*/
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]
/**
* @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';
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';
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 */
/** 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: [{
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')
}
- }]
+ }
}
}
});
if (this.vimList.length === 0) {
this.vimListData = null;
}
-
}
/** Get Selected VIM details @public */
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 */
*/
@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 */
/** 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
+ });
}
}
}
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
+ }
}
/** 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 */
}
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;
/**
* @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';
import { Subscription } from 'rxjs';
import { SharedService } from 'SharedService';
import { ShowInfoComponent } from 'ShowInfoComponent';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
/** 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;
}
/** 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,
}
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');
}
}
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;
/** 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
+ });
}
/**
/**
* @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';
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';
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 = {
}
/** 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];
}
}
/**
* @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';
/** 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;
/** 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;
* 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();
}
}, (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');
}
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();
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();
.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)
}
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;
/** 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
+ });
}
/**
/** 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());
}
}
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;
public ngOnInit(): void {
//empty
}
-
}
/** 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
+ });
}
}
-
}
K8sAddRepoComponent
],
providers: [DataService],
- schemas: [CUSTOM_ELEMENTS_SCHEMA],
- entryComponents: [K8sActionComponent, K8sAddClusterComponent, K8sAddRepoComponent]
+ schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
/** Exporting a class @exports K8sModule */
export class K8sModule {
/** 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 */
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,
/**
* @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';
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
* Creating Component
// 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;
});
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') {
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') {
this.fileInputCredentialsLabel.nativeElement.innerText = files[0].name;
this.fileInputCredentials.nativeElement.value = null;
}
-
}
this.restService.handleError(error, 'post');
});
}
-
}
/** 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
+ });
}
/**
this.isLoadingResults = false;
});
}
-
}
/** 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
+ });
}
/**
}
/** 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,
this.isLoadingResults = false;
});
}
-
}
/**
* @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
/** 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));
}
return this.translateService.instant('PAGE.DASHBOARD.NETSLICEINSTANCE');
}
}
-
}
/** 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' });
}
}
/**
* @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
}
/** 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();
/**
* @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';
import { RestService } from 'RestService';
import { Observable } from 'rxjs';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
+/* eslint-disable security/detect-object-injection */
/*
Copyright 2020 TATA ELXSI
/**
* @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';
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
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 */
* 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(); });
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
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);
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;
}
/** 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 };
}
/**
* @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
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]
}));
}
/**
* @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
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
}));
}
/**
* @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
/** 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
+ });
}
}
}
/**
* 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 */
/** 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
+ });
}
/**
});
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;
/** 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
+ });
}
}
}
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 {
/**
* @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';
import { NSICREATEPARAMS } from 'NSDModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
* Creating component
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 === '') {
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;
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;
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') {
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') {
} 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') {
/**
* @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';
import { NSCREATEPARAMS, NSData, NSDDetails } from 'NSDModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
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 === '') {
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;
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);
}
});
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') {
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') {
} 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') {
}
/** 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' };
}
/**
* @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';
} from 'NSDModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VNFD, VNFData } from 'VNFDModel';
/**
/** 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[] = [];
/** 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[] = [];
}
/** 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({
});
}
/** 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);
}
/** 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');
if (result) {
// empty
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Event to freeze the animation @public */
public onFreeze(): void {
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');
}
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]
});
});
.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); })
.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); })
.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); })
});
}
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'];
} else {
this.deselectPath();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
} else {
this.deselectPath();
this.notifierService.notify('error', this.translateService.instant('ERROR'));
}
/** 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) {
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();
}
/** 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;
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 {
}
/** 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;
if (result) {
this.doubleClick(d);
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Events handles when Double Click to Delete @private */
private doubleClick(d: COMPOSERNODES): void {
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 => {
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);
});
}
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);
}
}
});
}
/** 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)
/**
* @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';
/** 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[] = [];
/** 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;
* 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({
}, (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');
}
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);
}
}
/** 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');
if (result) {
// empty
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** Event to freeze the animation @public */
public onFreeze(): void {
.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); })
.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); })
.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); })
.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); })
}
/** 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) {
}
]
});
+ // eslint-disable-next-line security/detect-object-injection
this.vnfdPackageDetails['ext-cpd'][index] = {
id: extcpd.id,
'int-cpd': {
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)
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;
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') {
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);
}
}
} 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;
}
});
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();
}
/** 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' };
}
public ngOnInit(): void {
//donothing
}
-
}
/**
* @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';
import { RestService } from 'RestService';
import { Subscription } from 'rxjs';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
/** 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 */
});
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;
/**
* Creating @NgModule component for Modules
*/
-// tslint:disable-next-line: no-stateless-class
@NgModule({
imports: [
FormsModule,
],
providers: [
DataService
- ],
- entryComponents: [
- ProjectCreateUpdateComponent
]
})
/** Exporting a class @exports ProjectsModule */
/**
* @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';
import { ProjectService } from 'ProjectService';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
/** 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];
}
/** 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
+ });
}
}
-
}
@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
/**
* @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';
import { RestService } from 'RestService';
import { Permission, PermissionGroup, RoleConfig, RoleData } from 'RolesModel';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
};
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');
};
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');
}
this.viewMode = 'text';
}
-
}
/** Generate role permission post data @private */
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;
/** 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) => {
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');
});
}
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;
});
});
}
-
}
/**
* @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';
import { RoleData, RoleDetails } from 'RolesModel';
import { Subscription } from 'rxjs';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
});
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;
public ngOnDestroy(): void {
this.generateDataSub.unsubscribe();
}
-
}
/** 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
+ });
}
}
}
PagePerRowModule, LoaderModule, PageReloadModule],
declarations: [SDNControllerComponent, SDNControllerDetailsComponent, SDNControllerInfoComponent, NewSDNControllerComponent],
providers: [DataService],
- entryComponents: [SDNControllerInfoComponent, NewSDNControllerComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA]
})
/** Exporting a class @exports SDNControllerModule */
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- //Empty Class
- }
+ constructor() {
+ //Empty
+ }
}
/** 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
+ });
}
/**
}
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;
});
}
-
}
});
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');
}
}
/** 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
+ });
}
}
}
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
+ }
}
/**
* @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';
import { environment } from 'environment';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
/** 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];
}
/** 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;
}
/** 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);
});
/** 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);
}
/**
* @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';
import { SharedService } from 'SharedService';
import { UserData, UserDetail } from 'UserModel';
import { UsersActionComponent } from 'UsersActionComponent';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
/** 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';
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/** smart table listing manipulation @private */
}
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;
/** 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') {
}).catch((err: Error): void => { // catch error
});
}
-
}
@NgModule({
imports: [CommonModule, TranslateModule, FormsModule, ReactiveFormsModule, NgSelectModule, LoaderModule],
declarations: [AddEditUserComponent],
- exports: [AddEditUserComponent],
- entryComponents: [AddEditUserComponent]
+ exports: [AddEditUserComponent]
})
/** Exporting a class @exports ChangePasswordModule */
export class ChangePasswordModule {
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;
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;
/**
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;
}
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' });
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();
};
this.activeModal.close(modalData);
}
-
}
* Creating Directive
* @Directive for handling the files.
*/
-// tslint:disable-next-line:export-name
@Directive({
selector: '[appDrag]'
})
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 });
});
/** options @public */
public options: {} = {
+ // eslint-disable-next-line no-invalid-this
mode: this.modeDefault,
showCursorWhenSelecting: true,
autofocus: true,
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();
}
(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();
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');
}
this.getMessage = '';
}
}
-
}
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- // Empty Block
+ constructor() {
+ //Empty
}
}
/** 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',
/** 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 {
/** 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',
/** 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' });
}
}
<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>
/**
* @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';
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';
/** Operational Status Check @public */
public operationalStatus: string;
+ /** CNF Status Check @public */
+ public k8sStatus: boolean = false;
+
/** get Admin Details @public */
public getAdminDetails: {};
private cd: ChangeDetectorRef;
/** Set timeout @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private timeOut: number = 100;
constructor(injector: Injector) {
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',
/** 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 */
/** 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,
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;
/** 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,
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
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
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
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
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
/**
private cd: ChangeDetectorRef;
/** Set timeout @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private timeOut: number = 1000;
constructor(injector: Injector) {
/** 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 */
/** 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' };
}
/** 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
+ });
}
}
/**
* @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';
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';
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);
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];
}
}
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');
if (result.message === CONFIGCONSTANT.done) {
this.onSubmit();
}
- }).catch((): void => { //empty
- });
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
this.isLoadingResults = false;
}
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');
}
);
} 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');
};
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;
/** 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];
}
}
/** 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;
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
* @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;
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- // Empty Block
- }
+ constructor() {
+ //Empty
+ }
}
* @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;
/**
* Lifecyle Hooks the trigger before component is instantiate
*/
- public ngOnInit(): void {
- // Empty Block
- }
+ constructor() {
+ //Empty
+ }
}
/** 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',
/** 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;
}, this.timeOut);
});
}
-
}
/** 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
+ });
}
}
/** 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 */
// Catch Navigation Error
});
}
-
}
/**
* @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';
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';
/**
};
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;
/** 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];
}
}
/** 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'
/** 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
+ });
}
}
/** variables to hold options of editor @public */
public options: {} = {
+ // eslint-disable-next-line no-invalid-this
mode: this.modeDefault,
showCursorWhenSelecting: true,
autofocus: true,
/**
* @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';
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';
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);
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: {} =
{
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]
))
);
/** 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);
}
};
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;
/** 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];
}
}
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();
}
/** 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') {
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');
if (result) {
this.sharedService.callData();
}
- }).catch();
+ }).catch((): void => {
+ // Catch Navigation Error
+ });
}
}
/**
* @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';
import { VerticalScaling } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VDUR, VNFInstanceDetails } from 'VNFInstanceModel';
/**
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: {}[];
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);
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: {} =
{
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]
))
);
/** 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);
}
};
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;
/** 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];
}
}
/** 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 */
/** 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;
}
/**
* @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';
import { VMMIGRATION } from 'NSInstanceModel';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VDUR, VNFInstanceDetails } from 'VNFInstanceModel';
/**
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: {}[];
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);
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: {} =
{
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]
))
);
/** 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);
}
};
}
this.migrationInitialization(migrationPayload);
-
}
/** Initialize the Vm Migration operation @public */
};
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;
/** 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];
}
}
/** 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',
private cd: ChangeDetectorRef;
/** Set timeout @private */
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
private timeOut: number = 1000;
constructor(injector: Injector) {
/** 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 */
/** 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' };
}
/** 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 */
/** 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
+ });
}
}
/** 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'
/** 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
+ });
}
}
<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>
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));
}
.no-data {
margin-bottom: 2.5rem;
- margin-top: -1.5rem;
+ margin-top: 5rem;
}
}
.switch {
*/
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,
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[] = [];
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];
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;
}
* @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}]
};
}
/**
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 {
/** 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
+ });
}
}
}
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 {
/**
* @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';
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';
/**
* 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;
.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');
}
/**
* @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';
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
import { VimAccountDetails } from 'VimAccountModel';
/**
/** options @public */
public options: {} = {
+ // eslint-disable-next-line no-invalid-this
mode: this.modeDefault,
showCursorWhenSelecting: true,
autofocus: true,
} 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];
}
});
}
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];
}
});
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 });
}
}
/** 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 {
};
}
/** 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>';
/** 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
+ });
}
}
}
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 {
/**
* @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';
import * as jsyaml from 'js-yaml';
import { RestService } from 'RestService';
import { SharedService } from 'SharedService';
-import { isNullOrUndefined } from 'util';
/**
* Creating component
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') {
/** 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 */
}
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;
"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",
"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",
"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",
"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",
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;
}
}
.resources-chart-popover {
max-width: 60% !important;
+ width: 600px !important;
@include font-family("Roboto");
.popover-body {
max-height: 60vh;
* example: @include rem("font-size", 14);
*/
+@use "sass:math";
+
@mixin rem($property, $values...) {
$n: length($values);
$i: 1;
$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);
*/
/*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
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;
$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;
$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
/** 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 */
* 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;
this.sharedService.showGotoTop = false;
}
}
-
}
* 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/';
/** 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',
* 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/';
/** 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',
/**
* @file Model for Commonly used information.
*/
-// tslint:disable: completed-docs
+/* eslint-disable */
/**
* handle count @enum
*/
}
/** 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 */
/**
* @file Model for NSD related information.
*/
-// tslint:disable: completed-docs
import { VNFDAdminDetails } from './VNFDModel';
/** Interface for NSData */
/**
* @file Model for NS Instance related information.
*/
-// tslint:disable: completed-docs
+/* eslint-disable */
import { DF, VLD } from 'NSDModel';
import { VNFDAdminDetails } from 'VNFDModel';
}
/** Interface for _Admin */
-// tslint:disable-next-line:class-name
interface _Admin {
'projects_write': string[];
deployed: DeployedAdmin;
}
/** Interface for _AdminDetails */
-// tslint:disable-next-line:class-name
export interface _AdminDetails {
usageState: string;
projects_write: string[];
id: string;
'nss-connection-point-ref': NssConnectionPointRef[];
'mgmt-network': boolean;
- // tslint:disable-next-line:no-reserved-keywords
type: string;
}
* @file Model for Operational view JUJU information.
*/
-// tslint:disable: completed-docs
/** Interface for the VCASTATUS */
export interface VCASTATUS {
/**
* @file Model for VNFD related information.
*/
-// tslint:disable: completed-docs
/** Interface for Project */
export interface ProjectModel {
project_id: string;
/**
* @file Model for VimAccount Details related information.
*/
-// tslint:disable: completed-docs
import { NSInstanceDetails } from 'NSInstanceModel';
/** Interface for VimAccountDetails */
export interface VimAccountDetails {
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 {
/***************************************************************************************************
* 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
*/
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
*/
* 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
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;
}
* @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(
}
/** 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({
/**
* @file Auth service
*/
+import { isNullOrUndefined } from 'util';
import { HttpHeaders } from '@angular/common/http';
import { Injectable, Injector } from '@angular/core';
import { Router } from '@angular/router';
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';
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.
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
+ });
}
}
}
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 {
/** 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);
/** 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 };
}
* @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';
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.
* @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') {
/**
* @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';
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;
/**
@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 */
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 */
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 */
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');
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);
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)];
}
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 => {
}
}, (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('');
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);
}
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);
+++ /dev/null
-{
- "extends": "../tslint.json",
- "rules": {
- "directive-selector": [
- true,
- "attribute",
- "app",
- "camelCase"
- ],
- "component-selector": [
- true,
- "element",
- "app",
- "kebab-case"
- ]
- }
-}
"compileOnSave": false,
"compilerOptions": {
"resolveJsonModule": true,
+ "allowSyntheticDefaultImports": true,
"baseUrl": ".",
"downlevelIteration": true,
"outDir": "./dist/out-tsc",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
- "target": "es5",
+ "target": "es2020",
"types": [
"node"
],
+++ /dev/null
-{
- "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/"]
-}