Merge pull request #1451 from GNS3/upgrade-angular

Upgrade to Angular 14
This commit is contained in:
Jeremy Grossmann 2023-08-18 16:47:44 +10:00 committed by GitHub
commit 6322fea306
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
82 changed files with 3857 additions and 3538 deletions

View File

@ -3,11 +3,11 @@ __tests__
node_modules/*/test
node_modules/*/tests
powered-test
e2e
#e2e
# asset directories
docs
doc
#doc
website
images

View File

@ -27,7 +27,11 @@
"rxjs-compat/add/operator/map",
"classnames",
"stylenames",
"source-map-js"
"source-map-js",
"spark-md5",
"xterm",
"xterm-addon-attach",
"xterm-addon-fit"
],
"outputPath": "dist",
"index": "src/index.html",
@ -215,7 +219,6 @@
}
}
},
"defaultProject": "gns3-web-ui",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",

View File

@ -36,22 +36,22 @@
"generate-licenses-file": "yarn license-checker --production --csv --out licenses.csv",
"prebuildforelectron": "node set-variables-in-env.js --set src/environments/environment.electron.prod.ts",
"postbuildforelectron": "node set-variables-in-env.js --unset src/environments/environment.electron.prod.ts",
"postinstall": "ngcc --properties es5 browser module main --first-only --create-ivy-entry-points --tsconfig \"./src/tsconfig.app.json\" && ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points --tsconfig \"./src/tsconfig.app.json\"",
"postinstall": "ngcc --properties es2020 browser module main --first-only --create-ivy-entry-points --tsconfig \"./src/tsconfig.app.json\" && ngcc --properties es2020 browser module main --first-only --create-ivy-entry-points --tsconfig \"./src/tsconfig.app.json\"",
"snyk-protect": "snyk-protect",
"prepare": "yarn run snyk-protect"
},
"private": true,
"dependencies": {
"@angular/animations": "^13.3.5",
"@angular/cdk": "^13.3.5",
"@angular/common": "^13.3.5",
"@angular/compiler": "^13.3.5",
"@angular/core": "^13.3.5",
"@angular/forms": "^13.3.5",
"@angular/material": "^13.3.5",
"@angular/platform-browser": "^13.3.5",
"@angular/platform-browser-dynamic": "^13.3.5",
"@angular/router": "^13.3.5",
"@angular/animations": "^14.3.0",
"@angular/cdk": "^14.2.7",
"@angular/common": "^14.3.0",
"@angular/compiler": "^14.3.0",
"@angular/core": "^14.3.0",
"@angular/forms": "^14.3.0",
"@angular/material": "^14.2.7",
"@angular/platform-browser": "^14.3.0",
"@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^14.3.0",
"@sentry/browser": "^6.14.1",
"@snyk/protect": "^1.972.0",
"@types/jest": "^27.0.2",
@ -72,9 +72,9 @@
"material-design-icons": "^3.0.1",
"mousetrap": "^1.6.5",
"ng-circle-progress": "^1.6.0",
"ng2-file-upload": "^1.4.0",
"ng2-file-upload": "^3.0.0",
"ngx-childprocess": "^0.0.6",
"ngx-device-detector": "^3.0.0",
"ngx-device-detector": "4.0.1",
"ngx-electron": "^2.2.0",
"node-fetch": "^3.2.10",
"notosans-fontface": "^1.3.0",
@ -95,10 +95,10 @@
"zone.js": "^0.11.5"
},
"devDependencies": {
"@angular-devkit/build-angular": "^13.3.4",
"@angular/cli": "^13.3.4",
"@angular/compiler-cli": "^13.3.5",
"@angular/language-service": "^13.3.5",
"@angular-devkit/build-angular": "^14.2.12",
"@angular/cli": "^14.2.12",
"@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^14.3.0",
"@sentry/cli": "^2.0.4",
"@sentry/electron": "^3.0.7",
"@types/jasmine": "^4.0.3",

View File

@ -593,8 +593,8 @@ import { ProjectMapLockConfirmationDialogComponent } from './components/project-
SettingsService,
{ provide: ErrorHandler, useClass: ToasterErrorHandler },
{ provide: HTTP_INTERCEPTORS, useClass: HttpRequestsInterceptor, multi: true },
D3Service,
VersionService,
D3Service,
ProjectService,
SymbolService,
ControllerService,
@ -665,54 +665,7 @@ import { ProjectMapLockConfirmationDialogComponent } from './components/project-
LoginService,
UserService
],
entryComponents: [
AddControllerDialogComponent,
CreateSnapshotDialogComponent,
ProgressDialogComponent,
TemplateListDialogComponent,
AddBlankProjectDialogComponent,
ImportProjectDialogComponent,
ConfirmationDialogComponent,
StyleEditorDialogComponent,
PacketFiltersDialogComponent,
TextEditorDialogComponent,
SymbolsComponent,
DeleteConfirmationDialogComponent,
HelpDialogComponent,
StartCaptureDialogComponent,
ConfigEditorDialogComponent,
SaveProjectDialogComponent,
InfoDialogComponent,
ChangeSymbolDialogComponent,
EditProjectDialogComponent,
ConfiguratorDialogVpcsComponent,
ConfiguratorDialogEthernetHubComponent,
ConfiguratorDialogEthernetSwitchComponent,
ConfiguratorDialogSwitchComponent,
ConfiguratorDialogVirtualBoxComponent,
ConfiguratorDialogQemuComponent,
ConfiguratorDialogCloudComponent,
ConfiguratorDialogAtmSwitchComponent,
ConfiguratorDialogVmwareComponent,
ConfiguratorDialogIouComponent,
ConfiguratorDialogIosComponent,
ConfiguratorDialogDockerComponent,
ConfiguratorDialogNatComponent,
QemuImageCreatorComponent,
ChooseNameDialogComponent,
NavigationDialogComponent,
ScreenshotDialogComponent,
ConfirmationBottomSheetComponent,
ConfigDialogComponent,
AdbutlerComponent,
NewTemplateDialogComponent,
ChangeHostnameDialogComponent,
ApplianceInfoDialogComponent,
ConfigureCustomAdaptersDialogComponent,
EditNetworkConfigurationDialogComponent,
ProjectReadmeComponent
],
bootstrap: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {
constructor(protected _googleAnalyticsService: GoogleAnalyticsService) {}

View File

@ -1,5 +1,5 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ElectronService } from 'ngx-electron';
import { Controller } from '../../../models/controller';
@ -17,14 +17,14 @@ export class AddControllerDialogComponent implements OnInit {
];
locations = [];
controllerForm = new FormGroup({
name: new FormControl('', [Validators.required]),
location: new FormControl(''),
path: new FormControl(''),
ubridge_path: new FormControl(''),
host: new FormControl('', [Validators.required]),
port: new FormControl('', [Validators.required, Validators.min(1)]),
protocol: new FormControl('http:')
controllerForm = new UntypedFormGroup({
name: new UntypedFormControl('', [Validators.required]),
location: new UntypedFormControl(''),
path: new UntypedFormControl(''),
ubridge_path: new UntypedFormControl(''),
host: new UntypedFormControl('', [Validators.required]),
port: new UntypedFormControl('', [Validators.required, Validators.min(1)]),
protocol: new UntypedFormControl('http:')
});
constructor(

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import{ Controller } from '../../models/controller';
import { ControllerDatabase } from '../../services/controller.database';
@ -27,10 +27,10 @@ export class DirectLinkComponent implements OnInit {
{ key: 'remote', name: 'Remote' },
];
controllerForm = new FormGroup({
name: new FormControl('', [Validators.required]),
location: new FormControl(''),
protocol: new FormControl('http:')
controllerForm = new UntypedFormGroup({
name: new UntypedFormControl('', [Validators.required]),
location: new UntypedFormControl(''),
protocol: new UntypedFormControl('http:')
});
constructor(

View File

@ -1,5 +1,5 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Project } from '../../models/project';
import{ Controller } from '../../models/controller';
@ -11,7 +11,7 @@ import { ProjectService } from '../../services/project.service';
styleUrls: ['./export-portable-project.component.scss'],
})
export class ExportPortableProjectComponent implements OnInit {
export_project_form: FormGroup;
export_project_form: UntypedFormGroup;
chosenImage: string = '';
compression_methods: any = [];
compression_level: any = [];
@ -26,7 +26,7 @@ export class ExportPortableProjectComponent implements OnInit {
public dialogRef: MatDialogRef<ExportPortableProjectComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private projectService: ProjectService,
private _fb: FormBuilder
private _fb: UntypedFormBuilder
) {}
async ngOnInit() {

View File

@ -15,7 +15,7 @@ import {ActivatedRoute} from "@angular/router";
import {Controller} from "@models/controller";
import {Group} from "@models/groups/group";
import {User} from "@models/users/user";
import {FormControl, FormGroup} from "@angular/forms";
import {UntypedFormControl, UntypedFormGroup} from "@angular/forms";
import {MatDialog} from "@angular/material/dialog";
import {AddUserToGroupDialogComponent} from "@components/group-details/add-user-to-group-dialog/add-user-to-group-dialog.component";
import {RemoveToGroupDialogComponent} from "@components/group-details/remove-to-group-dialog/remove-to-group-dialog.component";
@ -34,7 +34,7 @@ export class GroupDetailsComponent implements OnInit {
controller: Controller;
group: Group;
members: User[];
editGroupForm: FormGroup;
editGroupForm: UntypedFormGroup;
pageEvent: PageEvent | undefined;
searchMembers: string;
roles: Role[];
@ -44,8 +44,8 @@ export class GroupDetailsComponent implements OnInit {
private groupService: GroupService,
private toastService: ToasterService) {
this.editGroupForm = new FormGroup({
groupname: new FormControl(''),
this.editGroupForm = new UntypedFormGroup({
groupname: new UntypedFormControl(''),
});
this.route.data.subscribe((d: { controller: Controller; group: Group, members: User[], roles: Role[] }) => {

View File

@ -12,7 +12,7 @@
*/
import {Component, Inject, OnInit} from '@angular/core';
import {MAT_DIALOG_DATA, MatDialogRef} from '@angular/material/dialog';
import {FormBuilder, FormControl, FormGroup, Validators} from "@angular/forms";
import {UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators} from "@angular/forms";
import {groupNameAsyncValidator} from "@components/group-management/add-group-dialog/groupNameAsyncValidator";
import {GroupNameValidator} from "@components/group-management/add-group-dialog/GroupNameValidator";
import {GroupService} from "../../../services/group.service";
@ -34,20 +34,20 @@ import {map, startWith} from "rxjs/operators";
})
export class AddGroupDialogComponent implements OnInit {
groupNameForm: FormGroup;
groupNameForm: UntypedFormGroup;
controller: Controller;
users: User[];
usersToAdd: Set<User> = new Set([]);
filteredUsers: Observable<User[]>
loading = false;
autocompleteControl = new FormControl();
autocompleteControl = new UntypedFormControl();
constructor(private dialogRef: MatDialogRef<AddGroupDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: { controller: Controller },
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private groupNameValidator: GroupNameValidator,
private groupService: GroupService,
private userService: UserService,
@ -57,7 +57,7 @@ export class AddGroupDialogComponent implements OnInit {
ngOnInit(): void {
this.controller = this.data.controller;
this.groupNameForm = this.formBuilder.group({
groupName: new FormControl(
groupName: new UntypedFormControl(
null,
[Validators.required, this.groupNameValidator.get],
[groupNameAsyncValidator(this.data.controller, this.groupService)]

View File

@ -10,14 +10,14 @@
*
* Author: Sylvain MATHIEU, Elise LEBEAU
*/
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { timer } from 'rxjs';
import { map, switchMap, tap } from 'rxjs/operators';
import { Controller } from "../../../models/controller";
import { GroupService } from "../../../services/group.service";
export const groupNameAsyncValidator = (controller: Controller, groupService: GroupService) => {
return (control: FormControl) => {
return (control: UntypedFormControl) => {
return timer(500).pipe(
switchMap(() => groupService.getGroups(controller)),
map((response) => {

View File

@ -38,7 +38,7 @@ export class AddImageDialogComponent implements OnInit {
public ngOnInit() {
this.controller = this.data;
this.uploaderImage = new FileUploader({});
this.uploaderImage = new FileUploader({url: ''});
this.uploaderImage.onAfterAddingFile = (file) => {
file.withCredentials = false;
};

View File

@ -1,5 +1,5 @@
import { Component, DoCheck, OnInit, ViewEncapsulation } from '@angular/core';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { AuthResponse } from '../../models/authResponse';
import{ Controller } from '../../models/controller';
@ -26,9 +26,9 @@ export class LoginComponent implements OnInit, DoCheck {
public isRememberMe: boolean = false;
public isRememberMeCheked: boolean = false;
loginForm = new FormGroup({
username: new FormControl('', [Validators.required]),
password: new FormControl('', [Validators.required]),
loginForm = new UntypedFormGroup({
username: new UntypedFormControl('', [Validators.required]),
password: new UntypedFormControl('', [Validators.required]),
});
constructor(

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import { Compute } from '../../../../../models/compute';
@ -19,7 +19,7 @@ import { ToasterService } from '../../../../../services/toaster.service';
export class CloudNodesAddTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
formGroup: FormGroup;
formGroup: UntypedFormGroup;
isLocalComputerChosen: boolean = true;
constructor(
@ -29,11 +29,11 @@ export class CloudNodesAddTemplateComponent implements OnInit {
private router: Router,
private toasterService: ToasterService,
private templateMocksService: TemplateMocksService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private computeService: ComputeService
) {
this.formGroup = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import { Compute } from '../../../../../models/compute';
@ -19,7 +19,7 @@ import { ToasterService } from '../../../../../services/toaster.service';
export class EthernetHubsAddTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
formGroup: FormGroup;
formGroup: UntypedFormGroup;
isLocalComputerChosen: boolean = true;
constructor(
@ -29,12 +29,12 @@ export class EthernetHubsAddTemplateComponent implements OnInit {
private router: Router,
private toasterService: ToasterService,
private templateMocksService: TemplateMocksService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private computeService: ComputeService
) {
this.formGroup = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
numberOfPorts: new FormControl(8, Validators.required),
templateName: new UntypedFormControl('', Validators.required),
numberOfPorts: new UntypedFormControl(8, Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import{ Controller } from '../../../../../models/controller';
import { EthernetHubTemplate } from '../../../../../models/templates/ethernet-hub-template';
@ -17,7 +17,7 @@ export class EthernetHubsTemplateDetailsComponent implements OnInit {
controller:Controller ;
ethernetHubTemplate: EthernetHubTemplate;
numberOfPorts: number;
inputForm: FormGroup;
inputForm: UntypedFormGroup;
isSymbolSelectionOpened: boolean = false;
categories = [];
@ -27,14 +27,14 @@ export class EthernetHubsTemplateDetailsComponent implements OnInit {
private controllerService: ControllerService,
private builtInTemplatesService: BuiltInTemplatesService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private builtInTemplatesConfigurationService: BuiltInTemplatesConfigurationService,
private router: Router
) {
this.inputForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import { Compute } from '../../../../../models/compute';
@ -19,7 +19,7 @@ import { ToasterService } from '../../../../../services/toaster.service';
export class EthernetSwitchesAddTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
formGroup: FormGroup;
formGroup: UntypedFormGroup;
isLocalComputerChosen: boolean = true;
constructor(
@ -29,12 +29,12 @@ export class EthernetSwitchesAddTemplateComponent implements OnInit {
private router: Router,
private toasterService: ToasterService,
private templateMocksService: TemplateMocksService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private computeService: ComputeService
) {
this.formGroup = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
numberOfPorts: new FormControl(8, Validators.required),
templateName: new UntypedFormControl('', Validators.required),
numberOfPorts: new UntypedFormControl(8, Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import{ Controller } from '../../../../../models/controller';
import { EthernetSwitchTemplate } from '../../../../../models/templates/ethernet-switch-template';
@ -18,7 +18,7 @@ export class EthernetSwitchesTemplateDetailsComponent implements OnInit {
@ViewChild(PortsComponent) portsComponent: PortsComponent;
controller:Controller ;
ethernetSwitchTemplate: EthernetSwitchTemplate;
inputForm: FormGroup;
inputForm: UntypedFormGroup;
isSymbolSelectionOpened: boolean = false;
categories = [];
consoleTypes: string[] = [];
@ -28,14 +28,14 @@ export class EthernetSwitchesTemplateDetailsComponent implements OnInit {
private controllerService: ControllerService,
private builtInTemplatesService: BuiltInTemplatesService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private builtInTemplatesConfigurationService: BuiltInTemplatesConfigurationService,
private router: Router
) {
this.inputForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,6 +1,6 @@
import { CommonModule } from '@angular/common';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { AbstractControlDirective, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AbstractControlDirective, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatCommonModule } from '@angular/material/core';
@ -77,7 +77,7 @@ xdescribe('AddDockerTemplateComponent', () => {
{ provide: ToasterService, useValue: mockedToasterService },
{ provide: TemplateMocksService, useClass: TemplateMocksService },
{ provide: DockerConfigurationService, useClass: DockerConfigurationService },
{ provide: AbstractControlDirective, useExisting: FormControl, useMulti: true },
{ provide: AbstractControlDirective, useExisting: UntypedFormControl, useMulti: true },
],
declarations: [AddDockerTemplateComponent],
}).compileComponents();

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import { Compute } from '../../../../models/compute';
@ -27,9 +27,9 @@ export class AddDockerTemplateComponent implements OnInit {
selectedImage: DockerImage;
newImageSelected: boolean = false;
virtualMachineForm: FormGroup;
containerNameForm: FormGroup;
networkAdaptersForm: FormGroup;
virtualMachineForm: UntypedFormGroup;
containerNameForm: UntypedFormGroup;
networkAdaptersForm: UntypedFormGroup;
isLocalComputerChosen: boolean = true;
constructor(
@ -38,7 +38,7 @@ export class AddDockerTemplateComponent implements OnInit {
private dockerService: DockerService,
private toasterService: ToasterService,
private router: Router,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private templateMocksService: TemplateMocksService,
private configurationService: DockerConfigurationService,
private computeService: ComputeService
@ -46,15 +46,15 @@ export class AddDockerTemplateComponent implements OnInit {
this.dockerTemplate = new DockerTemplate();
this.virtualMachineForm = this.formBuilder.group({
filename: new FormControl(null, Validators.required),
filename: new UntypedFormControl(null, Validators.required),
});
this.containerNameForm = this.formBuilder.group({
templateName: new FormControl(null, Validators.required),
templateName: new UntypedFormControl(null, Validators.required),
});
this.networkAdaptersForm = this.formBuilder.group({
adapters: new FormControl('1', Validators.required),
adapters: new UntypedFormControl('1', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import{ Controller } from '../../../../models/controller';
@ -17,7 +17,7 @@ export class CopyDockerTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
dockerTemplate: DockerTemplate;
templateNameForm: FormGroup;
templateNameForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -25,10 +25,10 @@ export class CopyDockerTemplateComponent implements OnInit {
private dockerService: DockerService,
private toasterService: ToasterService,
private router: Router,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.templateNameForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
import{ Controller } from '../../../../models/controller';
@ -26,7 +26,7 @@ export class DockerTemplateDetailsComponent implements OnInit {
adapters: CustomAdapter[] = [];
displayedColumns: string[] = ['adapter_number', 'port_name'];
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -34,14 +34,14 @@ export class DockerTemplateDetailsComponent implements OnInit {
private dockerService: DockerService,
private toasterService: ToasterService,
private configurationService: DockerConfigurationService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private router: Router
) {
this.generalSettingsForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
adapter: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
adapter: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,6 +1,6 @@
import { Location } from '@angular/common';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { ActivatedRoute, Router } from '@angular/router';
import { UploadServiceService } from 'app/common/uploading-processbar/upload-service.service';
@ -29,9 +29,9 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
iosTemplate: IosTemplate;
isEtherSwitchRouter: boolean = false;
iosImageForm: FormGroup;
iosNameForm: FormGroup;
iosMemoryForm: FormGroup;
iosImageForm: UntypedFormGroup;
iosNameForm: UntypedFormGroup;
iosMemoryForm: UntypedFormGroup;
selectedPlatform: string;
networkAdaptersForTemplate: string[] = [];
@ -59,7 +59,7 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
private controllerService: ControllerService,
private iosService: IosService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private router: Router,
private templateMocksService: TemplateMocksService,
private iosConfigurationService: IosConfigurationService,
@ -70,22 +70,22 @@ export class AddIosTemplateComponent implements OnInit, OnDestroy {
this.iosTemplate = new IosTemplate();
this.iosImageForm = this.formBuilder.group({
imageName: new FormControl(null, [Validators.required]),
imageName: new UntypedFormControl(null, [Validators.required]),
});
this.iosNameForm = this.formBuilder.group({
templateName: new FormControl(null, [Validators.required]),
platform: new FormControl(null, [Validators.required]),
chassis: new FormControl(null, [Validators.required]),
templateName: new UntypedFormControl(null, [Validators.required]),
platform: new UntypedFormControl(null, [Validators.required]),
chassis: new UntypedFormControl(null, [Validators.required]),
});
this.iosMemoryForm = this.formBuilder.group({
memory: new FormControl(null, [Validators.required]),
memory: new UntypedFormControl(null, [Validators.required]),
});
}
ngOnInit() {
this.uploader = new FileUploader({});
this.uploader = new FileUploader({url: ''});
this.uploader.onAfterAddingFile = (file) => {
file.withCredentials = false;
};

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import{ Controller } from '../../../../models/controller';
@ -17,7 +17,7 @@ export class CopyIosTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
iosTemplate: IosTemplate;
formGroup: FormGroup;
formGroup: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -25,10 +25,10 @@ export class CopyIosTemplateComponent implements OnInit {
private iosService: IosService,
private toasterService: ToasterService,
private router: Router,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.formGroup = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import{ Controller } from '../../../../models/controller';
import { IosTemplate } from '../../../../models/templates/ios-template';
@ -31,40 +31,40 @@ export class IosTemplateDetailsComponent implements OnInit {
networkAdaptersForPlatform = {};
networkModules = {};
generalSettingsForm: FormGroup;
memoryForm: FormGroup;
advancedForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
memoryForm: UntypedFormGroup;
advancedForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
private controllerService: ControllerService,
private iosService: IosService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private iosConfigurationService: IosConfigurationService,
private router: Router
) {
this.generalSettingsForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
path: new FormControl('', Validators.required),
initialConfig: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
path: new UntypedFormControl('', Validators.required),
initialConfig: new UntypedFormControl('', Validators.required),
});
this.memoryForm = this.formBuilder.group({
ram: new FormControl('', Validators.required),
nvram: new FormControl('', Validators.required),
iomemory: new FormControl('', Validators.required),
disk0: new FormControl('', Validators.required),
disk1: new FormControl('', Validators.required),
ram: new UntypedFormControl('', Validators.required),
nvram: new UntypedFormControl('', Validators.required),
iomemory: new UntypedFormControl('', Validators.required),
disk0: new UntypedFormControl('', Validators.required),
disk1: new UntypedFormControl('', Validators.required),
});
this.advancedForm = this.formBuilder.group({
systemId: new FormControl('', Validators.required),
idlemax: new FormControl('', Validators.required),
idlesleep: new FormControl('', Validators.required),
execarea: new FormControl('', Validators.required),
systemId: new UntypedFormControl('', Validators.required),
idlemax: new UntypedFormControl('', Validators.required),
idlesleep: new UntypedFormControl('', Validators.required),
execarea: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnDestroy, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { ActivatedRoute, Router } from '@angular/router';
import { UploadServiceService } from 'app/common/uploading-processbar/upload-service.service';
@ -32,8 +32,8 @@ export class AddIouTemplateComponent implements OnInit, OnDestroy {
iouImages: IouImage[] = [];
uploader: FileUploader;
templateNameForm: FormGroup;
imageForm: FormGroup;
templateNameForm: UntypedFormGroup;
imageForm: UntypedFormGroup;
isLocalComputerChosen: boolean = true;
uploadProgress: number = 0
subscription: Subscription;
@ -44,7 +44,7 @@ export class AddIouTemplateComponent implements OnInit, OnDestroy {
private iouService: IouService,
private toasterService: ToasterService,
private router: Router,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private templateMocksService: TemplateMocksService,
private computeService: ComputeService,
private uploadServiceService: UploadServiceService,
@ -53,16 +53,16 @@ export class AddIouTemplateComponent implements OnInit, OnDestroy {
this.iouTemplate = new IouTemplate();
this.templateNameForm = this.formBuilder.group({
templateName: new FormControl(null, Validators.required),
templateName: new UntypedFormControl(null, Validators.required),
});
this.imageForm = this.formBuilder.group({
imageName: new FormControl('', Validators.required),
imageName: new UntypedFormControl('', Validators.required),
});
}
ngOnInit() {
this.uploader = new FileUploader({});
this.uploader = new FileUploader({url: ''});
this.uploader.onAfterAddingFile = (file) => {
file.withCredentials = false;
};

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import{ Controller } from '../../../../models/controller';
@ -17,7 +17,7 @@ export class CopyIouTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
iouTemplate: IouTemplate;
templateNameForm: FormGroup;
templateNameForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -25,10 +25,10 @@ export class CopyIouTemplateComponent implements OnInit {
private qemuService: IouService,
private toasterService: ToasterService,
private router: Router,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.templateNameForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import{ Controller } from '../../../../models/controller';
import { IouTemplate } from '../../../../models/templates/iou-template';
@ -24,8 +24,8 @@ export class IouTemplateDetailsComponent implements OnInit {
consoleResolutions: string[] = [];
categories = [];
generalSettingsForm: FormGroup;
networkForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
networkForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -34,19 +34,19 @@ export class IouTemplateDetailsComponent implements OnInit {
private toasterService: ToasterService,
private configurationService: IouConfigurationService,
private router: Router,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.generalSettingsForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
path: new FormControl('', Validators.required),
initialConfig: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
path: new UntypedFormControl('', Validators.required),
initialConfig: new UntypedFormControl('', Validators.required),
});
this.networkForm = this.formBuilder.group({
ethernetAdapters: new FormControl('', Validators.required),
serialAdapters: new FormControl('', Validators.required),
ethernetAdapters: new UntypedFormControl('', Validators.required),
serialAdapters: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatSnackBar } from '@angular/material/snack-bar';
import { ActivatedRoute, Router } from '@angular/router';
import { UploadServiceService } from '../../../../common/uploading-processbar/upload-service.service';
@ -38,9 +38,9 @@ export class AddQemuVmTemplateComponent implements OnInit {
uploadedFile: boolean = false;
uploadProgress: number = 0;
nameForm: FormGroup;
memoryForm: FormGroup;
diskForm: FormGroup;
nameForm: UntypedFormGroup;
memoryForm: UntypedFormGroup;
diskForm: UntypedFormGroup;
isLocalComputerChosen: boolean = true;
constructor(
@ -49,7 +49,7 @@ export class AddQemuVmTemplateComponent implements OnInit {
private qemuService: QemuService,
private toasterService: ToasterService,
private router: Router,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private templateMocksService: TemplateMocksService,
private configurationService: QemuConfigurationService,
private computeService: ComputeService,
@ -59,20 +59,20 @@ export class AddQemuVmTemplateComponent implements OnInit {
this.qemuTemplate = new QemuTemplate();
this.nameForm = this.formBuilder.group({
templateName: new FormControl(null, Validators.required),
templateName: new UntypedFormControl(null, Validators.required),
});
this.memoryForm = this.formBuilder.group({
ramMemory: new FormControl('256', Validators.required),
ramMemory: new UntypedFormControl('256', Validators.required),
});
this.diskForm = this.formBuilder.group({
fileName: new FormControl('', Validators.required),
fileName: new UntypedFormControl('', Validators.required),
});
}
ngOnInit() {
this.uploader = new FileUploader({});
this.uploader = new FileUploader({url: ''});
this.uploader.onAfterAddingFile = (file) => {
file.withCredentials = false;

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import { QemuBinary } from '../../../../models/qemu/qemu-binary';
@ -18,7 +18,7 @@ export class CopyQemuVmTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
qemuTemplate: QemuTemplate;
nameForm: FormGroup;
nameForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -26,10 +26,10 @@ export class CopyQemuVmTemplateComponent implements OnInit {
private qemuService: QemuService,
private toasterService: ToasterService,
private router: Router,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.nameForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,7 +1,7 @@
import { CommonModule } from '@angular/common';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AbstractControlDirective, FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { AbstractControlDirective, UntypedFormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
import { MatCheckboxModule } from '@angular/material/checkbox';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
@ -66,7 +66,7 @@ describe('QemuVmTemplateDetailsComponent', () => {
{ provide: QemuService, useValue: mockedQemuService },
{ provide: ToasterService, useValue: mockedToasterService },
{ provide: QemuConfigurationService, useClass: QemuConfigurationService },
{ provide: AbstractControlDirective, useExisting: FormControl, useMulti: true },
{ provide: AbstractControlDirective, useExisting: UntypedFormControl, useMulti: true },
],
declarations: [QemuVmTemplateDetailsComponent],
schemas: [NO_ERRORS_SCHEMA],

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { QemuBinary } from '../../../../models/qemu/qemu-binary';
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
@ -30,7 +30,7 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
activateCpuThrottling: boolean = true;
isConfiguratorOpened: boolean = false;
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
selectPlatform: string[] = [];
selectedPlatform: string;
@ -44,13 +44,13 @@ export class QemuVmTemplateDetailsComponent implements OnInit {
private qemuService: QemuService,
private toasterService: ToasterService,
private configurationService: QemuConfigurationService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private router: Router
) {
this.generalSettingsForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import{ Controller } from '../../../../models/controller';
@ -20,7 +20,7 @@ export class AddVirtualBoxTemplateComponent implements OnInit {
virtualMachines: VirtualBoxVm[];
selectedVM: VirtualBoxVm;
virtualBoxTemplate: VirtualBoxTemplate;
vmForm: FormGroup;
vmForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -29,10 +29,10 @@ export class AddVirtualBoxTemplateComponent implements OnInit {
private toasterService: ToasterService,
private templateMocksService: TemplateMocksService,
private router: Router,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.vmForm = this.formBuilder.group({
vm: new FormControl('', Validators.required),
vm: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
import{ Controller } from '../../../../models/controller';
@ -25,8 +25,8 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit {
networkTypes = [];
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
isConfiguratorOpened: boolean = false;
generalSettingsForm: FormGroup;
networkForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
networkForm: UntypedFormGroup;
@ViewChild('customAdaptersConfigurator')
customAdaptersConfigurator: CustomAdaptersComponent;
@ -36,21 +36,21 @@ export class VirtualBoxTemplateDetailsComponent implements OnInit {
private controllerService: ControllerService,
private virtualBoxService: VirtualBoxService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private virtualBoxConfigurationService: VirtualBoxConfigurationService,
private router: Router
) {
this.generalSettingsForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
ram: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
ram: new UntypedFormControl('', Validators.required),
});
this.networkForm = this.formBuilder.group({
adapters: new FormControl('', Validators.required),
nameFormat: new FormControl('', Validators.required),
size: new FormControl('', Validators.required),
adapters: new UntypedFormControl('', Validators.required),
nameFormat: new UntypedFormControl('', Validators.required),
size: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import{ Controller } from '../../../../models/controller';
@ -20,7 +20,7 @@ export class AddVmwareTemplateComponent implements OnInit {
virtualMachines: VmwareVm[];
selectedVM: VmwareVm;
vmwareTemplate: VmwareTemplate;
templateNameForm: FormGroup;
templateNameForm: UntypedFormGroup;
constructor(
private route: ActivatedRoute,
@ -29,10 +29,10 @@ export class AddVmwareTemplateComponent implements OnInit {
private toasterService: ToasterService,
private templateMocksService: TemplateMocksService,
private router: Router,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.templateNameForm = this.formBuilder.group({
templateName: new FormControl(null, [Validators.required]),
templateName: new UntypedFormControl(null, [Validators.required]),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { CustomAdapter } from '../../../../models/qemu/qemu-custom-adapter';
import{ Controller } from '../../../../models/controller';
@ -18,7 +18,7 @@ import { CustomAdaptersComponent } from '../../common/custom-adapters/custom-ada
export class VmwareTemplateDetailsComponent implements OnInit {
controller:Controller ;
vmwareTemplate: VmwareTemplate;
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
displayedColumns: string[] = ['adapter_number', 'port_name', 'adapter_type', 'actions'];
isConfiguratorOpened: boolean = false;
isSymbolSelectionOpened: boolean = false;
@ -35,14 +35,14 @@ export class VmwareTemplateDetailsComponent implements OnInit {
private controllerService: ControllerService,
private vmwareService: VmwareService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private vmwareConfigurationService: VmwareConfigurationService,
private router: Router
) {
this.generalSettingsForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
import { Compute } from '../../../../models/compute';
@ -19,7 +19,7 @@ import { VpcsService } from '../../../../services/vpcs.service';
export class AddVpcsTemplateComponent implements OnInit {
controller:Controller ;
templateName: string = '';
templateNameForm: FormGroup;
templateNameForm: UntypedFormGroup;
isLocalComputerChosen: boolean = true;
constructor(
@ -29,11 +29,11 @@ export class AddVpcsTemplateComponent implements OnInit {
private router: Router,
private toasterService: ToasterService,
private templateMocksService: TemplateMocksService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private computeService: ComputeService
) {
this.templateNameForm = this.formBuilder.group({
templateName: new FormControl(null, [Validators.required]),
templateName: new UntypedFormControl(null, [Validators.required]),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import{ Controller } from '../../../../models/controller';
import { VpcsTemplate } from '../../../../models/templates/vpcs-template';
@ -16,7 +16,7 @@ import { VpcsService } from '../../../../services/vpcs.service';
export class VpcsTemplateDetailsComponent implements OnInit {
controller:Controller ;
vpcsTemplate: VpcsTemplate;
inputForm: FormGroup;
inputForm: UntypedFormGroup;
isSymbolSelectionOpened: boolean = false;
consoleTypes: string[] = [];
categories = [];
@ -26,15 +26,15 @@ export class VpcsTemplateDetailsComponent implements OnInit {
private controllerService: ControllerService,
private vpcsService: VpcsService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private vpcsConfigurationService: VpcsConfigurationService,
private router: Router
) {
this.inputForm = this.formBuilder.group({
templateName: new FormControl('', Validators.required),
defaultName: new FormControl('', Validators.required),
scriptFile: new FormControl('', Validators.required),
symbol: new FormControl('', Validators.required),
templateName: new UntypedFormControl('', Validators.required),
defaultName: new UntypedFormControl('', Validators.required),
scriptFile: new UntypedFormControl('', Validators.required),
symbol: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../cartography/models/node';
import{ Controller } from '../../../models/controller';
@ -14,17 +14,17 @@ import { ToasterService } from '../../../services/toaster.service';
export class ChangeHostnameDialogComponent implements OnInit {
controller:Controller ;
node: Node;
inputForm: FormGroup;
inputForm: UntypedFormGroup;
name: string;
constructor(
public dialogRef: MatDialogRef<ChangeHostnameDialogComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.inputForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { ResizeEvent } from 'angular-resizable-element';
import { Node } from '../../../cartography/models/node';
import { Project } from '../../../models/project';
@ -37,7 +37,7 @@ export class ConsoleWrapperComponent implements OnInit {
) {}
nodes: Node[] = [];
selected = new FormControl(0);
selected = new UntypedFormControl(0);
ngOnInit() {
this.themeService.getActualTheme() === 'light'

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Link } from '../../../../models/link';
import { Project } from '../../../../models/project';
@ -20,12 +20,12 @@ export class LinkStyleEditorDialogComponent implements OnInit {
controller:Controller ;
project: Project;
link: Link;
formGroup: FormGroup;
formGroup: UntypedFormGroup;
borderTypes = ["Solid", "Dash", "Dot", "Dash Dot", "Dash Dot Dot"];
constructor(
public dialogRef: MatDialogRef<LinkStyleEditorDialogComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private toasterService: ToasterService,
private linkService: LinkService,
private linksDataSource: LinksDataSource,
@ -34,9 +34,9 @@ export class LinkStyleEditorDialogComponent implements OnInit {
private nonNegativeValidator: NonNegativeValidator
) {
this.formGroup = this.formBuilder.group({
color: new FormControl('', [Validators.required]),
width: new FormControl('', [Validators.required, nonNegativeValidator.get]),
type: new FormControl('', [Validators.required])
color: new UntypedFormControl('', [Validators.required]),
width: new UntypedFormControl('', [Validators.required, nonNegativeValidator.get]),
type: new UntypedFormControl('', [Validators.required])
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { DrawingToMapDrawingConverter } from '../../../../cartography/converters/map/drawing-to-map-drawing-converter';
import { MapDrawingToSvgConverter } from '../../../../cartography/converters/map/map-drawing-to-svg-converter';
@ -26,7 +26,7 @@ export class StyleEditorDialogComponent implements OnInit {
project: Project;
drawing: Drawing;
element: ElementData;
formGroup: FormGroup;
formGroup: UntypedFormGroup;
borderTypes = [
{ qt: 'none', value: 'none', name: 'Solid' },
{ qt: '10, 2', value: '25, 25', name: 'Dash' },
@ -42,15 +42,15 @@ export class StyleEditorDialogComponent implements OnInit {
private mapDrawingToSvgConverter: MapDrawingToSvgConverter,
private drawingService: DrawingService,
private drawingsDataSource: DrawingsDataSource,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private toasterService: ToasterService,
private nonNegativeValidator: NonNegativeValidator,
private rotationValidator: RotationValidator,
private qtDasharrayFixer: QtDasharrayFixer
) {
this.formGroup = this.formBuilder.group({
borderWidth: new FormControl('', [Validators.required, nonNegativeValidator.get]),
rotation: new FormControl('', [Validators.required, rotationValidator.get]),
borderWidth: new UntypedFormControl('', [Validators.required, nonNegativeValidator.get]),
rotation: new UntypedFormControl('', [Validators.required, rotationValidator.get]),
});
}

View File

@ -1,5 +1,5 @@
import { Component, ElementRef, OnInit, Renderer2, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { DrawingToMapDrawingConverter } from '../../../../cartography/converters/map/drawing-to-map-drawing-converter';
import { MapDrawingToSvgConverter } from '../../../../cartography/converters/map/map-drawing-to-svg-converter';
@ -40,7 +40,7 @@ export class TextEditorDialogComponent implements OnInit {
element: TextElement;
rotation: string;
isTextEditable: boolean;
formGroup: FormGroup;
formGroup: UntypedFormGroup;
constructor(
private dialogRef: MatDialogRef<TextEditorDialogComponent>,
@ -53,7 +53,7 @@ export class TextEditorDialogComponent implements OnInit {
private nodesDataSource: NodesDataSource,
private linkService: LinkService,
private linksDataSource: LinksDataSource,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private toasterService: ToasterService,
private rotationValidator: RotationValidator,
private fontFixer: FontFixer
@ -61,7 +61,7 @@ export class TextEditorDialogComponent implements OnInit {
ngOnInit() {
this.formGroup = this.formBuilder.group({
rotation: new FormControl('', [Validators.required, this.rotationValidator.get]),
rotation: new UntypedFormControl('', [Validators.required, this.rotationValidator.get]),
});
if (this.label && this.node) {

View File

@ -33,7 +33,7 @@ export class ImportApplianceComponent implements OnInit {
) {}
ngOnInit() {
this.uploader = new FileUploader({});
this.uploader = new FileUploader({url: ''});
this.uploader.onAfterAddingFile = (file) => {
file.withCredentials = false;
};

View File

@ -9,7 +9,7 @@ import {
OnInit,
ViewChild,
} from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { Subscription } from 'rxjs';
import { NodesDataSource } from '../../../cartography/datasources/nodes-datasource';
import { Drawing } from '../../../cartography/models/drawing';
@ -63,7 +63,7 @@ export class LogConsoleComponent implements OnInit, AfterViewInit, OnDestroy {
public style: object = {};
public isDraggingEnabled: boolean = false;
public isLightThemeEnabled: boolean = false;
public selected = new FormControl(0);
public selected = new UntypedFormControl(0);
constructor(
private projectWebServiceHandler: ProjectWebServiceHandler,

View File

@ -149,7 +149,7 @@ export class NewTemplateDialogComponent implements OnInit {
this.dataSource.paginator = this.paginator;
});
this.uploader = new FileUploader({});
this.uploader = new FileUploader({url: ''});
this.uploader.onAfterAddingFile = (file) => {
file.withCredentials = false;
};
@ -168,7 +168,7 @@ export class NewTemplateDialogComponent implements OnInit {
this.getAppliance(item.url);
};
this.uploaderImage = new FileUploader({});
this.uploaderImage = new FileUploader({url: ''});
this.uploaderImage.onAfterAddingFile = (file) => {
file.withCredentials = false;
};

View File

@ -1,5 +1,5 @@
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { Router } from '@angular/router';
import{ Controller } from '../../../../models/controller';
@ -17,14 +17,14 @@ import { ProjectNameValidator } from '../../../projects/models/projectNameValida
})
export class TemplateNameDialogComponent implements OnInit {
controller:Controller ;
templateNameForm: FormGroup;
templateNameForm: UntypedFormGroup;
constructor(
public dialogRef: MatDialogRef<TemplateNameDialogComponent>,
private router: Router,
private dialog: MatDialog,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private templateNameValidator: ProjectNameValidator,
private templateService: TemplateService,
@Inject(MAT_DIALOG_DATA) public data: any
@ -33,7 +33,7 @@ export class TemplateNameDialogComponent implements OnInit {
ngOnInit() {
let name = this.data['name'];
this.templateNameForm = this.formBuilder.group({
templateName: new FormControl(
templateName: new UntypedFormControl(
name,
[Validators.required, this.templateNameValidator.get],
[templateNameAsyncValidator(this.controller, this.templateService)]

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -15,9 +15,9 @@ export class ConfiguratorDialogAtmSwitchComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
nameForm: FormGroup;
inputForm: FormGroup;
abstractForm: FormGroup;
nameForm: UntypedFormGroup;
inputForm: UntypedFormGroup;
abstractForm: UntypedFormGroup;
consoleTypes: string[] = [];
nodeMappings = new Map<string, string>();
@ -38,22 +38,22 @@ export class ConfiguratorDialogAtmSwitchComponent implements OnInit {
public dialogRef: MatDialogRef<ConfiguratorDialogAtmSwitchComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.nameForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
this.inputForm = this.formBuilder.group({
sourcePort: new FormControl('', Validators.required),
sourceVci: new FormControl('', Validators.required),
destinationPort: new FormControl('', Validators.required),
destinationVci: new FormControl('', Validators.required),
sourcePort: new UntypedFormControl('', Validators.required),
sourceVci: new UntypedFormControl('', Validators.required),
destinationPort: new UntypedFormControl('', Validators.required),
destinationVci: new UntypedFormControl('', Validators.required),
});
this.abstractForm = this.formBuilder.group({
sourceVpi: new FormControl('', Validators.required),
destinationVpi: new FormControl('', Validators.required),
sourceVpi: new UntypedFormControl('', Validators.required),
destinationVpi: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import { UdpTunnelsComponent } from '../../../../../components/preferences/common/udp-tunnels/udp-tunnels.component';
@ -19,7 +19,7 @@ export class ConfiguratorDialogCloudComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
consoleTypes: string[] = [];
onCloseOptions = [];
bootPriorities = [];
@ -41,11 +41,11 @@ export class ConfiguratorDialogCloudComponent implements OnInit {
public dialogRef: MatDialogRef<ConfiguratorDialogCloudComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private builtInTemplatesConfigurationService: BuiltInTemplatesConfigurationService
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -19,7 +19,7 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
consoleTypes: string[] = [];
consoleResolutions: string[] = ['2560x1440', '1920x1080', '1680x1050', '1440x900', '1366x768', '1280x1024', '1280x800', '1024x768', '800x600', '640x480'];
private conf = {
@ -33,19 +33,19 @@ export class ConfiguratorDialogDockerComponent implements OnInit {
public dialogReference: MatDialogRef<ConfiguratorDialogDockerComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private dockerConfigurationService: DockerConfigurationService,
private nonNegativeValidator: NonNegativeValidator,
private dialog: MatDialog
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
adapter: new FormControl('', Validators.required),
memory: new FormControl('', nonNegativeValidator.get),
cpus: new FormControl('', nonNegativeValidator.get),
startCommand: new FormControl(''),
consoleHttpPort: new FormControl('', Validators.required),
consoleHttpPath: new FormControl('', Validators.required)
name: new UntypedFormControl('', Validators.required),
adapter: new UntypedFormControl('', Validators.required),
memory: new UntypedFormControl('', nonNegativeValidator.get),
cpus: new UntypedFormControl('', nonNegativeValidator.get),
startCommand: new UntypedFormControl(''),
consoleHttpPort: new UntypedFormControl('', Validators.required),
consoleHttpPath: new UntypedFormControl('', Validators.required)
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder } from '@angular/forms';
import { UntypedFormBuilder } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../../cartography/models/node';
import{ Controller } from '../../../../../../models/controller';
@ -22,7 +22,7 @@ export class ConfigureCustomAdaptersDialogComponent implements OnInit {
public dialogRef: MatDialogRef<ConfigureCustomAdaptersDialogComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private dockerConfigurationService: DockerConfigurationService
) {}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import { PortsComponent } from '../../../../../components/preferences/common/ports/ports.component';
@ -18,18 +18,18 @@ export class ConfiguratorDialogEthernetSwitchComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
inputForm: FormGroup;
inputForm: UntypedFormGroup;
consoleTypes: string[] = [];
constructor(
public dialogRef: MatDialogRef<ConfiguratorDialogEthernetSwitchComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private ethernetSwitchesConfigurationService: BuiltInTemplatesConfigurationService
) {
this.inputForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -16,7 +16,7 @@ export class ConfiguratorDialogEthernetHubComponent implements OnInit {
controller:Controller ;
node: Node;
numberOfPorts: number;
inputForm: FormGroup;
inputForm: UntypedFormGroup;
consoleTypes: string[] = [];
categories = [];
name: string;
@ -25,11 +25,11 @@ export class ConfiguratorDialogEthernetHubComponent implements OnInit {
public dialogRef: MatDialogRef<ConfiguratorDialogEthernetHubComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private vpcsConfigurationService: VpcsConfigurationService
) {
this.inputForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -16,24 +16,24 @@ export class ConfiguratorDialogIosComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
memoryForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
memoryForm: UntypedFormGroup;
consoleTypes: string[] = [];
constructor(
public dialogRef: MatDialogRef<ConfiguratorDialogIosComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private configurationService: IosConfigurationService
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
this.memoryForm = this.formBuilder.group({
ram: new FormControl('', Validators.required),
nvram: new FormControl('', Validators.required),
ram: new UntypedFormControl('', Validators.required),
nvram: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -16,24 +16,24 @@ export class ConfiguratorDialogIouComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
networkForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
networkForm: UntypedFormGroup;
consoleTypes: string[] = [];
constructor(
public dialogRef: MatDialogRef<ConfiguratorDialogIouComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private configurationService: IouConfigurationService
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
this.networkForm = this.formBuilder.group({
ethernetAdapters: new FormControl('', Validators.required),
serialAdapters: new FormControl('', Validators.required),
ethernetAdapters: new UntypedFormControl('', Validators.required),
serialAdapters: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -15,16 +15,16 @@ export class ConfiguratorDialogNatComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
constructor(
public dialogRef: MatDialogRef<ConfiguratorDialogNatComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import { CustomAdaptersTableComponent } from '../../../../../components/preferences/common/custom-adapters-table/custom-adapters-table.component';
@ -21,7 +21,7 @@ export class ConfiguratorDialogQemuComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
consoleTypes: string[] = [];
onCloseOptions = [];
bootPriorities = [];
@ -46,13 +46,13 @@ export class ConfiguratorDialogQemuComponent implements OnInit {
public dialogRef: MatDialogRef<ConfiguratorDialogQemuComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private qemuService: QemuService,
private qemuConfigurationService: QemuConfigurationService
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
ram: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
ram: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { QemuImg } from '../../../../../../models/qemu/qemu-img';
import{ Controller } from '../../../../../../models/controller';
@ -75,19 +75,19 @@ export class QemuImageCreatorComponent implements OnInit {
lazyRefcountsOptions: string[] = ['off', 'on'];
refcountBitsOptions: number[] = [1, 2, 4, 8, 16, 32, 64];
zeroedGrainOptions: string[] = ['on', 'off'];
inputForm: FormGroup;
inputForm: UntypedFormGroup;
constructor(
public dialogRef: MatDialogRef<QemuImageCreatorComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private qemuService: QemuService
) {
this.inputForm = this.formBuilder.group({
qemu_img: new FormControl('', Validators.required),
path: new FormControl('', Validators.required),
size: new FormControl('', Validators.required),
qemu_img: new UntypedFormControl('', Validators.required),
path: new UntypedFormControl('', Validators.required),
size: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -15,8 +15,8 @@ export class ConfiguratorDialogSwitchComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
nameForm: FormGroup;
inputForm: FormGroup;
nameForm: UntypedFormGroup;
inputForm: UntypedFormGroup;
consoleTypes: string[] = [];
nodeMappings = new Map<string, string>();
@ -33,17 +33,17 @@ export class ConfiguratorDialogSwitchComponent implements OnInit {
public dialogRef: MatDialogRef<ConfiguratorDialogSwitchComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder
private formBuilder: UntypedFormBuilder
) {
this.nameForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
this.inputForm = this.formBuilder.group({
sourcePort: new FormControl('', Validators.required),
sourceDlci: new FormControl('', Validators.required),
destinationPort: new FormControl('', Validators.required),
destinationDlci: new FormControl('', Validators.required),
sourcePort: new UntypedFormControl('', Validators.required),
sourceDlci: new UntypedFormControl('', Validators.required),
destinationPort: new UntypedFormControl('', Validators.required),
destinationDlci: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import { CustomAdaptersTableComponent } from '../../../../../components/preferences/common/custom-adapters-table/custom-adapters-table.component';
@ -17,7 +17,7 @@ export class ConfiguratorDialogVirtualBoxComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
consoleTypes: string[] = [];
onCloseOptions = [];
@ -30,12 +30,12 @@ export class ConfiguratorDialogVirtualBoxComponent implements OnInit {
public dialogRef: MatDialogRef<ConfiguratorDialogVirtualBoxComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private virtualBoxConfigurationService: VirtualBoxConfigurationService
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
ram: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
ram: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import { CustomAdaptersTableComponent } from '../../../../../components/preferences/common/custom-adapters-table/custom-adapters-table.component';
@ -17,7 +17,7 @@ export class ConfiguratorDialogVmwareComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
generalSettingsForm: FormGroup;
generalSettingsForm: UntypedFormGroup;
consoleTypes: string[] = [];
onCloseOptions = [];
@ -30,11 +30,11 @@ export class ConfiguratorDialogVmwareComponent implements OnInit {
public dialogRef: MatDialogRef<ConfiguratorDialogVmwareComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private vmwareConfigurationService: VmwareConfigurationService
) {
this.generalSettingsForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Node } from '../../../../../cartography/models/node';
import{ Controller } from '../../../../../models/controller';
@ -16,18 +16,18 @@ export class ConfiguratorDialogVpcsComponent implements OnInit {
controller:Controller ;
node: Node;
name: string;
inputForm: FormGroup;
inputForm: UntypedFormGroup;
consoleTypes: string[] = [];
constructor(
public dialogRef: MatDialogRef<ConfiguratorDialogVpcsComponent>,
public nodeService: NodeService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private vpcsConfigurationService: VpcsConfigurationService
) {
this.inputForm = this.formBuilder.group({
name: new FormControl('', Validators.required),
name: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { NodesDataSource } from '../../../../cartography/datasources/nodes-datasource';
import { CapturingSettings } from '../../../../models/capturingSettings';
@ -22,20 +22,20 @@ export class StartCaptureDialogComponent implements OnInit {
project: Project;
link: Link;
linkTypes = [];
inputForm: FormGroup;
inputForm: UntypedFormGroup;
startProgram: boolean;
constructor(
private dialogRef: MatDialogRef<PacketFiltersDialogComponent>,
private linkService: LinkService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private toasterService: ToasterService,
private nodesDataSource: NodesDataSource,
private packetCaptureService: PacketCaptureService
) {
this.inputForm = this.formBuilder.group({
linkType: new FormControl('', Validators.required),
fileName: new FormControl('', Validators.required),
linkType: new UntypedFormControl('', Validators.required),
fileName: new UntypedFormControl('', Validators.required),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { DeviceDetectorService } from 'ngx-device-detector';
import { ElectronService } from 'ngx-electron';
@ -11,19 +11,19 @@ import { ToasterService } from '../../../services/toaster.service';
styleUrls: ['./screenshot-dialog.component.scss'],
})
export class ScreenshotDialogComponent implements OnInit {
nameForm: FormGroup;
nameForm: UntypedFormGroup;
isPngAvailable: boolean;
filetype: string = 'svg';
constructor(
public dialogRef: MatDialogRef<ScreenshotDialogComponent>,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private electronService: ElectronService,
private deviceService: DeviceDetectorService
) {
this.nameForm = this.formBuilder.group({
screenshotName: new FormControl(`screenshot-${Date.now()}`, [Validators.required]),
screenshotName: new UntypedFormControl(`screenshot-${Date.now()}`, [Validators.required]),
});
this.isPngAvailable = this.electronService.isWindows || this.deviceService.getDeviceInfo().os === 'Windows';
}

View File

@ -1,5 +1,5 @@
import { Component, EventEmitter, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog, MatDialogRef } from '@angular/material/dialog';
import { Router } from '@angular/router';
import { v4 as uuid } from 'uuid';
@ -19,7 +19,7 @@ import { ProjectNameValidator } from '../models/projectNameValidator';
})
export class AddBlankProjectDialogComponent implements OnInit {
controller:Controller ;
projectNameForm: FormGroup;
projectNameForm: UntypedFormGroup;
uuid: string;
onAddProject = new EventEmitter<string>();
@ -29,13 +29,13 @@ export class AddBlankProjectDialogComponent implements OnInit {
private dialog: MatDialog,
private projectService: ProjectService,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private projectNameValidator: ProjectNameValidator
) {}
ngOnInit() {
this.projectNameForm = this.formBuilder.group({
projectName: new FormControl(
projectName: new UntypedFormControl(
null,
[Validators.required, this.projectNameValidator.get],
[projectNameAsyncValidator(this.controller, this.projectService)]

View File

@ -1,5 +1,5 @@
import { Component, OnInit, Injectable, ViewChild } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { Project, ProjectVariable } from '../../../models/project';
import{ Controller } from '../../../models/controller';
@ -18,8 +18,8 @@ export class EditProjectDialogComponent implements OnInit {
controller:Controller ;
project: Project;
formGroup: FormGroup;
variableFormGroup: FormGroup;
formGroup: UntypedFormGroup;
variableFormGroup: UntypedFormGroup;
projectVariables: ProjectVariable[];
displayedColumns: string[] = ['name', 'value', 'actions'];
@ -29,22 +29,22 @@ export class EditProjectDialogComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<EditProjectDialogComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private projectService: ProjectService,
private toasterService: ToasterService,
private nonNegativeValidator: NonNegativeValidator
) {
this.formGroup = this.formBuilder.group({
projectName: new FormControl('', [Validators.required]),
width: new FormControl('', [Validators.required, nonNegativeValidator.get]),
height: new FormControl('', [Validators.required, nonNegativeValidator.get]),
nodeGridSize: new FormControl('', [Validators.required, nonNegativeValidator.get]),
drawingGridSize: new FormControl('', [Validators.required, nonNegativeValidator.get]),
projectName: new UntypedFormControl('', [Validators.required]),
width: new UntypedFormControl('', [Validators.required, nonNegativeValidator.get]),
height: new UntypedFormControl('', [Validators.required, nonNegativeValidator.get]),
nodeGridSize: new UntypedFormControl('', [Validators.required, nonNegativeValidator.get]),
drawingGridSize: new UntypedFormControl('', [Validators.required, nonNegativeValidator.get]),
});
this.variableFormGroup = this.formBuilder.group({
name: new FormControl('', [Validators.required]),
value: new FormControl('', [Validators.required]),
name: new UntypedFormControl('', [Validators.required]),
value: new UntypedFormControl('', [Validators.required]),
});
}

View File

@ -148,7 +148,7 @@ describe('ImportProjectDialogComponent', () => {
});
it('should call uploading item with correct arguments', () => {
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {});
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {url: ''});
fileSelectDirective.uploader.queue.push(fileItem);
spyOn(fileSelectDirective.uploader, 'uploadItem');
@ -167,7 +167,7 @@ describe('ImportProjectDialogComponent', () => {
});
it('should clear queue after calling delete', () => {
fileSelectDirective.uploader.queue.push(new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {}));
fileSelectDirective.uploader.queue.push(new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {url: ''}));
spyOn(fileSelectDirective.uploader.queue, 'pop');
component.onDeleteClick();
@ -177,7 +177,7 @@ describe('ImportProjectDialogComponent', () => {
});
it('should prepare correct upload path for file', () => {
fileSelectDirective.uploader.queue.push(new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {}));
fileSelectDirective.uploader.queue.push(new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {url: ''}));
component.projectNameForm.controls['projectName'].setValue('newProject');
component.onImportClick();
@ -187,7 +187,7 @@ describe('ImportProjectDialogComponent', () => {
});
it('should navigate to progress view after clicking import', () => {
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {});
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {url: ''});
fileSelectDirective.uploader.queue.push(fileItem);
component.onImportClick();
@ -227,7 +227,7 @@ describe('ImportProjectDialogComponent', () => {
});
it('should show delete button after selecting project', () => {
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {});
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {url: ''});
fileSelectDirective.uploader.queue.push(fileItem);
let event = {
target: {
@ -240,7 +240,7 @@ describe('ImportProjectDialogComponent', () => {
});
it('should hide delete button after deselecting project', () => {
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {});
let fileItem = new FileItem(fileSelectDirective.uploader, new File([], 'fileName'), {url: ''});
fileSelectDirective.uploader.queue.push(fileItem);
let event = {
target: {

View File

@ -1,5 +1,5 @@
import { Component, EventEmitter, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { ToasterService } from '../../../services/toaster.service';
import { FileItem, FileUploader, ParsedResponseHeaders } from 'ng2-file-upload';
@ -28,7 +28,7 @@ export class ImportProjectDialogComponent implements OnInit {
isFinishEnabled: boolean = false;
isDeleteVisible: boolean = false;
resultMessage: string = 'The project is being imported... Please wait';
projectNameForm: FormGroup;
projectNameForm: UntypedFormGroup;
submitted: boolean = false;
isFirstStepCompleted: boolean = false;
uuid: string;
@ -38,7 +38,7 @@ export class ImportProjectDialogComponent implements OnInit {
private dialog: MatDialog,
public dialogRef: MatDialogRef<ImportProjectDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private projectService: ProjectService,
private projectNameValidator: ProjectNameValidator,
private toasterService : ToasterService,
@ -47,12 +47,12 @@ export class ImportProjectDialogComponent implements OnInit {
) {
this.projectNameForm = this.formBuilder.group({
projectName: new FormControl(null, [Validators.required, projectNameValidator.get]),
projectName: new UntypedFormControl(null, [Validators.required, projectNameValidator.get]),
});
}
ngOnInit() {
this.uploader = new FileUploader({});
this.uploader = new FileUploader({url: ''});
this.uploader.onAfterAddingFile = (file) => {
file.withCredentials = false;
};

View File

@ -1,5 +1,5 @@
import { Component, EventEmitter, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { NodesDataSource } from '../../../cartography/datasources/nodes-datasource';
import { Project } from '../../../models/project';
@ -17,7 +17,7 @@ import { ProjectNameValidator } from '../models/projectNameValidator';
export class SaveProjectDialogComponent implements OnInit {
controller:Controller ;
project: Project;
projectNameForm: FormGroup;
projectNameForm: UntypedFormGroup;
onAddProject = new EventEmitter<string>();
constructor(
@ -25,11 +25,11 @@ export class SaveProjectDialogComponent implements OnInit {
private projectService: ProjectService,
private nodesDataSource: NodesDataSource,
private toasterService: ToasterService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private projectNameValidator: ProjectNameValidator
) {
this.projectNameForm = this.formBuilder.group({
projectName: new FormControl(null, [Validators.required, projectNameValidator.get]),
projectName: new UntypedFormControl(null, [Validators.required, projectNameValidator.get]),
});
}

View File

@ -11,7 +11,7 @@
* Author: Sylvain MATHIEU, Elise LEBEAU
*/
import {Component, Inject, OnInit} from '@angular/core';
import {FormBuilder, FormControl, FormGroup, Validators} from "@angular/forms";
import {UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators} from "@angular/forms";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {Controller} from "@models/controller";
import {GroupNameValidator} from "@components/group-management/add-group-dialog/GroupNameValidator";
@ -25,17 +25,17 @@ import {groupNameAsyncValidator} from "@components/group-management/add-group-di
})
export class AddRoleDialogComponent implements OnInit {
roleNameForm: FormGroup;
roleNameForm: UntypedFormGroup;
constructor(private dialogRef: MatDialogRef<AddRoleDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: { controller: Controller },
private formBuilder: FormBuilder) {
private formBuilder: UntypedFormBuilder) {
}
ngOnInit(): void {
this.roleNameForm = this.formBuilder.group({
name: new FormControl(),
description: new FormControl()
name: new UntypedFormControl(),
description: new UntypedFormControl()
});
}

View File

@ -16,7 +16,7 @@ import {ActivatedRoute} from "@angular/router";
import {Controller} from "@models/controller";
import {ControllerService} from "@services/controller.service";
import {Role} from "@models/api/role";
import {FormControl, FormGroup} from "@angular/forms";
import {UntypedFormControl, UntypedFormGroup} from "@angular/forms";
import {ToasterService} from "@services/toaster.service";
import {HttpErrorResponse} from "@angular/common/http";
@ -28,16 +28,16 @@ import {HttpErrorResponse} from "@angular/common/http";
export class RoleDetailComponent implements OnInit {
controller: Controller;
role: Role;
editRoleForm: FormGroup;
editRoleForm: UntypedFormGroup;
constructor(private roleService: RoleService,
private controllerService: ControllerService,
private toastService: ToasterService,
private route: ActivatedRoute) {
this.editRoleForm = new FormGroup({
rolename: new FormControl(),
description: new FormControl(),
this.editRoleForm = new UntypedFormGroup({
rolename: new UntypedFormControl(),
description: new UntypedFormControl(),
});
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { Router } from '@angular/router';
import { ConsoleService } from '../../../services/settings/console.service';
import { ToasterService } from '../../../services/toaster.service';
@ -10,8 +10,8 @@ import { ToasterService } from '../../../services/toaster.service';
styleUrls: ['./console.component.scss'],
})
export class ConsoleComponent implements OnInit {
consoleForm = new FormGroup({
command: new FormControl(''),
consoleForm = new UntypedFormGroup({
command: new UntypedFormControl(''),
});
constructor(private router: Router, private consoleService: ConsoleService, private toasterService: ToasterService) {}

View File

@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { NodesDataSource } from '../../../cartography/datasources/nodes-datasource';
import { Node } from '../../../cartography/models/node';
@ -18,13 +18,13 @@ export class CreateSnapshotDialogComponent {
controller:Controller ;
project: Project;
snapshot: Snapshot = new Snapshot();
inputForm: FormGroup;
inputForm: UntypedFormGroup;
snapshots: string[] = [];
isInRunningState: boolean;
constructor(
public dialogRef: MatDialogRef<CreateSnapshotDialogComponent>,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
private toasterService: ToasterService,
private snapshotService: SnapshotService,
private nodesDataSource: NodesDataSource,
@ -34,7 +34,7 @@ export class CreateSnapshotDialogComponent {
this.project = data['project'];
this.inputForm = this.formBuilder.group({
snapshotName: new FormControl('', Validators.required),
snapshotName: new UntypedFormControl('', Validators.required),
});
if (this.project && this.project.project_id) {

View File

@ -1,6 +1,6 @@
import { DataSource } from '@angular/cdk/collections';
import { Component, Inject, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { BehaviorSubject, merge, Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@ -32,8 +32,8 @@ export class TemplateListDialogComponent implements OnInit {
'qemu',
];
selectedType: string;
configurationForm: FormGroup;
positionForm: FormGroup;
configurationForm: UntypedFormGroup;
positionForm: UntypedFormGroup;
templates: Template[];
filteredTemplates: Template[];
selectedTemplate: Template;
@ -44,7 +44,7 @@ export class TemplateListDialogComponent implements OnInit {
constructor(
public dialogRef: MatDialogRef<TemplateListDialogComponent>,
private templateService: TemplateService,
private formBuilder: FormBuilder,
private formBuilder: UntypedFormBuilder,
@Inject(MAT_DIALOG_DATA) public data: any,
private toasterService: ToasterService,
private nonNegativeValidator: NonNegativeValidator
@ -52,11 +52,11 @@ export class TemplateListDialogComponent implements OnInit {
this.controller = data['controller'];
this.project = data['project'];
this.configurationForm = this.formBuilder.group({
numberOfNodes: new FormControl(1, [ Validators.compose([Validators.required, nonNegativeValidator.get])]),
numberOfNodes: new UntypedFormControl(1, [ Validators.compose([Validators.required, nonNegativeValidator.get])]),
});
this.positionForm = this.formBuilder.group({
top: new FormControl(0, Validators.required),
left: new FormControl(0, Validators.required),
top: new UntypedFormControl(0, Validators.required),
left: new UntypedFormControl(0, Validators.required),
});
}

View File

@ -11,7 +11,7 @@
* Author: Sylvain MATHIEU, Elise LEBEAU
*/
import { Component, OnInit } from '@angular/core';
import {FormControl, FormGroup, Validators} from "@angular/forms";
import {UntypedFormControl, UntypedFormGroup, Validators} from "@angular/forms";
import {MatDialogRef} from "@angular/material/dialog";
import {UserService} from "@services/user.service";
import {Controller} from "@models/controller";
@ -33,12 +33,12 @@ import {matchingPassword} from "@components/user-management/ConfirmPasswordValid
styleUrls: ['./add-user-dialog.component.scss']
})
export class AddUserDialogComponent implements OnInit {
addUserForm: FormGroup;
addUserForm: UntypedFormGroup;
controller: Controller;
groups: Group[];
groupsToAdd: Set<Group> = new Set([]);
autocompleteControl = new FormControl();
autocompleteControl = new UntypedFormControl();
filteredGroups: Observable<Group[]>;
constructor(public dialogRef: MatDialogRef<AddUserDialogComponent>,
@ -47,21 +47,21 @@ export class AddUserDialogComponent implements OnInit {
private groupService: GroupService) { }
ngOnInit(): void {
this.addUserForm = new FormGroup({
username: new FormControl(null, [
this.addUserForm = new UntypedFormGroup({
username: new UntypedFormControl(null, [
Validators.required,
Validators.minLength(3),
Validators.pattern("[a-zA-Z0-9_-]+$")],
[userNameAsyncValidator(this.controller, this.userService)]),
full_name: new FormControl(),
email: new FormControl(null,
full_name: new UntypedFormControl(),
email: new UntypedFormControl(null,
[Validators.email, Validators.required],
[userEmailAsyncValidator(this.controller, this.userService)]),
password: new FormControl(null,
password: new UntypedFormControl(null,
[Validators.required, Validators.minLength(6), Validators.maxLength(100)]),
confirmPassword: new FormControl(null,
confirmPassword: new UntypedFormControl(null,
[Validators.minLength(6), Validators.maxLength(100), Validators.required] ),
is_active: new FormControl(true)
is_active: new UntypedFormControl(true)
},{
validators: [matchingPassword]
});

View File

@ -12,12 +12,12 @@
*/
import {Controller} from "../../../models/controller";
import {UserService} from "../../../services/user.service";
import {FormControl} from "@angular/forms";
import {UntypedFormControl} from "@angular/forms";
import {timer} from "rxjs";
import {map, switchMap} from "rxjs/operators";
export const userEmailAsyncValidator = (controller: Controller, userService: UserService, except: string = '') => {
return (control: FormControl) => {
return (control: UntypedFormControl) => {
return timer(500).pipe(
switchMap(() => userService.list(controller)),
map((response) => {

View File

@ -11,13 +11,13 @@
* Author: Sylvain MATHIEU, Elise LEBEAU
*/
import {Controller} from "../../../models/controller";
import {FormControl} from "@angular/forms";
import {UntypedFormControl} from "@angular/forms";
import {timer} from "rxjs";
import {map, switchMap} from "rxjs/operators";
import {UserService} from "../../../services/user.service";
export const userNameAsyncValidator = (controller: Controller, userService: UserService, except: string = '') => {
return (control: FormControl) => {
return (control: UntypedFormControl) => {
return timer(500).pipe(
switchMap(() => userService.list(controller)),
map((response) => {

View File

@ -1,5 +1,5 @@
import {Component, Inject, OnInit} from '@angular/core';
import {AbstractControl, FormControl, FormGroup, ValidationErrors, ValidatorFn, Validators} from "@angular/forms";
import {AbstractControl, UntypedFormControl, UntypedFormGroup, ValidationErrors, ValidatorFn, Validators} from "@angular/forms";
import {User} from "@models/users/user";
import {MAT_DIALOG_DATA, MatDialogRef} from "@angular/material/dialog";
import {UserService} from "@services/user.service";
@ -14,7 +14,7 @@ import {matchingPassword} from "@components/user-management/ConfirmPasswordValid
})
export class ChangeUserPasswordComponent implements OnInit {
editPasswordForm: FormGroup;
editPasswordForm: UntypedFormGroup;
user: User;
constructor(private dialogRef: MatDialogRef<ChangeUserPasswordComponent>,
@ -24,10 +24,10 @@ export class ChangeUserPasswordComponent implements OnInit {
ngOnInit(): void {
this.user = this.data.user;
this.editPasswordForm = new FormGroup({
password: new FormControl(null,
this.editPasswordForm = new UntypedFormGroup({
password: new UntypedFormControl(null,
[Validators.minLength(6), Validators.maxLength(100), Validators.required] ),
confirmPassword: new FormControl(null,
confirmPassword: new UntypedFormControl(null,
[Validators.minLength(6), Validators.maxLength(100), Validators.required] ),
},{
validators: [matchingPassword]

View File

@ -1,5 +1,5 @@
import {Component, Inject, OnInit} from '@angular/core';
import {FormControl, FormGroup, Validators} from "@angular/forms";
import {UntypedFormControl, UntypedFormGroup, Validators} from "@angular/forms";
import {Group} from "@models/groups/group";
import {UserService} from "@services/user.service";
import {ToasterService} from "@services/toaster.service";
@ -22,7 +22,7 @@ import {RemoveToGroupDialogComponent} from "@components/group-details/remove-to-
})
export class UserDetailComponent implements OnInit {
editUserForm: FormGroup;
editUserForm: UntypedFormGroup;
groups: Group[];
user: User;
controller: Controller;
@ -53,17 +53,17 @@ export class UserDetailComponent implements OnInit {
}
initForm() {
this.editUserForm = new FormGroup({
username: new FormControl(this.user.username, [
this.editUserForm = new UntypedFormGroup({
username: new UntypedFormControl(this.user.username, [
Validators.required,
Validators.minLength(3),
Validators.pattern("[a-zA-Z0-9_-]+$")],
[userNameAsyncValidator(this.controller, this.userService, this.user.username)]),
full_name: new FormControl(this.user.full_name),
email: new FormControl(this.user.email,
full_name: new UntypedFormControl(this.user.full_name),
email: new UntypedFormControl(this.user.email,
[Validators.email, Validators.required],
[userEmailAsyncValidator(this.controller, this.userService, this.user.email)]),
is_active: new FormControl(this.user.is_active)
is_active: new UntypedFormControl(this.user.is_active)
});
}

View File

@ -1,11 +1,11 @@
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { timer } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import{ Controller } from '../models/controller';
import { ProjectService } from '../services/project.service';
export const projectNameAsyncValidator = (controller:Controller , projectService: ProjectService) => {
return (control: FormControl) => {
return (control: UntypedFormControl) => {
return timer(500).pipe(
switchMap(() => projectService.list(controller)),
map((response) => (response.find((n) => n.name === control.value) ? { projectExist: true } : null))

View File

@ -1,11 +1,11 @@
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { timer } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import{ Controller } from '../models/controller';
import { TemplateService } from '../services/template.service';
export const templateNameAsyncValidator = (controller:Controller , templateService: TemplateService) => {
return (control: FormControl) => {
return (control: UntypedFormControl) => {
return timer(500).pipe(
switchMap(() => templateService.list(controller)),
map((response) => (response.find((n) => n.name === control.value) ? { templateExist: true } : null))

View File

@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../out-tsc/spec",
"baseUrl": "./",
"target": "es5",
"target": "es2020",
"paths": {
"@components/*": ["app/components/*"],
"@services/*": ["app/services/*"],

5811
yarn.lock

File diff suppressed because it is too large Load Diff