2023-12-29 16:04:16 +01:00
|
|
|
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
|
2018-11-27 18:33:17 +01:00
|
|
|
import { Component, OnDestroy, OnInit } from '@angular/core';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
|
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
2018-11-27 18:33:17 +01:00
|
|
|
import { ActivatedRoute, Params, Router } from '@angular/router';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { RoleOrganizationType } from '@app/core/common/enum/role-organization-type';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { CultureInfo } from '@app/core/model/culture-info';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { Reference } from '@app/core/model/reference/reference';
|
2024-03-19 16:12:36 +01:00
|
|
|
import { User, UserCredential } from '@app/core/model/user/user';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { AuthService } from '@app/core/services/auth/auth.service';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
2019-12-11 15:51:03 +01:00
|
|
|
import { CultureService } from '@app/core/services/culture/culture-service';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { LanguageService } from '@app/core/services/language/language.service';
|
|
|
|
import { MatomoService } from '@app/core/services/matomo/matomo-service';
|
|
|
|
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
|
|
|
import { UserService } from '@app/core/services/user/user.service';
|
|
|
|
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
|
|
|
|
import { MultipleAutoCompleteConfiguration } from '@app/library/auto-complete/multiple/multiple-auto-complete-configuration';
|
|
|
|
import { PopupNotificationDialogComponent } from "@app/library/notification/popup/popup-notification.component";
|
2019-12-11 15:51:03 +01:00
|
|
|
import { BaseComponent } from '@common/base/base.component';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { FormValidationErrorsDialogComponent } from '@common/forms/form-validation-errors-dialog/form-validation-errors-dialog.component';
|
|
|
|
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
2018-08-24 17:21:02 +02:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
2018-11-27 18:33:17 +01:00
|
|
|
import * as moment from 'moment-timezone';
|
2019-09-23 10:17:03 +02:00
|
|
|
import { Observable, of } from 'rxjs';
|
|
|
|
import { map, takeUntil } from 'rxjs/operators';
|
2020-10-26 10:57:06 +01:00
|
|
|
import { AddAccountDialogComponent } from './add-account/add-account-dialog.component';
|
2023-12-29 16:04:16 +01:00
|
|
|
import { UserProfileEditorModel } from './user-profile-editor.model';
|
2024-03-19 12:57:30 +01:00
|
|
|
import { nameof } from 'ts-simple-nameof';
|
|
|
|
import { Guid } from '@common/types/guid';
|
2018-08-24 17:21:02 +02:00
|
|
|
|
|
|
|
@Component({
|
2018-10-05 17:00:54 +02:00
|
|
|
selector: 'app-user-profile',
|
|
|
|
templateUrl: './user-profile.component.html',
|
|
|
|
styleUrls: ['./user-profile.component.scss'],
|
2018-08-24 17:21:02 +02:00
|
|
|
})
|
2018-11-27 18:33:17 +01:00
|
|
|
export class UserProfileComponent extends BaseComponent implements OnInit, OnDestroy {
|
2018-08-24 17:21:02 +02:00
|
|
|
|
2020-10-23 09:49:09 +02:00
|
|
|
userProfileEditorModel: UserProfileEditorModel;
|
2023-12-29 16:04:16 +01:00
|
|
|
user: Observable<User>;
|
|
|
|
//TODO: refactor
|
2024-03-19 16:12:36 +01:00
|
|
|
userCredentials: Observable<UserCredential[]>;
|
|
|
|
firstEmail: String;
|
2018-10-05 17:00:54 +02:00
|
|
|
currentUserId: string;
|
|
|
|
cultures: Observable<CultureInfo[]>;
|
|
|
|
timezones: Observable<any[]>;
|
|
|
|
editMode = false;
|
2023-02-11 13:38:13 +01:00
|
|
|
languages = [];
|
2020-10-23 09:49:09 +02:00
|
|
|
roleOrganizationEnum = RoleOrganizationType;
|
2020-11-17 18:57:39 +01:00
|
|
|
errorMessages = [];
|
|
|
|
nestedCount = [];
|
|
|
|
nestedIndex = 0;
|
2020-10-23 09:49:09 +02:00
|
|
|
|
|
|
|
organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = {
|
|
|
|
filterFn: this.filterOrganisations.bind(this),
|
|
|
|
initialItems: (excludedItems: any[]) => this.filterOrganisations('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))),
|
|
|
|
displayFn: (item) => item['name'],
|
|
|
|
titleFn: (item) => item['name'],
|
|
|
|
subtitleFn: (item) => item['tag'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['tag'] : (item['key'] ? this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.SOURCE:') + item['key'] : this.language.instant('TYPES.EXTERNAL-DATASET-TYPE.NO-SOURCE'))
|
|
|
|
};
|
2018-10-05 17:00:54 +02:00
|
|
|
|
2023-10-05 15:39:17 +02:00
|
|
|
formGroup: UntypedFormGroup;
|
2018-10-05 17:00:54 +02:00
|
|
|
constructor(
|
2023-12-29 16:04:16 +01:00
|
|
|
private userService: UserService,
|
2018-10-05 17:00:54 +02:00
|
|
|
private route: ActivatedRoute,
|
|
|
|
private router: Router,
|
|
|
|
private authService: AuthService,
|
|
|
|
private language: TranslateService,
|
|
|
|
private cultureService: CultureService,
|
2020-01-23 17:35:11 +01:00
|
|
|
private authentication: AuthService,
|
2020-04-10 16:16:37 +02:00
|
|
|
private languageService: LanguageService,
|
|
|
|
private configurationService: ConfigurationService,
|
2020-11-17 18:57:39 +01:00
|
|
|
private uiNotificationService: UiNotificationService,
|
2020-10-26 10:57:06 +01:00
|
|
|
private dialog: MatDialog,
|
2020-10-26 17:18:26 +01:00
|
|
|
public enumUtils: EnumUtils,
|
2020-12-14 18:28:13 +01:00
|
|
|
private httpClient: HttpClient,
|
|
|
|
private matomoService: MatomoService
|
2023-02-11 13:38:13 +01:00
|
|
|
) {
|
|
|
|
super();
|
2023-11-29 14:26:40 +01:00
|
|
|
this.languages = this.languageService.getAvailableLanguagesCodes();
|
2023-02-11 13:38:13 +01:00
|
|
|
}
|
2018-10-05 17:00:54 +02:00
|
|
|
|
|
|
|
ngOnInit() {
|
2020-12-14 18:28:13 +01:00
|
|
|
this.matomoService.trackPageView('User Profile');
|
2018-11-27 18:33:17 +01:00
|
|
|
this.route.params
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe((params: Params) => {
|
2023-10-11 16:53:12 +02:00
|
|
|
this.currentUserId = this.authService.userId()?.toString();
|
2024-03-19 12:57:30 +01:00
|
|
|
this.user = this.userService.getSingle(
|
|
|
|
Guid.parse(this.currentUserId),
|
|
|
|
[
|
|
|
|
nameof<User>(x => x.id),
|
|
|
|
nameof<User>(x => x.name),
|
|
|
|
nameof<User>(x => x.additionalInfo.language),
|
|
|
|
nameof<User>(x => x.additionalInfo.timezone),
|
|
|
|
nameof<User>(x => x.additionalInfo.culture),
|
|
|
|
nameof<User>(x => x.additionalInfo.organization),
|
|
|
|
nameof<User>(x => x.additionalInfo.roleOrganization),
|
2024-03-19 16:12:36 +01:00
|
|
|
`${nameof<User>(x => x.credentials)}.${nameof<UserCredential>(x => x.data.email)}`,
|
|
|
|
`${nameof<User>(x => x.credentials)}.${nameof<UserCredential>(x => x.data.externalProviderNames)}`,
|
2024-03-19 12:57:30 +01:00
|
|
|
]
|
|
|
|
)
|
|
|
|
.pipe(map(result => {
|
2024-03-19 16:12:36 +01:00
|
|
|
//tested ui with fake data
|
|
|
|
// const fakecredentials: UserCredential = {
|
|
|
|
// "id": Guid.createEmpty(),
|
|
|
|
// "externalId": "123",
|
|
|
|
// "user": null,
|
|
|
|
// "createdAt": new Date(),
|
|
|
|
// "data": {
|
|
|
|
// "email": "dmpadmin@dmp.com",
|
|
|
|
// "externalProviderNames": ["Google", "Facebook"]
|
|
|
|
// }
|
|
|
|
// };
|
|
|
|
// result.credentials.push(fakecredentials);
|
|
|
|
// result.credentials[0].data.externalProviderNames = ['Google'];
|
|
|
|
|
|
|
|
this.firstEmail = result.credentials[0].data.email;
|
|
|
|
this.userCredentials = of(result.credentials);
|
2020-10-23 09:49:09 +02:00
|
|
|
|
2024-03-19 16:12:36 +01:00
|
|
|
this.userProfileEditorModel = new UserProfileEditorModel().fromModel(result);
|
|
|
|
this.formGroup = this.userProfileEditorModel.buildForm(this.languageService.getAvailableLanguagesCodes());
|
2024-03-19 12:57:30 +01:00
|
|
|
|
2024-03-19 16:12:36 +01:00
|
|
|
//this.formGroup.get('language').valueChanges.pipe(takeUntil(this._destroyed)).subscribe(x => { if (x) this.translate.use(x.value) })
|
|
|
|
this.formGroup.get('timezone').valueChanges
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(x => { if (x) { this.timezones = this._filterTimezone(x); } });
|
|
|
|
this.formGroup.get('culture').valueChanges
|
|
|
|
.pipe(takeUntil(this._destroyed))
|
|
|
|
.subscribe(x => { if (x) { this.cultures = this._filterCulture(x); } });
|
|
|
|
// this.initializeDisabledFormGroup();
|
|
|
|
this.unlock();
|
|
|
|
return result;
|
|
|
|
}));
|
2020-10-26 10:57:06 +01:00
|
|
|
|
2023-12-29 16:04:16 +01:00
|
|
|
//TODO: refactor
|
|
|
|
// this.userService.getEmails(userId).pipe(takeUntil(this._destroyed))
|
|
|
|
// .subscribe(result => {
|
|
|
|
// this.user.subscribe(x => {
|
|
|
|
// const mainEmail = result.filter(el => el.email === x.email)
|
|
|
|
// const otherEmails = result.filter(el => el.email !== x.email)
|
|
|
|
// this.userCredentials = [...mainEmail, ...otherEmails];
|
|
|
|
// }
|
|
|
|
// )
|
|
|
|
// });
|
2018-10-05 17:00:54 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2018-10-12 17:17:31 +02:00
|
|
|
ngOnDestroy(): void {
|
|
|
|
}
|
|
|
|
|
2024-03-19 16:12:36 +01:00
|
|
|
public hasProvider(userCredential: UserCredential, provider: string): boolean {
|
|
|
|
const result = userCredential.data.externalProviderNames?.find(x => x == provider);
|
|
|
|
|
|
|
|
return result != null;
|
|
|
|
}
|
|
|
|
|
2023-12-29 16:04:16 +01:00
|
|
|
private filterOrganisations(value: string): Observable<Reference[]> {
|
|
|
|
//TODO: refactor
|
|
|
|
// return this.externalSourcesService.searchDMPOrganizations(value);
|
|
|
|
return null;
|
2020-10-23 09:49:09 +02:00
|
|
|
}
|
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
private _filterTimezone(value: string): Observable<any[]> {
|
|
|
|
if (value && typeof value === 'string') {
|
|
|
|
const filterValue = value.toLowerCase();
|
2019-09-23 10:17:03 +02:00
|
|
|
return of(moment.tz.names().filter(option => option.toLowerCase().includes(filterValue)));
|
2018-10-05 17:00:54 +02:00
|
|
|
} else {
|
2019-09-23 10:17:03 +02:00
|
|
|
return of(moment.tz.names());
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private _filterCulture(value: string): Observable<any[]> {
|
|
|
|
if (value && typeof value === 'string') {
|
|
|
|
const filterValue = value.toLowerCase();
|
2019-09-23 10:17:03 +02:00
|
|
|
return of(this.cultureService.getCultureValues().filter(option => option.displayName.toLowerCase().includes(filterValue)));
|
2018-10-05 17:00:54 +02:00
|
|
|
} else {
|
2019-09-23 10:17:03 +02:00
|
|
|
return of(this.cultureService.getCultureValues());
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
displayFn(culture?: CultureInfo): string | undefined {
|
2024-03-19 12:57:30 +01:00
|
|
|
|
|
|
|
if (culture == null
|
|
|
|
|| culture.displayName == null
|
|
|
|
|| culture.nativeName == null)
|
|
|
|
return undefined;
|
|
|
|
|
|
|
|
return culture.displayName + '-' + culture.nativeName;
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
save() {
|
2023-12-29 16:04:16 +01:00
|
|
|
//TODO: refactor
|
|
|
|
// if (!this.formGroup.valid) {
|
|
|
|
// this.printErrors(this.formGroup);
|
|
|
|
// this.showValidationErrorsDialog();
|
|
|
|
// this.nestedCount = [];
|
|
|
|
// this.nestedIndex = 0;
|
|
|
|
// this.errorMessages = [];
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// this.userService.updateUserSettings(this.formGroup.value)
|
|
|
|
// .pipe(takeUntil(this._destroyed))
|
|
|
|
// .subscribe(
|
|
|
|
// x => {
|
|
|
|
// this.editMode = false;
|
|
|
|
// this.languageService.changeLanguage(this.formGroup.value.language.value);
|
|
|
|
// this.authService.refresh()
|
|
|
|
// .pipe(takeUntil(this._destroyed))
|
|
|
|
// .subscribe(result => {
|
|
|
|
// this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success);
|
|
|
|
// this.router.navigate(['/profile']);
|
|
|
|
// });
|
|
|
|
// // .subscribe(result => window.location.reload());
|
|
|
|
// },
|
|
|
|
// error => {
|
|
|
|
// console.log(error);
|
|
|
|
// });
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public unlock() {
|
|
|
|
this.editMode = true;
|
|
|
|
this.formGroup.enable();
|
|
|
|
}
|
|
|
|
|
2020-10-23 09:49:09 +02:00
|
|
|
public initializeDisabledFormGroup() {
|
|
|
|
this.formGroup.disable();
|
|
|
|
}
|
|
|
|
|
2018-10-05 17:00:54 +02:00
|
|
|
public lock() {
|
2019-01-21 12:14:20 +01:00
|
|
|
if (!this.formGroup.valid) { return; }
|
2023-12-29 16:04:16 +01:00
|
|
|
//TODO: refactor
|
|
|
|
// this.userService.updateUserSettings(this.formGroup.value)
|
|
|
|
// .pipe(takeUntil(this._destroyed))
|
|
|
|
// .subscribe(
|
|
|
|
// x => {
|
|
|
|
// this.editMode = false;
|
|
|
|
// this.languageService.changeLanguage(this.formGroup.value.language.value);
|
|
|
|
// this.formGroup.disable();
|
|
|
|
// this.authService.refresh()
|
|
|
|
// .pipe(takeUntil(this._destroyed))
|
|
|
|
// .subscribe(result => this.router.navigate(['/profile']));
|
|
|
|
// // .subscribe(result => window.location.reload());
|
|
|
|
// },
|
|
|
|
// error => {
|
|
|
|
// console.log(error);
|
|
|
|
// });
|
2018-10-05 17:00:54 +02:00
|
|
|
}
|
2018-08-30 13:09:36 +02:00
|
|
|
|
2020-11-17 18:57:39 +01:00
|
|
|
private showValidationErrorsDialog(projectOnly?: boolean) {
|
|
|
|
const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, {
|
|
|
|
disableClose: true,
|
|
|
|
autoFocus: false,
|
|
|
|
restoreFocus: false,
|
|
|
|
data: {
|
|
|
|
errorMessages: this.errorMessages,
|
|
|
|
projectOnly: projectOnly
|
|
|
|
},
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-02-17 16:39:33 +01:00
|
|
|
public applyFallbackAvatar(ev: Event) {
|
|
|
|
(ev.target as HTMLImageElement).src = 'assets/images/profile-placeholder.png';
|
|
|
|
}
|
|
|
|
|
2023-12-29 16:04:16 +01:00
|
|
|
public removeAccount(userCredential: any) {
|
2023-05-23 16:15:11 +02:00
|
|
|
this.dialog.open(ConfirmationDialogComponent, {
|
2023-12-29 16:04:16 +01:00
|
|
|
data: {
|
2023-05-23 16:18:06 +02:00
|
|
|
message: this.language.instant('USER-PROFILE.UNLINK-ACCOUNT-DIALOG.MESSAGE'),
|
2023-05-23 16:15:11 +02:00
|
|
|
confirmButton: this.language.instant('USER-PROFILE.UNLINK-ACCOUNT-DIALOG.CONFIRM'),
|
|
|
|
cancelButton: this.language.instant('USER-PROFILE.UNLINK-ACCOUNT-DIALOG.CANCEL')
|
|
|
|
},
|
2023-12-29 16:04:16 +01:00
|
|
|
maxWidth: '35em'
|
2023-05-23 16:15:11 +02:00
|
|
|
})
|
2023-12-29 16:04:16 +01:00
|
|
|
.afterClosed()
|
|
|
|
.subscribe(confirm => {
|
|
|
|
if (confirm) {
|
|
|
|
//TODO: refactor
|
2024-03-19 16:12:36 +01:00
|
|
|
console.log('removed!');
|
2023-12-29 16:04:16 +01:00
|
|
|
// const unlinkAccountModel: UnlinkAccountRequestModel = {
|
|
|
|
// userId: this.currentUserId,
|
|
|
|
// email: userCredential.email,
|
|
|
|
// provider: userCredential.provider
|
|
|
|
// };
|
|
|
|
// this.unlinkAccountEmailConfirmation.sendConfirmationEmail(unlinkAccountModel).pipe(takeUntil(this._destroyed)).subscribe(
|
|
|
|
// result => {
|
|
|
|
// this.dialog.open(PopupNotificationDialogComponent, {
|
|
|
|
// data: {
|
|
|
|
// title: this.language.instant('USER-PROFILE.UNLINK-ACCOUNT.TITLE'),
|
|
|
|
// message: this.language.instant('USER-PROFILE.UNLINK-ACCOUNT.MESSAGE', { 'accountToBeUnlinked': userCredential.email })
|
|
|
|
// }, maxWidth: '35em'
|
|
|
|
// });
|
|
|
|
// },
|
|
|
|
// error => { this.onCallbackError(error); }
|
|
|
|
// );
|
|
|
|
}
|
|
|
|
});
|
2023-05-23 16:15:11 +02:00
|
|
|
}
|
2020-10-26 10:57:06 +01:00
|
|
|
|
2023-05-23 16:15:11 +02:00
|
|
|
onCallbackError(errorResponse: HttpErrorResponse) {
|
|
|
|
this.uiNotificationService.snackBarNotification(errorResponse.message, SnackBarNotificationLevel.Warning);
|
2020-10-26 10:57:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public addAccount() {
|
|
|
|
const dialogRef = this.dialog.open(AddAccountDialogComponent, {
|
|
|
|
restoreFocus: false,
|
|
|
|
autoFocus: false,
|
2020-10-26 12:24:39 +01:00
|
|
|
width: '653px',
|
2020-11-27 13:41:27 +01:00
|
|
|
maxHeight: '90vh',
|
2020-10-26 10:57:06 +01:00
|
|
|
data: {
|
|
|
|
}
|
|
|
|
});
|
|
|
|
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
|
|
|
if (result) {
|
2023-12-29 16:04:16 +01:00
|
|
|
//TODO refactor
|
|
|
|
// this.mergeEmailConfirmation.sendConfirmationEmail(result).pipe(takeUntil(this._destroyed))
|
|
|
|
// .subscribe(res => {
|
|
|
|
// this.dialog.open(PopupNotificationDialogComponent, {
|
|
|
|
// data: {
|
|
|
|
// title: this.language.instant('USER-PROFILE.MERGING-EMAILS-DIALOG.TITLE'),
|
|
|
|
// message: this.language.instant('USER-PROFILE.MERGING-EMAILS-DIALOG.MESSAGE')
|
|
|
|
// }, maxWidth: '30em'
|
|
|
|
// });
|
|
|
|
// }, err => { });
|
2020-10-26 10:57:06 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-10-05 15:39:17 +02:00
|
|
|
printErrors(rootform: UntypedFormGroup) {
|
2020-11-17 18:57:39 +01:00
|
|
|
if (!rootform.valid) {
|
|
|
|
Object.keys(rootform.controls).forEach(key => {
|
|
|
|
const errors = rootform.get(key).errors;
|
|
|
|
if (errors !== null) {
|
|
|
|
let numbering: string = '';
|
|
|
|
for (let j = 0; j < this.nestedCount.length; j++) {
|
|
|
|
numbering += this.nestedCount[j];
|
|
|
|
if (j < this.nestedIndex) {
|
|
|
|
numbering += '.';
|
|
|
|
} else {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Object.keys(errors).forEach(keyError => {
|
|
|
|
if (typeof errors[keyError] === 'boolean') {
|
|
|
|
this.errorMessages.push(numbering + ' ' + key + ' is ' + keyError);
|
|
|
|
} else {
|
|
|
|
this.errorMessages.push(numbering + ' ' + key + ': ' + keyError + ': ' + JSON.stringify(errors[keyError]));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
2023-10-05 15:39:17 +02:00
|
|
|
if (rootform.get(key) instanceof UntypedFormGroup) {
|
|
|
|
this.printErrors(<UntypedFormGroup>rootform.get(key));
|
|
|
|
} else if (rootform.get(key) instanceof UntypedFormArray) {
|
2020-11-17 18:57:39 +01:00
|
|
|
this.nestedIndex++;
|
|
|
|
this.nestedCount[this.nestedIndex] = 0;
|
2023-10-05 15:39:17 +02:00
|
|
|
for (let childForm of (<UntypedFormArray>rootform.get(key)).controls) {
|
2020-11-17 18:57:39 +01:00
|
|
|
this.nestedCount[this.nestedIndex]++;
|
|
|
|
this.printErrors(<any>childForm);
|
|
|
|
}
|
|
|
|
this.nestedCount[this.nestedIndex] = 0;
|
|
|
|
this.nestedIndex--;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-08-24 17:21:02 +02:00
|
|
|
}
|