mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 22:03:36 +00:00
[PS-182] Upgrade Angular to V14 (#2948)
This commit is contained in:
@@ -3,7 +3,6 @@ const { pathsToModuleNameMapper } = require("ts-jest");
|
||||
const { compilerOptions } = require("./tsconfig");
|
||||
|
||||
module.exports = {
|
||||
name: "angular",
|
||||
displayName: "libs/components tests",
|
||||
preset: "jest-preset-angular",
|
||||
testMatch: ["**/+(*.)+(spec).+(ts)"],
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, Input } from "@angular/core";
|
||||
import { AbstractControl, FormGroup } from "@angular/forms";
|
||||
import { AbstractControl, UntypedFormGroup } from "@angular/forms";
|
||||
|
||||
@Component({
|
||||
selector: "bit-error-summary",
|
||||
@@ -13,7 +13,7 @@ import { AbstractControl, FormGroup } from "@angular/forms";
|
||||
})
|
||||
export class BitErrorSummary {
|
||||
@Input()
|
||||
formGroup: FormGroup;
|
||||
formGroup: UntypedFormGroup;
|
||||
|
||||
get errorCount(): number {
|
||||
return this.getErrorCount(this.formGroup);
|
||||
@@ -23,9 +23,9 @@ export class BitErrorSummary {
|
||||
return this.errorCount.toString();
|
||||
}
|
||||
|
||||
private getErrorCount(form: FormGroup): number {
|
||||
private 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);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { FormBuilder, FormsModule, ReactiveFormsModule, Validators } from "@angular/forms";
|
||||
import { UntypedFormBuilder, FormsModule, ReactiveFormsModule, Validators } from "@angular/forms";
|
||||
import { Meta, moduleMetadata, Story } from "@storybook/angular";
|
||||
|
||||
import { I18nService } from "@bitwarden/common/abstractions/i18n.service";
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
},
|
||||
} as Meta;
|
||||
|
||||
const fb = new FormBuilder();
|
||||
const fb = new UntypedFormBuilder();
|
||||
|
||||
const formObj = fb.group({
|
||||
name: ["", [Validators.required]],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
AbstractControl,
|
||||
FormBuilder,
|
||||
UntypedFormBuilder,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
ValidationErrors,
|
||||
@@ -46,7 +46,7 @@ export default {
|
||||
},
|
||||
} as Meta;
|
||||
|
||||
const fb = new FormBuilder();
|
||||
const fb = new UntypedFormBuilder();
|
||||
const formObj = fb.group({
|
||||
test: [""],
|
||||
required: ["", [Validators.required]],
|
||||
|
||||
Reference in New Issue
Block a user