mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 23:33:31 +00:00
[PS-182] Upgrade Angular to V14 (#2948)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Directive, Input, OnInit, Self } from "@angular/core";
|
||||
import { ControlValueAccessor, FormControl, NgControl, Validators } from "@angular/forms";
|
||||
import { ControlValueAccessor, UntypedFormControl, NgControl, Validators } from "@angular/forms";
|
||||
|
||||
import { dirtyRequired } from "@bitwarden/angular/validators/dirty.validator";
|
||||
|
||||
@@ -25,7 +25,7 @@ export abstract class BaseCvaComponent implements ControlValueAccessor, OnInit {
|
||||
@Input() controlId: string;
|
||||
@Input() helperText: string;
|
||||
|
||||
internalControl = new FormControl("");
|
||||
internalControl = new UntypedFormControl("");
|
||||
|
||||
protected onChange: any;
|
||||
protected onTouched: any;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { FormBuilder, FormControl } from "@angular/forms";
|
||||
import { UntypedFormBuilder, FormControl } from "@angular/forms";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
|
||||
import { ApiService } from "@bitwarden/common/abstractions/api.service";
|
||||
@@ -33,7 +33,7 @@ export class ScimComponent implements OnInit {
|
||||
});
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { AbstractControl, FormBuilder, FormGroup } from "@angular/forms";
|
||||
import { AbstractControl, UntypedFormBuilder, UntypedFormGroup } from "@angular/forms";
|
||||
import { ActivatedRoute } from "@angular/router";
|
||||
|
||||
import { SelectOptions } from "@bitwarden/angular/interfaces/selectOptions";
|
||||
@@ -142,7 +142,7 @@ export class SsoComponent implements OnInit {
|
||||
});
|
||||
|
||||
constructor(
|
||||
private formBuilder: FormBuilder,
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private apiService: ApiService,
|
||||
private platformUtilsService: PlatformUtilsService,
|
||||
@@ -242,9 +242,9 @@ export class SsoComponent implements OnInit {
|
||||
this.showOpenIdCustomizations = !this.showOpenIdCustomizations;
|
||||
}
|
||||
|
||||
getErrorCount(form: FormGroup): number {
|
||||
getErrorCount(form: UntypedFormGroup): number {
|
||||
return Object.values(form.controls).reduce((acc: number, control: AbstractControl) => {
|
||||
if (control instanceof FormGroup) {
|
||||
if (control instanceof UntypedFormGroup) {
|
||||
return acc + this.getErrorCount(control);
|
||||
}
|
||||
|
||||
@@ -270,13 +270,13 @@ export class SsoComponent implements OnInit {
|
||||
return this.samlSigningAlgorithms.map((algorithm) => ({ name: algorithm, value: algorithm }));
|
||||
}
|
||||
|
||||
private validateForm(form: FormGroup) {
|
||||
private validateForm(form: UntypedFormGroup) {
|
||||
Object.values(form.controls).forEach((control: AbstractControl) => {
|
||||
if (control.disabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (control instanceof FormGroup) {
|
||||
if (control instanceof UntypedFormGroup) {
|
||||
this.validateForm(control);
|
||||
} else {
|
||||
control.markAsDirty();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component } from "@angular/core";
|
||||
import { FormBuilder } from "@angular/forms";
|
||||
import { UntypedFormBuilder } from "@angular/forms";
|
||||
|
||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
import { PolicyType } from "@bitwarden/common/enums/policyType";
|
||||
@@ -27,7 +27,7 @@ export class MaximumVaultTimeoutPolicyComponent extends BasePolicyComponent {
|
||||
minutes: [null],
|
||||
});
|
||||
|
||||
constructor(private formBuilder: FormBuilder, private i18nService: I18nService) {
|
||||
constructor(private formBuilder: UntypedFormBuilder, private i18nService: I18nService) {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user