Skip to content

Commit

Permalink
Merge pull request #1347 from Senyoret1/angular14
Browse files Browse the repository at this point in the history
Update to Angular 14
  • Loading branch information
mrpalide committed Sep 6, 2022
2 parents 49bd6af + 91319b3 commit f5da40a
Show file tree
Hide file tree
Showing 21 changed files with 3,757 additions and 2,996 deletions.
5 changes: 3 additions & 2 deletions static/skywire-manager-src/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,10 @@
}
}
},
"defaultProject": "skywire-manager",
"cli": {
"analytics": "2d518d5d-5b45-41d0-ab29-e449d316a742",
"defaultCollection": "@angular-eslint/schematics"
"schematicCollections": [
"@angular-eslint/schematics"
]
}
}
6,584 changes: 3,672 additions & 2,912 deletions static/skywire-manager-src/package-lock.json

Large diffs are not rendered by default.

44 changes: 22 additions & 22 deletions static/skywire-manager-src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^13.2.5",
"@angular/cdk": "^13.2.5",
"@angular/common": "^13.2.5",
"@angular/compiler": "^13.2.5",
"@angular/core": "^13.2.5",
"@angular/forms": "^13.2.5",
"@angular/material": "^13.2.5",
"@angular/platform-browser": "^13.2.5",
"@angular/platform-browser-dynamic": "^13.2.5",
"@angular/router": "^13.2.5",
"@angular/animations": "^14.2.0",
"@angular/cdk": "^14.2.0",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/forms": "^14.2.0",
"@angular/material": "^14.2.0",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@ngx-translate/core": "^10.0.2",
"bignumber.js": "^7.2.1",
"chart.js": "^2.7.2",
Expand All @@ -33,20 +33,20 @@
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~13.2.5",
"@angular-eslint/builder": "13.1.0",
"@angular-eslint/eslint-plugin": "13.1.0",
"@angular-eslint/eslint-plugin-template": "13.1.0",
"@angular-eslint/schematics": "13.1.0",
"@angular-eslint/template-parser": "13.1.0",
"@angular/cli": "^13.2.5",
"@angular/compiler-cli": "~13.2.5",
"@angular/language-service": "^13.2.5",
"@angular-devkit/build-angular": "^14.2.1",
"@angular-eslint/builder": "14.0.2",
"@angular-eslint/eslint-plugin": "14.0.2",
"@angular-eslint/eslint-plugin-template": "14.0.2",
"@angular-eslint/schematics": "14.0.2",
"@angular-eslint/template-parser": "14.0.2",
"@angular/cli": "^14.2.1",
"@angular/compiler-cli": "^14.2.0",
"@angular/language-service": "^14.2.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "5.11.0",
"@typescript-eslint/parser": "5.11.0",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"bootstrap": "^4.1.3",
"eslint": "^8.2.0",
"eslint-plugin-import": "2.25.4",
Expand All @@ -61,6 +61,6 @@
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"typescript": "~4.5.5"
"typescript": "~4.8.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Inject, ViewChild, ElementRef, AfterViewInit, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogConfig, MatDialog } from '@angular/material/dialog';
import { FormGroup, FormBuilder } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';

import { StorageService, LabelInfo } from '../../../services/storage.service';
import { SnackbarService } from '../../../services/snackbar.service';
Expand All @@ -18,7 +18,7 @@ import { AppConfig } from 'src/app/app.config';
export class EditLabelComponent implements OnInit, AfterViewInit {
@ViewChild('firstInput') firstInput: ElementRef;

form: FormGroup;
form: UntypedFormGroup;

/**
* Opens the modal window. Please use this function instead of opening the window "by hand".
Expand All @@ -35,7 +35,7 @@ export class EditLabelComponent implements OnInit, AfterViewInit {
constructor(
public dialogRef: MatDialogRef<EditLabelComponent>,
@Inject(MAT_DIALOG_DATA) private data: LabelInfo,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private storageService: StorageService,
private snackbarService: SnackbarService,
) { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Inject, OnInit } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';
import { FormGroup, FormBuilder } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';

import { AppConfig } from 'src/app/app.config';
import { FilterFieldTypes, CompleteFilterProperties } from 'src/app/utils/filters';
Expand Down Expand Up @@ -33,7 +33,7 @@ export interface FiltersSelectiondParams {
styleUrls: ['./filters-selection.component.scss']
})
export class FiltersSelectionComponent implements OnInit {
form: FormGroup;
form: UntypedFormGroup;
filterFieldTypes = FilterFieldTypes;

/**
Expand All @@ -52,7 +52,7 @@ export class FiltersSelectionComponent implements OnInit {
constructor(
@Inject(MAT_DIALOG_DATA) public data: FiltersSelectiondParams,
public dialogRef: MatDialogRef<FiltersSelectionComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
) { }

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { Subscription } from 'rxjs';
Expand All @@ -20,7 +20,7 @@ import { processServiceError } from '../../../utils/errors';
styleUrls: ['./login.component.scss']
})
export class LoginComponent implements OnInit, OnDestroy {
form: FormGroup;
form: UntypedFormGroup;
loading = false;
isForVpn = false;
vpnKey = '';
Expand Down Expand Up @@ -52,8 +52,8 @@ export class LoginComponent implements OnInit, OnDestroy {
});
});

this.form = new FormGroup({
password: new FormControl('', Validators.required),
this.form = new UntypedFormGroup({
password: new UntypedFormControl('', Validators.required),
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, Inject, OnDestroy } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef, MatDialog, MatDialogConfig } from '@angular/material/dialog';
import { Subscription } from 'rxjs';

Expand Down Expand Up @@ -31,7 +31,7 @@ export interface LogsFilter {
})
export class LogFilterComponent implements OnInit, OnDestroy {
filters: LogsFilter[];
form: FormGroup;
form: UntypedFormGroup;

private formSubscription: Subscription;

Expand All @@ -50,7 +50,7 @@ export class LogFilterComponent implements OnInit, OnDestroy {
constructor(
@Inject(MAT_DIALOG_DATA) private data: LogsFilter,
public dialogRef: MatDialogRef<LogFilterComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
) { }

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, ViewChild, ElementRef, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MatDialogConfig, MatDialog, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { FormGroup, FormBuilder } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';

import { AppConfig } from 'src/app/app.config';

Expand All @@ -18,7 +18,7 @@ import { AppConfig } from 'src/app/app.config';
export class EditSkysocksClientNoteComponent implements OnInit {
@ViewChild('firstInput', { static: false }) firstInput: ElementRef;

form: FormGroup;
form: UntypedFormGroup;

/**
* Opens the modal window. Please use this function instead of opening the window "by hand".
Expand All @@ -35,7 +35,7 @@ export class EditSkysocksClientNoteComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<EditSkysocksClientNoteComponent>,
@Inject(MAT_DIALOG_DATA) private data: string,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
) { }

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, Inject } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef, MatDialog, MatDialogConfig } from '@angular/material/dialog';

import { AppConfig } from 'src/app/app.config';
Expand Down Expand Up @@ -35,7 +35,7 @@ export interface FilterWindowData {
styleUrls: ['./skysocks-client-filter.component.scss']
})
export class SkysocksClientFilterComponent implements OnInit {
form: FormGroup;
form: UntypedFormGroup;

completeCountriesList = countriesList;

Expand All @@ -54,7 +54,7 @@ export class SkysocksClientFilterComponent implements OnInit {
constructor(
@Inject(MAT_DIALOG_DATA) public data: FilterWindowData,
public dialogRef: MatDialogRef<SkysocksClientFilterComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
) { }

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, ViewChild, ElementRef, OnInit } from '@angular/core';
import { MatDialogRef, MatDialogConfig, MatDialog } from '@angular/material/dialog';
import { FormGroup, FormBuilder } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';

import { AppConfig } from 'src/app/app.config';

Expand All @@ -18,7 +18,7 @@ import { AppConfig } from 'src/app/app.config';
export class SkysocksClientPasswordComponent implements OnInit {
@ViewChild('firstInput', { static: false }) firstInput: ElementRef;

form: FormGroup;
form: UntypedFormGroup;

/**
* Opens the modal window. Please use this function instead of opening the window "by hand".
Expand All @@ -33,7 +33,7 @@ export class SkysocksClientPasswordComponent implements OnInit {

constructor(
public dialogRef: MatDialogRef<SkysocksClientPasswordComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
) { }

ngOnInit() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild, OnDestroy, ElementRef, Inject } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MatDialog, MatDialogConfig, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Subscription } from 'rxjs';

Expand Down Expand Up @@ -72,7 +72,7 @@ export class SkysocksClientSettingsComponent implements OnInit, OnDestroy {
@ViewChild('button') button: ButtonComponent;
@ViewChild('settingsButton') settingsButton: ButtonComponent;
@ViewChild('firstInput') firstInput: ElementRef;
form: FormGroup;
form: UntypedFormGroup;
// Entries to show on the history.
history: HistoryEntry[];

Expand Down Expand Up @@ -131,7 +131,7 @@ export class SkysocksClientSettingsComponent implements OnInit, OnDestroy {
@Inject(MAT_DIALOG_DATA) private data: Application,
public dialogRef: MatDialogRef<SkysocksClientSettingsComponent>,
private appsService: AppsService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private snackbarService: SnackbarService,
private dialog: MatDialog,
private proxyDiscoveryService: ProxyDiscoveryService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild, OnDestroy, ElementRef, Inject } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { MatDialogRef, MatDialog, MatDialogConfig, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Subscription } from 'rxjs';

Expand All @@ -24,7 +24,7 @@ import { Application } from 'src/app/app.datatypes';
export class SkysocksSettingsComponent implements OnInit, OnDestroy {
@ViewChild('button') button: ButtonComponent;
@ViewChild('firstInput') firstInput: ElementRef;
form: FormGroup;
form: UntypedFormGroup;

// True if configuring Vpn-Server, false if configuring Skysocks.
configuringVpn = false;
Expand All @@ -50,7 +50,7 @@ export class SkysocksSettingsComponent implements OnInit, OnDestroy {
constructor(
@Inject(MAT_DIALOG_DATA) private data: Application,
private appsService: AppsService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
public dialogRef: MatDialogRef<SkysocksSettingsComponent>,
private snackbarService: SnackbarService,
private dialog: MatDialog,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Inject, ViewChild, ElementRef, OnInit, OnDestroy } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogConfig, MatDialog } from '@angular/material/dialog';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
import { Subscription } from 'rxjs';

import { SnackbarService } from '../../../../../../services/snackbar.service';
Expand Down Expand Up @@ -38,7 +38,7 @@ export class RouterConfigComponent implements OnInit, OnDestroy {
@ViewChild('button') button: ButtonComponent;
@ViewChild('firstInput') firstInput: ElementRef;

form: FormGroup;
form: UntypedFormGroup;

private operationSubscription: Subscription;

Expand All @@ -57,7 +57,7 @@ export class RouterConfigComponent implements OnInit, OnDestroy {
constructor(
public dialogRef: MatDialogRef<RouterConfigComponent>,
@Inject(MAT_DIALOG_DATA) private data: RouterConfigParams,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private snackbarService: SnackbarService,
private routeService: RouteService,
) { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild, OnDestroy, ElementRef } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MatDialog, MatDialogConfig } from '@angular/material/dialog';
import { Subscription, of } from 'rxjs';
import { delay, flatMap } from 'rxjs/operators';
Expand Down Expand Up @@ -28,7 +28,7 @@ export class CreateTransportComponent implements OnInit, OnDestroy {
@ViewChild('button') button: ButtonComponent;
@ViewChild('firstInput') firstInput: ElementRef;
types: string[];
form: FormGroup;
form: UntypedFormGroup;

makePersistent = false;

Expand All @@ -49,7 +49,7 @@ export class CreateTransportComponent implements OnInit, OnDestroy {

constructor(
private transportService: TransportService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
public dialogRef: MatDialogRef<CreateTransportComponent>,
private snackbarService: SnackbarService,
private storageService: StorageService,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component, OnInit, Input, ViewChild, ElementRef, AfterViewInit, OnDestroy } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { Subscription } from 'rxjs';
Expand Down Expand Up @@ -28,7 +28,7 @@ export class PasswordComponent implements OnInit, AfterViewInit, OnDestroy {
*/
@Input() forInitialConfig = false;

form: FormGroup;
form: UntypedFormGroup;

private subscription: Subscription;
private formSubscription: Subscription;
Expand All @@ -42,10 +42,10 @@ export class PasswordComponent implements OnInit, AfterViewInit, OnDestroy {

ngOnInit() {
// TODO: Password validation is not exactly the same as in the hypervisor code.
this.form = new FormGroup({
oldPassword: new FormControl('', !this.forInitialConfig ? Validators.required : null),
newPassword: new FormControl('', Validators.compose([Validators.required, Validators.minLength(6), Validators.maxLength(64)])),
newPasswordConfirmation: new FormControl('', [Validators.required, this.validatePasswords.bind(this)]),
this.form = new UntypedFormGroup({
oldPassword: new UntypedFormControl('', !this.forInitialConfig ? Validators.required : null),
newPassword: new UntypedFormControl('', Validators.compose([Validators.required, Validators.minLength(6), Validators.maxLength(64)])),
newPasswordConfirmation: new UntypedFormControl('', [Validators.required, this.validatePasswords.bind(this)]),
});

this.formSubscription = this.form.controls['newPassword'].valueChanges
Expand Down
Loading

0 comments on commit f5da40a

Please sign in to comment.