update to angular 14

This commit is contained in:
Diamantis Tziotzios 2023-10-05 16:39:17 +03:00
parent 05a724d757
commit 203ee4fb29
241 changed files with 1435 additions and 1554 deletions

View File

@ -26,6 +26,7 @@
!.vscode/extensions.json
# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage

View File

@ -123,18 +123,6 @@
{ "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/tinymce/plugins/" }
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
@ -149,22 +137,10 @@
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "dmp-frontend:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.e2e.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
}
},
"defaultProject": "dmp-frontend",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",

View File

@ -12,13 +12,13 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^12.2.7",
"@angular/common": "^12.2.7",
"@angular/compiler": "^12.2.7",
"@angular/core": "^12.2.7",
"@angular/forms": "^12.2.7",
"@angular/material-moment-adapter": "^12.2.7",
"@angular/platform-browser": "^12.2.7",
"@angular/animations": "^14.3.0",
"@angular/common": "^14.3.0",
"@angular/compiler": "^14.3.0",
"@angular/core": "^14.3.0",
"@angular/forms": "^14.3.0",
"@angular/material-moment-adapter": "^14.2.7",
"@angular/platform-browser": "^14.3.0",
"@kolkov/angular-editor": "^1.2.0",
"@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0",
@ -43,18 +43,17 @@
"tinymce": "^5.9.2",
"ts-simple-nameof": "^1.3.1",
"tslib": "^2.0.0",
"web-animations-js": "^2.3.2",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.2.7",
"@angular/cdk": "^12.2.7",
"@angular/cli": "12.2.7",
"@angular/compiler-cli": "^12.2.7",
"@angular/language-service": "^12.2.7",
"@angular/material": "^12.2.7",
"@angular/platform-browser-dynamic": "^12.2.7",
"@angular/router": "^12.2.7",
"@angular-devkit/build-angular": "^14.2.12",
"@angular/cdk": "^14.2.7",
"@angular/cli": "14.2.12",
"@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^14.3.0",
"@angular/material": "^14.2.7",
"@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^14.3.0",
"@types/facebook-js-sdk": "^3.3.5",
"@types/file-saver": "^2.0.3",
"@types/gapi": "^0.0.41",
@ -67,6 +66,6 @@
"codelyzer": "^6.0.2",
"ts-node": "~10.2.1",
"tslint": "~6.1.0",
"typescript": "4.3.5"
"typescript": "4.6.4"
}
}

View File

@ -1,4 +1,4 @@
import { FormBuilder } from '@angular/forms';
import { UntypedFormBuilder } from '@angular/forms';
export abstract class BaseFormModel {
public formBuilder: FormBuilder = new FormBuilder();
public formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
}

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
export interface ContactEmail {
@ -17,8 +17,8 @@ export class ContactEmailFormModel {
return this;
}
buildForm(): FormGroup {
const formGroup = new FormBuilder().group({
buildForm(): UntypedFormGroup {
const formGroup = new UntypedFormBuilder().group({
subject: [this.subject, [Validators.required]],
description: [this.description, [Validators.required]]
});

View File

@ -1,4 +1,4 @@
import { FormGroup, FormBuilder } from '@angular/forms';
import { UntypedFormGroup, UntypedFormBuilder } from '@angular/forms';
import { isNullOrUndefined } from '@app/utilities/enhancers/utils';
export class DatasetIdModel {
@ -25,8 +25,8 @@ export class DatasetIdModel {
}
}
buildForm(): FormGroup {
return new FormBuilder().group({
buildForm(): UntypedFormGroup {
return new UntypedFormBuilder().group({
identifier: [this.identifier],
type: [this.type]
});

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpModel } from '@app/core/model/dmp/dmp';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
@ -17,9 +17,9 @@ export class DmpCreateWizardFormModel {
return this;
}
buildForm(context: ValidationContext = null): FormGroup {
buildForm(context: ValidationContext = null): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); }
const formBuilder = new FormBuilder();
const formBuilder = new UntypedFormBuilder();
const formGroup = formBuilder.group({
dmp: [this.dmp, context.getValidation('dmp').validators],
datasetProfile: [this.datasetProfile, context.getValidation('datasetProfile').validators],

View File

@ -1,4 +1,4 @@
import { FormGroup, FormBuilder } from "@angular/forms";
import { UntypedFormGroup, UntypedFormBuilder } from "@angular/forms";
import { BackendErrorValidator } from "@common/forms/validation/custom-validator";
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "@common/forms/validation/validation-context";
@ -12,9 +12,9 @@ export class DmpDatasetProfileSectionsFormModel {
return this;
}
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
const formGroup = new UntypedFormBuilder().group({
language: [{ value: this.dmpSectionIndex, disabled: disabled }, context.getValidation('dmpSectionIndex').validators],
});
return formGroup;

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { Serializable } from '@common/types/json/serializable';
export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
@ -14,8 +14,8 @@ export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
return this;
}
buildForm(): FormGroup {
return new FormBuilder().group({
buildForm(): UntypedFormGroup {
return new UntypedFormBuilder().group({
id: [this.id],
email: [this.email],
name: [this.name]

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormGroup } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { DmpInvitationUser } from './dmp-invitation-user';
export class DmpInvitation {
@ -7,8 +7,8 @@ export class DmpInvitation {
public users = new Array<DmpInvitationUser>();
public role: number;
buildForm(): FormGroup {
const formGroup = new FormBuilder().group({
buildForm(): UntypedFormGroup {
const formGroup = new UntypedFormBuilder().group({
dataManagementPlan: [this.dataManagementPlan],
users: [this.users],
role: [this.role]

View File

@ -1,12 +1,12 @@
import { Pipe, PipeTransform } from "@angular/core";
import { FormGroup } from "@angular/forms";
import { UntypedFormGroup } from "@angular/forms";
@Pipe({
name: 'datasetInSection'
})
export class DatasetInSectioPipe implements PipeTransform{
transform(datasets: FormGroup[], args: string): FormGroup[] {
transform(datasets: UntypedFormGroup[], args: string): UntypedFormGroup[] {
let values = [];
for(var dataset of datasets){
if(dataset.get('dmpSectionIndex').value == args){

View File

@ -5,8 +5,7 @@ import { CommonUiModule } from '@common/ui/common-ui.module';
@NgModule({
imports: [CommonUiModule],
declarations: [ExportMethodDialogComponent],
exports: [ExportMethodDialogComponent],
entryComponents: [ExportMethodDialogComponent]
exports: [ExportMethodDialogComponent]
})
export class ExportMethodDialogModule {
constructor() { }

View File

@ -8,8 +8,7 @@ import { WindowRefService } from './windowref.service';
declarations: [GuidedTourComponent],
imports: [CommonModule],
providers: [WindowRefService],
exports: [GuidedTourComponent],
entryComponents: [GuidedTourComponent],
exports: [GuidedTourComponent]
})
export class GuidedTourModule {
public static forRoot(): ModuleWithProviders<GuidedTourModule> {

View File

@ -15,10 +15,6 @@ import { CommonUiModule } from '@common/ui/common-ui.module';
],
exports: [
NotificationComponent
],
entryComponents: [
SnackBarNotificationComponent,
PopupNotificationDialogComponent,
]
})
export class NotificationModule {

View File

@ -1,6 +1,6 @@
import {Component, Input} from "@angular/core";
import {AngularEditorConfig} from "@kolkov/angular-editor";
import {FormControl} from "@angular/forms";
import {UntypedFormControl} from "@angular/forms";
@Component({
selector: 'rich-text-editor-component',
@ -66,7 +66,7 @@ export class RichTextEditorComponent {
]
};
get formInput(): FormControl {
get formInput(): UntypedFormControl {
return this.parentFormGroup.get(this.controlName);
}

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DefaultValue } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model';
@ -12,7 +12,7 @@ export class DefaultValueEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.type')) }],
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.value')) }]

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type';
import { AutoCompleteFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
@ -12,17 +12,17 @@ export class AutoCompleteFieldDataEditorModel extends FieldDataEditorModel<AutoC
public autoCompleteSingleDataList: Array<AutoCompleteSingleDataEditorModel> = new Array<AutoCompleteSingleDataEditorModel>();
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.type')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.multiAutoComplete')) }]
});
const autocompleteFormArray = new Array<FormGroup>();
const autocompleteFormArray = new Array<UntypedFormGroup>();
if (this.autoCompleteSingleDataList) {
this.autoCompleteSingleDataList.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
autocompleteFormArray.push(form);
});
}

View File

@ -1,7 +1,7 @@
import { FieldDataEditorModel } from './field-data-editor-model';
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
import { FieldDataOptionEditorModel } from './field-data-option-editor-model';
import { FormGroup, Validators } from '@angular/forms';
import { UntypedFormGroup, Validators } from '@angular/forms';
import { AutoCompleteFieldData, AutoCompleteSingleData } from '@app/core/model/dataset-profile-definition/field-data/field-data';
export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<AutoCompleteSingleDataEditorModel> {
@ -13,7 +13,7 @@ export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<Auto
public autoCompleteType: number;
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.label')) }],
url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.url')) },[Validators.required]],

View File

@ -1,10 +1,10 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { BooleanDecisionFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
export class BooleanDecisionFieldDataEditorModel extends FieldDataEditorModel<BooleanDecisionFieldDataEditorModel> {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('BooleanDecisionFieldDataEditorModel.label')) }]
});

View File

@ -1,10 +1,10 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { CheckBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
export class CheckBoxFieldDataEditorModel extends FieldDataEditorModel<CheckBoxFieldDataEditorModel> {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CheckBoxFieldDataEditorModel.label')) }]
});

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { CurrencyFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class CurrencyDataEditorModel extends FieldDataEditorModel<CurrencyDataEditorModel> {
public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CurrencyDataEditorModel.label')) }]
});

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { DataRepositoriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
@ -6,7 +6,7 @@ export class DataRepositoriesDataEditorModel extends FieldDataEditorModel<DataRe
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel<DatasetIdentifierDataEditorModel> {
public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetIdentifierDataEditorModel.label')) }]
});

View File

@ -2,7 +2,7 @@ import { FieldDataEditorModel } from "./field-data-editor-model";
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
import { DatasetsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data";
import { FormGroup } from "@angular/forms";
import { UntypedFormGroup } from "@angular/forms";
export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<DatasetsAutoCompleteFieldDataEditorModel> {
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Datasets;
@ -10,7 +10,7 @@ export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorMod
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
public autoCompleteType: number;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.type')) }],

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class DatePickerDataEditorModel extends FieldDataEditorModel<DatePickerDataEditorModel> {
public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatePickerDataEditorModel.label')) }]
});

View File

@ -2,14 +2,14 @@ import { FieldDataEditorModel } from "./field-data-editor-model";
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
import { DmpsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data";
import { FormGroup } from "@angular/forms";
import { UntypedFormGroup } from "@angular/forms";
export class DmpsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<DmpsAutoCompleteFieldDataEditorModel> {
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Dmps;
public multiAutoComplete: boolean = false;
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.type')) }],

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-type-enum';
@ -8,7 +8,7 @@ export class ExternalDatasetsDataEditorModel extends FieldDataEditorModel<Extern
public multiAutoComplete: boolean;
public type: ExternalDatasetTypeEnum;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.multiAutoComplete')) }],

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { BaseFormModel } from '../../../../../core/model/base-form-model';
export abstract class FieldDataEditorModel<T> extends BaseFormModel {
public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
throw new Error('Build Form Is not not correctly overriden');
}

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { FieldDataOption } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
@ -7,8 +7,8 @@ export class FieldDataOptionEditorModel extends FieldDataEditorModel<FieldDataOp
public value: string;
public source: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
return new FormBuilder().group({
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
return new UntypedFormBuilder().group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.label')) },[Validators.required]],
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.value')) },[Validators.required]],
source: [{ value: this.source, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.source')) }]

View File

@ -1,10 +1,10 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FreeTextFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
export class FreeTextFieldDataEditorModel extends FieldDataEditorModel<FreeTextFieldDataEditorModel> {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FreeTextFieldDataEditorModel.label')) }]
});

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { LicensesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class LicensesDataEditorModel extends FieldDataEditorModel<LicensesDataEditorModel> {
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { OrganizationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
@ -6,7 +6,7 @@ export class OrganizationsDataEditorModel extends FieldDataEditorModel<Organizat
public label: string;
public multiAutoComplete: boolean = false;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.multiAutoComplete')) }]

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { PublicationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class PublicationsDataEditorModel extends FieldDataEditorModel<PublicationsDataEditorModel> {
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { RadioBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
import { FieldDataOptionEditorModel } from './field-data-option-editor-model';
@ -7,14 +7,14 @@ export class RadioBoxFieldDataEditorModel extends FieldDataEditorModel<RadioBoxF
public options: Array<FieldDataOptionEditorModel> = [];
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RadioBoxFieldDataEditorModel.label')) }]
});
const optionsFormArray = new Array<FormGroup>();
const optionsFormArray = new Array<UntypedFormGroup>();
if (this.options) {
this.options.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
optionsFormArray.push(form);
});
}

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
@ -6,7 +6,7 @@ export class RegistriesDataEditorModel extends FieldDataEditorModel<RegistriesDa
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.multiAutoComplete')) }]

View File

@ -1,7 +1,7 @@
import { FieldDataEditorModel } from "./field-data-editor-model";
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
import { FormGroup } from "@angular/forms";
import { UntypedFormGroup } from "@angular/forms";
import { ResearchersAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data";
export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<ResearchersAutoCompleteFieldDataEditorModel> {
@ -10,7 +10,7 @@ export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditor
public multiAutoComplete: boolean = false;
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.type')) }],

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class ResearchersDataEditorModel extends FieldDataEditorModel<ResearchersDataEditorModel> {
public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersDataEditorModel.label')) }]
});

View File

@ -1,10 +1,10 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { RichTextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
export class RichTextAreaFieldDataEditorModel extends FieldDataEditorModel<RichTextAreaFieldDataEditorModel> {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RichTextAreaFieldDataEditorModel.label')) }]
});

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { ServicesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
@ -6,7 +6,7 @@ export class ServicesDataEditorModel extends FieldDataEditorModel<ServicesDataEd
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class TagsDataEditorModel extends FieldDataEditorModel<TagsDataEditorModel> {
public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TagsDataEditorModel.label')) }]
});

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import {TaxonomiesFieldData} from "@app/core/model/dataset-profile-definition/field-data/field-data";
@ -6,7 +6,7 @@ export class TaxonomiesDataEditorModel extends FieldDataEditorModel<TaxonomiesDa
public label: string;
public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }]

View File

@ -1,10 +1,10 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { TextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
export class TextAreaFieldDataEditorModel extends FieldDataEditorModel<TextAreaFieldDataEditorModel> {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TextAreaFieldDataEditorModel.label')) }]
});

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import {
FieldDataOption,
UploadFieldData
@ -10,16 +10,16 @@ export class UploadFieldDataEditorModel extends FieldDataEditorModel<UploadField
public types: Array<FieldDataOptionEditorModel> = [];
public maxFileSizeInMB: number;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.label')) }],
maxFileSizeInMB: [{ value: this.maxFileSizeInMB, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.maxFileSizeInMB')) }],
// types: [{ value: this.types, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.types')) }]
});
const optionsFormArray = new Array<FormGroup>();
const optionsFormArray = new Array<UntypedFormGroup>();
if (this.types) {
this.types.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
optionsFormArray.push(form);
});
}

View File

@ -1,11 +1,11 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FieldDataEditorModel } from './field-data-editor-model';
import { ValidationFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class ValidationDataEditorModel extends FieldDataEditorModel<ValidationDataEditorModel> {
public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ValidationDataEditorModel.label')) }]
});

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type';
import { WordListFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model';
@ -9,16 +9,16 @@ export class WordListFieldDataEditorModel extends FieldDataEditorModel<WordListF
public options: Array<FieldDataOptionEditorModel>;
public multipleList: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.type')) }],
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.label')) }],
multiList: [{ value: this.multipleList, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.multipleList'))}]
});
const optionsFormArray = new Array<FormGroup>();
const optionsFormArray = new Array<UntypedFormGroup>();
if (this.options) {
this.options.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
optionsFormArray.push(form);
});
}

View File

@ -1,4 +1,4 @@
import { FormArray, FormControl, FormGroup, Validators } from '@angular/forms';
import { FormArray, FormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ValidationType } from '../../../../core/common/enum/validation-type';
import { Field } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model';
@ -98,7 +98,7 @@ export class FieldEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
// title: [this.title],
@ -134,7 +134,7 @@ export class FieldEditorModel extends BaseFormModel {
}
private _appendCustomValidators(formGroup: FormGroup){
private _appendCustomValidators(formGroup: UntypedFormGroup){
const renderStyleValue = formGroup.get('viewStyle').get('renderStyle').value;
if(renderStyleValue === 'checkBox'){
formGroup.get('defaultValue').get('value').setValidators(Validators.required);

View File

@ -1,5 +1,5 @@

import { FormGroup, Validators } from '@angular/forms';
import { UntypedFormGroup, Validators } from '@angular/forms';
import { FieldSet } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model';
import { FieldEditorModel } from './field-editor-model';
@ -31,7 +31,7 @@ export class FieldSetEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.ordinal')) }],
@ -41,9 +41,9 @@ export class FieldSetEditorModel extends BaseFormModel {
additionalInformation: [{ value: this.additionalInformation, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.additionalInformation')) }],
hasCommentField: [{ value: this.hasCommentField, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.hasCommentField')) }]
});
const fieldsFormArray = new Array<FormGroup>();
const fieldsFormArray = new Array<UntypedFormGroup>();
this.fields.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
fieldsFormArray.push(form);
});
formGroup.addControl('fields', this.formBuilder.array(fieldsFormArray));

View File

@ -1,4 +1,4 @@
import {FormGroup} from '@angular/forms';
import {UntypedFormGroup} from '@angular/forms';
import {Multiplicity} from '../../../../core/model/admin/dataset-profile/dataset-profile';
import {BaseFormModel} from '../../../../core/model/base-form-model';
@ -16,7 +16,7 @@ export class MultiplicityEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
return this.formBuilder.group({
min: [{value: this.min, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.min'))}],
max: [{value: this.max, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.max'))}],

View File

@ -1,4 +1,4 @@
import { FormGroup, Validators } from '@angular/forms';
import { UntypedFormGroup, Validators } from '@angular/forms';
import { Page } from '@app/core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '@app/core/model/base-form-model';
import { Guid } from '@common/types/guid';
@ -21,7 +21,7 @@ export class PageEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('PageEditorModel.title')) }, [Validators.required]],
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('PageEditorModel.id')) }, [Validators.required]],

View File

@ -1,4 +1,4 @@
import { FormGroup, Validators } from "@angular/forms";
import { UntypedFormGroup, Validators } from "@angular/forms";
import { Rule } from "../../../../core/model/admin/dataset-profile/dataset-profile";
import { BaseFormModel } from "../../../../core/model/base-form-model";
@ -18,7 +18,7 @@ export class RuleEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
// sourceField: [this.sourceField],
target: [{ value: this.target, disabled: (disabled && !skipDisable.includes('RuleEditorModel.target')) }, [Validators.required]],

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, FormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { Section } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model';
import { EditorCustomValidators } from '../editor/custom-validators/editor-custom-validators';
@ -26,8 +26,8 @@ export class SectionEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup: FormGroup = new FormBuilder().group({
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('SectionEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
page: [{ value: this.page, disabled: (disabled && !skipDisable.includes('SectionEditorModel.page')) }, [Validators.required]],
title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('SectionEditorModel.title')) } , [Validators.required]],
@ -35,17 +35,17 @@ export class SectionEditorModel extends BaseFormModel {
ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('SectionEditorModel.ordinal')) }, [Validators.required]],
defaultVisibility: [{ value: this.defaultVisibility, disabled: (disabled && !skipDisable.includes('SectionEditorModel.defaultVisibility')) }]
});
const sectionsFormArray = new Array<FormGroup>();
const sectionsFormArray = new Array<UntypedFormGroup>();
if (this.sections) {
this.sections.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
sectionsFormArray.push(form);
});
}
const compositeFieldsFormArray = new Array<FormGroup>();
const compositeFieldsFormArray = new Array<UntypedFormGroup>();
if (this.fieldSets) {
this.fieldSets.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
compositeFieldsFormArray.push(form);
});
}

View File

@ -1,4 +1,4 @@
import { FormGroup, Validators } from "@angular/forms";
import { UntypedFormGroup, Validators } from "@angular/forms";
import { ViewStyle } from "../../../../core/model/admin/dataset-profile/dataset-profile";
import { BaseFormModel } from "../../../../core/model/base-form-model";
@ -12,7 +12,7 @@ export class ViewStyleEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
cssClass: [{ value: this.cssClass, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.cssClass')) }],
renderStyle: [{ value: this.renderStyle, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.renderStyle')) }, Validators.required]

View File

@ -1,4 +1,4 @@
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { Visibility } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model';
import { RuleEditorModel } from './rule-editor-model';
@ -15,15 +15,15 @@ export class VisibilityEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({
style: [{ value: this.style, disabled: (disabled && !skipDisable.includes('VisibilityEditorModel.style')) }]
});
const rulesFormArray = new Array<FormGroup>();
const rulesFormArray = new Array<UntypedFormGroup>();
if (this.rules) {
this.rules.forEach(rule => {
const form: FormGroup = rule.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = rule.buildForm(disabled, skipDisable);
rulesFormArray.push(form);
});
}

View File

@ -131,9 +131,6 @@ import {DatasetProfileEditorUploadFieldComponent} from "@app/ui/admin/dataset-pr
DatasetProfileTableOfContentsInternalSection,
DatasetProfileEditorSectionFieldSetComponent,
FinalPreviewComponent
],
entryComponents: [
DialogConfirmationUploadDatasetProfiles
]
})
export class DatasetProfileModule { }

View File

@ -1,5 +1,5 @@
import {Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
import {AbstractControl, FormArray, FormControl, FormGroup} from '@angular/forms';
import {AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup} from '@angular/forms';
import {FieldEditorModel} from '../../../admin/field-editor-model';
import {Guid} from '@common/types/guid';
import {RuleEditorModel} from '../../../admin/rule-editor-model';
@ -65,7 +65,7 @@ import {ConfigurationService} from "@app/core/services/configuration/configurati
})
export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent implements OnInit, OnChanges {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
@Input() indexPath: string;
@Input() viewOnly: boolean;
@ -83,7 +83,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
showAdditionalInfo: boolean = false;
showExtendedDescription: boolean = false;
previewForm: FormGroup = null;
previewForm: UntypedFormGroup = null;
// isComposite = false;
// isMultiplicityEnabled = false;
viewStyleEnum = DatasetProfileFieldViewStyle;
@ -122,7 +122,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
get firstField(){
try{
return (this.form.get('fields') as FormArray).at(0);
return (this.form.get('fields') as UntypedFormArray).at(0);
}catch{
return null;
}
@ -209,7 +209,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
if(this.previewDirty) return '';
else return 'updated';
}
private reloadPreview(updatedForm: FormGroup){
private reloadPreview(updatedForm: UntypedFormGroup){
setTimeout(() => {
const previewContainer = document.getElementById('preview_container'+ this.form.get('id').value);
@ -345,20 +345,20 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
// }
onIsCompositeChange(isComposite: boolean) {
if (!isComposite && (<FormArray>this.form.get('fields')).length > 1) {
for (let i = 0; i < (<FormArray>this.form.get('fields')).length - 1; i++) {
(<FormArray>this.form.get('fields')).removeAt(1);
if (!isComposite && (<UntypedFormArray>this.form.get('fields')).length > 1) {
for (let i = 0; i < (<UntypedFormArray>this.form.get('fields')).length - 1; i++) {
(<UntypedFormArray>this.form.get('fields')).removeAt(1);
}
(this.form.get('fields') as FormArray).controls.splice(1);
(this.form.get('fields') as UntypedFormArray).controls.splice(1);
}
if ((<FormArray>this.form.get('fields')).length === 0) {
if ((<UntypedFormArray>this.form.get('fields')).length === 0) {
const field: FieldEditorModel = new FieldEditorModel();
(<FormArray>this.form.get('fields')).push(field.buildForm());
(<UntypedFormArray>this.form.get('fields')).push(field.buildForm());
}
}
onIsMultiplicityEnabledChange(isMultiplicityEnabled: MatCheckboxChange) {
const multiplicity = this.form.get('multiplicity') as FormGroup;
const multiplicity = this.form.get('multiplicity') as UntypedFormGroup;
const minControl = multiplicity.get('min');
const maxControl = multiplicity.get('max');
@ -387,14 +387,14 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
const field: FieldEditorModel = new FieldEditorModel();
field.id=Guid.create().toString();
field.ordinal = (this.form.get('fields') as FormArray).length;
field.ordinal = (this.form.get('fields') as UntypedFormArray).length;
const fieldForm = field.buildForm();
// fieldForm.setValidators(this.customFieldValidator());
// fieldForm.get('viewStyle').get('renderStyle').setValidators(Validators.required);
(<FormArray>this.form.get('fields')).push(fieldForm);
(<UntypedFormArray>this.form.get('fields')).push(fieldForm);
this.setTargetField(fieldForm);
fieldForm.updateValueAndValidity();
@ -402,7 +402,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
DeleteField(index) {
const fieldsForm = <FormArray>this.form.get('fields');
const fieldsForm = <UntypedFormArray>this.form.get('fields');
fieldsForm.removeAt(index);
this.inputs.init();
// calculate ordinals
@ -413,23 +413,23 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
this.form.markAsDirty();//deactivate guard
}
getFieldTile(formGroup: FormGroup, index: number) {
getFieldTile(formGroup: UntypedFormGroup, index: number) {
if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; }
return "Field " + (index + 1);
}
targetField:FormGroup;
targetField:UntypedFormGroup;
validationTypeEnum = ValidationType;
addVisibilityRule(targetField: FormGroup){
addVisibilityRule(targetField: UntypedFormGroup){
const rule: RuleEditorModel = new RuleEditorModel();
(<FormArray>targetField.get('visible').get('rules')).push(rule.buildForm());
(<UntypedFormArray>targetField.get('visible').get('rules')).push(rule.buildForm());
}
toggleRequired(targetField: FormGroup, event:MatCheckboxChange){
toggleRequired(targetField: UntypedFormGroup, event:MatCheckboxChange){
let validationsControl = targetField.get('validations') as FormControl;
let validationsControl = targetField.get('validations') as UntypedFormControl;
let validations: Array<ValidationType> = validationsControl.value;
if(event.checked){
@ -458,7 +458,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
// }
}
setTargetField(field:AbstractControl){
this.targetField = <FormGroup>field;
this.targetField = <UntypedFormGroup>field;
}
@ -487,7 +487,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
let index = -1;
const fields = this.form.get('fields') as FormArray;
const fields = this.form.get('fields') as UntypedFormArray;
for(let i=0;i< fields.length; i++){
let field = fields.at(i);
@ -528,7 +528,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
addNewInput(type: ViewStyleType){
const fieldsArray = this.form.get('fields') as FormArray;
const fieldsArray = this.form.get('fields') as UntypedFormArray;
let targetOrdinal = fieldsArray.length;
try{
@ -974,7 +974,7 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
}
}
(<FormArray>this.form.get('fields')).push(new FieldEditorModel().fromModel(field).buildForm());
(<UntypedFormArray>this.form.get('fields')).push(new FieldEditorModel().fromModel(field).buildForm());
this.inputs.init();
// fieldForm.get('viewStyle').get('renderStyle').updateValueAndValidity();
// fieldForm.get('data').updateValueAndValidity();
@ -1051,9 +1051,9 @@ export class DatasetProfileEditorCompositeFieldComponent extends BaseComponent i
return {'width':width+'em'}
}
get fieldsArray(): FormArray {
get fieldsArray(): UntypedFormArray {
if(this.form && this.form.get('fields')) {
return this.form.get('fields') as FormArray;
return this.form.get('fields') as UntypedFormArray;
}
return null;
}

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormControl } from '@angular/forms';
import { UntypedFormArray, UntypedFormControl } from '@angular/forms';
import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style';
import { DatasetProfileInternalDmpEntitiesType } from '../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type';
@ -12,8 +12,8 @@ import { DatasetProfileInternalDmpEntitiesType } from '../../../../../../core/co
export class DatasetProfileEditorDefaultValueComponent implements OnInit {
@Input() viewStyle: DatasetProfileFieldViewStyle;
@Input() form: FormControl;
@Input() formArrayOptions: FormArray;
@Input() form: UntypedFormControl;
@Input() formArrayOptions: UntypedFormArray;
@Input() comboBoxType: DatasetProfileComboBoxType;
@Input() internalDmpEntitiesType: DatasetProfileInternalDmpEntitiesType;
@Input() placeHolder: String;

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup, FormArray, AbstractControl } from '@angular/forms';
import { UntypedFormGroup, UntypedFormArray, AbstractControl } from '@angular/forms';
import { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { AutoCompleteFieldDataEditorModel } from '../../../../admin/field-data/auto-complete-field-data-editor-model';
import { AutoCompleteSingleDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/auto-complete-single-data';
@ -11,20 +11,20 @@ import { AutoCompleteSingleDataEditorModel } from '@app/ui/admin/dataset-profile
})
export class DatasetProfileEditorAutoCompleteFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: AutoCompleteFieldDataEditorModel = new AutoCompleteFieldDataEditorModel();
multiForm: FormArray;
multiForm: UntypedFormArray;
ngOnInit() {
this.multiForm = (<FormArray>this.form.get('data').get('autoCompleteSingleDataList'));
this.multiForm = (<UntypedFormArray>this.form.get('data').get('autoCompleteSingleDataList'));
this.data.type = DatasetProfileComboBoxType.Autocomplete;
}
addSource() {
(<FormArray>this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm());
(<UntypedFormArray>this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm());
}
removeSource(index: number) {
(<FormArray>this.multiForm).removeAt(index);
(<UntypedFormArray>this.multiForm).removeAt(index);
}
}

View File

@ -1,6 +1,6 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-data/boolean-decision-field-data-editor-model';
@Component({
@ -10,7 +10,7 @@ import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-dat
})
export class DatasetProfileEditorBooleanDecisionFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: BooleanDecisionFieldDataEditorModel = new BooleanDecisionFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { CheckBoxFieldDataEditorModel } from '../../../../admin/field-data/check-box-field-data-editor-model';
@Component({
@ -9,7 +9,7 @@ import { CheckBoxFieldDataEditorModel } from '../../../../admin/field-data/check
})
export class DatasetProfileEditorCheckboxFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: CheckBoxFieldDataEditorModel = new CheckBoxFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { AutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/auto-complete-field-data-editor-model';
@ -14,7 +14,7 @@ import { takeUntil } from 'rxjs/operators';
})
export class DatasetProfileEditorComboBoxFieldComponent extends BaseComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
options = DatasetProfileComboBoxType;
constructor(

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@Component({
@ -9,7 +9,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a
})
export class DatasetProfileEditorCurrencyFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@ -11,7 +11,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a
})
export class DatasetProfileEditorDataRepositoriesFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { Router } from '@angular/router';
import { DatasetIdentifierDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/dataset-identifier-data-editor-models';
@ -10,7 +10,7 @@ import { DatasetIdentifierDataEditorModel } from '@app/ui/admin/dataset-profile/
})
export class DatasetProfileEditorDatasetIdentifierFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DatasetIdentifierDataEditorModel = new DatasetIdentifierDataEditorModel();
constructor(private router: Router) {}

View File

@ -1,5 +1,5 @@
import { OnInit, Input, Component } from "@angular/core";
import { FormGroup } from "@angular/forms";
import { UntypedFormGroup } from "@angular/forms";
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode";
@ -10,7 +10,7 @@ import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/fiel
})
export class DatasetProfileEditorDatasetsAutoCompleteFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DatasetsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
@Component({
@ -9,7 +9,7 @@ import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-pic
})
export class DatasetProfileEditorDatePickerFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DatePickerDataEditorModel = new DatePickerDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { OnInit, Input, Component } from "@angular/core";
import { FormGroup } from "@angular/forms";
import { UntypedFormGroup } from "@angular/forms";
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { DatasetsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/datasets-autocomplete-field-data-editor-mode";
import { DmpsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/dmps-autocomplete-field-data-editor-model";
@ -11,7 +11,7 @@ import { DmpsAutoCompleteFieldDataEditorModel } from "../../../../admin/field-da
})
export class DatasetProfileEditorDmpsAutoCompleteFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DmpsAutoCompleteFieldDataEditorModel = new DatasetsAutoCompleteFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-type-enum';
@ -11,7 +11,7 @@ import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-
})
export class DatasetProfileEditorExternalDatasetsFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: ExternalDatasetsDataEditorModel = new ExternalDatasetsDataEditorModel();
externalDatasetTypes = [

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { FreeTextFieldDataEditorModel } from '../../../../admin/field-data/free-text-field-data-editor-model';
@Component({
@ -9,7 +9,7 @@ import { FreeTextFieldDataEditorModel } from '../../../../admin/field-data/free-
})
export class DatasetProfileEditorFreeTextFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: FreeTextFieldDataEditorModel = new FreeTextFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service';
import { DatasetsAutoCompleteFieldDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/datasets-autocomplete-field-data-editor-mode';
@ -14,7 +14,7 @@ import { takeUntil } from 'rxjs/operators';
templateUrl: './dataset-profile-editor-internal-dmp-entities-field.component.html'
})
export class DatasetProfileEditorInternalDmpEntitiesFieldComponent extends BaseComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
options = DatasetProfileInternalDmpEntitiesType;
constructor(

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
import { FormControl } from '@angular/forms';
@ -10,7 +10,7 @@ import { FormControl } from '@angular/forms';
})
export class DatasetProfileEditorJournalRepositoriesFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import {Component, Input, OnInit} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {UntypedFormGroup} from '@angular/forms';
import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/licenses-data-editor-models";
@Component({
@ -9,7 +9,7 @@ import {LicensesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field
})
export class DatasetProfileEditorLicensesFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: LicensesDataEditorModel = new LicensesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@ -16,7 +16,7 @@ import { OrganizationsDataEditorModel } from '@app/ui/admin/dataset-profile/admi
})
export class DatasetProfileEditorOrganizationsFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: OrganizationsDataEditorModel = new OrganizationsDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@ -11,7 +11,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a
})
export class DatasetProfileEditorPubRepositoriesFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import {Component, Input, OnInit} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {UntypedFormGroup} from '@angular/forms';
import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/publications-data-editor-models";
@Component({
@ -9,7 +9,7 @@ import {PublicationsDataEditorModel} from "@app/ui/admin/dataset-profile/admin/f
})
export class DatasetProfileEditorPublicationsFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: PublicationsDataEditorModel = new PublicationsDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormBuilder, FormGroup } from '@angular/forms';
import { UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model';
import { RadioBoxFieldDataEditorModel } from '../../../../admin/field-data/radio-box-field-data-editor-model';
@ -10,7 +10,7 @@ import { RadioBoxFieldDataEditorModel } from '../../../../admin/field-data/radio
})
export class DatasetProfileEditorRadioBoxFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: RadioBoxFieldDataEditorModel = new RadioBoxFieldDataEditorModel();
ngOnInit() {
@ -19,11 +19,11 @@ export class DatasetProfileEditorRadioBoxFieldComponent implements OnInit {
addNewRow() {
const radioListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
if (!this.form.get('data').get('options')) { (<FormGroup>this.form.get('data')).addControl('options', new FormBuilder().array([])); }
(<FormArray>this.form.get('data').get('options')).push(radioListOptions.buildForm());
if (!this.form.get('data').get('options')) { (<UntypedFormGroup>this.form.get('data')).addControl('options', new UntypedFormBuilder().array([])); }
(<UntypedFormArray>this.form.get('data').get('options')).push(radioListOptions.buildForm());
}
deleteRow(intex: number) {
if (this.form.get('data').get('options')) { (<FormArray>this.form.get('data').get('options')).removeAt(intex); }
if (this.form.get('data').get('options')) { (<UntypedFormArray>this.form.get('data').get('options')).removeAt(intex); }
}
}

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@ -12,7 +12,7 @@ import { RegistriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/f
})
export class DatasetProfileEditorRegistriesFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: RegistriesDataEditorModel = new RegistriesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { ResearchersAutoCompleteFieldDataEditorModel } from "../../../../admin/field-data/researchers-auto-complete-field-data-editor-model";
import { FormGroup } from "@angular/forms";
import { UntypedFormGroup } from "@angular/forms";
import { Input, Component, OnInit } from "@angular/core";
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
@ -10,7 +10,7 @@ import { DatasetProfileInternalDmpEntitiesType } from "../../../../../../../core
})
export class DatasetProfileEditorResearchersAutoCompleteFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: ResearchersAutoCompleteFieldDataEditorModel = new ResearchersAutoCompleteFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@ -16,7 +16,7 @@ import { Router } from '@angular/router';
})
export class DatasetProfileEditorResearchersFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: ResearchersDataEditorModel = new ResearchersDataEditorModel();
constructor(private router: Router) {}

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { RichTextAreaFieldDataEditorModel } from '../../../../admin/field-data/rich-text-area-field-data-editor-model';
@Component({
@ -9,7 +9,7 @@ import { RichTextAreaFieldDataEditorModel } from '../../../../admin/field-data/r
})
export class DatasetProfileEditorRichTextAreaFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: RichTextAreaFieldDataEditorModel = new RichTextAreaFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@ -13,7 +13,7 @@ import { ServicesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/fie
})
export class DatasetProfileEditorServicesFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: ServicesDataEditorModel = new ServicesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DatePickerDataEditorModel } from '../../../../admin/field-data/date-picker-data-editor-models';
import { ExternalDatasetsDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/external-datasets-data-editor-models';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@ -15,7 +15,7 @@ import { Router } from '@angular/router';
})
export class DatasetProfileEditorTagsFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: TagsDataEditorModel = new TagsDataEditorModel();
constructor(private router: Router) {}

View File

@ -1,5 +1,5 @@
import {Component, Input, OnInit} from '@angular/core';
import {FormGroup} from '@angular/forms';
import {UntypedFormGroup} from '@angular/forms';
import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/taxonomies-data-editor-models";
@Component({
@ -9,7 +9,7 @@ import {TaxonomiesDataEditorModel} from "@app/ui/admin/dataset-profile/admin/fie
})
export class DatasetProfileEditorTaxonomiesFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: TaxonomiesDataEditorModel = new TaxonomiesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { TextAreaFieldDataEditorModel } from '../../../../admin/field-data/text-area-field-data-editor-model';
@Component({
@ -9,7 +9,7 @@ import { TextAreaFieldDataEditorModel } from '../../../../admin/field-data/text-
})
export class DatasetProfileEditorTextAreaFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: TextAreaFieldDataEditorModel = new TextAreaFieldDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import {Component, Input, OnInit, ViewChild} from '@angular/core';
import {FormArray, FormBuilder, FormControl, FormGroup, Validators} from '@angular/forms';
import {UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators} from '@angular/forms';
import { UploadFieldDataEditorModel } from '../../../../admin/field-data/upload-field-data-editor-model';
import {FieldDataOption} from "@app/core/model/dataset-profile-definition/field-data/field-data";
import {FieldDataOptionEditorModel} from "@app/ui/admin/dataset-profile/admin/field-data/field-data-option-editor-model";
@ -44,9 +44,9 @@ export class DatasetProfileEditorUploadFieldComponent implements OnInit {
];
selected: string[] = [];
public typesFormControl = new FormControl();
public typesFormControl = new UntypedFormControl();
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: UploadFieldDataEditorModel = new UploadFieldDataEditorModel();
constructor(private configurationService: ConfigurationService) {}
@ -89,12 +89,12 @@ export class DatasetProfileEditorUploadFieldComponent implements OnInit {
if(type != null) {
typeListOptions.fromModel(type);
}
(<FormGroup>this.form.get('data')).addControl('types', new FormBuilder().array([]));
(<FormArray>this.form.get('data').get('types')).push(typeListOptions.buildForm());
(<UntypedFormGroup>this.form.get('data')).addControl('types', new UntypedFormBuilder().array([]));
(<UntypedFormArray>this.form.get('data').get('types')).push(typeListOptions.buildForm());
}
deleteRow(index: number) {
if (this.form.get('data').get('types')) { (<FormArray>this.form.get('data').get('types')).removeAt(index); }
if (this.form.get('data').get('types')) { (<UntypedFormArray>this.form.get('data').get('types')).removeAt(index); }
}
public getConfiguration() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup } from '@angular/forms';
import { UntypedFormGroup } from '@angular/forms';
import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/admin/field-data/data-repositories-data-editor-models';
@Component({
@ -9,7 +9,7 @@ import { DataRepositoriesDataEditorModel } from '@app/ui/admin/dataset-profile/a
})
export class DatasetProfileEditorValidatorFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core';
import { FormArray, FormGroup } from '@angular/forms';
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
import { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model';
import { WordListFieldDataEditorModel } from '../../../../admin/field-data/word-list-field-data-editor-model';
@ -11,7 +11,7 @@ import { WordListFieldDataEditorModel } from '../../../../admin/field-data/word-
})
export class DatasetProfileEditorWordListFieldComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
private data: WordListFieldDataEditorModel = new WordListFieldDataEditorModel();
ngOnInit() {
@ -20,10 +20,10 @@ export class DatasetProfileEditorWordListFieldComponent implements OnInit {
addNewRow() {
const wordListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
(<FormArray>this.form.get('data').get('options')).push(wordListOptions.buildForm());
(<UntypedFormArray>this.form.get('data').get('options')).push(wordListOptions.buildForm());
}
deleteRow(intex: number) {
if (this.form.get('data').get('options')) { (<FormArray>this.form.get('data').get('options')).removeAt(intex); }
if (this.form.get('data').get('options')) { (<UntypedFormArray>this.form.get('data').get('options')).removeAt(intex); }
}
}

View File

@ -1,5 +1,5 @@
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {FormArray, FormControl, FormGroup, FormGroupDirective, NgForm,} from '@angular/forms';
import {UntypedFormArray, UntypedFormControl, UntypedFormGroup, FormGroupDirective, NgForm,} from '@angular/forms';
import {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style';
import {ValidationType} from '@app/core/common/enum/validation-type';
import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-profile.service';
@ -55,7 +55,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes';
})
export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit, ErrorStateMatcher {
@Input() viewOnly: boolean;
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
@Input() showOrdinal = true;
@Input() indexPath: string;
validationTypeEnum = ValidationType;
@ -96,7 +96,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
}
isErrorState(control: FormControl, form: FormGroupDirective | NgForm): boolean {
isErrorState(control: UntypedFormControl, form: FormGroupDirective | NgForm): boolean {
if(this.form.get('viewStyle').untouched) return false;
@ -336,7 +336,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
addNewRule() {
const rule: RuleEditorModel = new RuleEditorModel();
(<FormArray>this.form.get('visible').get('rules')).push(rule.buildForm());
(<UntypedFormArray>this.form.get('visible').get('rules')).push(rule.buildForm());
}
@ -922,7 +922,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
const form = (new FieldEditorModel).fromModel(field).buildForm();
const fields = this.form.parent as FormArray;
const fields = this.form.parent as UntypedFormArray;
let index = -1;
fields.controls.forEach((control,i)=>{
@ -953,7 +953,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
}
private setValidator(validationType: ValidationType, add: boolean) {
let validationsControl = this.form.get('validations') as FormControl;
let validationsControl = this.form.get('validations') as UntypedFormControl;
let validations: Array<ValidationType> = validationsControl.value;
if(add){
@ -969,13 +969,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
}
get isRequired(){
let validationsControl = this.form.get('validations') as FormControl;
let validationsControl = this.form.get('validations') as UntypedFormControl;
let validations: Array<ValidationType> = validationsControl.value;
return validations.includes(ValidationType.Required);
}
get isURL(){
let validationsControl = this.form.get('validations') as FormControl;
let validationsControl = this.form.get('validations') as UntypedFormControl;
let validations: Array<ValidationType> = validationsControl.value;
return validations.includes(ValidationType.URL);
}

View File

@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core';
import { FormArray } from '@angular/forms';
import { UntypedFormArray } from '@angular/forms';
@Component({
selector: 'app-dataset-profile-editor-page-component',
@ -8,10 +8,10 @@ import { FormArray } from '@angular/forms';
})
export class DatasetProfileEditorPageComponent {
@Input() form: FormArray;
@Input() form: UntypedFormArray;
@Input() viewOnly: boolean;
removePage(index) {
(<FormArray>this.form).removeAt(index);
(<UntypedFormArray>this.form).removeAt(index);
}
}

View File

@ -1,5 +1,5 @@
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import { FormArray, FormControl, FormGroup } from '@angular/forms';
import { UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style';
import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { ToCEntryType } from '../../../table-of-contents/table-of-contents-entry';
@ -15,11 +15,11 @@ import { TranslateService } from '@ngx-translate/core';
export class DatasetProfileEditorRuleComponent implements OnInit {
@Input() form: FormArray;
@Input() form: UntypedFormArray;
@Input() viewStyleForCheck: DatasetProfileFieldViewStyle;
@Input() formControlForCheck: FormControl;
@Input() formArrayOptionsForCheck: FormArray;
@Input() formControlForCheck: UntypedFormControl;
@Input() formArrayOptionsForCheck: UntypedFormArray;
@Input() comboBoxTypeForCheck: DatasetProfileComboBoxType;
@Input() viewOnly: boolean;
@ -89,7 +89,7 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
private _buildHiddenBy(fo:OptionItem){
try{
this.fieldOptions.forEach(foption=>{
const rules = (foption.form.get('visible').get('rules') as FormArray).controls.map(c=>(c as FormGroup).getRawValue()) as Rule[]
const rules = (foption.form.get('visible').get('rules') as UntypedFormArray).controls.map(c=>(c as UntypedFormGroup).getRawValue()) as Rule[]
const targets = rules.map(rule=>rule.target);
targets.forEach(target=>{
if(fo.parentsIds.includes(target) && !fo.hiddenBy.includes(foption.id)){
@ -114,11 +114,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
const result:OptionItem[] =[];
const sections = rootForm.get('sections') as FormArray;
const sections = rootForm.get('sections') as UntypedFormArray;
if(sections){
sections.controls.forEach(section=>{
const subResult = this.buildOptions(section as FormGroup, ToCEntryType.Section,[]);
const subResult = this.buildOptions(section as UntypedFormGroup, ToCEntryType.Section,[]);
result.push(...subResult);
});
}
@ -131,11 +131,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
return [];
}
private buildOptions(form: FormGroup, type: ToCEntryType, parentIds:string[]):OptionItem[]{
private buildOptions(form: UntypedFormGroup, type: ToCEntryType, parentIds:string[]):OptionItem[]{
const sections = form.get('sections') as FormArray;
const fieldSets = form.get('fieldSets') as FormArray;
const fields = form.get('fields') as FormArray;
const sections = form.get('sections') as UntypedFormArray;
const fieldSets = form.get('fieldSets') as UntypedFormArray;
const fields = form.get('fields') as UntypedFormArray;
const result:OptionItem[] = [];
@ -153,17 +153,17 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
if(sections){
sections.controls.forEach(section=>{
result.push( ...this.buildOptions(section as FormGroup, ToCEntryType.Section, currentOptionItem.parentsIds) );
result.push( ...this.buildOptions(section as UntypedFormGroup, ToCEntryType.Section, currentOptionItem.parentsIds) );
});
}
if(fieldSets){
fieldSets.controls.forEach(fieldset=>{
result.push( ...this.buildOptions(fieldset as FormGroup, ToCEntryType.FieldSet, currentOptionItem.parentsIds) );
result.push( ...this.buildOptions(fieldset as UntypedFormGroup, ToCEntryType.FieldSet, currentOptionItem.parentsIds) );
});
}
if(fields){
fields.controls.forEach(field=>{
result.push( ...this.buildOptions(field as FormGroup, ToCEntryType.Field, currentOptionItem.parentsIds) ); //TODO NA TO DOUME
result.push( ...this.buildOptions(field as UntypedFormGroup, ToCEntryType.Field, currentOptionItem.parentsIds) ); //TODO NA TO DOUME
});
}
@ -218,6 +218,6 @@ interface OptionItem{
label: string,
type: ToCEntryType,
parentsIds: string[],
form:FormGroup,
form:UntypedFormGroup,
hiddenBy:string[]
}

View File

@ -1,6 +1,6 @@
import { OnDestroy } from '@angular/core';
import { Component, ElementRef, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
import { FormArray, FormGroup } from '@angular/forms';
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
import { Guid } from '@common/types/guid';
import { isNullOrUndefined } from '@swimlane/ngx-datatable';
import { DragulaService } from 'ng2-dragula';
@ -31,8 +31,8 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
@Output() selectedEntryId = new EventEmitter<string>();
@Output() dataNeedsRefresh = new EventEmitter<void> ();
@Output() removeFieldSet = new EventEmitter<string>();
@Output() addNewFieldSet = new EventEmitter<FormGroup>();
@Output() cloneFieldSet = new EventEmitter<FormGroup>();
@Output() addNewFieldSet = new EventEmitter<UntypedFormGroup>();
@Output() cloneFieldSet = new EventEmitter<UntypedFormGroup>();
// FIELDSET_PREFIX_ID="FIELDSET_PREFIX_ID";
@ -67,7 +67,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
this.subs.add(this.dragulaService.drop(this.FIELDSETS).subscribe(obs=>{
(this.form.get('fieldSets') as FormArray).controls.forEach((e,i)=>{
(this.form.get('fieldSets') as UntypedFormArray).controls.forEach((e,i)=>{
e.get('ordinal').setValue(i);
});
@ -193,19 +193,19 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
this.removeFieldSet.emit(fieldsetId);
}
onCloneFieldSet(fieldset: FormGroup){
onCloneFieldSet(fieldset: UntypedFormGroup){
this.cloneFieldSet.emit(fieldset);
}
onAddFieldSet(){
// this.addNewFieldSet.emit(this.form);
try{
const length = (this.form.get('fieldSets') as FormArray).length;
const length = (this.form.get('fieldSets') as UntypedFormArray).length;
if(length === 0){
this.addFieldSetAfter(-9999, 0);
return;
}
else{
const lastElement = (this.form.get('fieldSets') as FormArray).at(length -1);
const lastElement = (this.form.get('fieldSets') as UntypedFormArray).at(length -1);
this.addFieldSetAfter(lastElement.get('ordinal').value, length-1);
}
} catch {}
@ -223,7 +223,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
fieldSet.id = fieldSetId;
fieldSet.ordinal = afterOrdinal < 0? 0 :afterOrdinal;
const parentArray = this.form.get('fieldSets') as FormArray;
const parentArray = this.form.get('fieldSets') as UntypedFormArray;
parentArray.controls.forEach(fieldset=>{
const ordinalControl = fieldset.get('ordinal');
@ -233,7 +233,7 @@ export class DatasetProfileEditorSectionFieldSetComponent implements OnInit, OnC
}
});
const fieldsetForm = fieldSet.buildForm();
(fieldsetForm.get('fields') as FormArray).push(fieldForm);
(fieldsetForm.get('fields') as UntypedFormArray).push(fieldForm);
const index = afterOrdinal < 0 ? 0: afterIndex +1;
parentArray.insert(index, fieldsetForm);

View File

@ -1,5 +1,5 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { FormArray, FormGroup } from '@angular/forms';
import { UntypedFormArray, UntypedFormGroup } from '@angular/forms';
import { FieldEditorModel } from '@app/ui/admin/dataset-profile/admin/field-editor-model';
import { FieldSetEditorModel } from '@app/ui/admin/dataset-profile/admin/field-set-editor-model';
import { SectionEditorModel } from '@app/ui/admin/dataset-profile/admin/section-editor-model';
@ -15,7 +15,7 @@ import { takeUntil } from 'rxjs/operators';
export class DatasetProfileEditorSectionComponent extends BaseComponent implements OnInit {
@Input() form: FormGroup;
@Input() form: UntypedFormGroup;
//@Input() dataModel: SectionEditorModel;
@Input() indexPath: string;
@Input() viewOnly: boolean;
@ -35,7 +35,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
addField() {
const fieldSet: FieldSetEditorModel = new FieldSetEditorModel();
fieldSet.ordinal = (this.form.get('fieldSets') as FormArray).length;
fieldSet.ordinal = (this.form.get('fieldSets') as UntypedFormArray).length;
const field: FieldEditorModel = new FieldEditorModel();
field.id = Guid.create().toString();
@ -45,7 +45,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
fieldSet.id = Guid.create().toString();
//this.dataModel.fieldSets.push(fieldSet);
//}
const fieldsetsArray = this.form.get('fieldSets') as FormArray;
const fieldsetsArray = this.form.get('fieldSets') as UntypedFormArray;
fieldsetsArray.push(fieldSet.buildForm());
const fieldSetForm = fieldsetsArray.at(fieldsetsArray.length-1);
@ -59,17 +59,17 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
addSectioninSection() {
const section: SectionEditorModel = new SectionEditorModel();
//this.dataModel.sections.push(section);
(<FormArray>this.form.get('sections')).push(section.buildForm());
(<UntypedFormArray>this.form.get('sections')).push(section.buildForm());
}
DeleteSectionInSection(index) {
//this.dataModel.sections.splice(index, 1);
(<FormArray>this.form.get('sections')).removeAt(index);
(<UntypedFormArray>this.form.get('sections')).removeAt(index);
}
deleteFieldSet(index) {
//this.dataModel.fieldSets.splice(index, 1);
(<FormArray>this.form.get('fieldSets')).removeAt(index);
(<UntypedFormArray>this.form.get('fieldSets')).removeAt(index);
}
keepPageSelectionValid(pagesJson: Array<any>) {
@ -80,7 +80,7 @@ export class DatasetProfileEditorSectionComponent extends BaseComponent implemen
}
}
getFieldTile(formGroup: FormGroup, index: number) {
getFieldTile(formGroup: UntypedFormGroup, index: number) {
if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; }
return "Field " + (index + 1);
}

View File

@ -1,5 +1,5 @@
import { Inject, Injectable } from "@angular/core";
import { AbstractControl, FormArray, ValidationErrors, ValidatorFn } from "@angular/forms";
import { AbstractControl, UntypedFormArray, ValidationErrors, ValidatorFn } from "@angular/forms";
export class EditorCustomValidators{
@ -7,7 +7,7 @@ export class EditorCustomValidators{
static atLeastOneElementListValidator(arrayToCheck): ValidatorFn{
return (control: AbstractControl): ValidationErrors | null=>{
const fa = control.get(arrayToCheck) as FormArray;
const fa = control.get(arrayToCheck) as UntypedFormArray;
if(!fa || fa.length === 0){
return {[EditorCustomValidatorsEnum.emptyArray]: true};
@ -19,8 +19,8 @@ export class EditorCustomValidators{
return (control: AbstractControl): ValidationErrors | null=>{
const pages = control.get(pagesArrayName) as FormArray;
const sections = control.get(sectionsArrayName) as FormArray;
const pages = control.get(pagesArrayName) as UntypedFormArray;
const sections = control.get(sectionsArrayName) as UntypedFormArray;
const pageIdsArray = pages.controls.map(page=>page.get('id').value);
@ -42,8 +42,8 @@ export class EditorCustomValidators{
return (control: AbstractControl): ValidationErrors | null=>{
const fieldsets = control.get(fieldsetsArrayName) as FormArray;
const sections = control.get(sectionsArrayName) as FormArray;
const fieldsets = control.get(fieldsetsArrayName) as UntypedFormArray;
const sections = control.get(sectionsArrayName) as UntypedFormArray;
if((fieldsets && fieldsets.length) || (sections && sections.length)){

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, FormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
import { DatasetProfile } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model';
@ -32,8 +32,8 @@ export class DatasetProfileEditorModel extends BaseFormModel {
return this;
}
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup {
const formGroup: FormGroup = new FormBuilder().group({
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.label')) }, [Validators.required]],
description: [{ value: this.description, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.description')) }, [Validators.required]],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.type')) }, [Validators.required]],
@ -43,16 +43,16 @@ export class DatasetProfileEditorModel extends BaseFormModel {
users: [{ value: this.users, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.users')) }]
});
const sectionsFormArray = new Array<FormGroup>();
const sectionsFormArray = new Array<UntypedFormGroup>();
this.sections.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
sectionsFormArray.push(form);
});
formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray));
const pagesFormArray = new Array<FormGroup>();
const pagesFormArray = new Array<UntypedFormGroup>();
this.pages.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable);
const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
pagesFormArray.push(form);
});
formGroup.addControl('pages', this.formBuilder.array(pagesFormArray));

View File

@ -2,7 +2,7 @@
import { of as observableOf, Observable, combineLatest, BehaviorSubject,of } from 'rxjs';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit, QueryList, ViewChild } from '@angular/core';
import { AbstractControl, FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { MatDialog } from '@angular/material/dialog';
import { MatHorizontalStepper} from '@angular/material/stepper';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
@ -71,8 +71,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
isClone = false;
isDeleted = false;
dataModel: DatasetProfileEditorModel;
form: FormGroup;
previewerFormGroup: FormGroup;
form: UntypedFormGroup;
previewerFormGroup: UntypedFormGroup;
private datasetProfileId: string;
newVersionId: string;
dataWizardModel: DatasetWizardModel;
@ -116,7 +116,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
private enumUtils: EnumUtils,
private datasetWizardService: DatasetWizardService,
private visibilityRulesService: VisibilityRulesService,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private sidenavService: SideNavService,
private userService: UserService,
private descriptionTemplateTypeService: DescriptionTemplateTypeService
@ -289,8 +289,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const fieldSetHavingInvalidVisibilityRules:ToCEntry[] = fieldsetEntries
.filter(entry=>{
const fieldsFormGroup = entry.form.get('fields');
const invalid = (fieldsFormGroup as FormArray).controls.filter(field=>{
return this.hasInvalidVisibilityRule(field as FormGroup);
const invalid = (fieldsFormGroup as UntypedFormArray).controls.filter(field=>{
return this.hasInvalidVisibilityRule(field as UntypedFormGroup);
});
if(invalid && invalid.length){
@ -333,12 +333,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
if(fieldset.type != ToCEntryType.FieldSet){
return;
}
const fields = fieldset.form.get('fields') as FormArray;
const fields = fieldset.form.get('fields') as UntypedFormArray;
fields.controls.forEach(fieldControl=>{
if(this.hasInvalidVisibilityRule(fieldControl as FormGroup)){
if(this.hasInvalidVisibilityRule(fieldControl as UntypedFormGroup)){
try{
(fieldControl.get('visible').get('rules') as FormArray).clear();
(fieldControl.get('visible').get('rules') as UntypedFormArray).clear();
}catch{}
}
})
@ -347,7 +347,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}
private hasInvalidVisibilityRule(field: FormGroup):boolean{
private hasInvalidVisibilityRule(field: UntypedFormGroup):boolean{
const renderStyle = field.get('viewStyle').get('renderStyle').value;
if(renderStyle && ![
DatasetProfileFieldViewStyle.TextArea,
@ -410,8 +410,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
onIsMultiplicityEnabledChange(isMultiplicityEnabled: boolean) {
if (!isMultiplicityEnabled) {
(<FormControl>this.form.get('multiplicity').get('min')).setValue(0);
(<FormControl>this.form.get('multiplicity').get('max')).setValue(0);
(<UntypedFormControl>this.form.get('multiplicity').get('min')).setValue(0);
(<UntypedFormControl>this.form.get('multiplicity').get('max')).setValue(0);
}
}
@ -711,7 +711,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
datasetWizardModel: DatasetWizardEditorModel;
formGroup: FormGroup;
formGroup: UntypedFormGroup;
getPreview() {
let data = this.form.getRawValue();
this.datasetProfileService.preview(data).subscribe(x => {
@ -719,7 +719,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
datasetProfileDefinition: x
});
this.updateVisibilityRules();
this.formGroup = <FormGroup>this.datasetWizardModel.buildForm().get('datasetProfileDefinition');
this.formGroup = <UntypedFormGroup>this.datasetWizardModel.buildForm().get('datasetProfileDefinition');
});
//this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
@ -844,7 +844,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const result: ToCEntry[] = [];
//build parent pages
(this.form.get('pages') as FormArray).controls.forEach((pageElement, i) => {
(this.form.get('pages') as UntypedFormArray).controls.forEach((pageElement, i) => {
result.push({
id: pageElement.get('id').value,
label: pageElement.get('title').value,
@ -856,7 +856,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
});
// build first level sections
(this.form.get('sections') as FormArray).controls.forEach((sectionElement, i) => {
(this.form.get('sections') as UntypedFormArray).controls.forEach((sectionElement, i) => {
const currentSectionPageId = sectionElement.get('page').value;
const pageToAdd = result.filter(x => x.id == currentSectionPageId)[0];
if (pageToAdd.subEntries == null) pageToAdd.subEntries = [];
@ -868,8 +868,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
form: sectionElement,
numbering: pageToAdd.numbering + '.' + (pageToAdd.subEntries.length +1)
} as ToCEntry;
const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering);
const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering);
const sectionItems = this.populateSections(sectionElement.get('sections') as UntypedFormArray, item.numbering);
const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as UntypedFormArray, item.numbering);
if (sectionItems != null) {
item.subEntries = sectionItems;
item.subEntriesType = ToCEntryType.Section;
@ -891,7 +891,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
return result;
}
private populateSections(sections: FormArray, existingNumbering: string): ToCEntry[] {
private populateSections(sections: UntypedFormArray, existingNumbering: string): ToCEntry[] {
if (sections == null || sections.controls == null || sections.controls.length == 0) { return null; }
const result: ToCEntry[] = [];
@ -904,8 +904,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
form: sectionElement,
numbering: existingNumbering + '.' + (i + 1)
} as ToCEntry;
const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering);
const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering);
const sectionItems = this.populateSections(sectionElement.get('sections') as UntypedFormArray, item.numbering);
const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as UntypedFormArray, item.numbering);
if (sectionItems != null) {
item.subEntries = sectionItems;
item.subEntriesType = ToCEntryType.Section;
@ -924,7 +924,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
return result;
}
private populateFieldSets(fieldSets: FormArray, existingNumbering: string): ToCEntry[] {
private populateFieldSets(fieldSets: UntypedFormArray, existingNumbering: string): ToCEntry[] {
if (fieldSets == null || fieldSets.controls == null || fieldSets.controls.length == 0) { return null; }
const result: ToCEntry[] = [];
@ -974,7 +974,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
//define entry type
switch (tce.childType) {
case ToCEntryType.Page:
const pagesArray = (this.form.get('pages') as FormArray);
const pagesArray = (this.form.get('pages') as UntypedFormArray);
const page: PageEditorModel = new PageEditorModel(pagesArray.length);
const pageForm = page.buildForm();
@ -990,10 +990,10 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const section: SectionEditorModel = new SectionEditorModel();
section.id = Guid.create().toString();
let sectionsArray:FormArray;
let sectionsArray:UntypedFormArray;
if (parent.type === ToCEntryType.Page) {//FIRST LEVEL SECTION
sectionsArray = this.form.get('sections') as FormArray;
sectionsArray = this.form.get('sections') as UntypedFormArray;
section.page = parent.id;
@ -1011,7 +1011,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
// this.form.updateValueAndValidity();
} else if( parent.type == ToCEntryType.Section) { //SUBSECTION OF SECTION
sectionsArray = parent.form.get('sections') as FormArray;
sectionsArray = parent.form.get('sections') as UntypedFormArray;
//adding page parent MAYBE NOT NEEDED
section.page = parent.form.get('page').value;
@ -1030,7 +1030,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}
const sectionAdded = sectionsArray.at(sectionsArray.length -1) as FormGroup;
const sectionAdded = sectionsArray.at(sectionsArray.length -1) as UntypedFormGroup;
// sectionAdded.setValidators(this.customEditorValidators.sectionHasAtLeastOneChildOf('fieldSets','sections'));
// sectionAdded.updateValueAndValidity();
@ -1052,7 +1052,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
// fieldSet.fields.push(field);
// field.ordinal = fieldSet.fields.length-1;
const fieldSetsArray = parent.form.get('fieldSets') as FormArray
const fieldSetsArray = parent.form.get('fieldSets') as UntypedFormArray
//give fieldset id and ordinal
const fieldSet: FieldSetEditorModel = new FieldSetEditorModel();
@ -1069,7 +1069,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
(fieldsetForm.get('fields') as FormArray).push(fieldForm);
(fieldsetForm.get('fields') as UntypedFormArray).push(fieldForm);
fieldSetsArray.push(fieldsetForm);
this.refreshToCEntries();
@ -1110,12 +1110,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
//define entry type
switch (tce.type) {
case ToCEntryType.Page:
const pages = this.form.get('pages') as FormArray;
const pages = this.form.get('pages') as UntypedFormArray;
let pageIndex = -1;
//get the index
for (let i = 0; i < pages.length; i++) {
let page = pages.at(i) as FormGroup;
let page = pages.at(i) as UntypedFormGroup;
if (page.controls.id.value === tce.id) {
pageIndex = i;
@ -1129,7 +1129,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
pages.removeAt(pageIndex);
//clean up sections of removed page
const sections = (this.form.get('sections') as FormArray);
const sections = (this.form.get('sections') as UntypedFormArray);
const sectionsIndexToBeRemoved = [];
@ -1161,7 +1161,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
let index = -1;
const sections = (this.form.get('sections') as FormArray);
const sections = (this.form.get('sections') as UntypedFormArray);
for (let i = 0; i < sections.length; i++) {
@ -1177,7 +1177,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
if (index >= 0) { //section found
const sections = (this.form.get('sections') as FormArray);
const sections = (this.form.get('sections') as UntypedFormArray);
//remove section
this._updateSelectedItem(tce);
@ -1190,7 +1190,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
} else {//NOT FOUND IN FIRST LEVEL CASE
//LOOK FOR SUBSECTION CASE
let parentFormArray = tce.form.parent as FormArray;
let parentFormArray = tce.form.parent as UntypedFormArray;
for (let i = 0; i < parentFormArray.length; i++) {
let section = parentFormArray.at(i);
@ -1215,7 +1215,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
break;
case ToCEntryType.FieldSet:
const parentFormArray = tce.form.parent as FormArray;
const parentFormArray = tce.form.parent as UntypedFormArray;
let idx = -1;
@ -1263,7 +1263,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}else{
//if first level section
const firstLevelSections = (this.form.get('sections') as FormArray);
const firstLevelSections = (this.form.get('sections') as UntypedFormArray);
let isFirstLevel: boolean = false;
firstLevelSections.controls.forEach(section=>{
if(section.get('id').value === tce.id){
@ -1323,7 +1323,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}
get numOfPages(){
return (<FormArray>this.form.get('pages')).length;
return (<UntypedFormArray>this.form.get('pages')).length;
}
// getSectionIndex(): number{
@ -1353,12 +1353,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
// return subForm;
// }
getFieldTile(formGroup: FormGroup, index: number) {
getFieldTile(formGroup: UntypedFormGroup, index: number) {
if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; }
return "Field " + (index + 1);
}
deleteFieldSet(formArray: FormArray, index: number) {
deleteFieldSet(formArray: UntypedFormArray, index: number) {
formArray.removeAt(index);
}
@ -1475,7 +1475,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const fieldSets = this._getFieldSets(this.getTocEntries());
fieldSets.forEach(fs=>{
const fields = fs.form.get('fields') as FormArray;
const fields = fs.form.get('fields') as UntypedFormArray;
if(fields){
fields.controls.forEach(field=>{
const rulesArray = field.get('visible').get('rules').value;
@ -1549,15 +1549,15 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
fieldset.hasCommentField = fs.form.get('hasCommentField').value;
fieldset.title = fs.label;
// fieldset.fields = (fs.form.get('fields') as FormArray).getRawValue();
fieldset.fields = (fs.form.get('fields') as FormArray).controls.map(field=>{
fieldset.fields = (fs.form.get('fields') as UntypedFormArray).controls.map(field=>{
const fieldModel = new DatasetDescriptionFieldEditorModel();
fieldModel.data = (field.get('data') as FormGroup).getRawValue();
fieldModel.data = (field.get('data') as UntypedFormGroup).getRawValue();
fieldModel.id = field.get('id').value;
fieldModel.viewStyle = (field.get('viewStyle') as FormGroup).getRawValue();
fieldModel.viewStyle = (field.get('viewStyle') as UntypedFormGroup).getRawValue();
// fieldModel.defaultValue = (field.get('defaultValue') as FormGroup).getRawValue();
fieldModel.value = (field.get('defaultValue') as FormGroup).get('value').value;
fieldModel.value = (field.get('defaultValue') as UntypedFormGroup).get('value').value;
fieldModel.defaultValue = fieldModel.value;
fieldModel.page = field.get('page').value;
fieldModel.validations = field.get('validations').value;
@ -1639,9 +1639,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
this.form.markAsDirty();
}
cloneFieldSet(fieldset: FormGroup){
cloneFieldSet(fieldset: UntypedFormGroup){
const values = fieldset.getRawValue();
const parentArray = fieldset.parent as FormArray;
const parentArray = fieldset.parent as UntypedFormArray;
values.id = Guid.create().toString();
values.ordinal = parentArray.length;
@ -1813,7 +1813,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
result.forEach((err,i)=>{
fieldsets.filter(fs=>{
let fieldFound = false;
(fs.form.get('fields') as FormArray).controls.forEach(field=>{
(fs.form.get('fields') as UntypedFormArray).controls.forEach(field=>{
if(field.get('id').value === err.id){
fieldFound = true;
indexes.push(i);
@ -1886,9 +1886,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
let controlType = 'control';
if(aControl instanceof FormGroup) controlType="fg"
if(aControl instanceof FormControl) controlType="fc";
if(aControl instanceof FormArray) controlType="fa";
if(aControl instanceof UntypedFormGroup) controlType="fg"
if(aControl instanceof UntypedFormControl) controlType="fc";
if(aControl instanceof UntypedFormArray) controlType="fa";
const invalidControls:InvalidControl[] = [];
@ -1896,14 +1896,14 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
switch (controlType){
case 'fg':
const controls = (aControl as FormGroup).controls;
const controls = (aControl as UntypedFormGroup).controls;
const keys = Object.keys(controls);
keys.forEach(key=>{
const control = controls[key];
if(!control.invalid) return; //// !!!!! Important to be !invalid. (In case the template is finalized)
if(control instanceof FormControl){
const ctrl = control as FormControl;
if(control instanceof UntypedFormControl){
const ctrl = control as UntypedFormControl;
invalidControls.push({
errors:ctrl.errors,
@ -1957,15 +1957,15 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
break;
case 'fa':
// const fa = (aControl as FormArray);
const ctrls = (aControl as FormArray).controls;
const ctrls = (aControl as UntypedFormArray).controls;
const keys_ = Object.keys(ctrls);
keys_.forEach(key=>{
const control = ctrls[key];
if(control.valid) return;
if(control instanceof FormControl){ //for completion purposes. should never run this case
const ctrl = control as FormControl;
if(control instanceof UntypedFormControl){ //for completion purposes. should never run this case
const ctrl = control as UntypedFormControl;
invalidControls.push({
errors:ctrl.errors,
id: ctrl.get('id')? ctrl.get('id').value: null,
@ -2056,7 +2056,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
try{
fieldsets.forEach(fs=>{
fs.form.get('title').setValidators(Validators.required);
const fieldsF = fs.form.get('fields') as FormArray;
const fieldsF = fs.form.get('fields') as UntypedFormArray;
if(fieldsF){
fieldsF.controls.forEach(field=>{
const renderStyleValue = field.get('viewStyle').get('renderStyle').value;

View File

@ -1,7 +1,7 @@
import { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
import { DOCUMENT } from '@angular/common';
import { Component, EventEmitter, Inject, Input, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms';
import { BaseComponent } from '@common/base/base.component';
import { NewEntryType, ToCEntry, ToCEntryType } from '../table-of-contents-entry';
@ -216,7 +216,7 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent
if(this.parentLink.type === this.tocEntryType.Page && allFieldsAreTouched){
const rootForm = form.root;
if(rootForm){
const sections = rootForm.get('sections') as FormArray;
const sections = rootForm.get('sections') as UntypedFormArray;
if(!sections.controls.find(section=>section.get('page').value === this.parentLink.id)){
return true;
}
@ -227,8 +227,8 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent
//checking first child form controls if have errors
let hasErrors = false;
if(allFieldsAreTouched){
if(form instanceof FormGroup){
const formGroup = form as FormGroup;
if(form instanceof UntypedFormGroup){
const formGroup = form as UntypedFormGroup;
const controls = Object.keys(formGroup.controls);
@ -249,10 +249,10 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent
if(!aControl|| aControl.untouched) return false;
if(aControl instanceof FormControl){
if(aControl instanceof UntypedFormControl){
return aControl.touched;
}else if(aControl instanceof FormGroup){
const controlKeys = Object.keys((aControl as FormGroup).controls);
}else if(aControl instanceof UntypedFormGroup){
const controlKeys = Object.keys((aControl as UntypedFormGroup).controls);
let areAllTouched = true;
controlKeys.forEach(key=>{
if(!this.allFieldsAreTouched(aControl.get(key))){
@ -262,8 +262,8 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent
// const areAllTouched = controlKeys.reduce((acc, key)=>acc && this._allFieldsAreTouched(aControl.get(key)), true);
return areAllTouched;
}else if(aControl instanceof FormArray){
const controls = (aControl as FormArray).controls;
}else if(aControl instanceof UntypedFormArray){
const controls = (aControl as UntypedFormArray).controls;
// const areAllTouched = controls.reduce((acc, control)=>acc && this._allFieldsAreTouched(control), true);
let areAllTouched = true;
// controls.reduce((acc, control)=>acc && this._allFieldsAreTouched(control), true);

View File

@ -7,7 +7,7 @@ import { type } from 'os';
import { SimpleChanges } from '@angular/core';
import { NewEntryType, TableUpdateInfo, ToCEntry, ToCEntryType } from './table-of-contents-entry';
import { DragulaService } from 'ng2-dragula';
import { FormArray } from '@angular/forms';
import { UntypedFormArray } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TranslateService } from '@ngx-translate/core';
import { ContentObserver } from '@angular/cdk/observers';
@ -119,7 +119,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
}
//check if target container has no sections
if((targetContainer.form.get('sections') as FormArray).length){
if((targetContainer.form.get('sections') as UntypedFormArray).length){
// const message = 'Cannot have inputs and sections on the same level';
const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL');
this.notifyUser(message);
@ -129,8 +129,8 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
}
const fieldsetForm = element.form;
const targetFieldsets = targetContainer.form.get('fieldSets') as FormArray;
const sourceFieldsets = sourceContainer.form.get('fieldSets') as FormArray;
const targetFieldsets = targetContainer.form.get('fieldSets') as UntypedFormArray;
const sourceFieldsets = sourceContainer.form.get('fieldSets') as UntypedFormArray;
if(!targetFieldsets){
console.info('Not target fieldsets container found');
@ -197,7 +197,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
case ToCEntryType.Section:{
if(targetContainer.type == ToCEntryType.Section){
if((targetContainer.form.get('fieldSets')as FormArray).length){
if((targetContainer.form.get('fieldSets')as UntypedFormArray).length){
// const message = 'Cannot have inputs and sections on the same level';
const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL');;
this.notifyUser(message);
@ -206,9 +206,9 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
return;
}
const targetSections = targetContainer.form.get('sections') as FormArray;
const targetSections = targetContainer.form.get('sections') as UntypedFormArray;
const elementSectionForm = element.form;
const sourceSections = elementSectionForm.parent as FormArray;
const sourceSections = elementSectionForm.parent as UntypedFormArray;
if(!(targetSections && sourceSections && elementSectionForm)){
console.info('Could not load sections');
@ -269,7 +269,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
const rootform = targetContainer.form.root;
const sectionForm = element.form;
const parentSections = sectionForm.parent as FormArray;
const parentSections = sectionForm.parent as UntypedFormArray;
let parentIndex = -1;
parentSections.controls.forEach((section,i )=>{
@ -301,7 +301,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
position = targetContainer.subEntries.length;
}
//populate sections
const targetSectionsArray = rootform.get('sections') as FormArray;
const targetSectionsArray = rootform.get('sections') as UntypedFormArray;
if(sibling && sibling.id){
@ -364,7 +364,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
}
const pages = rootForm.get('pages') as FormArray;
const pages = rootForm.get('pages') as UntypedFormArray;
const pageForm = element.form;
let index = -1;

View File

@ -1,5 +1,5 @@
import { AfterViewInit, Component, OnInit } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type';
@ -20,7 +20,7 @@ import { takeUntil } from 'rxjs/operators';
})
export class DescriptionTypeEditorComponent extends BaseComponent implements OnInit {
formGroup: FormGroup = null;
formGroup: UntypedFormGroup = null;
descriptionTypeModel: DescriptionTypeEditorModel;
isNew = true;
@ -142,9 +142,9 @@ export class DescriptionTypeEditorModel {
return this;
}
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
const formGroup = new UntypedFormBuilder().group({
id: [this.id],
name: [{ value: this.name, disabled: disabled }, context.getValidation('name').validators],
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators]

View File

@ -30,9 +30,6 @@ import { AutoCompleteModule } from "@app/library/auto-complete/auto-complete.mod
DmpProfileCriteriaComponent,
DialodConfirmationUploadDmpProfiles,
DmpProfileExternalAutocompleteFieldEditorComponent
],
entryComponents: [
DialodConfirmationUploadDmpProfiles
]
})
export class DmpProfileModule { }

View File

@ -1,4 +1,4 @@
import { FormBuilder, FormGroup, Validators } from "@angular/forms";
import { UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, FieldCategory, FieldInSection, SectionDmpBlueprint } from "@app/core/model/dmp/dmp-blueprint/dmp-blueprint";
import { BackendErrorValidator } from "@common/forms/validation/custom-validator";
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
@ -23,9 +23,9 @@ export class DmpBlueprintEditor {
return this;
}
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
const formGroup = new UntypedFormBuilder().group({
id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
label: [{ value: this.label, disabled: disabled }, context.getValidation('label')],
status: [{ value: this.status, disabled: disabled }, context.getValidation('status')],
@ -58,12 +58,12 @@ export class DmpBlueprintDefinitionEditor {
return this;
}
buildForm(): FormGroup {
const formBuilder = new FormBuilder();
buildForm(): UntypedFormGroup {
const formBuilder = new UntypedFormBuilder();
const formGroup = formBuilder.group({});
const sectionsFormArray = new Array<FormGroup>();
const sectionsFormArray = new Array<UntypedFormGroup>();
this.sections.forEach(item => {
const form: FormGroup = item.buildForm();
const form: UntypedFormGroup = item.buildForm();
sectionsFormArray.push(form);
});
formGroup.addControl('sections', formBuilder.array(sectionsFormArray));
@ -92,25 +92,25 @@ export class SectionDmpBlueprintEditor {
return this;
}
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
const formGroup = new UntypedFormBuilder().group({
id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
label: [{ value: this.label, disabled: disabled }, context.getValidation('label')],
description: [{ value: this.description, disabled: disabled }, context.getValidation('description')],
ordinal: [{ value: this.ordinal, disabled: disabled }, context.getValidation('ordinal')],
hasTemplates: [{ value: this.hasTemplates, disabled: disabled }, context.getValidation('hasTemplates')]
});
const formBuilder = new FormBuilder();
const fieldsFormArray = new Array<FormGroup>();
const formBuilder = new UntypedFormBuilder();
const fieldsFormArray = new Array<UntypedFormGroup>();
this.fields.forEach(item => {
const form: FormGroup = item.buildForm();
const form: UntypedFormGroup = item.buildForm();
fieldsFormArray.push(form);
});
formGroup.addControl('fields', formBuilder.array(fieldsFormArray));
const descriptionTemplatesFormArray = new Array<FormGroup>();
const descriptionTemplatesFormArray = new Array<UntypedFormGroup>();
this.descriptionTemplates.forEach(item => {
const form: FormGroup = item.buildForm();
const form: UntypedFormGroup = item.buildForm();
descriptionTemplatesFormArray.push(form);
});
formGroup.addControl('descriptionTemplates', formBuilder.array(descriptionTemplatesFormArray));
@ -152,9 +152,9 @@ export class FieldInSectionEditor {
return this;
}
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
const formGroup = new UntypedFormBuilder().group({
id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
category: [{ value: this.category, disabled: disabled }, context.getValidation('category')],
type: [{ value: this.type, disabled: disabled }, context.getValidation('type')],
@ -198,9 +198,9 @@ export class DescriptionTemplatesInSectionEditor {
return this;
}
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({
const formGroup = new UntypedFormBuilder().group({
id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
descriptionTemplateId: [{ value: this.descriptionTemplateId, disabled: disabled }, context.getValidation('descriptionTemplateId')],
label: [{ value: this.label, disabled: disabled }, context.getValidation('label')],

View File

@ -1,6 +1,6 @@
import { AfterViewInit, Component, ViewChild } from '@angular/core';
import { FormArray, FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { UntypedFormArray, UntypedFormBuilder, FormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Params, Router } from '@angular/router';
import { DmpProfileFieldDataType } from '@app/core/common/enum/dmp-profile-field-type';
import { DmpProfileStatus } from '@app/core/common/enum/dmp-profile-status';
@ -53,12 +53,12 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
viewOnly = false;
dmpProfileModel: DmpProfileEditorModel;
dmpBlueprintModel: DmpBlueprintEditor;
formGroup: FormGroup = null;
formGroup: UntypedFormGroup = null;
host: string;
dmpProfileId: string;
breadCrumbs: Observable<BreadcrumbItem[]>;
dmpBlueprintsFormGroup: FormGroup = null;
dmpBlueprintsFormGroup: UntypedFormGroup = null;
profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration;
@ -87,7 +87,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
private enumUtils: EnumUtils,
private uiNotificationService: UiNotificationService,
private formService: FormService,
private fb: FormBuilder,
private fb: UntypedFormBuilder,
private configurationService: ConfigurationService,
private httpClient: HttpClient,
private matomoService: MatomoService,
@ -206,9 +206,9 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
return this._service.searchDMPProfiles(request);
}
sectionsArray(): FormArray {
sectionsArray(): UntypedFormArray {
//return this.dmpBlueprintsFormGroup.get('sections') as FormArray;
return this.formGroup.get('definition').get('sections') as FormArray;
return this.formGroup.get('definition').get('sections') as UntypedFormArray;
}
addSection(): void {
@ -228,8 +228,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
});
}
fieldsArray(sectionIndex: number): FormArray {
return this.sectionsArray().at(sectionIndex).get('fields') as FormArray;
fieldsArray(sectionIndex: number): UntypedFormArray {
return this.sectionsArray().at(sectionIndex).get('fields') as UntypedFormArray;
}
addField(sectionIndex: number, fieldCategory: FieldCategory, fieldType?: number): void {
@ -248,11 +248,11 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
this.fieldsArray(sectionIndex).removeAt(fieldIndex);
}
systemFieldsArray(sectionIndex: number): FormArray {
return this.sectionsArray().at(sectionIndex).get('systemFields') as FormArray;
systemFieldsArray(sectionIndex: number): UntypedFormArray {
return this.sectionsArray().at(sectionIndex).get('systemFields') as UntypedFormArray;
}
initSystemField(systemField?: SystemFieldType): FormGroup {
initSystemField(systemField?: SystemFieldType): UntypedFormGroup {
return this.fb.group({
id: this.fb.control(Guid.create().toString()),
type: this.fb.control(systemField),
@ -317,8 +317,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
}
}
descriptionTemplatesArray(sectionIndex: number): FormArray {
return this.sectionsArray().at(sectionIndex).get('descriptionTemplates') as FormArray;
descriptionTemplatesArray(sectionIndex: number): UntypedFormArray {
return this.sectionsArray().at(sectionIndex).get('descriptionTemplates') as UntypedFormArray;
}
addDescriptionTemplate(descriptionTemplate, sectionIndex: number): void {
@ -331,8 +331,8 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
this.descriptionTemplatesArray(sectionIndex).removeAt(templateIndex);
}
extraFieldsArray(sectionIndex: number): FormArray {
return this.sectionsArray().at(sectionIndex).get('extraFields') as FormArray;
extraFieldsArray(sectionIndex: number): UntypedFormArray {
return this.sectionsArray().at(sectionIndex).get('extraFields') as UntypedFormArray;
}
addExtraField(sectionIndex: number): void {
@ -372,7 +372,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
});
}
moveItemInFormArray(formArray: FormArray, fromIndex: number, toIndex: number): void {
moveItemInFormArray(formArray: UntypedFormArray, fromIndex: number, toIndex: number): void {
const dir = toIndex > fromIndex ? 1 : -1;
const item = formArray.at(fromIndex);
@ -638,7 +638,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
return filename;
}
isExternalAutocomplete(formGroup: FormGroup) {
isExternalAutocomplete(formGroup: UntypedFormGroup) {
if (formGroup.get('dataType').value == DmpProfileFieldDataType.ExternalAutocomplete) {
this.addControl(formGroup);
return true;
@ -648,12 +648,12 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
}
}
addControl(formGroup: FormGroup) {
addControl(formGroup: UntypedFormGroup) {
if (formGroup.get('dataType').value == 3)
formGroup.addControl('externalAutocomplete', new DmpProfileExternalAutoCompleteFieldDataEditorModel().buildForm());
}
removeControl(formGroup: FormGroup) {
removeControl(formGroup: UntypedFormGroup) {
if (formGroup.get('dataType').value != 3)
formGroup.removeControl('externalAutocomplete');
}

Some files were not shown because too many files have changed in this diff Show More