chore(console): angular 14 (#3799)

* eslint schematics

* cli, core migrations

* material

* schematics

* ng-qrcode update

* fix input, formfield errorstatemixin

* other packages

* downgrade codemirror

* codemirror

* @next of alphas

Co-authored-by: Livio Spring <[email protected]>
This commit is contained in:
Max Peintner
2022-06-27 13:17:17 +00:00
committed by GitHub
co-authored by Livio Spring
parent 12d4d3ea0b
commit fb0f29aa32
41 changed files with 5012 additions and 9824 deletions
@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { KeyType } from 'src/app/proto/generated/zitadel/auth_n_key_pb';
@@ -17,7 +17,7 @@ export class AddKeyDialogComponent {
public startDate: Date = new Date();
types: KeyType[] = [];
public type!: KeyType;
public dateControl: FormControl = new FormControl('', []);
public dateControl: UntypedFormControl = new UntypedFormControl('', []);
constructor(
public dialogRef: MatDialogRef<AddKeyDialogComponent>,
@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
@Component({
@@ -9,7 +9,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
})
export class AddTokenDialogComponent {
public startDate: Date = new Date();
public dateControl: FormControl = new FormControl('', []);
public dateControl: UntypedFormControl = new UntypedFormControl('', []);
constructor(public dialogRef: MatDialogRef<AddTokenDialogComponent>, @Inject(MAT_DIALOG_DATA) public data: any) {
const today = new Date();
@@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { Observable, Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
@@ -18,7 +18,7 @@ export class EditTextComponent implements OnInit, OnDestroy {
@Output() changedValues: EventEmitter<{ [key: string]: string }> = new EventEmitter();
public currentMap: { [key: string]: string | boolean } = {}; // boolean because of isDefault
private destroy$: Subject<void> = new Subject();
public form!: FormGroup;
public form!: UntypedFormGroup;
public warnText: { [key: string]: string | boolean | undefined } = {};
@Input() public chips: any[] = [];
@@ -30,10 +30,10 @@ export class EditTextComponent implements OnInit, OnDestroy {
public ngOnInit(): void {
this.current$.pipe(takeUntil(this.destroy$)).subscribe((value) => {
this.currentMap = value;
this.form = new FormGroup({});
this.form = new UntypedFormGroup({});
Object.keys(value).map((key) => {
if (key !== 'isDefault') {
const control = new FormControl({ value: value[key], disabled: this.disabled });
const control = new UntypedFormControl({ value: value[key], disabled: this.disabled });
this.form.addControl(key, control);
}
});
@@ -26,16 +26,14 @@ import { CNSL_ERROR, CnslErrorDirective } from './error.directive';
export const CNSL_FORM_FIELD = new InjectionToken<CnslFormFieldComponent>('CnslFormFieldComponent');
class CnslFormFieldBase {
constructor(public _elementRef: ElementRef) { }
constructor(public _elementRef: ElementRef) {}
}
@Component({
selector: 'cnsl-form-field',
templateUrl: './form-field.component.html',
styleUrls: ['./form-field.component.scss'],
providers: [
{ provide: CNSL_FORM_FIELD, useExisting: CnslFormFieldComponent },
],
providers: [{ provide: CNSL_FORM_FIELD, useExisting: CnslFormFieldComponent }],
host: {
'[class.ng-untouched]': '_shouldForward("untouched")',
'[class.ng-touched]': '_shouldForward("touched")',
@@ -76,18 +74,20 @@ export class CnslFormFieldComponent extends CnslFormFieldBase implements OnDestr
@HostListener('blur', ['false'])
_focusChanged(isFocused: boolean): void {
if (isFocused !== this.focused && (!isFocused)) {
if (isFocused !== this.focused && !isFocused) {
this.focused = isFocused;
this.stateChanges.next();
}
}
constructor(public _elementRef: ElementRef, private _changeDetectorRef: ChangeDetectorRef,
constructor(
public _elementRef: ElementRef,
private _changeDetectorRef: ChangeDetectorRef,
@Inject(ElementRef)
// Use `ElementRef` here so Angular has something to inject.
_labelOptions: any) {
_labelOptions: // Use `ElementRef` here so Angular has something to inject.
any,
) {
super(_elementRef);
}
public ngAfterViewInit(): void {
@@ -135,13 +135,12 @@ export class CnslFormFieldComponent extends CnslFormFieldBase implements OnDestr
if (this._control) {
const ids: string[] = [];
if (this._control.userAriaDescribedBy &&
typeof this._control.userAriaDescribedBy === 'string') {
if (this._control.userAriaDescribedBy && typeof this._control.userAriaDescribedBy === 'string') {
ids.push(...this._control.userAriaDescribedBy.split(' '));
}
if (this._errorChildren) {
ids.push(...this._errorChildren.map(error => error.id));
ids.push(...this._errorChildren.map((error) => error.id));
}
this._control.setDescribedByIds(ids);
@@ -150,12 +149,12 @@ export class CnslFormFieldComponent extends CnslFormFieldBase implements OnDestr
/** Determines whether a class from the NgControl should be forwarded to the host element. */
_shouldForward(prop: keyof NgControl): boolean {
const ngControl = this._control ? this._control.ngControl : null;
const ngControl: any = this._control ? this._control.ngControl : null;
return ngControl && ngControl[prop];
}
/** Determines whether to display hints or errors. */
_getDisplayedMessages(): 'error' | 'hint' {
return (this._errorChildren && this._errorChildren.length > 0) ? 'error' : 'hint';
return this._errorChildren && this._errorChildren.length > 0 ? 'error' : 'hint';
}
}
@@ -1,7 +1,7 @@
import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
import { Location } from '@angular/common';
import { Component, Injector, OnDestroy, OnInit, Type } from '@angular/core';
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatChipInputEvent } from '@angular/material/chips';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { Subscription } from 'rxjs';
@@ -31,8 +31,8 @@ export class IdpCreateComponent implements OnInit, OnDestroy {
private subscription?: Subscription;
public projectId: string = '';
public oidcFormGroup!: FormGroup;
public jwtFormGroup!: FormGroup;
public oidcFormGroup!: UntypedFormGroup;
public jwtFormGroup!: UntypedFormGroup;
public createSteps: number = 2;
public currentCreateStep: number = 1;
@@ -53,25 +53,25 @@ export class IdpCreateComponent implements OnInit, OnDestroy {
private _location: Location,
breadcrumbService: BreadcrumbService,
) {
this.oidcFormGroup = new FormGroup({
name: new FormControl('', [Validators.required]),
clientId: new FormControl('', [Validators.required]),
clientSecret: new FormControl('', [Validators.required]),
issuer: new FormControl('', [Validators.required]),
scopesList: new FormControl(['openid', 'profile', 'email'], []),
idpDisplayNameMapping: new FormControl(0),
usernameMapping: new FormControl(0),
autoRegister: new FormControl(false),
this.oidcFormGroup = new UntypedFormGroup({
name: new UntypedFormControl('', [Validators.required]),
clientId: new UntypedFormControl('', [Validators.required]),
clientSecret: new UntypedFormControl('', [Validators.required]),
issuer: new UntypedFormControl('', [Validators.required]),
scopesList: new UntypedFormControl(['openid', 'profile', 'email'], []),
idpDisplayNameMapping: new UntypedFormControl(0),
usernameMapping: new UntypedFormControl(0),
autoRegister: new UntypedFormControl(false),
});
this.jwtFormGroup = new FormGroup({
jwtName: new FormControl('', [Validators.required]),
jwtHeaderName: new FormControl('', [Validators.required]),
jwtIssuer: new FormControl('', [Validators.required]),
jwtEndpoint: new FormControl('', [Validators.required]),
jwtKeysEndpoint: new FormControl('', [Validators.required]),
jwtStylingType: new FormControl(0),
jwtAutoRegister: new FormControl(false),
this.jwtFormGroup = new UntypedFormGroup({
jwtName: new UntypedFormControl('', [Validators.required]),
jwtHeaderName: new UntypedFormControl('', [Validators.required]),
jwtIssuer: new UntypedFormControl('', [Validators.required]),
jwtEndpoint: new UntypedFormControl('', [Validators.required]),
jwtKeysEndpoint: new UntypedFormControl('', [Validators.required]),
jwtStylingType: new UntypedFormControl(0),
jwtAutoRegister: new UntypedFormControl(false),
});
this.route.data.pipe(take(1)).subscribe((data) => {
+21 -21
View File
@@ -1,7 +1,7 @@
import { COMMA, ENTER, SPACE } from '@angular/cdk/keycodes';
import { Location } from '@angular/common';
import { Component, Injector, OnDestroy, Type } from '@angular/core';
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatChipInputEvent } from '@angular/material/chips';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
@@ -46,9 +46,9 @@ export class IdpComponent implements OnDestroy {
private destroy$: Subject<void> = new Subject();
public projectId: string = '';
public idpForm!: FormGroup;
public oidcConfigForm!: FormGroup;
public jwtConfigForm!: FormGroup;
public idpForm!: UntypedFormGroup;
public oidcConfigForm!: UntypedFormGroup;
public jwtConfigForm!: UntypedFormGroup;
IDPState: any = IDPState;
@@ -70,27 +70,27 @@ export class IdpComponent implements OnDestroy {
private dialog: MatDialog,
breadcrumbService: BreadcrumbService,
) {
this.idpForm = new FormGroup({
id: new FormControl({ disabled: true, value: '' }, [Validators.required]),
name: new FormControl('', [Validators.required]),
stylingType: new FormControl('', [Validators.required]),
autoRegister: new FormControl(false, [Validators.required]),
this.idpForm = new UntypedFormGroup({
id: new UntypedFormControl({ disabled: true, value: '' }, [Validators.required]),
name: new UntypedFormControl('', [Validators.required]),
stylingType: new UntypedFormControl('', [Validators.required]),
autoRegister: new UntypedFormControl(false, [Validators.required]),
});
this.oidcConfigForm = new FormGroup({
clientId: new FormControl('', [Validators.required]),
clientSecret: new FormControl(''),
issuer: new FormControl('', [Validators.required]),
scopesList: new FormControl([], []),
displayNameMapping: new FormControl(0),
usernameMapping: new FormControl(0),
this.oidcConfigForm = new UntypedFormGroup({
clientId: new UntypedFormControl('', [Validators.required]),
clientSecret: new UntypedFormControl(''),
issuer: new UntypedFormControl('', [Validators.required]),
scopesList: new UntypedFormControl([], []),
displayNameMapping: new UntypedFormControl(0),
usernameMapping: new UntypedFormControl(0),
});
this.jwtConfigForm = new FormGroup({
jwtEndpoint: new FormControl('', [Validators.required]),
issuer: new FormControl('', [Validators.required]),
keysEndpoint: new FormControl('', [Validators.required]),
headerName: new FormControl('', [Validators.required]),
this.jwtConfigForm = new UntypedFormGroup({
jwtEndpoint: new UntypedFormControl('', [Validators.required]),
issuer: new UntypedFormControl('', [Validators.required]),
keysEndpoint: new UntypedFormControl('', [Validators.required]),
headerName: new UntypedFormControl('', [Validators.required]),
});
const serviceType = this.route.snapshot.data.serviceType;
@@ -1,11 +1,11 @@
import { Injectable } from '@angular/core';
import { FormControl, FormGroupDirective, NgForm } from '@angular/forms';
import { UntypedFormControl, FormGroupDirective, NgForm } from '@angular/forms';
/** Provider that defines how form controls behave with regards to displaying error messages. */
@Injectable({ providedIn: 'root' })
export class ErrorStateMatcher {
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {
return !!(control && control.invalid && (control.touched || (form && form.submitted)));
}
}
@@ -13,7 +13,7 @@ export class ErrorStateMatcher {
/** Error state matcher that matches when a control is invalid and dirty. */
@Injectable()
export class ShowOnDirtyErrorStateMatcher implements ErrorStateMatcher {
isErrorState(control: FormControl | null, form: FormGroupDirective | NgForm | null): boolean {
isErrorState(control: UntypedFormControl | null, form: FormGroupDirective | NgForm | null): boolean {
return !!(control && control.invalid && (control.dirty || (form && form.submitted)));
}
}
@@ -28,11 +28,17 @@ let nextUniqueId = 0;
const _MatInputBase = mixinErrorState(
class {
readonly stateChanges = new Subject<void>();
constructor(
public _defaultErrorStateMatcher: ErrorStateMatcher,
public _parentForm: NgForm,
public _parentFormGroup: FormGroupDirective,
/** @docs-private */
/**
* Form control bound to the component.
* Implemented as part of `MatFormFieldControl`.
* @docs-private
*/
public ngControl: NgControl,
) {}
},
@@ -98,7 +104,7 @@ export class InputDirective
* Implemented as part of MatFormFieldControl.
* @docs-private
*/
readonly stateChanges: Subject<void> = new Subject<void>();
override readonly stateChanges: Subject<void> = new Subject<void>();
/**
* Implemented as part of MatFormFieldControl.
+2 -2
View File
@@ -2,7 +2,7 @@ import { animate, keyframes, style, transition, trigger } from '@angular/animati
import { BreakpointObserver } from '@angular/cdk/layout';
import { HttpClient } from '@angular/common/http';
import { Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { Router } from '@angular/router';
import { BehaviorSubject, map, Observable, Subject, take } from 'rxjs';
import { Org } from 'src/app/proto/generated/zitadel/org_pb';
@@ -81,7 +81,7 @@ export class NavComponent implements OnDestroy {
);
@Input() public org!: Org.AsObject;
public filterControl: FormControl = new FormControl('');
public filterControl: UntypedFormControl = new UntypedFormControl('');
public orgLoading$: BehaviorSubject<any> = new BehaviorSubject(false);
public showAccount: boolean = false;
public hideAdminWarn: boolean = true;
@@ -1,6 +1,6 @@
import { SelectionModel } from '@angular/cdk/collections';
import { Component, ElementRef, EventEmitter, Input, OnInit, Output, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { BehaviorSubject, catchError, debounceTime, finalize, from, map, Observable, of, pipe, tap } from 'rxjs';
import { TextQueryMethod } from 'src/app/proto/generated/zitadel/object_pb';
import { Org, OrgNameQuery, OrgQuery } from 'src/app/proto/generated/zitadel/org_pb';
@@ -17,7 +17,7 @@ export class OrgContextComponent implements OnInit {
public orgLoading$: BehaviorSubject<any> = new BehaviorSubject(false);
public orgs$: Observable<Org.AsObject[]> = of([]);
public filterControl: FormControl = new FormControl('');
public filterControl: UntypedFormControl = new UntypedFormControl('');
@Input() public org!: Org.AsObject;
@ViewChild('input', { static: false }) input!: ElementRef;
@Output() public closedCard: EventEmitter<void> = new EventEmitter();
@@ -1,5 +1,5 @@
import { Component, Injector, Input, OnInit, Type } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
import { take } from 'rxjs';
@@ -43,11 +43,11 @@ export class LoginPolicyComponent implements OnInit {
public loading: boolean = false;
public InfoSectionType: any = InfoSectionType;
public PasswordlessType: any = PasswordlessType;
public lifetimeForm!: FormGroup;
public lifetimeForm!: UntypedFormGroup;
constructor(
private toast: ToastService,
private injector: Injector,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private authService: GrpcAuthService,
private dialog: MatDialog,
) {
@@ -1,5 +1,5 @@
import { Component, Injector, Input, OnDestroy, OnInit, Type } from '@angular/core';
import { FormControl, FormGroup } from '@angular/forms';
import { UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { Timestamp } from 'google-protobuf/google/protobuf/timestamp_pb';
import { BehaviorSubject, from, interval, Observable, of, Subject, Subscription } from 'rxjs';
@@ -115,9 +115,9 @@ export class LoginTextsComponent implements OnInit, OnDestroy {
public destroy$: Subject<void> = new Subject();
public InfoSectionType: any = InfoSectionType;
public form: FormGroup = new FormGroup({
currentSubMap: new FormControl('emailVerificationDoneText'),
locale: new FormControl('en'),
public form: UntypedFormGroup = new UntypedFormGroup({
currentSubMap: new UntypedFormControl('emailVerificationDoneText'),
locale: new UntypedFormControl('en'),
});
public canWrite$: Observable<boolean> = this.authService.isAllowed([
@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
import {
AddSMSProviderTwilioRequest,
@@ -27,12 +27,12 @@ export class DialogAddSMSProviderComponent {
public provider: SMSProviderType = SMSProviderType.Twilio;
public req!: AddSMSProviderTwilioRequest | UpdateSMSProviderTwilioRequest;
public twilioForm!: FormGroup;
public twilioForm!: UntypedFormGroup;
private smsProviders: SMSProvider.AsObject[] = [];
constructor(
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private service: AdminService,
public dialogRef: MatDialogRef<DialogAddSMSProviderComponent>,
private toast: ToastService,
@@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { take } from 'rxjs';
import {
@@ -36,7 +36,7 @@ export class NotificationSettingsComponent implements OnInit {
public logProviderLoading: boolean = false;
public fileProviderLoading: boolean = false;
public form!: FormGroup;
public form!: UntypedFormGroup;
public SMSProviderConfigState: any = SMSProviderConfigState;
public InfoSectionType: any = InfoSectionType;
@@ -49,7 +49,7 @@ export class NotificationSettingsComponent implements OnInit {
private service: AdminService,
private dialog: MatDialog,
private toast: ToastService,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private authService: GrpcAuthService,
) {
this.form = this.fb.group({
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
import { take } from 'rxjs';
import { SetDefaultLanguageResponse, UpdateOIDCSettingsRequest } from 'src/app/proto/generated/zitadel/admin_pb';
@@ -17,10 +17,10 @@ export class OIDCConfigurationComponent implements OnInit {
public oidcSettings!: OIDCSettings.AsObject;
public loading: boolean = false;
public form!: FormGroup;
public form!: UntypedFormGroup;
constructor(
private service: AdminService,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private toast: ToastService,
private authService: GrpcAuthService,
) {
@@ -1,5 +1,5 @@
import { Component, Injector, Input, OnInit, Type } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { GetLockoutPolicyResponse as AdminGetPasswordLockoutPolicyResponse } from 'src/app/proto/generated/zitadel/admin_pb';
import {
@@ -23,7 +23,7 @@ export class PasswordLockoutPolicyComponent implements OnInit {
@Input() public service!: ManagementService | AdminService;
@Input() public serviceType: PolicyComponentServiceType = PolicyComponentServiceType.MGMT;
public lockoutForm!: FormGroup;
public lockoutForm!: UntypedFormGroup;
public lockoutData!: LockoutPolicy.AsObject;
public PolicyComponentServiceType: any = PolicyComponentServiceType;
public InfoSectionType: any = InfoSectionType;
@@ -1,5 +1,5 @@
import { Component, Injector, Input, OnDestroy, OnInit, Type } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { Observable, Subscription } from 'rxjs';
import { take } from 'rxjs/operators';
@@ -35,7 +35,7 @@ export class PrivacyPolicyComponent implements OnInit, OnDestroy {
private sub: Subscription = new Subscription();
public privacyPolicy: PrivacyPolicy.AsObject | undefined = undefined;
public form!: FormGroup;
public form!: UntypedFormGroup;
public InfoSectionType: any = InfoSectionType;
public canWrite$: Observable<boolean> = this.authService.isAllowed([
@@ -54,7 +54,7 @@ export class PrivacyPolicyComponent implements OnInit, OnDestroy {
private injector: Injector,
private dialog: MatDialog,
private toast: ToastService,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
) {
this.form = this.fb.group({
tosLink: ['', []],
@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
import { AbstractControl, FormBuilder, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
import { UpdateSecretGeneratorRequest } from 'src/app/proto/generated/zitadel/admin_pb';
@@ -22,10 +22,10 @@ export class DialogAddSecretGeneratorComponent {
];
public req: UpdateSecretGeneratorRequest = new UpdateSecretGeneratorRequest();
public specsForm!: FormGroup;
public specsForm!: UntypedFormGroup;
constructor(
private fb: FormBuilder,
private fb: UntypedFormBuilder,
public dialogRef: MatDialogRef<DialogAddSecretGeneratorComponent>,
@Inject(MAT_DIALOG_DATA) public data: any,
) {
@@ -1,5 +1,5 @@
import { Component, Inject } from '@angular/core';
import { AbstractControl, FormControl, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
import { ManagementService } from 'src/app/services/mgmt.service';
import { ToastService } from 'src/app/services/toast.service';
@@ -12,7 +12,7 @@ import { ToastService } from 'src/app/services/toast.service';
export class ProjectRoleDetailDialogComponent {
public projectId: string = '';
public formGroup!: FormGroup;
public formGroup!: UntypedFormGroup;
constructor(
private mgmtService: ManagementService,
private toast: ToastService,
@@ -20,10 +20,10 @@ export class ProjectRoleDetailDialogComponent {
@Inject(MAT_DIALOG_DATA) public data: any,
) {
this.projectId = data.projectId;
this.formGroup = new FormGroup({
key: new FormControl({ value: '', disabled: true }, [Validators.required]),
displayName: new FormControl(''),
group: new FormControl(''),
this.formGroup = new UntypedFormGroup({
key: new UntypedFormControl({ value: '', disabled: true }, [Validators.required]),
displayName: new UntypedFormControl(''),
group: new UntypedFormControl(''),
});
this.formGroup.patchValue(data.role);
@@ -1,6 +1,6 @@
import { COMMA, ENTER } from '@angular/cdk/keycodes';
import { Component, ElementRef, EventEmitter, Input, OnDestroy, Output, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { MatChipInputEvent } from '@angular/material/chips';
import { forkJoin, from, Subject } from 'rxjs';
@@ -27,7 +27,7 @@ export class SearchProjectAutocompleteComponent implements OnDestroy {
public removable: boolean = true;
public addOnBlur: boolean = true;
public separatorKeysCodes: number[] = [ENTER, COMMA];
public myControl: FormControl = new FormControl();
public myControl: UntypedFormControl = new UntypedFormControl();
public names: string[] = [];
public projects: Array<GrantedProject.AsObject | Project.AsObject | any> = [];
public filteredProjects: Array<GrantedProject.AsObject | Project.AsObject | any> = [];
@@ -1,6 +1,6 @@
import { COMMA, ENTER } from '@angular/cdk/keycodes';
import { Component, ElementRef, EventEmitter, Input, OnDestroy, Output, ViewChild } from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { MatChipInputEvent } from '@angular/material/chips';
import { from, Subject } from 'rxjs';
@@ -19,7 +19,7 @@ export class SearchRolesAutocompleteComponent implements OnDestroy {
public removable: boolean = true;
public addOnBlur: boolean = true;
public separatorKeysCodes: number[] = [ENTER, COMMA];
public myControl: FormControl = new FormControl();
public myControl: UntypedFormControl = new UntypedFormControl();
public names: string[] = [];
public roles: Array<Role.AsObject> = [];
public filteredRoles: Array<Role.AsObject> = [];
@@ -10,7 +10,7 @@ import {
Output,
ViewChild,
} from '@angular/core';
import { FormControl } from '@angular/forms';
import { UntypedFormControl } from '@angular/forms';
import { MatAutocomplete, MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
import { MatChipInputEvent } from '@angular/material/chips';
import { from, of, Subject } from 'rxjs';
@@ -37,8 +37,8 @@ export class SearchUserAutocompleteComponent implements OnInit, AfterContentChec
public addOnBlur: boolean = true;
public separatorKeysCodes: number[] = [ENTER, COMMA];
public myControl: FormControl = new FormControl();
public globalLoginNameControl: FormControl = new FormControl();
public myControl: UntypedFormControl = new UntypedFormControl();
public globalLoginNameControl: UntypedFormControl = new UntypedFormControl();
public loginNames: string[] = [];
@Input() public users: Array<User.AsObject> = [];