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 !.vscode/extensions.json
# misc # misc
/.angular/cache
/.sass-cache /.sass-cache
/connect.lock /connect.lock
/coverage /coverage

View File

@ -123,18 +123,6 @@
{ "glob": "**/*", "input": "node_modules/tinymce/plugins", "output": "/tinymce/plugins/" } { "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", "protractorConfig": "./protractor.conf.js",
"devServerTarget": "dmp-frontend:serve" "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": {
"@schematics/angular:component": { "@schematics/angular:component": {
"prefix": "app", "prefix": "app",

View File

@ -12,13 +12,13 @@
}, },
"private": true, "private": true,
"dependencies": { "dependencies": {
"@angular/animations": "^12.2.7", "@angular/animations": "^14.3.0",
"@angular/common": "^12.2.7", "@angular/common": "^14.3.0",
"@angular/compiler": "^12.2.7", "@angular/compiler": "^14.3.0",
"@angular/core": "^12.2.7", "@angular/core": "^14.3.0",
"@angular/forms": "^12.2.7", "@angular/forms": "^14.3.0",
"@angular/material-moment-adapter": "^12.2.7", "@angular/material-moment-adapter": "^14.2.7",
"@angular/platform-browser": "^12.2.7", "@angular/platform-browser": "^14.3.0",
"@kolkov/angular-editor": "^1.2.0", "@kolkov/angular-editor": "^1.2.0",
"@ngx-translate/core": "^13.0.0", "@ngx-translate/core": "^13.0.0",
"@ngx-translate/http-loader": "^6.0.0", "@ngx-translate/http-loader": "^6.0.0",
@ -43,18 +43,17 @@
"tinymce": "^5.9.2", "tinymce": "^5.9.2",
"ts-simple-nameof": "^1.3.1", "ts-simple-nameof": "^1.3.1",
"tslib": "^2.0.0", "tslib": "^2.0.0",
"web-animations-js": "^2.3.2",
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "~12.2.7", "@angular-devkit/build-angular": "^14.2.12",
"@angular/cdk": "^12.2.7", "@angular/cdk": "^14.2.7",
"@angular/cli": "12.2.7", "@angular/cli": "14.2.12",
"@angular/compiler-cli": "^12.2.7", "@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^12.2.7", "@angular/language-service": "^14.3.0",
"@angular/material": "^12.2.7", "@angular/material": "^14.2.7",
"@angular/platform-browser-dynamic": "^12.2.7", "@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^12.2.7", "@angular/router": "^14.3.0",
"@types/facebook-js-sdk": "^3.3.5", "@types/facebook-js-sdk": "^3.3.5",
"@types/file-saver": "^2.0.3", "@types/file-saver": "^2.0.3",
"@types/gapi": "^0.0.41", "@types/gapi": "^0.0.41",
@ -67,6 +66,6 @@
"codelyzer": "^6.0.2", "codelyzer": "^6.0.2",
"ts-node": "~10.2.1", "ts-node": "~10.2.1",
"tslint": "~6.1.0", "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 { 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'; import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model';
export interface ContactEmail { export interface ContactEmail {
@ -17,8 +17,8 @@ export class ContactEmailFormModel {
return this; return this;
} }
buildForm(): FormGroup { buildForm(): UntypedFormGroup {
const formGroup = new FormBuilder().group({ const formGroup = new UntypedFormBuilder().group({
subject: [this.subject, [Validators.required]], subject: [this.subject, [Validators.required]],
description: [this.description, [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'; import { isNullOrUndefined } from '@app/utilities/enhancers/utils';
export class DatasetIdModel { export class DatasetIdModel {
@ -25,8 +25,8 @@ export class DatasetIdModel {
} }
} }
buildForm(): FormGroup { buildForm(): UntypedFormGroup {
return new FormBuilder().group({ return new UntypedFormBuilder().group({
identifier: [this.identifier], identifier: [this.identifier],
type: [this.type] 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 { DatasetProfileModel } from '@app/core/model/dataset/dataset-profile';
import { DmpModel } from '@app/core/model/dmp/dmp'; import { DmpModel } from '@app/core/model/dmp/dmp';
import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
@ -17,9 +17,9 @@ export class DmpCreateWizardFormModel {
return this; return this;
} }
buildForm(context: ValidationContext = null): FormGroup { buildForm(context: ValidationContext = null): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); } if (context == null) { context = this.createValidationContext(); }
const formBuilder = new FormBuilder(); const formBuilder = new UntypedFormBuilder();
const formGroup = formBuilder.group({ const formGroup = formBuilder.group({
dmp: [this.dmp, context.getValidation('dmp').validators], dmp: [this.dmp, context.getValidation('dmp').validators],
datasetProfile: [this.datasetProfile, context.getValidation('datasetProfile').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 { BackendErrorValidator } from "@common/forms/validation/custom-validator";
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model"; import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
import { ValidationContext } from "@common/forms/validation/validation-context"; import { ValidationContext } from "@common/forms/validation/validation-context";
@ -12,9 +12,9 @@ export class DmpDatasetProfileSectionsFormModel {
return this; return this;
} }
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); } 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], language: [{ value: this.dmpSectionIndex, disabled: disabled }, context.getValidation('dmpSectionIndex').validators],
}); });
return formGroup; 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'; import { Serializable } from '@common/types/json/serializable';
export class DmpInvitationUser implements Serializable<DmpInvitationUser> { export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
@ -14,8 +14,8 @@ export class DmpInvitationUser implements Serializable<DmpInvitationUser> {
return this; return this;
} }
buildForm(): FormGroup { buildForm(): UntypedFormGroup {
return new FormBuilder().group({ return new UntypedFormBuilder().group({
id: [this.id], id: [this.id],
email: [this.email], email: [this.email],
name: [this.name] 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'; import { DmpInvitationUser } from './dmp-invitation-user';
export class DmpInvitation { export class DmpInvitation {
@ -7,8 +7,8 @@ export class DmpInvitation {
public users = new Array<DmpInvitationUser>(); public users = new Array<DmpInvitationUser>();
public role: number; public role: number;
buildForm(): FormGroup { buildForm(): UntypedFormGroup {
const formGroup = new FormBuilder().group({ const formGroup = new UntypedFormBuilder().group({
dataManagementPlan: [this.dataManagementPlan], dataManagementPlan: [this.dataManagementPlan],
users: [this.users], users: [this.users],
role: [this.role] role: [this.role]

View File

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

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
import {Component, Input} from "@angular/core"; import {Component, Input} from "@angular/core";
import {AngularEditorConfig} from "@kolkov/angular-editor"; import {AngularEditorConfig} from "@kolkov/angular-editor";
import {FormControl} from "@angular/forms"; import {UntypedFormControl} from "@angular/forms";
@Component({ @Component({
selector: 'rich-text-editor-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); 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 { DefaultValue } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model'; import { BaseFormModel } from '../../../../core/model/base-form-model';
@ -12,7 +12,7 @@ export class DefaultValueEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.type')) }], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.type')) }],
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('DefaultValueEditorModel.value')) }] 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 { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type';
import { AutoCompleteFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { AutoCompleteFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; 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 autoCompleteSingleDataList: Array<AutoCompleteSingleDataEditorModel> = new Array<AutoCompleteSingleDataEditorModel>();
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); //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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.type')) }], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.type')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.multiAutoComplete')) }] multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('AutoCompleteFieldDataEditorModel.multiAutoComplete')) }]
}); });
const autocompleteFormArray = new Array<FormGroup>(); const autocompleteFormArray = new Array<UntypedFormGroup>();
if (this.autoCompleteSingleDataList) { if (this.autoCompleteSingleDataList) {
this.autoCompleteSingleDataList.forEach(item => { this.autoCompleteSingleDataList.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
autocompleteFormArray.push(form); autocompleteFormArray.push(form);
}); });
} }

View File

@ -1,7 +1,7 @@
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type'; import { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
import { FieldDataOptionEditorModel } from './field-data-option-editor-model'; 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'; import { AutoCompleteFieldData, AutoCompleteSingleData } from '@app/core/model/dataset-profile-definition/field-data/field-data';
export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<AutoCompleteSingleDataEditorModel> { export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<AutoCompleteSingleDataEditorModel> {
@ -13,7 +13,7 @@ export class AutoCompleteSingleDataEditorModel extends FieldDataEditorModel<Auto
public autoCompleteType: number; public autoCompleteType: number;
//public multiAutoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); //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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.label')) }],
url: [{ value: this.url, disabled: (disabled && !skipDisable.includes('AutoCompleteSingleDataEditorModel.url')) },[Validators.required]], 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 { BooleanDecisionFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
export class BooleanDecisionFieldDataEditorModel extends FieldDataEditorModel<BooleanDecisionFieldDataEditorModel> { 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('BooleanDecisionFieldDataEditorModel.label')) }] 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 { CheckBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
export class CheckBoxFieldDataEditorModel extends FieldDataEditorModel<CheckBoxFieldDataEditorModel> { 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CheckBoxFieldDataEditorModel.label')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { CurrencyFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { CurrencyFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class CurrencyDataEditorModel extends FieldDataEditorModel<CurrencyDataEditorModel> { export class CurrencyDataEditorModel extends FieldDataEditorModel<CurrencyDataEditorModel> {
public label: string; public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('CurrencyDataEditorModel.label')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { DataRepositoriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; 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 label: string;
public multiAutoComplete: boolean; public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { DatasetIdentifierFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel<DatasetIdentifierDataEditorModel> { export class DatasetIdentifierDataEditorModel extends FieldDataEditorModel<DatasetIdentifierDataEditorModel> {
public label: string; public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetIdentifierDataEditorModel.label')) }] 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 { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model"; import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
import { DatasetsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data"; 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> { export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<DatasetsAutoCompleteFieldDataEditorModel> {
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Datasets; public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Datasets;
@ -10,7 +10,7 @@ export class DatasetsAutoCompleteFieldDataEditorModel extends FieldDataEditorMod
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel();
public autoCompleteType: number; public autoCompleteType: number;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DatasetsAutoCompleteFieldDataEditorModel.type')) }], 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 { FieldDataEditorModel } from './field-data-editor-model';
import { DatePickerFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { DatePickerFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class DatePickerDataEditorModel extends FieldDataEditorModel<DatePickerDataEditorModel> { export class DatePickerDataEditorModel extends FieldDataEditorModel<DatePickerDataEditorModel> {
public label: string; public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatePickerDataEditorModel.label')) }] 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 { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model"; import { FieldDataOptionEditorModel } from "./field-data-option-editor-model";
import { DmpsAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data"; 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> { export class DmpsAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<DmpsAutoCompleteFieldDataEditorModel> {
public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Dmps; public type: DatasetProfileInternalDmpEntitiesType = DatasetProfileInternalDmpEntitiesType.Dmps;
public multiAutoComplete: boolean = false; public multiAutoComplete: boolean = false;
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('DmpsAutoCompleteFieldDataEditorModel.type')) }], 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 { FieldDataEditorModel } from './field-data-editor-model';
import { ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { ExternalDatasetsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { ExternalDatasetTypeEnum } from '@app/core/common/enum/external-dataset-type-enum'; 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 multiAutoComplete: boolean;
public type: ExternalDatasetTypeEnum; public type: ExternalDatasetTypeEnum;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ExternalDatasetsDataEditorModel.multiAutoComplete')) }], 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'; import { BaseFormModel } from '../../../../../core/model/base-form-model';
export abstract class FieldDataEditorModel<T> extends BaseFormModel { export abstract class FieldDataEditorModel<T> extends BaseFormModel {
public label: string; 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'); 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 { FieldDataOption } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
@ -7,8 +7,8 @@ export class FieldDataOptionEditorModel extends FieldDataEditorModel<FieldDataOp
public value: string; public value: string;
public source: string; public source: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
return new FormBuilder().group({ return new UntypedFormBuilder().group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.label')) },[Validators.required]], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.label')) },[Validators.required]],
value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.value')) },[Validators.required]], value: [{ value: this.value, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.value')) },[Validators.required]],
source: [{ value: this.source, disabled: (disabled && !skipDisable.includes('FieldDataOptionEditorModel.source')) }] 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 { FreeTextFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
export class FreeTextFieldDataEditorModel extends FieldDataEditorModel<FreeTextFieldDataEditorModel> { 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('FreeTextFieldDataEditorModel.label')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { LicensesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { LicensesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class LicensesDataEditorModel extends FieldDataEditorModel<LicensesDataEditorModel> { export class LicensesDataEditorModel extends FieldDataEditorModel<LicensesDataEditorModel> {
public label: string; public label: string;
public multiAutoComplete: boolean; public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { OrganizationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; 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 label: string;
public multiAutoComplete: boolean = false; 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('OrganizationsDataEditorModel.multiAutoComplete')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { PublicationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { PublicationsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class PublicationsDataEditorModel extends FieldDataEditorModel<PublicationsDataEditorModel> { export class PublicationsDataEditorModel extends FieldDataEditorModel<PublicationsDataEditorModel> {
public label: string; public label: string;
public multiAutoComplete: boolean; public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] 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 { RadioBoxFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
import { FieldDataOptionEditorModel } from './field-data-option-editor-model'; import { FieldDataOptionEditorModel } from './field-data-option-editor-model';
@ -7,14 +7,14 @@ export class RadioBoxFieldDataEditorModel extends FieldDataEditorModel<RadioBoxF
public options: Array<FieldDataOptionEditorModel> = []; 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RadioBoxFieldDataEditorModel.label')) }] label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RadioBoxFieldDataEditorModel.label')) }]
}); });
const optionsFormArray = new Array<FormGroup>(); const optionsFormArray = new Array<UntypedFormGroup>();
if (this.options) { if (this.options) {
this.options.forEach(item => { this.options.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
optionsFormArray.push(form); 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 { FieldDataEditorModel } from './field-data-editor-model';
import { RegistriesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; 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 label: string;
public multiAutoComplete: boolean; public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.multiAutoComplete')) }] multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('RegistriesDataEditorModel.multiAutoComplete')) }]

View File

@ -1,7 +1,7 @@
import { FieldDataEditorModel } from "./field-data-editor-model"; import { FieldDataEditorModel } from "./field-data-editor-model";
import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type"; import { DatasetProfileInternalDmpEntitiesType } from "../../../../../core/common/enum/dataset-profile-internal-dmp-entities-type";
import { FieldDataOptionEditorModel } from "./field-data-option-editor-model"; 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"; import { ResearchersAutoCompleteFieldData } from "../../../../../core/model/dataset-profile-definition/field-data/field-data";
export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<ResearchersAutoCompleteFieldDataEditorModel> { export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditorModel<ResearchersAutoCompleteFieldDataEditorModel> {
@ -10,7 +10,7 @@ export class ResearchersAutoCompleteFieldDataEditorModel extends FieldDataEditor
public multiAutoComplete: boolean = false; public multiAutoComplete: boolean = false;
public autoCompleteOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.label')) }],
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('ResearchersAutoCompleteFieldDataEditorModel.type')) }], 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 { FieldDataEditorModel } from './field-data-editor-model';
import { ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { ResearchersFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class ResearchersDataEditorModel extends FieldDataEditorModel<ResearchersDataEditorModel> { export class ResearchersDataEditorModel extends FieldDataEditorModel<ResearchersDataEditorModel> {
public label: string; public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ResearchersDataEditorModel.label')) }] 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 { RichTextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
export class RichTextAreaFieldDataEditorModel extends FieldDataEditorModel<RichTextAreaFieldDataEditorModel> { 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('RichTextAreaFieldDataEditorModel.label')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { ServicesFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; 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 label: string;
public multiAutoComplete: boolean; public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import { TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { TagsFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class TagsDataEditorModel extends FieldDataEditorModel<TagsDataEditorModel> { export class TagsDataEditorModel extends FieldDataEditorModel<TagsDataEditorModel> {
public label: string; public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TagsDataEditorModel.label')) }] 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 { FieldDataEditorModel } from './field-data-editor-model';
import {TaxonomiesFieldData} from "@app/core/model/dataset-profile-definition/field-data/field-data"; 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 label: string;
public multiAutoComplete: boolean; public multiAutoComplete: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.label')) }],
multiAutoComplete: [{ value: this.multiAutoComplete, disabled: (disabled && !skipDisable.includes('ServicesDataEditorModel.multiAutoComplete')) }] 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 { TextAreaFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
export class TextAreaFieldDataEditorModel extends FieldDataEditorModel<TextAreaFieldDataEditorModel> { 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({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('TextAreaFieldDataEditorModel.label')) }] 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 { import {
FieldDataOption, FieldDataOption,
UploadFieldData UploadFieldData
@ -10,16 +10,16 @@ export class UploadFieldDataEditorModel extends FieldDataEditorModel<UploadField
public types: Array<FieldDataOptionEditorModel> = []; public types: Array<FieldDataOptionEditorModel> = [];
public maxFileSizeInMB: number; public maxFileSizeInMB: number;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.label')) }],
maxFileSizeInMB: [{ value: this.maxFileSizeInMB, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.maxFileSizeInMB')) }], maxFileSizeInMB: [{ value: this.maxFileSizeInMB, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.maxFileSizeInMB')) }],
// types: [{ value: this.types, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.types')) }] // types: [{ value: this.types, disabled: (disabled && !skipDisable.includes('UploadFieldDataEditorModel.types')) }]
}); });
const optionsFormArray = new Array<FormGroup>(); const optionsFormArray = new Array<UntypedFormGroup>();
if (this.types) { if (this.types) {
this.types.forEach(item => { this.types.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
optionsFormArray.push(form); 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 { FieldDataEditorModel } from './field-data-editor-model';
import { ValidationFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { ValidationFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
export class ValidationDataEditorModel extends FieldDataEditorModel<ValidationDataEditorModel> { export class ValidationDataEditorModel extends FieldDataEditorModel<ValidationDataEditorModel> {
public label: string; public label: string;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('ValidationDataEditorModel.label')) }] 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 { DatasetProfileComboBoxType } from '../../../../../core/common/enum/dataset-profile-combo-box-type';
import { WordListFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data'; import { WordListFieldData } from '../../../../../core/model/dataset-profile-definition/field-data/field-data';
import { FieldDataEditorModel } from './field-data-editor-model'; import { FieldDataEditorModel } from './field-data-editor-model';
@ -9,16 +9,16 @@ export class WordListFieldDataEditorModel extends FieldDataEditorModel<WordListF
public options: Array<FieldDataOptionEditorModel>; public options: Array<FieldDataOptionEditorModel>;
public multipleList: boolean; public multipleList: boolean;
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.type')) }], type: [{ value: this.type, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.type')) }],
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.label')) }], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.label')) }],
multiList: [{ value: this.multipleList, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.multipleList'))}] multiList: [{ value: this.multipleList, disabled: (disabled && !skipDisable.includes('WordListFieldDataEditorModel.multipleList'))}]
}); });
const optionsFormArray = new Array<FormGroup>(); const optionsFormArray = new Array<UntypedFormGroup>();
if (this.options) { if (this.options) {
this.options.forEach(item => { this.options.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
optionsFormArray.push(form); 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 { ValidationType } from '../../../../core/common/enum/validation-type';
import { Field } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { Field } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model'; import { BaseFormModel } from '../../../../core/model/base-form-model';
@ -98,7 +98,7 @@ export class FieldEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]], id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
// title: [this.title], // 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; const renderStyleValue = formGroup.get('viewStyle').get('renderStyle').value;
if(renderStyleValue === 'checkBox'){ if(renderStyleValue === 'checkBox'){
formGroup.get('defaultValue').get('value').setValidators(Validators.required); 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 { FieldSet } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model'; import { BaseFormModel } from '../../../../core/model/base-form-model';
import { FieldEditorModel } from './field-editor-model'; import { FieldEditorModel } from './field-editor-model';
@ -31,7 +31,7 @@ export class FieldSetEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]], id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]],
ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.ordinal')) }], 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')) }], additionalInformation: [{ value: this.additionalInformation, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.additionalInformation')) }],
hasCommentField: [{ value: this.hasCommentField, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.hasCommentField')) }] hasCommentField: [{ value: this.hasCommentField, disabled: (disabled && !skipDisable.includes('FieldSetEditorModel.hasCommentField')) }]
}); });
const fieldsFormArray = new Array<FormGroup>(); const fieldsFormArray = new Array<UntypedFormGroup>();
this.fields.forEach(item => { this.fields.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
fieldsFormArray.push(form); fieldsFormArray.push(form);
}); });
formGroup.addControl('fields', this.formBuilder.array(fieldsFormArray)); 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 {Multiplicity} from '../../../../core/model/admin/dataset-profile/dataset-profile';
import {BaseFormModel} from '../../../../core/model/base-form-model'; import {BaseFormModel} from '../../../../core/model/base-form-model';
@ -16,7 +16,7 @@ export class MultiplicityEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
return this.formBuilder.group({ return this.formBuilder.group({
min: [{value: this.min, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.min'))}], min: [{value: this.min, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.min'))}],
max: [{value: this.max, disabled: (disabled && !skipDisable.includes('MultiplicityEditorModel.max'))}], 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 { Page } from '@app/core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '@app/core/model/base-form-model'; import { BaseFormModel } from '@app/core/model/base-form-model';
import { Guid } from '@common/types/guid'; import { Guid } from '@common/types/guid';
@ -21,7 +21,7 @@ export class PageEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('PageEditorModel.title')) }, [Validators.required]], title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('PageEditorModel.title')) }, [Validators.required]],
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('PageEditorModel.id')) }, [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 { Rule } from "../../../../core/model/admin/dataset-profile/dataset-profile";
import { BaseFormModel } from "../../../../core/model/base-form-model"; import { BaseFormModel } from "../../../../core/model/base-form-model";
@ -18,7 +18,7 @@ export class RuleEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
// sourceField: [this.sourceField], // sourceField: [this.sourceField],
target: [{ value: this.target, disabled: (disabled && !skipDisable.includes('RuleEditorModel.target')) }, [Validators.required]], 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 { Section } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model'; import { BaseFormModel } from '../../../../core/model/base-form-model';
import { EditorCustomValidators } from '../editor/custom-validators/editor-custom-validators'; import { EditorCustomValidators } from '../editor/custom-validators/editor-custom-validators';
@ -26,8 +26,8 @@ export class SectionEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup: FormGroup = new FormBuilder().group({ const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({
id: [{ value: this.id, disabled: (disabled && !skipDisable.includes('SectionEditorModel.id')) }, [Validators.required, Validators.pattern('^[^<_>]+$')]], 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]], page: [{ value: this.page, disabled: (disabled && !skipDisable.includes('SectionEditorModel.page')) }, [Validators.required]],
title: [{ value: this.title, disabled: (disabled && !skipDisable.includes('SectionEditorModel.title')) } , [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]], ordinal: [{ value: this.ordinal, disabled: (disabled && !skipDisable.includes('SectionEditorModel.ordinal')) }, [Validators.required]],
defaultVisibility: [{ value: this.defaultVisibility, disabled: (disabled && !skipDisable.includes('SectionEditorModel.defaultVisibility')) }] defaultVisibility: [{ value: this.defaultVisibility, disabled: (disabled && !skipDisable.includes('SectionEditorModel.defaultVisibility')) }]
}); });
const sectionsFormArray = new Array<FormGroup>(); const sectionsFormArray = new Array<UntypedFormGroup>();
if (this.sections) { if (this.sections) {
this.sections.forEach(item => { this.sections.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
sectionsFormArray.push(form); sectionsFormArray.push(form);
}); });
} }
const compositeFieldsFormArray = new Array<FormGroup>(); const compositeFieldsFormArray = new Array<UntypedFormGroup>();
if (this.fieldSets) { if (this.fieldSets) {
this.fieldSets.forEach(item => { this.fieldSets.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
compositeFieldsFormArray.push(form); 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 { ViewStyle } from "../../../../core/model/admin/dataset-profile/dataset-profile";
import { BaseFormModel } from "../../../../core/model/base-form-model"; import { BaseFormModel } from "../../../../core/model/base-form-model";
@ -12,7 +12,7 @@ export class ViewStyleEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
cssClass: [{ value: this.cssClass, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.cssClass')) }], cssClass: [{ value: this.cssClass, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.cssClass')) }],
renderStyle: [{ value: this.renderStyle, disabled: (disabled && !skipDisable.includes('ViewStyleEditorModel.renderStyle')) }, Validators.required] 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 { Visibility } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model'; import { BaseFormModel } from '../../../../core/model/base-form-model';
import { RuleEditorModel } from './rule-editor-model'; import { RuleEditorModel } from './rule-editor-model';
@ -15,15 +15,15 @@ export class VisibilityEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup = this.formBuilder.group({ const formGroup = this.formBuilder.group({
style: [{ value: this.style, disabled: (disabled && !skipDisable.includes('VisibilityEditorModel.style')) }] style: [{ value: this.style, disabled: (disabled && !skipDisable.includes('VisibilityEditorModel.style')) }]
}); });
const rulesFormArray = new Array<FormGroup>(); const rulesFormArray = new Array<UntypedFormGroup>();
if (this.rules) { if (this.rules) {
this.rules.forEach(rule => { this.rules.forEach(rule => {
const form: FormGroup = rule.buildForm(disabled, skipDisable); const form: UntypedFormGroup = rule.buildForm(disabled, skipDisable);
rulesFormArray.push(form); rulesFormArray.push(form);
}); });
} }

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { AutoCompleteFieldDataEditorModel } from '../../../../admin/field-data/auto-complete-field-data-editor-model'; 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'; 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 { export class DatasetProfileEditorAutoCompleteFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: AutoCompleteFieldDataEditorModel = new AutoCompleteFieldDataEditorModel(); private data: AutoCompleteFieldDataEditorModel = new AutoCompleteFieldDataEditorModel();
multiForm: FormArray; multiForm: UntypedFormArray;
ngOnInit() { ngOnInit() {
this.multiForm = (<FormArray>this.form.get('data').get('autoCompleteSingleDataList')); this.multiForm = (<UntypedFormArray>this.form.get('data').get('autoCompleteSingleDataList'));
this.data.type = DatasetProfileComboBoxType.Autocomplete; this.data.type = DatasetProfileComboBoxType.Autocomplete;
} }
addSource() { addSource() {
(<FormArray>this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm()); (<UntypedFormArray>this.multiForm).push(new AutoCompleteSingleDataEditorModel().buildForm());
} }
removeSource(index: number) { 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 { 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'; import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-data/boolean-decision-field-data-editor-model';
@Component({ @Component({
@ -10,7 +10,7 @@ import { BooleanDecisionFieldDataEditorModel } from '../../../../admin/field-dat
}) })
export class DatasetProfileEditorBooleanDecisionFieldComponent implements OnInit { export class DatasetProfileEditorBooleanDecisionFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: BooleanDecisionFieldDataEditorModel = new BooleanDecisionFieldDataEditorModel(); private data: BooleanDecisionFieldDataEditorModel = new BooleanDecisionFieldDataEditorModel();
ngOnInit() { ngOnInit() {

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { DatasetProfileComboBoxType } from '@app/core/common/enum/dataset-profile-combo-box-type';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; 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'; 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 { export class DatasetProfileEditorComboBoxFieldComponent extends BaseComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
options = DatasetProfileComboBoxType; options = DatasetProfileComboBoxType;
constructor( constructor(

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { 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 { 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'; 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 { export class DatasetProfileEditorDataRepositoriesFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() { ngOnInit() {

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { 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 { 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'; 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 { export class DatasetProfileEditorExternalDatasetsFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: ExternalDatasetsDataEditorModel = new ExternalDatasetsDataEditorModel(); private data: ExternalDatasetsDataEditorModel = new ExternalDatasetsDataEditorModel();
externalDatasetTypes = [ externalDatasetTypes = [

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { DatasetProfileInternalDmpEntitiesType } from '@app/core/common/enum/dataset-profile-internal-dmp-entities-type';
import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; 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'; 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' templateUrl: './dataset-profile-editor-internal-dmp-entities-field.component.html'
}) })
export class DatasetProfileEditorInternalDmpEntitiesFieldComponent extends BaseComponent implements OnInit { export class DatasetProfileEditorInternalDmpEntitiesFieldComponent extends BaseComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
options = DatasetProfileInternalDmpEntitiesType; options = DatasetProfileInternalDmpEntitiesType;
constructor( constructor(

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { 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 { 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'; 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 { export class DatasetProfileEditorOrganizationsFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: OrganizationsDataEditorModel = new OrganizationsDataEditorModel(); private data: OrganizationsDataEditorModel = new OrganizationsDataEditorModel();
ngOnInit() { ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { 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 { 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'; 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 { export class DatasetProfileEditorPubRepositoriesFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel(); private data: DataRepositoriesDataEditorModel = new DataRepositoriesDataEditorModel();
ngOnInit() { ngOnInit() {

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { 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 { 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'; 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 { export class DatasetProfileEditorResearchersFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: ResearchersDataEditorModel = new ResearchersDataEditorModel(); private data: ResearchersDataEditorModel = new ResearchersDataEditorModel();
constructor(private router: Router) {} constructor(private router: Router) {}

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { 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 { 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'; 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 { export class DatasetProfileEditorServicesFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: ServicesDataEditorModel = new ServicesDataEditorModel(); private data: ServicesDataEditorModel = new ServicesDataEditorModel();
ngOnInit() { ngOnInit() {

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { 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 { 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'; 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 { export class DatasetProfileEditorTagsFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: TagsDataEditorModel = new TagsDataEditorModel(); private data: TagsDataEditorModel = new TagsDataEditorModel();
constructor(private router: Router) {} constructor(private router: Router) {}

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { Component, Input, OnInit } from '@angular/core'; 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 { DatasetProfileComboBoxType } from '../../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model'; import { FieldDataOptionEditorModel } from '../../../../admin/field-data/field-data-option-editor-model';
import { WordListFieldDataEditorModel } from '../../../../admin/field-data/word-list-field-data-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 { export class DatasetProfileEditorWordListFieldComponent implements OnInit {
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
private data: WordListFieldDataEditorModel = new WordListFieldDataEditorModel(); private data: WordListFieldDataEditorModel = new WordListFieldDataEditorModel();
ngOnInit() { ngOnInit() {
@ -20,10 +20,10 @@ export class DatasetProfileEditorWordListFieldComponent implements OnInit {
addNewRow() { addNewRow() {
const wordListOptions: FieldDataOptionEditorModel = new FieldDataOptionEditorModel(); 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) { 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 {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 {DatasetProfileFieldViewStyle} from '@app/core/common/enum/dataset-profile-field-view-style';
import {ValidationType} from '@app/core/common/enum/validation-type'; import {ValidationType} from '@app/core/common/enum/validation-type';
import {DatasetProfileService} from '@app/core/services/dataset-profile/dataset-profile.service'; 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 { export class DatasetProfileEditorFieldComponent extends BaseComponent implements OnInit, ErrorStateMatcher {
@Input() viewOnly: boolean; @Input() viewOnly: boolean;
@Input() form: FormGroup; @Input() form: UntypedFormGroup;
@Input() showOrdinal = true; @Input() showOrdinal = true;
@Input() indexPath: string; @Input() indexPath: string;
validationTypeEnum = ValidationType; 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; if(this.form.get('viewStyle').untouched) return false;
@ -336,7 +336,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
addNewRule() { addNewRule() {
const rule: RuleEditorModel = new RuleEditorModel(); 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 form = (new FieldEditorModel).fromModel(field).buildForm();
const fields = this.form.parent as FormArray; const fields = this.form.parent as UntypedFormArray;
let index = -1; let index = -1;
fields.controls.forEach((control,i)=>{ fields.controls.forEach((control,i)=>{
@ -953,7 +953,7 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
} }
private setValidator(validationType: ValidationType, add: boolean) { 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; let validations: Array<ValidationType> = validationsControl.value;
if(add){ if(add){
@ -969,13 +969,13 @@ export class DatasetProfileEditorFieldComponent extends BaseComponent implements
} }
get isRequired(){ get isRequired(){
let validationsControl = this.form.get('validations') as FormControl; let validationsControl = this.form.get('validations') as UntypedFormControl;
let validations: Array<ValidationType> = validationsControl.value; let validations: Array<ValidationType> = validationsControl.value;
return validations.includes(ValidationType.Required); return validations.includes(ValidationType.Required);
} }
get isURL(){ get isURL(){
let validationsControl = this.form.get('validations') as FormControl; let validationsControl = this.form.get('validations') as UntypedFormControl;
let validations: Array<ValidationType> = validationsControl.value; let validations: Array<ValidationType> = validationsControl.value;
return validations.includes(ValidationType.URL); return validations.includes(ValidationType.URL);
} }

View File

@ -1,5 +1,5 @@
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { FormArray } from '@angular/forms'; import { UntypedFormArray } from '@angular/forms';
@Component({ @Component({
selector: 'app-dataset-profile-editor-page-component', selector: 'app-dataset-profile-editor-page-component',
@ -8,10 +8,10 @@ import { FormArray } from '@angular/forms';
}) })
export class DatasetProfileEditorPageComponent { export class DatasetProfileEditorPageComponent {
@Input() form: FormArray; @Input() form: UntypedFormArray;
@Input() viewOnly: boolean; @Input() viewOnly: boolean;
removePage(index) { 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 { 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 { DatasetProfileFieldViewStyle } from '../../../../../../core/common/enum/dataset-profile-field-view-style';
import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type'; import { DatasetProfileComboBoxType } from '../../../../../../core/common/enum/dataset-profile-combo-box-type';
import { ToCEntryType } from '../../../table-of-contents/table-of-contents-entry'; 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 { export class DatasetProfileEditorRuleComponent implements OnInit {
@Input() form: FormArray; @Input() form: UntypedFormArray;
@Input() viewStyleForCheck: DatasetProfileFieldViewStyle; @Input() viewStyleForCheck: DatasetProfileFieldViewStyle;
@Input() formControlForCheck: FormControl; @Input() formControlForCheck: UntypedFormControl;
@Input() formArrayOptionsForCheck: FormArray; @Input() formArrayOptionsForCheck: UntypedFormArray;
@Input() comboBoxTypeForCheck: DatasetProfileComboBoxType; @Input() comboBoxTypeForCheck: DatasetProfileComboBoxType;
@Input() viewOnly: boolean; @Input() viewOnly: boolean;
@ -89,7 +89,7 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
private _buildHiddenBy(fo:OptionItem){ private _buildHiddenBy(fo:OptionItem){
try{ try{
this.fieldOptions.forEach(foption=>{ 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); const targets = rules.map(rule=>rule.target);
targets.forEach(target=>{ targets.forEach(target=>{
if(fo.parentsIds.includes(target) && !fo.hiddenBy.includes(foption.id)){ if(fo.parentsIds.includes(target) && !fo.hiddenBy.includes(foption.id)){
@ -114,11 +114,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
const result:OptionItem[] =[]; const result:OptionItem[] =[];
const sections = rootForm.get('sections') as FormArray; const sections = rootForm.get('sections') as UntypedFormArray;
if(sections){ if(sections){
sections.controls.forEach(section=>{ 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); result.push(...subResult);
}); });
} }
@ -131,11 +131,11 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
return []; 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 sections = form.get('sections') as UntypedFormArray;
const fieldSets = form.get('fieldSets') as FormArray; const fieldSets = form.get('fieldSets') as UntypedFormArray;
const fields = form.get('fields') as FormArray; const fields = form.get('fields') as UntypedFormArray;
const result:OptionItem[] = []; const result:OptionItem[] = [];
@ -153,17 +153,17 @@ export class DatasetProfileEditorRuleComponent implements OnInit {
if(sections){ if(sections){
sections.controls.forEach(section=>{ 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){ if(fieldSets){
fieldSets.controls.forEach(fieldset=>{ 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){ if(fields){
fields.controls.forEach(field=>{ 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, label: string,
type: ToCEntryType, type: ToCEntryType,
parentsIds: string[], parentsIds: string[],
form:FormGroup, form:UntypedFormGroup,
hiddenBy:string[] hiddenBy:string[]
} }

View File

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

View File

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

View File

@ -1,5 +1,5 @@
import { Inject, Injectable } from "@angular/core"; 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{ export class EditorCustomValidators{
@ -7,7 +7,7 @@ export class EditorCustomValidators{
static atLeastOneElementListValidator(arrayToCheck): ValidatorFn{ static atLeastOneElementListValidator(arrayToCheck): ValidatorFn{
return (control: AbstractControl): ValidationErrors | null=>{ return (control: AbstractControl): ValidationErrors | null=>{
const fa = control.get(arrayToCheck) as FormArray; const fa = control.get(arrayToCheck) as UntypedFormArray;
if(!fa || fa.length === 0){ if(!fa || fa.length === 0){
return {[EditorCustomValidatorsEnum.emptyArray]: true}; return {[EditorCustomValidatorsEnum.emptyArray]: true};
@ -19,8 +19,8 @@ export class EditorCustomValidators{
return (control: AbstractControl): ValidationErrors | null=>{ return (control: AbstractControl): ValidationErrors | null=>{
const pages = control.get(pagesArrayName) as FormArray; const pages = control.get(pagesArrayName) as UntypedFormArray;
const sections = control.get(sectionsArrayName) as FormArray; const sections = control.get(sectionsArrayName) as UntypedFormArray;
const pageIdsArray = pages.controls.map(page=>page.get('id').value); const pageIdsArray = pages.controls.map(page=>page.get('id').value);
@ -42,8 +42,8 @@ export class EditorCustomValidators{
return (control: AbstractControl): ValidationErrors | null=>{ return (control: AbstractControl): ValidationErrors | null=>{
const fieldsets = control.get(fieldsetsArrayName) as FormArray; const fieldsets = control.get(fieldsetsArrayName) as UntypedFormArray;
const sections = control.get(sectionsArrayName) as FormArray; const sections = control.get(sectionsArrayName) as UntypedFormArray;
if((fieldsets && fieldsets.length) || (sections && sections.length)){ 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 { UserInfoListingModel } from '@app/core/model/user/user-info-listing';
import { DatasetProfile } from '../../../../core/model/admin/dataset-profile/dataset-profile'; import { DatasetProfile } from '../../../../core/model/admin/dataset-profile/dataset-profile';
import { BaseFormModel } from '../../../../core/model/base-form-model'; import { BaseFormModel } from '../../../../core/model/base-form-model';
@ -32,8 +32,8 @@ export class DatasetProfileEditorModel extends BaseFormModel {
return this; return this;
} }
buildForm(disabled: boolean = false, skipDisable: Array<String> = []): FormGroup { buildForm(disabled: boolean = false, skipDisable: Array<String> = []): UntypedFormGroup {
const formGroup: FormGroup = new FormBuilder().group({ const formGroup: UntypedFormGroup = new UntypedFormBuilder().group({
label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.label')) }, [Validators.required]], label: [{ value: this.label, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.label')) }, [Validators.required]],
description: [{ value: this.description, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.description')) }, [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]], 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')) }] users: [{ value: this.users, disabled: (disabled && !skipDisable.includes('DatasetProfileEditorModel.users')) }]
}); });
const sectionsFormArray = new Array<FormGroup>(); const sectionsFormArray = new Array<UntypedFormGroup>();
this.sections.forEach(item => { this.sections.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
sectionsFormArray.push(form); sectionsFormArray.push(form);
}); });
formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray)); formGroup.addControl('sections', this.formBuilder.array(sectionsFormArray));
const pagesFormArray = new Array<FormGroup>(); const pagesFormArray = new Array<UntypedFormGroup>();
this.pages.forEach(item => { this.pages.forEach(item => {
const form: FormGroup = item.buildForm(disabled, skipDisable); const form: UntypedFormGroup = item.buildForm(disabled, skipDisable);
pagesFormArray.push(form); pagesFormArray.push(form);
}); });
formGroup.addControl('pages', this.formBuilder.array(pagesFormArray)); formGroup.addControl('pages', this.formBuilder.array(pagesFormArray));

View File

@ -2,7 +2,7 @@
import { of as observableOf, Observable, combineLatest, BehaviorSubject,of } from 'rxjs'; import { of as observableOf, Observable, combineLatest, BehaviorSubject,of } from 'rxjs';
import { HttpClient, HttpErrorResponse } from '@angular/common/http'; import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit, QueryList, ViewChild } from '@angular/core'; 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 { MatDialog } from '@angular/material/dialog';
import { MatHorizontalStepper} from '@angular/material/stepper'; import { MatHorizontalStepper} from '@angular/material/stepper';
import { ActivatedRoute, ParamMap, Router } from '@angular/router'; import { ActivatedRoute, ParamMap, Router } from '@angular/router';
@ -71,8 +71,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
isClone = false; isClone = false;
isDeleted = false; isDeleted = false;
dataModel: DatasetProfileEditorModel; dataModel: DatasetProfileEditorModel;
form: FormGroup; form: UntypedFormGroup;
previewerFormGroup: FormGroup; previewerFormGroup: UntypedFormGroup;
private datasetProfileId: string; private datasetProfileId: string;
newVersionId: string; newVersionId: string;
dataWizardModel: DatasetWizardModel; dataWizardModel: DatasetWizardModel;
@ -116,7 +116,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
private enumUtils: EnumUtils, private enumUtils: EnumUtils,
private datasetWizardService: DatasetWizardService, private datasetWizardService: DatasetWizardService,
private visibilityRulesService: VisibilityRulesService, private visibilityRulesService: VisibilityRulesService,
private fb: FormBuilder, private fb: UntypedFormBuilder,
private sidenavService: SideNavService, private sidenavService: SideNavService,
private userService: UserService, private userService: UserService,
private descriptionTemplateTypeService: DescriptionTemplateTypeService private descriptionTemplateTypeService: DescriptionTemplateTypeService
@ -289,8 +289,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const fieldSetHavingInvalidVisibilityRules:ToCEntry[] = fieldsetEntries const fieldSetHavingInvalidVisibilityRules:ToCEntry[] = fieldsetEntries
.filter(entry=>{ .filter(entry=>{
const fieldsFormGroup = entry.form.get('fields'); const fieldsFormGroup = entry.form.get('fields');
const invalid = (fieldsFormGroup as FormArray).controls.filter(field=>{ const invalid = (fieldsFormGroup as UntypedFormArray).controls.filter(field=>{
return this.hasInvalidVisibilityRule(field as FormGroup); return this.hasInvalidVisibilityRule(field as UntypedFormGroup);
}); });
if(invalid && invalid.length){ if(invalid && invalid.length){
@ -333,12 +333,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
if(fieldset.type != ToCEntryType.FieldSet){ if(fieldset.type != ToCEntryType.FieldSet){
return; return;
} }
const fields = fieldset.form.get('fields') as FormArray; const fields = fieldset.form.get('fields') as UntypedFormArray;
fields.controls.forEach(fieldControl=>{ fields.controls.forEach(fieldControl=>{
if(this.hasInvalidVisibilityRule(fieldControl as FormGroup)){ if(this.hasInvalidVisibilityRule(fieldControl as UntypedFormGroup)){
try{ try{
(fieldControl.get('visible').get('rules') as FormArray).clear(); (fieldControl.get('visible').get('rules') as UntypedFormArray).clear();
}catch{} }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; const renderStyle = field.get('viewStyle').get('renderStyle').value;
if(renderStyle && ![ if(renderStyle && ![
DatasetProfileFieldViewStyle.TextArea, DatasetProfileFieldViewStyle.TextArea,
@ -410,8 +410,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
onIsMultiplicityEnabledChange(isMultiplicityEnabled: boolean) { onIsMultiplicityEnabledChange(isMultiplicityEnabled: boolean) {
if (!isMultiplicityEnabled) { if (!isMultiplicityEnabled) {
(<FormControl>this.form.get('multiplicity').get('min')).setValue(0); (<UntypedFormControl>this.form.get('multiplicity').get('min')).setValue(0);
(<FormControl>this.form.get('multiplicity').get('max')).setValue(0); (<UntypedFormControl>this.form.get('multiplicity').get('max')).setValue(0);
} }
} }
@ -711,7 +711,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
datasetWizardModel: DatasetWizardEditorModel; datasetWizardModel: DatasetWizardEditorModel;
formGroup: FormGroup; formGroup: UntypedFormGroup;
getPreview() { getPreview() {
let data = this.form.getRawValue(); let data = this.form.getRawValue();
this.datasetProfileService.preview(data).subscribe(x => { this.datasetProfileService.preview(data).subscribe(x => {
@ -719,7 +719,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
datasetProfileDefinition: x datasetProfileDefinition: x
}); });
this.updateVisibilityRules(); 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())); //this.formGroupRawValue = JSON.parse(JSON.stringify(this.formGroup.getRawValue()));
@ -844,7 +844,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const result: ToCEntry[] = []; const result: ToCEntry[] = [];
//build parent pages //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({ result.push({
id: pageElement.get('id').value, id: pageElement.get('id').value,
label: pageElement.get('title').value, label: pageElement.get('title').value,
@ -856,7 +856,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}); });
// build first level sections // 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 currentSectionPageId = sectionElement.get('page').value;
const pageToAdd = result.filter(x => x.id == currentSectionPageId)[0]; const pageToAdd = result.filter(x => x.id == currentSectionPageId)[0];
if (pageToAdd.subEntries == null) pageToAdd.subEntries = []; if (pageToAdd.subEntries == null) pageToAdd.subEntries = [];
@ -868,8 +868,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
form: sectionElement, form: sectionElement,
numbering: pageToAdd.numbering + '.' + (pageToAdd.subEntries.length +1) numbering: pageToAdd.numbering + '.' + (pageToAdd.subEntries.length +1)
} as ToCEntry; } as ToCEntry;
const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering); const sectionItems = this.populateSections(sectionElement.get('sections') as UntypedFormArray, item.numbering);
const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering); const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as UntypedFormArray, item.numbering);
if (sectionItems != null) { if (sectionItems != null) {
item.subEntries = sectionItems; item.subEntries = sectionItems;
item.subEntriesType = ToCEntryType.Section; item.subEntriesType = ToCEntryType.Section;
@ -891,7 +891,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
return result; 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; } if (sections == null || sections.controls == null || sections.controls.length == 0) { return null; }
const result: ToCEntry[] = []; const result: ToCEntry[] = [];
@ -904,8 +904,8 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
form: sectionElement, form: sectionElement,
numbering: existingNumbering + '.' + (i + 1) numbering: existingNumbering + '.' + (i + 1)
} as ToCEntry; } as ToCEntry;
const sectionItems = this.populateSections(sectionElement.get('sections') as FormArray, item.numbering); const sectionItems = this.populateSections(sectionElement.get('sections') as UntypedFormArray, item.numbering);
const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as FormArray, item.numbering); const fieldSetItems = this.populateFieldSets(sectionElement.get('fieldSets') as UntypedFormArray, item.numbering);
if (sectionItems != null) { if (sectionItems != null) {
item.subEntries = sectionItems; item.subEntries = sectionItems;
item.subEntriesType = ToCEntryType.Section; item.subEntriesType = ToCEntryType.Section;
@ -924,7 +924,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
return result; 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; } if (fieldSets == null || fieldSets.controls == null || fieldSets.controls.length == 0) { return null; }
const result: ToCEntry[] = []; const result: ToCEntry[] = [];
@ -974,7 +974,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
//define entry type //define entry type
switch (tce.childType) { switch (tce.childType) {
case ToCEntryType.Page: 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 page: PageEditorModel = new PageEditorModel(pagesArray.length);
const pageForm = page.buildForm(); const pageForm = page.buildForm();
@ -990,10 +990,10 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const section: SectionEditorModel = new SectionEditorModel(); const section: SectionEditorModel = new SectionEditorModel();
section.id = Guid.create().toString(); section.id = Guid.create().toString();
let sectionsArray:FormArray; let sectionsArray:UntypedFormArray;
if (parent.type === ToCEntryType.Page) {//FIRST LEVEL SECTION 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; section.page = parent.id;
@ -1011,7 +1011,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
// this.form.updateValueAndValidity(); // this.form.updateValueAndValidity();
} else if( parent.type == ToCEntryType.Section) { //SUBSECTION OF SECTION } 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 //adding page parent MAYBE NOT NEEDED
section.page = parent.form.get('page').value; 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.setValidators(this.customEditorValidators.sectionHasAtLeastOneChildOf('fieldSets','sections'));
// sectionAdded.updateValueAndValidity(); // sectionAdded.updateValueAndValidity();
@ -1052,7 +1052,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
// fieldSet.fields.push(field); // fieldSet.fields.push(field);
// field.ordinal = fieldSet.fields.length-1; // 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 //give fieldset id and ordinal
const fieldSet: FieldSetEditorModel = new FieldSetEditorModel(); 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); fieldSetsArray.push(fieldsetForm);
this.refreshToCEntries(); this.refreshToCEntries();
@ -1110,12 +1110,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
//define entry type //define entry type
switch (tce.type) { switch (tce.type) {
case ToCEntryType.Page: case ToCEntryType.Page:
const pages = this.form.get('pages') as FormArray; const pages = this.form.get('pages') as UntypedFormArray;
let pageIndex = -1; let pageIndex = -1;
//get the index //get the index
for (let i = 0; i < pages.length; i++) { 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) { if (page.controls.id.value === tce.id) {
pageIndex = i; pageIndex = i;
@ -1129,7 +1129,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
pages.removeAt(pageIndex); pages.removeAt(pageIndex);
//clean up sections of removed page //clean up sections of removed page
const sections = (this.form.get('sections') as FormArray); const sections = (this.form.get('sections') as UntypedFormArray);
const sectionsIndexToBeRemoved = []; const sectionsIndexToBeRemoved = [];
@ -1161,7 +1161,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
let index = -1; 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++) { for (let i = 0; i < sections.length; i++) {
@ -1177,7 +1177,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
if (index >= 0) { //section found if (index >= 0) { //section found
const sections = (this.form.get('sections') as FormArray); const sections = (this.form.get('sections') as UntypedFormArray);
//remove section //remove section
this._updateSelectedItem(tce); this._updateSelectedItem(tce);
@ -1190,7 +1190,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
} else {//NOT FOUND IN FIRST LEVEL CASE } else {//NOT FOUND IN FIRST LEVEL CASE
//LOOK FOR SUBSECTION 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++) { for (let i = 0; i < parentFormArray.length; i++) {
let section = parentFormArray.at(i); let section = parentFormArray.at(i);
@ -1215,7 +1215,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
break; break;
case ToCEntryType.FieldSet: case ToCEntryType.FieldSet:
const parentFormArray = tce.form.parent as FormArray; const parentFormArray = tce.form.parent as UntypedFormArray;
let idx = -1; let idx = -1;
@ -1263,7 +1263,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
}else{ }else{
//if first level section //if first level section
const firstLevelSections = (this.form.get('sections') as FormArray); const firstLevelSections = (this.form.get('sections') as UntypedFormArray);
let isFirstLevel: boolean = false; let isFirstLevel: boolean = false;
firstLevelSections.controls.forEach(section=>{ firstLevelSections.controls.forEach(section=>{
if(section.get('id').value === tce.id){ if(section.get('id').value === tce.id){
@ -1323,7 +1323,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
} }
get numOfPages(){ get numOfPages(){
return (<FormArray>this.form.get('pages')).length; return (<UntypedFormArray>this.form.get('pages')).length;
} }
// getSectionIndex(): number{ // getSectionIndex(): number{
@ -1353,12 +1353,12 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
// return subForm; // 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; } if (formGroup.get('title') && formGroup.get('title').value && formGroup.get('title').value.length > 0) { return formGroup.get('title').value; }
return "Field " + (index + 1); return "Field " + (index + 1);
} }
deleteFieldSet(formArray: FormArray, index: number) { deleteFieldSet(formArray: UntypedFormArray, index: number) {
formArray.removeAt(index); formArray.removeAt(index);
} }
@ -1475,7 +1475,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
const fieldSets = this._getFieldSets(this.getTocEntries()); const fieldSets = this._getFieldSets(this.getTocEntries());
fieldSets.forEach(fs=>{ fieldSets.forEach(fs=>{
const fields = fs.form.get('fields') as FormArray; const fields = fs.form.get('fields') as UntypedFormArray;
if(fields){ if(fields){
fields.controls.forEach(field=>{ fields.controls.forEach(field=>{
const rulesArray = field.get('visible').get('rules').value; 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.hasCommentField = fs.form.get('hasCommentField').value;
fieldset.title = fs.label; fieldset.title = fs.label;
// fieldset.fields = (fs.form.get('fields') as FormArray).getRawValue(); // 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(); 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.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.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.defaultValue = fieldModel.value;
fieldModel.page = field.get('page').value; fieldModel.page = field.get('page').value;
fieldModel.validations = field.get('validations').value; fieldModel.validations = field.get('validations').value;
@ -1639,9 +1639,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
this.form.markAsDirty(); this.form.markAsDirty();
} }
cloneFieldSet(fieldset: FormGroup){ cloneFieldSet(fieldset: UntypedFormGroup){
const values = fieldset.getRawValue(); const values = fieldset.getRawValue();
const parentArray = fieldset.parent as FormArray; const parentArray = fieldset.parent as UntypedFormArray;
values.id = Guid.create().toString(); values.id = Guid.create().toString();
values.ordinal = parentArray.length; values.ordinal = parentArray.length;
@ -1813,7 +1813,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
result.forEach((err,i)=>{ result.forEach((err,i)=>{
fieldsets.filter(fs=>{ fieldsets.filter(fs=>{
let fieldFound = false; 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){ if(field.get('id').value === err.id){
fieldFound = true; fieldFound = true;
indexes.push(i); indexes.push(i);
@ -1886,9 +1886,9 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
let controlType = 'control'; let controlType = 'control';
if(aControl instanceof FormGroup) controlType="fg" if(aControl instanceof UntypedFormGroup) controlType="fg"
if(aControl instanceof FormControl) controlType="fc"; if(aControl instanceof UntypedFormControl) controlType="fc";
if(aControl instanceof FormArray) controlType="fa"; if(aControl instanceof UntypedFormArray) controlType="fa";
const invalidControls:InvalidControl[] = []; const invalidControls:InvalidControl[] = [];
@ -1896,14 +1896,14 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
switch (controlType){ switch (controlType){
case 'fg': case 'fg':
const controls = (aControl as FormGroup).controls; const controls = (aControl as UntypedFormGroup).controls;
const keys = Object.keys(controls); const keys = Object.keys(controls);
keys.forEach(key=>{ keys.forEach(key=>{
const control = controls[key]; const control = controls[key];
if(!control.invalid) return; //// !!!!! Important to be !invalid. (In case the template is finalized) if(!control.invalid) return; //// !!!!! Important to be !invalid. (In case the template is finalized)
if(control instanceof FormControl){ if(control instanceof UntypedFormControl){
const ctrl = control as FormControl; const ctrl = control as UntypedFormControl;
invalidControls.push({ invalidControls.push({
errors:ctrl.errors, errors:ctrl.errors,
@ -1957,15 +1957,15 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
break; break;
case 'fa': case 'fa':
// const fa = (aControl as FormArray); // const fa = (aControl as FormArray);
const ctrls = (aControl as FormArray).controls; const ctrls = (aControl as UntypedFormArray).controls;
const keys_ = Object.keys(ctrls); const keys_ = Object.keys(ctrls);
keys_.forEach(key=>{ keys_.forEach(key=>{
const control = ctrls[key]; const control = ctrls[key];
if(control.valid) return; if(control.valid) return;
if(control instanceof FormControl){ //for completion purposes. should never run this case if(control instanceof UntypedFormControl){ //for completion purposes. should never run this case
const ctrl = control as FormControl; const ctrl = control as UntypedFormControl;
invalidControls.push({ invalidControls.push({
errors:ctrl.errors, errors:ctrl.errors,
id: ctrl.get('id')? ctrl.get('id').value: null, id: ctrl.get('id')? ctrl.get('id').value: null,
@ -2056,7 +2056,7 @@ export class DatasetProfileEditorComponent extends CheckDeactivateBaseComponent
try{ try{
fieldsets.forEach(fs=>{ fieldsets.forEach(fs=>{
fs.form.get('title').setValidators(Validators.required); 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){ if(fieldsF){
fieldsF.controls.forEach(field=>{ fieldsF.controls.forEach(field=>{
const renderStyleValue = field.get('viewStyle').get('renderStyle').value; 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 { CdkDrag, CdkDragDrop, CdkDropList, moveItemInArray } from '@angular/cdk/drag-drop';
import { DOCUMENT } from '@angular/common'; import { DOCUMENT } from '@angular/common';
import { Component, EventEmitter, Inject, Input, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'; 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 { BaseComponent } from '@common/base/base.component';
import { NewEntryType, ToCEntry, ToCEntryType } from '../table-of-contents-entry'; 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){ if(this.parentLink.type === this.tocEntryType.Page && allFieldsAreTouched){
const rootForm = form.root; const rootForm = form.root;
if(rootForm){ 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)){ if(!sections.controls.find(section=>section.get('page').value === this.parentLink.id)){
return true; return true;
} }
@ -227,8 +227,8 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent
//checking first child form controls if have errors //checking first child form controls if have errors
let hasErrors = false; let hasErrors = false;
if(allFieldsAreTouched){ if(allFieldsAreTouched){
if(form instanceof FormGroup){ if(form instanceof UntypedFormGroup){
const formGroup = form as FormGroup; const formGroup = form as UntypedFormGroup;
const controls = Object.keys(formGroup.controls); const controls = Object.keys(formGroup.controls);
@ -249,10 +249,10 @@ export class DatasetProfileTableOfContentsInternalSection extends BaseComponent
if(!aControl|| aControl.untouched) return false; if(!aControl|| aControl.untouched) return false;
if(aControl instanceof FormControl){ if(aControl instanceof UntypedFormControl){
return aControl.touched; return aControl.touched;
}else if(aControl instanceof FormGroup){ }else if(aControl instanceof UntypedFormGroup){
const controlKeys = Object.keys((aControl as FormGroup).controls); const controlKeys = Object.keys((aControl as UntypedFormGroup).controls);
let areAllTouched = true; let areAllTouched = true;
controlKeys.forEach(key=>{ controlKeys.forEach(key=>{
if(!this.allFieldsAreTouched(aControl.get(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); // const areAllTouched = controlKeys.reduce((acc, key)=>acc && this._allFieldsAreTouched(aControl.get(key)), true);
return areAllTouched; return areAllTouched;
}else if(aControl instanceof FormArray){ }else if(aControl instanceof UntypedFormArray){
const controls = (aControl as FormArray).controls; const controls = (aControl as UntypedFormArray).controls;
// const areAllTouched = controls.reduce((acc, control)=>acc && this._allFieldsAreTouched(control), true); // const areAllTouched = controls.reduce((acc, control)=>acc && this._allFieldsAreTouched(control), true);
let areAllTouched = true; let areAllTouched = true;
// controls.reduce((acc, control)=>acc && this._allFieldsAreTouched(control), 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 { SimpleChanges } from '@angular/core';
import { NewEntryType, TableUpdateInfo, ToCEntry, ToCEntryType } from './table-of-contents-entry'; import { NewEntryType, TableUpdateInfo, ToCEntry, ToCEntryType } from './table-of-contents-entry';
import { DragulaService } from 'ng2-dragula'; import { DragulaService } from 'ng2-dragula';
import { FormArray } from '@angular/forms'; import { UntypedFormArray } from '@angular/forms';
import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
import { ContentObserver } from '@angular/cdk/observers'; import { ContentObserver } from '@angular/cdk/observers';
@ -119,7 +119,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
} }
//check if target container has no sections //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 = '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'); const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL');
this.notifyUser(message); this.notifyUser(message);
@ -129,8 +129,8 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
} }
const fieldsetForm = element.form; const fieldsetForm = element.form;
const targetFieldsets = targetContainer.form.get('fieldSets') as FormArray; const targetFieldsets = targetContainer.form.get('fieldSets') as UntypedFormArray;
const sourceFieldsets = sourceContainer.form.get('fieldSets') as FormArray; const sourceFieldsets = sourceContainer.form.get('fieldSets') as UntypedFormArray;
if(!targetFieldsets){ if(!targetFieldsets){
console.info('Not target fieldsets container found'); console.info('Not target fieldsets container found');
@ -197,7 +197,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
case ToCEntryType.Section:{ case ToCEntryType.Section:{
if(targetContainer.type == 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 = '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');; const message = this.language.instant('DATASET-PROFILE-EDITOR.STEPS.FORM.TABLE-OF-CONTENTS.ERROR-MESSAGES.INPUT-SECTION-SAME-LEVEL');;
this.notifyUser(message); this.notifyUser(message);
@ -206,9 +206,9 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
return; return;
} }
const targetSections = targetContainer.form.get('sections') as FormArray; const targetSections = targetContainer.form.get('sections') as UntypedFormArray;
const elementSectionForm = element.form; const elementSectionForm = element.form;
const sourceSections = elementSectionForm.parent as FormArray; const sourceSections = elementSectionForm.parent as UntypedFormArray;
if(!(targetSections && sourceSections && elementSectionForm)){ if(!(targetSections && sourceSections && elementSectionForm)){
console.info('Could not load sections'); console.info('Could not load sections');
@ -269,7 +269,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
const rootform = targetContainer.form.root; const rootform = targetContainer.form.root;
const sectionForm = element.form; const sectionForm = element.form;
const parentSections = sectionForm.parent as FormArray; const parentSections = sectionForm.parent as UntypedFormArray;
let parentIndex = -1; let parentIndex = -1;
parentSections.controls.forEach((section,i )=>{ parentSections.controls.forEach((section,i )=>{
@ -301,7 +301,7 @@ export class DatasetProfileTableOfContents extends BaseComponent implements OnIn
position = targetContainer.subEntries.length; position = targetContainer.subEntries.length;
} }
//populate sections //populate sections
const targetSectionsArray = rootform.get('sections') as FormArray; const targetSectionsArray = rootform.get('sections') as UntypedFormArray;
if(sibling && sibling.id){ 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; const pageForm = element.form;
let index = -1; let index = -1;

View File

@ -1,5 +1,5 @@
import { AfterViewInit, Component, OnInit } from '@angular/core'; 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 { ActivatedRoute, ParamMap, Router } from '@angular/router';
import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status'; import { DescriptionTemplateTypeStatus } from '@app/core/common/enum/description-template-type-status';
import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; 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 { export class DescriptionTypeEditorComponent extends BaseComponent implements OnInit {
formGroup: FormGroup = null; formGroup: UntypedFormGroup = null;
descriptionTypeModel: DescriptionTypeEditorModel; descriptionTypeModel: DescriptionTypeEditorModel;
isNew = true; isNew = true;
@ -142,9 +142,9 @@ export class DescriptionTypeEditorModel {
return this; return this;
} }
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); } if (context == null) { context = this.createValidationContext(); }
const formGroup = new FormBuilder().group({ const formGroup = new UntypedFormBuilder().group({
id: [this.id], id: [this.id],
name: [{ value: this.name, disabled: disabled }, context.getValidation('name').validators], name: [{ value: this.name, disabled: disabled }, context.getValidation('name').validators],
status: [{ value: this.status, disabled: disabled }, context.getValidation('status').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, DmpProfileCriteriaComponent,
DialodConfirmationUploadDmpProfiles, DialodConfirmationUploadDmpProfiles,
DmpProfileExternalAutocompleteFieldEditorComponent DmpProfileExternalAutocompleteFieldEditorComponent
],
entryComponents: [
DialodConfirmationUploadDmpProfiles
] ]
}) })
export class DmpProfileModule { } 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 { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, FieldCategory, FieldInSection, SectionDmpBlueprint } from "@app/core/model/dmp/dmp-blueprint/dmp-blueprint";
import { BackendErrorValidator } from "@common/forms/validation/custom-validator"; import { BackendErrorValidator } from "@common/forms/validation/custom-validator";
import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model"; import { ValidationErrorModel } from "@common/forms/validation/error-model/validation-error-model";
@ -23,9 +23,9 @@ export class DmpBlueprintEditor {
return this; return this;
} }
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); } 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')], id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
label: [{ value: this.label, disabled: disabled }, context.getValidation('label')], label: [{ value: this.label, disabled: disabled }, context.getValidation('label')],
status: [{ value: this.status, disabled: disabled }, context.getValidation('status')], status: [{ value: this.status, disabled: disabled }, context.getValidation('status')],
@ -58,12 +58,12 @@ export class DmpBlueprintDefinitionEditor {
return this; return this;
} }
buildForm(): FormGroup { buildForm(): UntypedFormGroup {
const formBuilder = new FormBuilder(); const formBuilder = new UntypedFormBuilder();
const formGroup = formBuilder.group({}); const formGroup = formBuilder.group({});
const sectionsFormArray = new Array<FormGroup>(); const sectionsFormArray = new Array<UntypedFormGroup>();
this.sections.forEach(item => { this.sections.forEach(item => {
const form: FormGroup = item.buildForm(); const form: UntypedFormGroup = item.buildForm();
sectionsFormArray.push(form); sectionsFormArray.push(form);
}); });
formGroup.addControl('sections', formBuilder.array(sectionsFormArray)); formGroup.addControl('sections', formBuilder.array(sectionsFormArray));
@ -92,25 +92,25 @@ export class SectionDmpBlueprintEditor {
return this; return this;
} }
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); } 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')], id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
label: [{ value: this.label, disabled: disabled }, context.getValidation('label')], label: [{ value: this.label, disabled: disabled }, context.getValidation('label')],
description: [{ value: this.description, disabled: disabled }, context.getValidation('description')], description: [{ value: this.description, disabled: disabled }, context.getValidation('description')],
ordinal: [{ value: this.ordinal, disabled: disabled }, context.getValidation('ordinal')], ordinal: [{ value: this.ordinal, disabled: disabled }, context.getValidation('ordinal')],
hasTemplates: [{ value: this.hasTemplates, disabled: disabled }, context.getValidation('hasTemplates')] hasTemplates: [{ value: this.hasTemplates, disabled: disabled }, context.getValidation('hasTemplates')]
}); });
const formBuilder = new FormBuilder(); const formBuilder = new UntypedFormBuilder();
const fieldsFormArray = new Array<FormGroup>(); const fieldsFormArray = new Array<UntypedFormGroup>();
this.fields.forEach(item => { this.fields.forEach(item => {
const form: FormGroup = item.buildForm(); const form: UntypedFormGroup = item.buildForm();
fieldsFormArray.push(form); fieldsFormArray.push(form);
}); });
formGroup.addControl('fields', formBuilder.array(fieldsFormArray)); formGroup.addControl('fields', formBuilder.array(fieldsFormArray));
const descriptionTemplatesFormArray = new Array<FormGroup>(); const descriptionTemplatesFormArray = new Array<UntypedFormGroup>();
this.descriptionTemplates.forEach(item => { this.descriptionTemplates.forEach(item => {
const form: FormGroup = item.buildForm(); const form: UntypedFormGroup = item.buildForm();
descriptionTemplatesFormArray.push(form); descriptionTemplatesFormArray.push(form);
}); });
formGroup.addControl('descriptionTemplates', formBuilder.array(descriptionTemplatesFormArray)); formGroup.addControl('descriptionTemplates', formBuilder.array(descriptionTemplatesFormArray));
@ -152,9 +152,9 @@ export class FieldInSectionEditor {
return this; return this;
} }
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); } 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')], id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
category: [{ value: this.category, disabled: disabled }, context.getValidation('category')], category: [{ value: this.category, disabled: disabled }, context.getValidation('category')],
type: [{ value: this.type, disabled: disabled }, context.getValidation('type')], type: [{ value: this.type, disabled: disabled }, context.getValidation('type')],
@ -198,9 +198,9 @@ export class DescriptionTemplatesInSectionEditor {
return this; return this;
} }
buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup { buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
if (context == null) { context = this.createValidationContext(); } 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')], id: [{ value: this.id, disabled: disabled }, context.getValidation('id')],
descriptionTemplateId: [{ value: this.descriptionTemplateId, disabled: disabled }, context.getValidation('descriptionTemplateId')], descriptionTemplateId: [{ value: this.descriptionTemplateId, disabled: disabled }, context.getValidation('descriptionTemplateId')],
label: [{ value: this.label, disabled: disabled }, context.getValidation('label')], label: [{ value: this.label, disabled: disabled }, context.getValidation('label')],

View File

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

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