From c8104a577f721c2746770e80c56f5751c4ac6ba2 Mon Sep 17 00:00:00 2001 From: piotrpekala7 <31202938+piotrpekala7@users.noreply.github.com> Date: Tue, 30 Jun 2020 10:42:31 +0200 Subject: [PATCH] Update to Angular 10 --- angular.json | 36 +++++++++++++-- e2e/tsconfig.e2e.json | 2 +- package.json | 45 ++++++++++--------- .../components/d3-map/d3-map.component.ts | 4 +- .../drawing/drawings/text/text.component.ts | 2 +- .../experimental-map.component.ts | 2 +- .../interface-label.component.ts | 2 +- .../experimental-map/link/link.component.ts | 2 +- .../experimental-map/node/node.component.ts | 4 +- .../text-editor/text-editor.component.ts | 2 +- .../directives/moving-canvas.directive.ts | 2 +- .../error-handlers/toaster-error-handler.ts | 2 + .../components/adbutler/adbutler.component.ts | 2 +- .../notification-box.component.ts | 2 +- .../cloud-nodes-templates.component.ts | 2 +- .../ethernet-hubs-templates.component.ts | 2 +- ...net-switches-template-details.component.ts | 2 +- .../ethernet-switches-templates.component.ts | 2 +- .../custom-adapters.component.ts | 2 +- .../docker-templates.component.ts | 2 +- .../ios-templates/ios-templates.component.ts | 2 +- .../iou-templates/iou-templates.component.ts | 2 +- .../qemu-vm-template-details.component.ts | 2 +- .../qemu-vm-templates.component.ts | 2 +- .../traceng-templates.component.ts | 2 +- .../virtual-box-template-details.component.ts | 2 +- .../virtual-box-templates.component.ts | 2 +- .../vmware-template-details.component.ts | 2 +- .../vmware-templates.component.ts | 2 +- .../vpcs-templates.component.ts | 2 +- .../import-config-action.component.ts | 2 +- .../context-menu/context-menu.component.ts | 2 +- .../draw-link-tool.component.ts | 2 +- .../log-console/log-console.component.ts | 2 +- .../cloud/configurator-cloud.component.ts | 2 +- .../configurator-ethernet-switch.component.ts | 2 +- .../qemu/configurator-qemu.component.ts | 2 +- .../configurator-virtualbox.component.ts | 2 +- .../vmware/configurator-vmware.component.ts | 2 +- .../node-select-interface.component.ts | 2 +- .../project-map/project-map.component.ts | 6 +-- .../web-console/web-console.component.ts | 2 +- .../web-console-full-window.component.ts | 2 +- src/tsconfig.app.json | 9 ++-- src/tsconfig.spec.json | 3 +- tsconfig.base.json | 30 +++++++++++++ tsconfig.json | 41 ++++++----------- tslint.json | 4 +- 48 files changed, 153 insertions(+), 105 deletions(-) create mode 100644 tsconfig.base.json diff --git a/angular.json b/angular.json index 60b56f8e..9fd99be7 100644 --- a/angular.json +++ b/angular.json @@ -11,6 +11,7 @@ "build": { "builder": "@angular-devkit/build-angular:browser", "options": { + "aot": true, "outputPath": "dist", "index": "src/index.html", "main": "src/main.ts", @@ -27,13 +28,13 @@ "node_modules/notosans-fontface/css/notosans-fontface.min.css", "src/styles.css", { + "inject": false, "input": "src/theme.scss", - "lazy": true, "bundleName": "theme-default-dark" }, { + "inject": false, "input": "src/theme-light.scss", - "lazy": true, "bundleName": "theme-default" } ], @@ -41,6 +42,12 @@ }, "configurations": { "production": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], "optimization": true, "outputHashing": "all", "sourceMap": { @@ -62,6 +69,12 @@ ] }, "electronProd": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], "optimization": true, "outputHashing": "all", "sourceMap": false, @@ -79,6 +92,12 @@ ] }, "electronDev": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], "fileReplacements": [ { "replace": "src/environments/environment.ts", @@ -87,6 +106,12 @@ ] }, "githubProd": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], "optimization": true, "outputHashing": "all", "sourceMap": false, @@ -198,10 +223,13 @@ "schematics": { "@schematics/angular:component": { "prefix": "app", - "styleext": "scss" + "style": "scss" }, "@schematics/angular:directive": { "prefix": "app" } + }, + "cli": { + "analytics": false } -} +} \ No newline at end of file diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json index 1d9e5edf..8cc9c0df 100644 --- a/e2e/tsconfig.e2e.json +++ b/e2e/tsconfig.e2e.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "baseUrl": "./", diff --git a/package.json b/package.json index a47edf61..dcdad05d 100644 --- a/package.json +++ b/package.json @@ -38,17 +38,17 @@ }, "private": true, "dependencies": { - "@angular/animations": "^8.2.11", + "@angular/animations": "^10.0.1", "@angular/cdk": "^8.2.3", - "@angular/common": "^8.2.11", - "@angular/compiler": "^8.2.11", - "@angular/core": "^8.2.11", - "@angular/forms": "^8.2.11", + "@angular/common": "^10.0.1", + "@angular/compiler": "^10.0.1", + "@angular/core": "^10.0.1", + "@angular/forms": "^10.0.1", "@angular/http": "^7.2.16", "@angular/material": "^8.2.3", - "@angular/platform-browser": "^8.2.11", - "@angular/platform-browser-dynamic": "^8.2.11", - "@angular/router": "^8.2.11", + "@angular/platform-browser": "^10.0.1", + "@angular/platform-browser-dynamic": "^10.0.1", + "@angular/router": "^10.0.1", "angular-draggable-droppable": "^4.5.1", "angular-persistence": "^1.0.1", "angular-resizable-element": "^3.3.2", @@ -78,45 +78,46 @@ "save-svg-as-png": "^1.4.14", "svg-crowbar": "^0.2.4", "tree-kill": "^1.2.1", + "tslib": "^2.0.0", "typeface-roboto": "^0.0.75", "xterm": "^4.1.0", "xterm-addon-attach": "^0.5.0", "xterm-addon-fit": "^0.3.0", "yargs": "^15.3.1", - "zone.js": "^0.10.3" + "zone.js": "~0.10.3" }, "devDependencies": { - "@angular-devkit/build-angular": "^0.803.28", - "@angular/cli": "^8.3.28", - "@angular/compiler-cli": "^8.2.11", - "@angular/language-service": "^8.2.11", + "@angular-devkit/build-angular": "~0.1000.0", + "@angular/cli": "^10.0.0", + "@angular/compiler-cli": "^10.0.1", + "@angular/language-service": "^10.0.1", "@sentry/cli": "^1.53.0", "@sentry/electron": "^0.17.4", "@types/jasmine": "^3.5.11", "@types/jasminewd2": "^2.0.8", - "@types/node": "^12.12.47", - "codelyzer": "^5.2.2", + "@types/node": "^12.11.1", + "codelyzer": "^5.1.2", "electron": "7.1.2", "electron-builder": "21.2.0", "file-loader": "^6.0.0", "jasmine-core": "~3.5.0", - "jasmine-spec-reporter": "~4.2.1", + "jasmine-spec-reporter": "~5.0.0", "jquery": "^3.5.1", - "karma": "~4.4.0", + "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", "karma-cli": "~2.0.0", - "karma-coverage-istanbul-reporter": "^2.1.0", - "karma-jasmine": "~2.0.1", - "karma-jasmine-html-reporter": "^1.5.4", + "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-jasmine": "~3.3.0", + "karma-jasmine-html-reporter": "^1.5.0", "license-checker": "^25.0.1", "node-sass": "^4.14.1", "popper.js": "^1.16.1", "prettier": "^1.18.2", - "protractor": "^5.4.4", + "protractor": "~7.0.0", "replace": "^1.2.0", "ts-mockito": "^2.6.1", "ts-node": "~8.4.1", - "tslint": "~5.20.0", + "tslint": "~6.1.0", "tslint-config-prettier": "^1.18.0", "typescript": "^3.9.5" }, diff --git a/src/app/cartography/components/d3-map/d3-map.component.ts b/src/app/cartography/components/d3-map/d3-map.component.ts index cdcaad70..e1c2591d 100644 --- a/src/app/cartography/components/d3-map/d3-map.component.ts +++ b/src/app/cartography/components/d3-map/d3-map.component.ts @@ -51,8 +51,8 @@ export class D3MapComponent implements OnInit, OnChanges, OnDestroy { @Input() width = 1500; @Input() height = 600; - @ViewChild('svg', {static: false}) svgRef: ElementRef; - @ViewChild('textEditor', {static: false}) textEditor: TextEditorComponent; + @ViewChild('svg') svgRef: ElementRef; + @ViewChild('textEditor') textEditor: TextEditorComponent; private parentNativeElement: any; private svg: Selection; diff --git a/src/app/cartography/components/experimental-map/drawing/drawings/text/text.component.ts b/src/app/cartography/components/experimental-map/drawing/drawings/text/text.component.ts index f9feb399..c1f97e1c 100644 --- a/src/app/cartography/components/experimental-map/drawing/drawings/text/text.component.ts +++ b/src/app/cartography/components/experimental-map/drawing/drawings/text/text.component.ts @@ -13,7 +13,7 @@ export class TextComponent implements OnInit, DoCheck { @Input('app-text') text: TextElement; - @ViewChild('text', {static: false}) textRef: ElementRef; + @ViewChild('text') textRef: ElementRef; lines: string[] = []; diff --git a/src/app/cartography/components/experimental-map/experimental-map.component.ts b/src/app/cartography/components/experimental-map/experimental-map.component.ts index 9847db28..d5b0708e 100644 --- a/src/app/cartography/components/experimental-map/experimental-map.component.ts +++ b/src/app/cartography/components/experimental-map/experimental-map.component.ts @@ -43,7 +43,7 @@ export class ExperimentalMapComponent implements OnInit, OnChanges, OnDestroy { @Input() width = 1500; @Input() height = 600; - @ViewChild('svg', {static: false}) svg: ElementRef; + @ViewChild('svg') svg: ElementRef; private changesDetected: Subscription; diff --git a/src/app/cartography/components/experimental-map/interface-label/interface-label.component.ts b/src/app/cartography/components/experimental-map/interface-label/interface-label.component.ts index 77240bcf..0a2c8921 100644 --- a/src/app/cartography/components/experimental-map/interface-label/interface-label.component.ts +++ b/src/app/cartography/components/experimental-map/interface-label/interface-label.component.ts @@ -10,7 +10,7 @@ import { CssFixer } from '../../../helpers/css-fixer'; export class InterfaceLabelComponent implements OnInit { @Input('app-interface-label') ignore: any; - @ViewChild('textSvg', {static: false}) textRef: ElementRef; + @ViewChild('textSvg') textRef: ElementRef; private label = { x: 0, diff --git a/src/app/cartography/components/experimental-map/link/link.component.ts b/src/app/cartography/components/experimental-map/link/link.component.ts index 02b9c1c8..f89139dc 100644 --- a/src/app/cartography/components/experimental-map/link/link.component.ts +++ b/src/app/cartography/components/experimental-map/link/link.component.ts @@ -26,7 +26,7 @@ export class LinkComponent implements OnInit, OnDestroy { @Input('node-changed') nodeChanged: EventEmitter; @Input('show-interface-labels') showInterfaceLabels: boolean; - @ViewChild('path', {static: false}) path: ElementRef; + @ViewChild('path') path: ElementRef; private ethernetLinkStrategy = new EthernetLinkStrategy(); private serialLinkStrategy = new SerialLinkStrategy(); diff --git a/src/app/cartography/components/experimental-map/node/node.component.ts b/src/app/cartography/components/experimental-map/node/node.component.ts index 2ddb8baa..896ec653 100644 --- a/src/app/cartography/components/experimental-map/node/node.component.ts +++ b/src/app/cartography/components/experimental-map/node/node.component.ts @@ -30,8 +30,8 @@ import { DraggedDataEvent } from '../../../events/event-source'; export class NodeComponent implements OnInit, OnDestroy, OnChanges, AfterViewInit { static NODE_LABEL_MARGIN = 3; - @ViewChild('label', {static: false}) label: ElementRef; - @ViewChild('image', {static: false}) imageRef: ElementRef; + @ViewChild('label') label: ElementRef; + @ViewChild('image') imageRef: ElementRef; @Input('app-node') node: MapNode; @Input('symbols') symbols: Symbol[]; diff --git a/src/app/cartography/components/text-editor/text-editor.component.ts b/src/app/cartography/components/text-editor/text-editor.component.ts index 39cb032b..e98cea56 100644 --- a/src/app/cartography/components/text-editor/text-editor.component.ts +++ b/src/app/cartography/components/text-editor/text-editor.component.ts @@ -27,7 +27,7 @@ import { Font } from '../../models/font'; styleUrls: ['./text-editor.component.scss'] }) export class TextEditorComponent implements OnInit, OnDestroy { - @ViewChild('temporaryTextElement', {static: false}) temporaryTextElement: ElementRef; + @ViewChild('temporaryTextElement') temporaryTextElement: ElementRef; @Input('svg') svg: SVGSVGElement; @Input('server') server: Server; diff --git a/src/app/cartography/directives/moving-canvas.directive.ts b/src/app/cartography/directives/moving-canvas.directive.ts index 983b2e3b..4fe6c197 100644 --- a/src/app/cartography/directives/moving-canvas.directive.ts +++ b/src/app/cartography/directives/moving-canvas.directive.ts @@ -1,4 +1,4 @@ -import { HostListener, ElementRef, Renderer, Directive, Input, OnInit, OnDestroy } from '@angular/core' +import { HostListener, ElementRef, Directive, Input, OnInit, OnDestroy, Renderer2 } from '@angular/core' import { Subscription } from 'rxjs'; import { MovingEventSource } from '../events/moving-event-source'; import { Context } from '../models/context'; diff --git a/src/app/common/error-handlers/toaster-error-handler.ts b/src/app/common/error-handlers/toaster-error-handler.ts index 555cb22c..880065e7 100644 --- a/src/app/common/error-handlers/toaster-error-handler.ts +++ b/src/app/common/error-handlers/toaster-error-handler.ts @@ -1,6 +1,8 @@ import { RavenErrorHandler } from './raven-error-handler'; import { ToasterService } from '../../services/toaster.service'; +import { Injectable } from "@angular/core"; +@Injectable() export class ToasterErrorHandler extends RavenErrorHandler { handleError(err: any): void { super.handleError(err); diff --git a/src/app/components/adbutler/adbutler.component.ts b/src/app/components/adbutler/adbutler.component.ts index 8abd3183..153339d8 100644 --- a/src/app/components/adbutler/adbutler.component.ts +++ b/src/app/components/adbutler/adbutler.component.ts @@ -10,7 +10,7 @@ import { ToasterService } from '../../services/toaster.service'; encapsulation: ViewEncapsulation.None }) export class AdbutlerComponent implements OnInit { - @ViewChild('ad', {static: false}) ad: ElementRef; + @ViewChild('ad') ad: ElementRef; theme: string; onLoad = new EventEmitter(); htmlCode: string; diff --git a/src/app/components/notification-box/notification-box.component.ts b/src/app/components/notification-box/notification-box.component.ts index 83dfa3ca..420ec50e 100644 --- a/src/app/components/notification-box/notification-box.component.ts +++ b/src/app/components/notification-box/notification-box.component.ts @@ -11,7 +11,7 @@ import { Location } from '@angular/common'; styleUrls: ['./notification-box.component.scss'] }) export class NotificationBoxComponent implements OnInit, OnDestroy { - @ViewChild('dynamicComponentContainer', {read: ViewContainerRef, static: false}) dynamicComponentContainer; + @ViewChild('dynamicComponentContainer', { read: ViewContainerRef }) dynamicComponentContainer; timer: Observable; viewTimer: Observable; diff --git a/src/app/components/preferences/built-in/cloud-nodes/cloud-nodes-templates/cloud-nodes-templates.component.ts b/src/app/components/preferences/built-in/cloud-nodes/cloud-nodes-templates/cloud-nodes-templates.component.ts index 84637931..7efc602c 100644 --- a/src/app/components/preferences/built-in/cloud-nodes/cloud-nodes-templates/cloud-nodes-templates.component.ts +++ b/src/app/components/preferences/built-in/cloud-nodes/cloud-nodes-templates/cloud-nodes-templates.component.ts @@ -15,7 +15,7 @@ import { DeleteTemplateComponent } from '../../../common/delete-template-compone export class CloudNodesTemplatesComponent implements OnInit { server: Server; cloudNodesTemplates: CloudTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/built-in/ethernet-hubs/ethernet-hubs-templates/ethernet-hubs-templates.component.ts b/src/app/components/preferences/built-in/ethernet-hubs/ethernet-hubs-templates/ethernet-hubs-templates.component.ts index 8350cba7..02dfd070 100644 --- a/src/app/components/preferences/built-in/ethernet-hubs/ethernet-hubs-templates/ethernet-hubs-templates.component.ts +++ b/src/app/components/preferences/built-in/ethernet-hubs/ethernet-hubs-templates/ethernet-hubs-templates.component.ts @@ -15,7 +15,7 @@ import { DeleteTemplateComponent } from '../../../common/delete-template-compone export class EthernetHubsTemplatesComponent implements OnInit { server: Server; ethernetHubsTemplates: EthernetHubTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-template-details/ethernet-switches-template-details.component.ts b/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-template-details/ethernet-switches-template-details.component.ts index 6ffd3415..290da59f 100644 --- a/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-template-details/ethernet-switches-template-details.component.ts +++ b/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-template-details/ethernet-switches-template-details.component.ts @@ -16,7 +16,7 @@ import { PortsComponent } from '../../../common/ports/ports.component'; styleUrls: ['./ethernet-switches-template-details.component.scss', '../../../preferences.component.scss'] }) export class EthernetSwitchesTemplateDetailsComponent implements OnInit { - @ViewChild(PortsComponent, {static: false}) portsComponent: PortsComponent; + @ViewChild(PortsComponent) portsComponent: PortsComponent; server: Server; ethernetSwitchTemplate: EthernetSwitchTemplate; inputForm: FormGroup; diff --git a/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-templates/ethernet-switches-templates.component.ts b/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-templates/ethernet-switches-templates.component.ts index 9d36330e..b29092b3 100644 --- a/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-templates/ethernet-switches-templates.component.ts +++ b/src/app/components/preferences/built-in/ethernet-switches/ethernet-switches-templates/ethernet-switches-templates.component.ts @@ -15,7 +15,7 @@ import { DeleteTemplateComponent } from '../../../common/delete-template-compone export class EthernetSwitchesTemplatesComponent implements OnInit { server: Server; ethernetSwitchesTemplates: EthernetSwitchTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts b/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts index cdc00db9..9eac1689 100644 --- a/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts +++ b/src/app/components/preferences/common/custom-adapters/custom-adapters.component.ts @@ -14,7 +14,7 @@ export class CustomAdaptersComponent { @Output() closeConfiguratorEmitter = new EventEmitter(); @Output() saveConfigurationEmitter = new EventEmitter(); - @ViewChild("customAdapters", {static: false}) customAdapters: CustomAdaptersTableComponent; + @ViewChild("customAdapters") customAdapters: CustomAdaptersTableComponent; public adapters: CustomAdapter[]; public numberOfAdapters: number; diff --git a/src/app/components/preferences/docker/docker-templates/docker-templates.component.ts b/src/app/components/preferences/docker/docker-templates/docker-templates.component.ts index 44a0aacc..1fe7f1c6 100644 --- a/src/app/components/preferences/docker/docker-templates/docker-templates.component.ts +++ b/src/app/components/preferences/docker/docker-templates/docker-templates.component.ts @@ -15,7 +15,7 @@ import { DockerService } from '../../../../services/docker.service'; export class DockerTemplatesComponent implements OnInit { server: Server; dockerTemplates: DockerTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/dynamips/ios-templates/ios-templates.component.ts b/src/app/components/preferences/dynamips/ios-templates/ios-templates.component.ts index f1ab23b2..d8536d8f 100644 --- a/src/app/components/preferences/dynamips/ios-templates/ios-templates.component.ts +++ b/src/app/components/preferences/dynamips/ios-templates/ios-templates.component.ts @@ -16,7 +16,7 @@ import { VpcsTemplate } from '../../../../models/templates/vpcs-template'; export class IosTemplatesComponent implements OnInit { server: Server; iosTemplates: IosTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/ios-on-unix/iou-templates/iou-templates.component.ts b/src/app/components/preferences/ios-on-unix/iou-templates/iou-templates.component.ts index ab1fa8e9..4abb3203 100644 --- a/src/app/components/preferences/ios-on-unix/iou-templates/iou-templates.component.ts +++ b/src/app/components/preferences/ios-on-unix/iou-templates/iou-templates.component.ts @@ -15,7 +15,7 @@ import { IouService } from '../../../../services/iou.service'; export class IouTemplatesComponent implements OnInit { server: Server; iouTemplates: IouTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts b/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts index 32caa4d9..7fc7d285 100644 --- a/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts +++ b/src/app/components/preferences/qemu/qemu-vm-template-details/qemu-vm-template-details.component.ts @@ -34,7 +34,7 @@ export class QemuVmTemplateDetailsComponent implements OnInit { displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions']; generalSettingsForm: FormGroup; - @ViewChild("customAdaptersConfigurator", {static: false}) + @ViewChild("customAdaptersConfigurator") customAdaptersConfigurator: CustomAdaptersComponent; constructor( diff --git a/src/app/components/preferences/qemu/qemu-vm-templates/qemu-vm-templates.component.ts b/src/app/components/preferences/qemu/qemu-vm-templates/qemu-vm-templates.component.ts index 319a6566..cadc97e8 100644 --- a/src/app/components/preferences/qemu/qemu-vm-templates/qemu-vm-templates.component.ts +++ b/src/app/components/preferences/qemu/qemu-vm-templates/qemu-vm-templates.component.ts @@ -15,7 +15,7 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/ export class QemuVmTemplatesComponent implements OnInit { server: Server; qemuTemplates: QemuTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/traceng/traceng-templates/traceng-templates.component.ts b/src/app/components/preferences/traceng/traceng-templates/traceng-templates.component.ts index b640193c..ad7ef307 100644 --- a/src/app/components/preferences/traceng/traceng-templates/traceng-templates.component.ts +++ b/src/app/components/preferences/traceng/traceng-templates/traceng-templates.component.ts @@ -14,7 +14,7 @@ import { TracengService } from '../../../../services/traceng.service'; export class TracengTemplatesComponent implements OnInit { server: Server; tracengTemplates: TracengTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts b/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts index d4469e15..13fe3164 100644 --- a/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts +++ b/src/app/components/preferences/virtual-box/virtual-box-template-details/virtual-box-template-details.component.ts @@ -29,7 +29,7 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit { generalSettingsForm: FormGroup; networkForm: FormGroup - @ViewChild("customAdaptersConfigurator", {static: false}) + @ViewChild("customAdaptersConfigurator") customAdaptersConfigurator: CustomAdaptersComponent; constructor( diff --git a/src/app/components/preferences/virtual-box/virtual-box-templates/virtual-box-templates.component.ts b/src/app/components/preferences/virtual-box/virtual-box-templates/virtual-box-templates.component.ts index b5daf248..357f254c 100644 --- a/src/app/components/preferences/virtual-box/virtual-box-templates/virtual-box-templates.component.ts +++ b/src/app/components/preferences/virtual-box/virtual-box-templates/virtual-box-templates.component.ts @@ -16,7 +16,7 @@ import { VpcsTemplate } from '../../../../models/templates/vpcs-template'; export class VirtualBoxTemplatesComponent implements OnInit { server: Server; virtualBoxTemplates: VirtualBoxTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts b/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts index 00bd2215..ff451779 100644 --- a/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts +++ b/src/app/components/preferences/vmware/vmware-template-details/vmware-template-details.component.ts @@ -28,7 +28,7 @@ export class VmwareTemplateDetailsComponent implements OnInit { onCloseOptions = []; networkTypes = []; - @ViewChild("customAdaptersConfigurator", {static: false}) + @ViewChild("customAdaptersConfigurator") customAdaptersConfigurator: CustomAdaptersComponent; constructor( diff --git a/src/app/components/preferences/vmware/vmware-templates/vmware-templates.component.ts b/src/app/components/preferences/vmware/vmware-templates/vmware-templates.component.ts index 4e629e68..5f1a941e 100644 --- a/src/app/components/preferences/vmware/vmware-templates/vmware-templates.component.ts +++ b/src/app/components/preferences/vmware/vmware-templates/vmware-templates.component.ts @@ -15,7 +15,7 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/ export class VmwareTemplatesComponent implements OnInit { server: Server; vmwareTemplates: VmwareTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/preferences/vpcs/vpcs-templates/vpcs-templates.component.ts b/src/app/components/preferences/vpcs/vpcs-templates/vpcs-templates.component.ts index 04ac0867..a2e570d8 100644 --- a/src/app/components/preferences/vpcs/vpcs-templates/vpcs-templates.component.ts +++ b/src/app/components/preferences/vpcs/vpcs-templates/vpcs-templates.component.ts @@ -14,7 +14,7 @@ import { DeleteTemplateComponent } from '../../common/delete-template-component/ export class VpcsTemplatesComponent implements OnInit { server: Server; vpcsTemplates: VpcsTemplate[] = []; - @ViewChild(DeleteTemplateComponent, {static: false}) deleteComponent: DeleteTemplateComponent; + @ViewChild(DeleteTemplateComponent) deleteComponent: DeleteTemplateComponent; constructor( private route: ActivatedRoute, diff --git a/src/app/components/project-map/context-menu/actions/import-config/import-config-action.component.ts b/src/app/components/project-map/context-menu/actions/import-config/import-config-action.component.ts index 3e6fde6f..aa4779cb 100644 --- a/src/app/components/project-map/context-menu/actions/import-config/import-config-action.component.ts +++ b/src/app/components/project-map/context-menu/actions/import-config/import-config-action.component.ts @@ -14,7 +14,7 @@ import { ConfigDialogComponent } from '../../dialogs/config-dialog/config-dialog export class ImportConfigActionComponent { @Input() server: Server; @Input() node: Node; - @ViewChild('fileInput', {static: false}) fileInput: ElementRef; + @ViewChild('fileInput') fileInput: ElementRef; configType: string; constructor( diff --git a/src/app/components/project-map/context-menu/context-menu.component.ts b/src/app/components/project-map/context-menu/context-menu.component.ts index 5580612a..7d17b4c2 100644 --- a/src/app/components/project-map/context-menu/context-menu.component.ts +++ b/src/app/components/project-map/context-menu/context-menu.component.ts @@ -22,7 +22,7 @@ export class ContextMenuComponent implements OnInit { @Input() project: Project; @Input() server: Server; - @ViewChild(MatMenuTrigger, {static: false}) contextMenu: MatMenuTrigger; + @ViewChild(MatMenuTrigger) contextMenu: MatMenuTrigger; topPosition; leftPosition; diff --git a/src/app/components/project-map/draw-link-tool/draw-link-tool.component.ts b/src/app/components/project-map/draw-link-tool/draw-link-tool.component.ts index 79e7e09c..98e5c827 100644 --- a/src/app/components/project-map/draw-link-tool/draw-link-tool.component.ts +++ b/src/app/components/project-map/draw-link-tool/draw-link-tool.component.ts @@ -19,7 +19,7 @@ import { NodeToMapNodeConverter } from '../../../cartography/converters/map/node }) export class DrawLinkToolComponent implements OnInit, OnDestroy { @Input() links: Link[]; - @ViewChild(NodeSelectInterfaceComponent, {static: false}) nodeSelectInterfaceMenu: NodeSelectInterfaceComponent; + @ViewChild(NodeSelectInterfaceComponent) nodeSelectInterfaceMenu: NodeSelectInterfaceComponent; private nodeClicked$: Subscription; diff --git a/src/app/components/project-map/log-console/log-console.component.ts b/src/app/components/project-map/log-console/log-console.component.ts index 3bdb2f4e..b4c06803 100644 --- a/src/app/components/project-map/log-console/log-console.component.ts +++ b/src/app/components/project-map/log-console/log-console.component.ts @@ -28,7 +28,7 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy { @Input() server: Server; @Input() project: Project; - @ViewChild('console', {static: false}) console: ElementRef; + @ViewChild('console') console: ElementRef; private version = version; private nodeSubscription: Subscription; diff --git a/src/app/components/project-map/node-editors/configurator/cloud/configurator-cloud.component.ts b/src/app/components/project-map/node-editors/configurator/cloud/configurator-cloud.component.ts index 6043bda7..fcfe1ee3 100644 --- a/src/app/components/project-map/node-editors/configurator/cloud/configurator-cloud.component.ts +++ b/src/app/components/project-map/node-editors/configurator/cloud/configurator-cloud.component.ts @@ -38,7 +38,7 @@ export class ConfiguratorDialogCloudComponent implements OnInit { ethernetInterface: string = ''; ethernetInterfaces: string[] = ['Ethernet 2', 'Ethernet 3']; - @ViewChild("udpTunnels", {static: false}) udpTunnels: UdpTunnelsComponent; + @ViewChild("udpTunnels") udpTunnels: UdpTunnelsComponent; constructor( public dialogRef: MatDialogRef, diff --git a/src/app/components/project-map/node-editors/configurator/ethernet-switch/configurator-ethernet-switch.component.ts b/src/app/components/project-map/node-editors/configurator/ethernet-switch/configurator-ethernet-switch.component.ts index 484f6138..fee5351c 100644 --- a/src/app/components/project-map/node-editors/configurator/ethernet-switch/configurator-ethernet-switch.component.ts +++ b/src/app/components/project-map/node-editors/configurator/ethernet-switch/configurator-ethernet-switch.component.ts @@ -15,7 +15,7 @@ import { PortsComponent } from '../../../../../components/preferences/common/por styleUrls: ['../configurator.component.scss'] }) export class ConfiguratorDialogEthernetSwitchComponent implements OnInit { - @ViewChild(PortsComponent, {static: false}) portsComponent: PortsComponent; + @ViewChild(PortsComponent) portsComponent: PortsComponent; server: Server; node: Node; name: string; diff --git a/src/app/components/project-map/node-editors/configurator/qemu/configurator-qemu.component.ts b/src/app/components/project-map/node-editors/configurator/qemu/configurator-qemu.component.ts index 22a84aac..330384b0 100644 --- a/src/app/components/project-map/node-editors/configurator/qemu/configurator-qemu.component.ts +++ b/src/app/components/project-map/node-editors/configurator/qemu/configurator-qemu.component.ts @@ -40,7 +40,7 @@ export class ConfiguratorDialogQemuComponent implements OnInit { }; dialogRefQemuImageCreator; - @ViewChild("customAdapters", {static: false}) customAdapters: CustomAdaptersTableComponent; + @ViewChild("customAdapters") customAdapters: CustomAdaptersTableComponent; constructor( private dialog: MatDialog, diff --git a/src/app/components/project-map/node-editors/configurator/virtualbox/configurator-virtualbox.component.ts b/src/app/components/project-map/node-editors/configurator/virtualbox/configurator-virtualbox.component.ts index 83ffeeed..a1398965 100644 --- a/src/app/components/project-map/node-editors/configurator/virtualbox/configurator-virtualbox.component.ts +++ b/src/app/components/project-map/node-editors/configurator/virtualbox/configurator-virtualbox.component.ts @@ -25,7 +25,7 @@ export class ConfiguratorDialogVirtualBoxComponent implements OnInit { displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions']; networkTypes = []; - @ViewChild("customAdapters", {static: false}) customAdapters: CustomAdaptersTableComponent; + @ViewChild("customAdapters") customAdapters: CustomAdaptersTableComponent; constructor( public dialogRef: MatDialogRef, diff --git a/src/app/components/project-map/node-editors/configurator/vmware/configurator-vmware.component.ts b/src/app/components/project-map/node-editors/configurator/vmware/configurator-vmware.component.ts index 707e36ff..974611b7 100644 --- a/src/app/components/project-map/node-editors/configurator/vmware/configurator-vmware.component.ts +++ b/src/app/components/project-map/node-editors/configurator/vmware/configurator-vmware.component.ts @@ -25,7 +25,7 @@ export class ConfiguratorDialogVmwareComponent implements OnInit { displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions']; networkTypes = []; - @ViewChild("customAdapters", {static: false}) customAdapters: CustomAdaptersTableComponent; + @ViewChild("customAdapters") customAdapters: CustomAdaptersTableComponent; constructor( public dialogRef: MatDialogRef, diff --git a/src/app/components/project-map/node-select-interface/node-select-interface.component.ts b/src/app/components/project-map/node-select-interface/node-select-interface.component.ts index 9e2919e4..8d2f6311 100644 --- a/src/app/components/project-map/node-select-interface/node-select-interface.component.ts +++ b/src/app/components/project-map/node-select-interface/node-select-interface.component.ts @@ -15,7 +15,7 @@ export class NodeSelectInterfaceComponent implements OnInit { @Input() links: Link[]; @Output() onChooseInterface = new EventEmitter(); - @ViewChild(MatMenuTrigger, {static: false}) contextMenu: MatMenuTrigger; + @ViewChild(MatMenuTrigger) contextMenu: MatMenuTrigger; protected topPosition; protected leftPosition; diff --git a/src/app/components/project-map/project-map.component.ts b/src/app/components/project-map/project-map.component.ts index 32abc9f6..0a72f019 100644 --- a/src/app/components/project-map/project-map.component.ts +++ b/src/app/components/project-map/project-map.component.ts @@ -109,9 +109,9 @@ export class ProjectMapComponent implements OnInit, OnDestroy { private scrollEnabled: boolean = false; public isLightThemeEnabled: boolean = false; - @ViewChild(ContextMenuComponent, {static: false}) contextMenu: ContextMenuComponent; - @ViewChild(D3MapComponent, {static: false}) mapChild: D3MapComponent; - @ViewChild(ProjectMapMenuComponent, {static: false}) projectMapMenuComponent: ProjectMapMenuComponent; + @ViewChild(ContextMenuComponent) contextMenu: ContextMenuComponent; + @ViewChild(D3MapComponent) mapChild: D3MapComponent; + @ViewChild(ProjectMapMenuComponent) projectMapMenuComponent: ProjectMapMenuComponent; private projectMapSubscription: Subscription = new Subscription(); diff --git a/src/app/components/project-map/web-console/web-console.component.ts b/src/app/components/project-map/web-console/web-console.component.ts index 89d8008b..82c5b550 100644 --- a/src/app/components/project-map/web-console/web-console.component.ts +++ b/src/app/components/project-map/web-console/web-console.component.ts @@ -23,7 +23,7 @@ export class WebConsoleComponent implements OnInit, AfterViewInit { public fitAddon: FitAddon = new FitAddon(); private copiedText: string = ''; - @ViewChild('terminal', {static: false}) terminal: ElementRef; + @ViewChild('terminal') terminal: ElementRef; constructor( private consoleService: NodeConsoleService diff --git a/src/app/components/web-console-full-window/web-console-full-window.component.ts b/src/app/components/web-console-full-window/web-console-full-window.component.ts index 0e284d1b..99b2f68f 100644 --- a/src/app/components/web-console-full-window/web-console-full-window.component.ts +++ b/src/app/components/web-console-full-window/web-console-full-window.component.ts @@ -30,7 +30,7 @@ export class WebConsoleFullWindowComponent implements OnInit { public term: Terminal = new Terminal(); public fitAddon: FitAddon = new FitAddon(); - @ViewChild('terminal', {static: false}) terminal: ElementRef; + @ViewChild('terminal') terminal: ElementRef; constructor( private consoleService: NodeConsoleService, diff --git a/src/tsconfig.app.json b/src/tsconfig.app.json index 438bf094..bbba1b26 100644 --- a/src/tsconfig.app.json +++ b/src/tsconfig.app.json @@ -1,14 +1,13 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/app", "baseUrl": "./", - "module": "es2015", "types": [] }, - "exclude": [ - "test.ts", - "**/*.spec.ts" + "files": [ + "main.ts", + "polyfills.ts" ], "include": [ "../src/**/*", diff --git a/src/tsconfig.spec.json b/src/tsconfig.spec.json index a9f4a571..0ecac797 100644 --- a/src/tsconfig.spec.json +++ b/src/tsconfig.spec.json @@ -1,9 +1,8 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/spec", "baseUrl": "./", - "module": "commonjs", "target": "es5", "types": [ "jasmine", diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 00000000..40da7b3f --- /dev/null +++ b/tsconfig.base.json @@ -0,0 +1,30 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es5", + "typeRoots": [ + "node_modules/@types" + ], + // below is fix for angular-cli to support core-js >= 3.0 + "paths": { + "core-js/es7/reflect": ["../node_modules/core-js/proposals/reflect-metadata"], + "core-js/es6/*": ["../node_modules/core-js/es/*"] + }, + "lib": [ + "es2018", + "dom" + ], + }, + "include": [ + "./src/**/*", + ] +} diff --git a/tsconfig.json b/tsconfig.json index 7b31bf3e..26abde9a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,30 +1,17 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "es2015", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "target": "es5", - "typeRoots": [ - "node_modules/@types" - ], - // below is fix for angular-cli to support core-js >= 3.0 - "paths": { - "core-js/es7/reflect": ["../node_modules/core-js/proposals/reflect-metadata"], - "core-js/es6/*": ["../node_modules/core-js/es/*"] + "files": [], + "references": [ + { + "path": "./src/tsconfig.app.json" }, - "lib": [ - "es2018", - "dom" - ], - }, - "include": [ - "./src/**/*", + { + "path": "./src/tsconfig.spec.json" + } ] -} +} \ No newline at end of file diff --git a/tslint.json b/tslint.json index eea41d6d..c123a5f1 100644 --- a/tslint.json +++ b/tslint.json @@ -11,6 +11,9 @@ "check-space" ], "curly": true, + "deprecation": { + "severity": "warning" + }, "eofline": true, "forin": true, "import-blacklist": [ @@ -68,7 +71,6 @@ "no-trailing-whitespace": false, "no-unnecessary-initializer": true, "no-unused-expression": true, - "no-use-before-declare": true, "no-var-keyword": true, "object-literal-sort-keys": false, "one-line": [