From a31605e9d53684e54b67b9eef88e2b7e4833d62e Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Fri, 23 Sep 2022 13:25:08 +0300 Subject: [PATCH] Update angular core and cli to version 14 --- dashboard/divId/divIds.component.ts | 10 ++++---- .../class-help-content-form.component.ts | 6 ++--- .../class-help-contents.component.ts | 8 +++---- dashboard/entity/entities.component.ts | 8 +++---- .../page-help-content-form.component.ts | 6 ++--- .../helpTexts/page-help-contents.component.ts | 8 +++---- dashboard/page/pages.component.ts | 10 ++++---- dashboard/portal/portals.component.ts | 8 +++---- .../users/role-users/role-users.component.ts | 10 ++++---- landingPages/feedback/feedback.component.ts | 12 +++++----- .../notify-form/notify-form.component.ts | 10 ++++---- .../role-verification.component.ts | 6 ++--- .../searchUtils/dateFilter.component.ts | 6 ++--- .../searchUtils/quick-selections.component.ts | 4 ++-- sharedComponents/input/input.component.ts | 24 +++++++++---------- utils/rangeFilter/rangeFilter.component.ts | 6 ++--- utils/string-utils.class.ts | 4 ++-- 17 files changed, 73 insertions(+), 73 deletions(-) diff --git a/dashboard/divId/divIds.component.ts b/dashboard/divId/divIds.component.ts index 62b1383c..28908c8b 100644 --- a/dashboard/divId/divIds.component.ts +++ b/dashboard/divId/divIds.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from "@angular/router"; import {HelpContentService} from "../../services/help-content.service"; -import {FormArray, FormBuilder, FormGroup, Validators} from "@angular/forms"; +import {UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms"; import {CheckDivId, DivId} from "../../utils/entities/adminTool/divId"; import {Page} from "../../utils/entities/adminTool/page"; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -25,15 +25,15 @@ export class DivIdsComponent implements OnInit { private selectedDivIds: string[] = []; public checkboxes: CheckDivId[] = []; public divIds: DivId[] = []; - public classForm: FormGroup; - public pagesCtrl: FormArray; + public classForm: UntypedFormGroup; + public pagesCtrl: UntypedFormArray; private searchText: RegExp = new RegExp(''); public keyword: string = ""; public properties: EnvProperties = properties; public formPages: Page[] = []; public showLoading: boolean = true; - public filterForm: FormGroup; + public filterForm: UntypedFormGroup; private subscriptions: any[] = []; public allPages: Option[] = []; selectedCommunityPid = null; @@ -42,7 +42,7 @@ export class DivIdsComponent implements OnInit { constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, private title: Title, - private _helpContentService: HelpContentService, private _fb: FormBuilder, + private _helpContentService: HelpContentService, private _fb: UntypedFormBuilder, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/divhelpcontent/class-help-content-form.component.ts b/dashboard/divhelpcontent/class-help-content-form.component.ts index d598ee09..906040bf 100644 --- a/dashboard/divhelpcontent/class-help-content-form.component.ts +++ b/dashboard/divhelpcontent/class-help-content-form.component.ts @@ -1,6 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {Page} from '../../utils/entities/adminTool/page'; import {HelpContentService} from '../../services/help-content.service'; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -16,7 +16,7 @@ import {ClearCacheService} from "../../services/clear-cache.service"; }) export class ClassContentFormComponent implements OnInit { - myForm: FormGroup; + myForm: UntypedFormGroup; portal: string; parentClass: string; pageId: string; @@ -28,7 +28,7 @@ export class ClassContentFormComponent implements OnInit { private subs: Subscription[] = []; public pageHelpContent: DivHelpContent; - constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, + constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder, private _helpContentService: HelpContentService, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/divhelpcontent/class-help-contents.component.ts b/dashboard/divhelpcontent/class-help-contents.component.ts index 49df2efa..d59cd7d9 100644 --- a/dashboard/divhelpcontent/class-help-contents.component.ts +++ b/dashboard/divhelpcontent/class-help-contents.component.ts @@ -1,5 +1,5 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; import {PageHelpContentFilterOptions} from '../../utils/entities/adminTool/page-help-content'; @@ -26,7 +26,7 @@ export class ClassHelpContentsComponent implements OnInit { private selectedPageContents: string[] = []; public checkboxes: CheckDivHelpContent[] = []; public divHelpContents: DivHelpContent[] = []; - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; public pages: Page[]; public checkboxAll: boolean = false; public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')}; @@ -39,11 +39,11 @@ export class ClassHelpContentsComponent implements OnInit { public page: Page; public properties: EnvProperties = properties; public showLoading: boolean = true; - public filterForm: FormControl; + public filterForm: UntypedFormControl; private subscriptions: any[] = []; constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, - private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer, + private _helpService: HelpContentService, private _fb: UntypedFormBuilder, private sanitizer: DomSanitizer, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/entity/entities.component.ts b/dashboard/entity/entities.component.ts index 89a184e8..38fa4c6d 100644 --- a/dashboard/entity/entities.component.ts +++ b/dashboard/entity/entities.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {CheckEntity, Entity} from '../../utils/entities/adminTool/entity'; import {Portal} from '../../utils/entities/adminTool/portal'; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -34,7 +34,7 @@ export class EntitiesComponent implements OnInit { public entities: Entity[] = []; - public entityForm: FormGroup; + public entityForm: UntypedFormGroup; private searchText: RegExp = new RegExp(''); public keyword = ''; @@ -52,14 +52,14 @@ export class EntitiesComponent implements OnInit { public showLoading = true; public isPortalAdministrator = null; - public filterForm: FormGroup; + public filterForm: UntypedFormGroup; private subscriptions: any[] = []; private index: number; constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router, private title: Title, private _helpContentService: HelpContentService, - private userManagementService: UserManagementService, private _fb: FormBuilder, + private userManagementService: UserManagementService, private _fb: UntypedFormBuilder, private communityService: CommunityService, private stakeholderService: StakeholderService, private _clearCacheService: ClearCacheService) { diff --git a/dashboard/helpTexts/page-help-content-form.component.ts b/dashboard/helpTexts/page-help-content-form.component.ts index b66b4b94..2fa17105 100644 --- a/dashboard/helpTexts/page-help-content-form.component.ts +++ b/dashboard/helpTexts/page-help-content-form.component.ts @@ -1,6 +1,6 @@ import {Component, OnInit} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {Page} from '../../utils/entities/adminTool/page'; import {HelpContentService} from '../../services/help-content.service'; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -17,7 +17,7 @@ import {NotificationHandler} from "../../utils/notification-handler"; }) export class PageContentFormComponent implements OnInit { - myForm: FormGroup; + myForm: UntypedFormGroup; portal: string; parentClass: string; pageId: string; @@ -30,7 +30,7 @@ export class PageContentFormComponent implements OnInit { private subs: Subscription[] = []; public pageHelpContent: PageHelpContent; - constructor(private route: ActivatedRoute, private _router: Router, private _fb: FormBuilder, + constructor(private route: ActivatedRoute, private _router: Router, private _fb: UntypedFormBuilder, private _helpContentService: HelpContentService, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/helpTexts/page-help-contents.component.ts b/dashboard/helpTexts/page-help-contents.component.ts index 832087a9..deba6ebd 100644 --- a/dashboard/helpTexts/page-help-contents.component.ts +++ b/dashboard/helpTexts/page-help-contents.component.ts @@ -1,5 +1,5 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormControl, UntypedFormGroup} from '@angular/forms'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; import { @@ -27,7 +27,7 @@ export class PageHelpContentsComponent implements OnInit { private selectedPageContents: string[] = []; public checkboxes: CheckPageHelpContent[] = []; public pageHelpContents: PageHelpContent[] = []; - public formGroup: FormGroup; + public formGroup: UntypedFormGroup; public pages: Page[]; public checkboxAll: boolean = false; public filters: PageHelpContentFilterOptions = {id: '', active: null, text: new RegExp('')}; @@ -40,13 +40,13 @@ export class PageHelpContentsComponent implements OnInit { public page: Page; public properties: EnvProperties = properties; public showLoading: boolean = true; - public filterForm: FormControl; + public filterForm: UntypedFormControl; private subscriptions: any[] = []; public selectedKeyword: string; @ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent; constructor(private element: ElementRef, private route: ActivatedRoute, private router: Router, - private _helpService: HelpContentService, private _fb: FormBuilder, private sanitizer: DomSanitizer, + private _helpService: HelpContentService, private _fb: UntypedFormBuilder, private sanitizer: DomSanitizer, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/page/pages.component.ts b/dashboard/page/pages.component.ts index 15e55350..777f2dd2 100644 --- a/dashboard/page/pages.component.ts +++ b/dashboard/page/pages.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; -import {FormArray, FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {CheckPage, Page} from '../../utils/entities/adminTool/page'; import {Entity} from '../../utils/entities/adminTool/entity'; import {EnvProperties} from '../../utils/properties/env-properties'; @@ -38,7 +38,7 @@ export class PagesComponent implements OnInit { //public errorMessage: string; - public pageForm: FormGroup; + public pageForm: UntypedFormGroup; private searchText: RegExp = new RegExp(''); public keyword: string = ''; @@ -53,7 +53,7 @@ export class PagesComponent implements OnInit { public showLoading: boolean = true; public isPortalAdministrator = null; - public filterForm: FormGroup; + public filterForm: UntypedFormGroup; public typeOptions = [{label: 'Search', value: 'search'}, { label: 'Share', value: 'share' @@ -61,7 +61,7 @@ export class PagesComponent implements OnInit { label: 'Link', value: 'link' }, {label: 'Other', value: 'other'}]; - public entitiesCtrl: FormArray; + public entitiesCtrl: UntypedFormArray; allEntities: Option[] = []; private subscriptions: any[] = []; public portalUtils: PortalUtils = new PortalUtils(); @@ -72,7 +72,7 @@ export class PagesComponent implements OnInit { constructor(private element: ElementRef, private route: ActivatedRoute, private title: Title, private _router: Router, private _helpContentService: HelpContentService, - private userManagementService: UserManagementService, private _fb: FormBuilder, + private userManagementService: UserManagementService, private _fb: UntypedFormBuilder, private communityService: CommunityService, private stakeholderService: StakeholderService, private _clearCacheService: ClearCacheService) { diff --git a/dashboard/portal/portals.component.ts b/dashboard/portal/portals.component.ts index 355f4712..be2ed599 100644 --- a/dashboard/portal/portals.component.ts +++ b/dashboard/portal/portals.component.ts @@ -1,7 +1,7 @@ import {Component, ElementRef, OnInit, ViewChild} from '@angular/core'; import {ActivatedRoute, Router} from '@angular/router'; import {HelpContentService} from '../../services/help-content.service'; -import {FormBuilder, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms'; import {EnvProperties} from '../../utils/properties/env-properties'; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {Subscriber} from "rxjs"; @@ -27,8 +27,8 @@ export class PortalsComponent implements OnInit { public checkboxes: CheckPortal[] = []; public portals: Portal[] = []; - public portalForm: FormGroup; - public filterForm: FormGroup; + public portalForm: UntypedFormGroup; + public filterForm: UntypedFormGroup; private subscriptions: any[] = []; private searchText: RegExp = new RegExp(''); @@ -42,7 +42,7 @@ export class PortalsComponent implements OnInit { constructor(private element: ElementRef, private route: ActivatedRoute, private title: Title, - private _router: Router, private _helpContentService: HelpContentService, private _fb: FormBuilder, + private _router: Router, private _helpContentService: HelpContentService, private _fb: UntypedFormBuilder, private _clearCacheService: ClearCacheService) { } diff --git a/dashboard/users/role-users/role-users.component.ts b/dashboard/users/role-users/role-users.component.ts index bf02493e..59ad68df 100644 --- a/dashboard/users/role-users/role-users.component.ts +++ b/dashboard/users/role-users/role-users.component.ts @@ -1,5 +1,5 @@ import {Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild} from '@angular/core'; -import {FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms'; +import {UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms'; import {AlertModal} from "../../../utils/modal/alert"; import {UserRegistryService} from "../../../services/user-registry.service"; import {EnvProperties} from "../../../utils/properties/env-properties"; @@ -46,16 +46,16 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { public loadActive: boolean = true; public loadPending: boolean = true; public selectedUser: string = null; - public invited: FormControl; + public invited: UntypedFormControl; public properties: EnvProperties = properties; public exists: boolean = true; - public roleFb: FormGroup; + public roleFb: UntypedFormGroup; /** Paging */ activePage: number = 1; pendingPage: number = 1; pageSize: number = 10; /** Search */ - filterForm: FormGroup; + filterForm: UntypedFormGroup; @ViewChild('inviteModal') inviteModal: AlertModal; @ViewChild('deleteModal') deleteModal: AlertModal; @ViewChild('deletePendingModal') deletePendingModal: AlertModal; @@ -65,7 +65,7 @@ export class RoleUsersComponent implements OnInit, OnDestroy, OnChanges { private userManagementService: UserManagementService, private notificationService: NotificationService, private router: Router, - private fb: FormBuilder) { + private fb: UntypedFormBuilder) { } ngOnInit() { diff --git a/landingPages/feedback/feedback.component.ts b/landingPages/feedback/feedback.component.ts index 8864209a..5bb5bc11 100644 --- a/landingPages/feedback/feedback.component.ts +++ b/landingPages/feedback/feedback.component.ts @@ -11,7 +11,7 @@ import { } from "@angular/core"; import {ResultLandingInfo} from "../../utils/entities/resultLandingInfo"; import {EnvProperties} from "../../utils/properties/env-properties"; -import {FormArray, FormBuilder, FormGroup, Validators} from "@angular/forms"; +import {UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators} from "@angular/forms"; import {AlertModal} from "../../utils/modal/alert"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {OrganizationInfo} from "../../utils/entities/organizationInfo"; @@ -43,12 +43,12 @@ export class FeedbackComponent implements OnInit, OnChanges { public sending: boolean = false; public sent: boolean = false; public error: boolean = false; - public form: FormGroup; + public form: UntypedFormGroup; public url: string = null; public recipients: string[] = []; subscriptions = []; - constructor(private fb: FormBuilder, + constructor(private fb: UntypedFormBuilder, private emailService: EmailService) { } @@ -94,7 +94,7 @@ export class FeedbackComponent implements OnInit, OnChanges { } public addIssue() { - let issue: FormGroup = this.fb.group({ + let issue: UntypedFormGroup = this.fb.group({ field: this.fb.control(this.preSelectedField, Validators.required), report: this.fb.control('', Validators.required) }); @@ -105,8 +105,8 @@ export class FeedbackComponent implements OnInit, OnChanges { this.issues.removeAt(index); } - public get issues(): FormArray { - return this.form.get('issues'); + public get issues(): UntypedFormArray { + return this.form.get('issues'); } changeShowForm(value: boolean) { diff --git a/notifications/notify-form/notify-form.component.ts b/notifications/notify-form/notify-form.component.ts index 469d7ca7..0072855c 100644 --- a/notifications/notify-form/notify-form.component.ts +++ b/notifications/notify-form/notify-form.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectorRef, Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation} from "@angular/core"; -import {FormArray, FormBuilder, FormGroup} from "@angular/forms"; +import {UntypedFormArray, UntypedFormBuilder, UntypedFormGroup} from "@angular/forms"; import {Role, User} from "../../login/utils/helper.class"; import {UserManagementService} from "../../services/user-management.service"; import {Subscription} from "rxjs"; @@ -47,7 +47,7 @@ import {NotificationHandler} from "../../utils/notification-handler"; export class NotifyFormComponent implements OnInit, OnDestroy { @Input() public label: string = 'Notify Managers'; - public form: FormGroup; + public form: UntypedFormGroup; @Input() public availableGroups: Option[] = null; public groups: Option[] = []; @@ -60,7 +60,7 @@ export class NotifyFormComponent implements OnInit, OnDestroy { private subscriptions: any[] = []; public sending: boolean = false; - constructor(private fb: FormBuilder, + constructor(private fb: UntypedFormBuilder, private cdr: ChangeDetectorRef, private userManagementService: UserManagementService, private notificationService: NotificationService) { @@ -157,8 +157,8 @@ export class NotifyFormComponent implements OnInit, OnDestroy { return groups; } - get groupsAsFromArray(): FormArray { - return this.form.get('groups')?(this.form.get('groups')):null; + get groupsAsFromArray(): UntypedFormArray { + return this.form.get('groups')?(this.form.get('groups')):null; } get message(): string { diff --git a/role-verification/role-verification.component.ts b/role-verification/role-verification.component.ts index c45184f8..269f4409 100644 --- a/role-verification/role-verification.component.ts +++ b/role-verification/role-verification.component.ts @@ -5,7 +5,7 @@ import {UserManagementService} from "../services/user-management.service"; import {UserRegistryService} from "../services/user-registry.service"; import {LoginErrorCodes} from "../login/utils/guardHelper.class"; import {Subscriber} from "rxjs"; -import {FormBuilder, FormControl, Validators} from "@angular/forms"; +import {UntypedFormBuilder, UntypedFormControl, Validators} from "@angular/forms"; import {AlertModal} from "../utils/modal/alert"; import {properties} from "../../../environments/environment"; import {EmailService} from "../utils/email/email.service"; @@ -79,7 +79,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn public service: "connect" | "monitor" = "monitor"; public user: User; public verification: any; - public code: FormControl; + public code: UntypedFormControl; private subs: any[] = []; @ViewChild('managerModal') managerModal: AlertModal; @ViewChild('memberModal') memberModal: AlertModal; @@ -90,7 +90,7 @@ export class RoleVerificationComponent implements OnInit, OnDestroy, AfterViewIn constructor(private route: ActivatedRoute, private router: Router, - private fb: FormBuilder, + private fb: UntypedFormBuilder, private emailService: EmailService, private userManagementService: UserManagementService, private userRegistryService: UserRegistryService) { diff --git a/searchPages/searchUtils/dateFilter.component.ts b/searchPages/searchUtils/dateFilter.component.ts index 7dec2a2c..30499e86 100644 --- a/searchPages/searchUtils/dateFilter.component.ts +++ b/searchPages/searchUtils/dateFilter.component.ts @@ -1,7 +1,7 @@ import {Component, Input} from '@angular/core'; import {DateValue} from './searchHelperClasses.class'; -import {FormControl} from "@angular/forms"; +import {UntypedFormControl} from "@angular/forms"; import { MatDatepickerInputEvent } from "@angular/material/datepicker"; @Component({ @@ -61,8 +61,8 @@ ngOnInit() { this.updateDefaultRangeDates(this.dateValue.from,this.dateValue.to); } updateDefaultRangeDates(df:Date,dt:Date){ - this.fromDate = new FormControl(df); - this.toDate = new FormControl(dt); + this.fromDate = new UntypedFormControl(df); + this.toDate = new UntypedFormControl(dt); } typeChanged(type:string){ diff --git a/searchPages/searchUtils/quick-selections.component.ts b/searchPages/searchUtils/quick-selections.component.ts index dbe91093..ad1cfb97 100644 --- a/searchPages/searchUtils/quick-selections.component.ts +++ b/searchPages/searchUtils/quick-selections.component.ts @@ -1,5 +1,5 @@ import {ChangeDetectorRef, Component, EventEmitter, Input, Output} from '@angular/core'; -import {FormBuilder} from "@angular/forms"; +import {UntypedFormBuilder} from "@angular/forms"; import {Filter} from "./searchHelperClasses.class"; import {EnvProperties} from "../../utils/properties/env-properties"; import {ConfigurationService} from "../../utils/configuration/configuration.service"; @@ -48,7 +48,7 @@ export class QuickSelectionsComponent { subs: Subscription[] = []; - constructor(private _fb: FormBuilder, private config: ConfigurationService, private _router: Router, private route: ActivatedRoute, private cdr:ChangeDetectorRef) { + constructor(private _fb: UntypedFormBuilder, private config: ConfigurationService, private _router: Router, private route: ActivatedRoute, private cdr:ChangeDetectorRef) { } changed() { diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index b2d1afaf..f6396592 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -13,7 +13,7 @@ import { SimpleChanges, ViewChild } from "@angular/core"; -import {AbstractControl, FormArray, FormControl, ValidatorFn} from "@angular/forms"; +import {AbstractControl, UntypedFormArray, UntypedFormControl, ValidatorFn} from "@angular/forms"; import {HelperFunctions} from "../../utils/HelperFunctions.class"; import {Subscription} from "rxjs"; import {EnvProperties} from "../../utils/properties/env-properties"; @@ -217,7 +217,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang @Input() noValueSelected: string = 'No option selected'; /** Chips && Autocomplete*/ public filteredOptions: Option[] = []; - public searchControl: FormControl; + public searchControl: UntypedFormControl; /** Use modifier's class(es) to change view of your Input */ @Input() inputClass: string = 'inner'; /** Icon on the input */ @@ -332,12 +332,12 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.id = 'input-' + InputComponent.INPUT_COUNTER; if (!this.formControl) { if (Array.isArray(this.value)) { - this.formControl = new FormArray([]); + this.formControl = new UntypedFormArray([]); this.value.forEach(value => { - this.formAsArray.push(new FormControl(value, this.validators)); + this.formAsArray.push(new UntypedFormControl(value, this.validators)); }); } else { - this.formControl = new FormControl(this.value); + this.formControl = new UntypedFormControl(this.value); this.formControl.setValidators(this.validators); } if (this.disabled) { @@ -372,16 +372,16 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang this.unsubscribe(); } - get formAsControl(): FormControl { - if (this.formControl instanceof FormControl) { + get formAsControl(): UntypedFormControl { + if (this.formControl instanceof UntypedFormControl) { return this.formControl; } else { return null; } } - get formAsArray(): FormArray { - if (this.formControl instanceof FormArray) { + get formAsArray(): UntypedFormArray { + if (this.formControl instanceof UntypedFormArray) { return this.formControl; } else { return null; @@ -401,7 +401,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang } if (this.type === 'chips' || this.type === 'autocomplete') { if (!this.searchControl) { - this.searchControl = new FormControl('', this.validators); + this.searchControl = new UntypedFormControl('', this.validators); } this.subscriptions.push(this.searchControl.valueChanges.subscribe(value => { this.filteredOptions = this.filter(value); @@ -488,7 +488,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang if (event && event.stopPropagation) { event.stopPropagation(); } - this.formAsArray.push(new FormControl(this.searchControl.value, this.validators)); + this.formAsArray.push(new UntypedFormControl(this.searchControl.value, this.validators)); this.formAsArray.markAsDirty(); } this.searchControl.setValue(''); @@ -573,7 +573,7 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang if (this.formAsControl) { this.formAsControl.setValue(option.value); } else if (this.formAsArray) { - this.formAsArray.push(new FormControl(option.value)); + this.formAsArray.push(new UntypedFormControl(option.value)); this.formAsArray.markAsDirty(); event.stopPropagation(); this.focus(true); diff --git a/utils/rangeFilter/rangeFilter.component.ts b/utils/rangeFilter/rangeFilter.component.ts index 77ad9697..6e0454bb 100644 --- a/utils/rangeFilter/rangeFilter.component.ts +++ b/utils/rangeFilter/rangeFilter.component.ts @@ -3,7 +3,7 @@ import {RangeFilter} from './rangeFilterHelperClasses.class'; import {Dates, StringUtils} from "../string-utils.class"; import {ActivatedRoute, Router} from "@angular/router"; import {properties} from "../../../../environments/environment"; -import {FormBuilder, FormGroup} from "@angular/forms"; +import {UntypedFormBuilder, UntypedFormGroup} from "@angular/forms"; @Component({ selector: 'range-filter', @@ -23,12 +23,12 @@ export class RangeFilterComponent { public currentYear: number = Dates.currentYear; public yearValidators = [StringUtils.inValidYearValidator(this.yearMin, this.yearMax)]; public formValidators = [StringUtils.fromYearAfterToYearValidator]; - public rangeForm: FormGroup; + public rangeForm: UntypedFormGroup; @Output() onFilterChange = new EventEmitter(); @Input() actionRoute:boolean = false; queryParams = {}; - constructor(private _router: Router, private route: ActivatedRoute, private _fb: FormBuilder) {} + constructor(private _router: Router, private route: ActivatedRoute, private _fb: UntypedFormBuilder) {} ngOnInit() { if(this.mandatoryRange) { diff --git a/utils/string-utils.class.ts b/utils/string-utils.class.ts index 75046e4a..ced29bc7 100644 --- a/utils/string-utils.class.ts +++ b/utils/string-utils.class.ts @@ -1,5 +1,5 @@ import {UrlSegment} from '@angular/router'; -import {AbstractControl, FormGroup, ValidationErrors, ValidatorFn, Validators} from "@angular/forms"; +import {AbstractControl, UntypedFormGroup, ValidationErrors, ValidatorFn, Validators} from "@angular/forms"; import {Stakeholder, StakeholderEntities} from "../monitor/entities/stakeholder"; import {CommunityInfo} from "../connect/community/communityInfo"; import {properties} from "../../../environments/environment"; @@ -435,7 +435,7 @@ export class StringUtils { }; } - public static fromYearAfterToYearValidator: ValidatorFn = (control: FormGroup): ValidationErrors | null => { + public static fromYearAfterToYearValidator: ValidatorFn = (control: UntypedFormGroup): ValidationErrors | null => { const yearFrom = control.get('yearFrom'); const yearTo = control.get('yearTo'); return ((yearFrom && yearTo && (parseInt(yearFrom.value, 10) > parseInt(yearTo.value, 10))) ? { 'fromYearAfterToYear': true } : null);