more description editor changes

This commit is contained in:
Diamantis Tziotzios 2024-02-07 14:15:25 +02:00
parent 2b436be2cd
commit 8bf262693f
17 changed files with 261 additions and 519 deletions

View File

@ -387,6 +387,7 @@ public class DmpBlueprintServiceImpl implements DmpBlueprintService {
List<DmpBlueprintEntity> latestVersionDmpBlueprints = this.queryFactory.query(DmpBlueprintQuery.class) List<DmpBlueprintEntity> latestVersionDmpBlueprints = this.queryFactory.query(DmpBlueprintQuery.class)
.versionStatuses(DmpBlueprintVersionStatus.Current) .versionStatuses(DmpBlueprintVersionStatus.Current)
.isActive(IsActive.Active) .isActive(IsActive.Active)
.statuses(DmpBlueprintStatus.Finalized)
.groupIds(oldDmpBlueprintEntity.getGroupId()) .groupIds(oldDmpBlueprintEntity.getGroupId())
.collect(); .collect();
if (latestVersionDmpBlueprints.isEmpty()) if (latestVersionDmpBlueprints.isEmpty())

View File

@ -6,7 +6,7 @@ export enum DescriptionTemplateFieldType {
INTERNAL_DMP_ENTRIES = "internalDmpEntities", //Delete INTERNAL_DMP_ENTRIES = "internalDmpEntities", //Delete
INTERNAL_DMP_ENTRIES_RESEARCHERS = "internalDmpResearchers", INTERNAL_DMP_ENTRIES_RESEARCHERS = "internalDmpResearchers",
INTERNAL_DMP_ENTRIES_DMPS = "internalDmpDmps", INTERNAL_DMP_ENTRIES_DMPS = "internalDmpDmps",
INTERNAL_DMP_ENTRIES_DATASETS = "internalDmpDatasets", INTERNAL_ENTRIES_DESCRIPTIONS = "internalDmpDescriptions",
CHECK_BOX = "checkBox", CHECK_BOX = "checkBox",
FREE_TEXT = "freetext", FREE_TEXT = "freetext",
TEXT_AREA = "textarea", TEXT_AREA = "textarea",

View File

@ -39,12 +39,25 @@ export interface DescriptionPropertyDefinitionFieldSetItem {
} }
export interface DescriptionField { export interface DescriptionField {
value: string; textValue: string;
textListValue: string[];
dateValue: Date;
externalIdentifier?: DescriptionExternalIdentifier;
}
export interface DescriptionExternalIdentifier {
identifier: string;
type: string;
} }
export interface DescriptionReference extends BaseEntity { export interface DescriptionReference extends BaseEntity {
description?: Description; description?: Description;
reference?: Reference; reference?: Reference;
data?: DescriptionReferenceData;
}
export interface DescriptionReferenceData {
fieldId?: string;
} }
export interface DescriptionTag extends BaseEntity { export interface DescriptionTag extends BaseEntity {
@ -82,7 +95,16 @@ export interface DescriptionPropertyDefinitionFieldSetItemPersist {
} }
export interface DescriptionFieldPersist { export interface DescriptionFieldPersist {
value: string; textValue: string;
textListValue: string[];
dateValue: Date;
references: ReferencePersist[];
externalIdentifier?: DescriptionExternalIdentifierPersist;
}
export interface DescriptionExternalIdentifierPersist {
identifier: string;
type: string;
} }
export interface DescriptionReferencePersist { export interface DescriptionReferencePersist {

View File

@ -63,7 +63,7 @@ export class FieldValuePipe implements PipeTransform {
return this.parseJson(value); return this.parseJson(value);
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DATASETS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
return this.parseJson(value, 'label'); return this.parseJson(value, 'label');
case DescriptionTemplateFieldType.DATASET_IDENTIFIER: case DescriptionTemplateFieldType.DATASET_IDENTIFIER:
case DescriptionTemplateFieldType.VALIDATION: case DescriptionTemplateFieldType.VALIDATION:

View File

@ -164,7 +164,7 @@ export class EnumUtils {
case DescriptionTemplateFieldType.RADIO_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.RADIO-BOX'); case DescriptionTemplateFieldType.RADIO_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.RADIO-BOX');
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-RESEARCHERS'); case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-RESEARCHERS');
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DMPS'); case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DMPS');
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DATASETS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DATASETS'); case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.INTERNAL-DMP-ENTITIES-DATASETS');
case DescriptionTemplateFieldType.CHECK_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.CHECKBOX'); case DescriptionTemplateFieldType.CHECK_BOX: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.CHECKBOX');
case DescriptionTemplateFieldType.FREE_TEXT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.FREE-TEXT'); case DescriptionTemplateFieldType.FREE_TEXT: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.FREE-TEXT');
case DescriptionTemplateFieldType.TEXT_AREA: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.TEXT-AREA'); case DescriptionTemplateFieldType.TEXT_AREA: return this.language.instant('TYPES.DESCRIPTION-TEMPLATE-FIELD-TYPE.TEXT-AREA');

View File

@ -250,9 +250,9 @@
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon"> <img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DMPS)}} {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DMPS)}}
</button> </button>
<button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DATASETS)"> <button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon"> <img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DATASETS)}} {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS)}}
</button> </button>
<button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_RESEARCHERS)"> <button mat-list-item (click)="addNewInput(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_RESEARCHERS)">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon"> <img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="Internal Dmp icon">

View File

@ -533,7 +533,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon
} }
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DATASETS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
case DescriptionTemplateFieldType.DATA_REPOSITORIES: case DescriptionTemplateFieldType.DATA_REPOSITORIES:
case DescriptionTemplateFieldType.JOURNAL_REPOSITORIES: case DescriptionTemplateFieldType.JOURNAL_REPOSITORIES:
case DescriptionTemplateFieldType.PUB_REPOSITORIES: case DescriptionTemplateFieldType.PUB_REPOSITORIES:

View File

@ -143,9 +143,9 @@
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon"> <img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DMPS)}} {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DMPS)}}
</mat-option> </mat-option>
<mat-option [value]="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DATASETS"> <mat-option [value]="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon"> <img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon">
{{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DATASETS)}} {{enumUtils.toDescriptionTemplateFieldTypeString(descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS)}}
</mat-option> </mat-option>
<mat-option [value]="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_RESEARCHERS"> <mat-option [value]="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_RESEARCHERS">
<img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon"> <img src="/assets/images/editor/icons/api_entity.svg" class="input_icon" alt="InternalDmpEntities icon">
@ -229,7 +229,7 @@
<app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_RESEARCHERS" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component> <app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_RESEARCHERS" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component>
<app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DMPS" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component> <app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DMPS" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component>
<app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DATASETS" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component> <app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component>
<app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATA_REPOSITORIES" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component> <app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATA_REPOSITORIES" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component>
<app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.JOURNAL_REPOSITORIES" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component> <app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.JOURNAL_REPOSITORIES" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component>
<app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.PUB_REPOSITORIES" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component> <app-description-template-editor-multiplicity-field-component *ngSwitchCase="descriptionTemplateFieldTypeEnum.PUB_REPOSITORIES" class="col-12" [form]="form"></app-description-template-editor-multiplicity-field-component>

View File

@ -178,7 +178,7 @@ export class DescriptionTemplateEditorFieldComponent extends BaseComponent imple
} }
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DATASETS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
case DescriptionTemplateFieldType.DATA_REPOSITORIES: case DescriptionTemplateFieldType.DATA_REPOSITORIES:
case DescriptionTemplateFieldType.JOURNAL_REPOSITORIES: case DescriptionTemplateFieldType.JOURNAL_REPOSITORIES:
case DescriptionTemplateFieldType.PUB_REPOSITORIES: case DescriptionTemplateFieldType.PUB_REPOSITORIES:

View File

@ -821,7 +821,7 @@ export class DescriptionTemplateFieldEditorModel implements DescriptionTemplateF
return new DescriptionTemplateLabelDataEditorModel(this.validationErrorModel); return new DescriptionTemplateLabelDataEditorModel(this.validationErrorModel);
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS:
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DATASETS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
case DescriptionTemplateFieldType.DATA_REPOSITORIES: case DescriptionTemplateFieldType.DATA_REPOSITORIES:
case DescriptionTemplateFieldType.JOURNAL_REPOSITORIES: case DescriptionTemplateFieldType.JOURNAL_REPOSITORIES:
case DescriptionTemplateFieldType.PUB_REPOSITORIES: case DescriptionTemplateFieldType.PUB_REPOSITORIES:

View File

@ -57,7 +57,7 @@
<div class="col-auto d-flex align-items-center"> <div class="col-auto d-flex align-items-center">
<button [disabled]="saving" *ngIf="!lockStatus && !viewOnly" mat-raised-button class="description-save-btn mr-2" type="button"> <button [disabled]="saving" *ngIf="!lockStatus && !viewOnly" mat-raised-button class="description-save-btn mr-2" type="button">
<span class="d-flex flex-row row"> <span class="d-flex flex-row row">
<span (click)="!saving?save():null" class="col">{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE' | translate }}</span> <span (click)="!saving?formSubmit():null" class="col">{{ 'DESCRIPTION-EDITOR.ACTIONS.SAVE' | translate }}</span>
<mat-divider [vertical]="true"></mat-divider> <mat-divider [vertical]="true"></mat-divider>
<span *ngIf="!saving" class="align-items-center justify-content-center col-4 d-flex" (click)="$event.stopPropagation();" [matMenuTriggerFor]="menu"> <span *ngIf="!saving" class="align-items-center justify-content-center col-4 d-flex" (click)="$event.stopPropagation();" [matMenuTriggerFor]="menu">
<mat-icon>expand_more</mat-icon> <mat-icon>expand_more</mat-icon>

View File

@ -13,8 +13,6 @@ import {
} from '@app/core/services/notification/ui-notification-service'; } from '@app/core/services/notification/ui-notification-service';
import { FileUtils } from '@app/core/services/utilities/file-utils.service'; import { FileUtils } from '@app/core/services/utilities/file-utils.service';
import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component'; import { PopupNotificationDialogComponent } from '@app/library/notification/popup/popup-notification.component';
// import { IBreadCrumbComponent } from '@app/ui/misc/breadcrumb/definition/IBreadCrumbComponent';
// import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-item';
import { DatePipe } from '@angular/common'; import { DatePipe } from '@angular/common';
import { IsActive } from '@app/core/common/enum/is-active.enum'; import { IsActive } from '@app/core/common/enum/is-active.enum';
import { AppPermission } from '@app/core/common/enum/permission.enum'; import { AppPermission } from '@app/core/common/enum/permission.enum';
@ -611,9 +609,9 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
formSubmit(): void { formSubmit(): void {
this.formService.touchAllFormFields(this.formGroup); this.formService.touchAllFormFields(this.formGroup);
if (!this.isFormValid()) { // if (!this.isFormValid()) {
return; // return;
} // }
this.persistEntity(); this.persistEntity();
} }
@ -785,7 +783,7 @@ export class DescriptionEditorComponent extends BaseEditor<DescriptionEditorMode
this.descriptionTemplateService.getSingle(descriptionTemplateId, DescriptionEditorResolver.descriptionTemplateLookupFields()).pipe(takeUntil(this._destroyed)).subscribe(descriptionTemplate => { this.descriptionTemplateService.getSingle(descriptionTemplateId, DescriptionEditorResolver.descriptionTemplateLookupFields()).pipe(takeUntil(this._destroyed)).subscribe(descriptionTemplate => {
this.editorModel.properties = new DescriptionPropertyDefinitionEditorModel().fromModel(null, descriptionTemplate); this.editorModel.properties = new DescriptionPropertyDefinitionEditorModel().fromModel(null, descriptionTemplate, null);
this.formGroup.removeControl('properties'); this.formGroup.removeControl('properties');
this.formGroup.addControl('properties', this.editorModel.buildProperties()); this.formGroup.addControl('properties', this.editorModel.buildProperties());
this.item.descriptionTemplate = descriptionTemplate; this.item.descriptionTemplate = descriptionTemplate;

View File

@ -1,7 +1,8 @@
import { FormControl, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms"; import { FormControl, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
import { DescriptionStatus } from "@app/core/common/enum/description-status"; import { DescriptionStatus } from "@app/core/common/enum/description-status";
import { DescriptionTemplate, DescriptionTemplateFieldSet, DescriptionTemplateSection } from "@app/core/model/description-template/description-template"; import { IsActive } from "@app/core/common/enum/is-active.enum";
import { Description, DescriptionField, DescriptionFieldPersist, DescriptionPersist, DescriptionPropertyDefinition, DescriptionPropertyDefinitionFieldSet, DescriptionPropertyDefinitionFieldSetItem, DescriptionPropertyDefinitionFieldSetItemPersist, DescriptionPropertyDefinitionFieldSetPersist, DescriptionPropertyDefinitionPersist, DescriptionReference, DescriptionReferencePersist } from "@app/core/model/description/description"; import { DescriptionTemplate, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateSection } from "@app/core/model/description-template/description-template";
import { Description, DescriptionExternalIdentifier, DescriptionExternalIdentifierPersist, DescriptionField, DescriptionFieldPersist, DescriptionPersist, DescriptionPropertyDefinition, DescriptionPropertyDefinitionFieldSet, DescriptionPropertyDefinitionFieldSetItem, DescriptionPropertyDefinitionFieldSetItemPersist, DescriptionPropertyDefinitionFieldSetPersist, DescriptionPropertyDefinitionPersist, DescriptionReference, DescriptionReferencePersist } from "@app/core/model/description/description";
import { ReferencePersist } from "@app/core/model/reference/reference"; import { ReferencePersist } from "@app/core/model/reference/reference";
import { BaseEditorModel } from "@common/base/base-form-editor-model"; import { BaseEditorModel } from "@common/base/base-form-editor-model";
import { BackendErrorValidator } from '@common/forms/validation/custom-validator'; import { BackendErrorValidator } from '@common/forms/validation/custom-validator';
@ -36,7 +37,7 @@ export class DescriptionEditorModel extends BaseEditorModel implements Descripti
this.status = item.status; this.status = item.status;
this.description = item.description; this.description = item.description;
this.tags = item.descriptionTags?.map(x => x.tag?.label); this.tags = item.descriptionTags?.map(x => x.tag?.label);
this.properties = new DescriptionPropertyDefinitionEditorModel().fromModel(item.properties, descriptionTemplate); this.properties = new DescriptionPropertyDefinitionEditorModel().fromModel(item.properties, descriptionTemplate, item.descriptionReferences);
//if (item.references) { item.references.map(x => this.references.push(new DescriptionReferenceEditorModel().fromModel(x))); } //if (item.references) { item.references.map(x => this.references.push(new DescriptionReferenceEditorModel().fromModel(x))); }
} }
return this; return this;
@ -91,8 +92,8 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { } ) { }
public fromModel(item: DescriptionPropertyDefinition, descriptionTemplate: DescriptionTemplate): DescriptionPropertyDefinitionEditorModel { public fromModel(item: DescriptionPropertyDefinition, descriptionTemplate: DescriptionTemplate, descriptionReferences: DescriptionReference[]): DescriptionPropertyDefinitionEditorModel {
this.fieldSets = this.calculateProperties(item, descriptionTemplate); this.fieldSets = this.calculateProperties(item, descriptionTemplate, descriptionReferences);
return this; return this;
} }
@ -135,14 +136,14 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
return baseContext; return baseContext;
} }
private calculateProperties(item: DescriptionPropertyDefinition, descriptionTemplate: DescriptionTemplate,): Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> { private calculateProperties(item: DescriptionPropertyDefinition, descriptionTemplate: DescriptionTemplate, descriptionReferences: DescriptionReference[]): Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> {
let result: Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> = new Map<string, DescriptionPropertyDefinitionFieldSetEditorModel>(); let result: Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> = new Map<string, DescriptionPropertyDefinitionFieldSetEditorModel>();
if (descriptionTemplate) ( if (descriptionTemplate) (
descriptionTemplate.definition.pages.forEach(definitionPage => { descriptionTemplate.definition.pages.forEach(definitionPage => {
definitionPage.sections.forEach(definitionSection => { definitionPage.sections.forEach(definitionSection => {
const sectionResult = this.calculateSectionProperties(definitionSection, item); const sectionResult = this.calculateSectionProperties(definitionSection, item, descriptionReferences);
if (sectionResult != null) { if (sectionResult != null) {
result = new Map([...result, ...sectionResult]); result = new Map([...result, ...sectionResult]);
} }
@ -152,12 +153,12 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
return result; return result;
} }
private calculateSectionProperties(definitionSection: DescriptionTemplateSection, item: DescriptionPropertyDefinition): Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> { private calculateSectionProperties(definitionSection: DescriptionTemplateSection, item: DescriptionPropertyDefinition, descriptionReferences: DescriptionReference[]): Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> {
if (definitionSection == null) return null; if (definitionSection == null) return null;
let result: Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> = new Map<string, DescriptionPropertyDefinitionFieldSetEditorModel>(); let result: Map<string, DescriptionPropertyDefinitionFieldSetEditorModel> = new Map<string, DescriptionPropertyDefinitionFieldSetEditorModel>();
definitionSection?.fieldSets?.forEach(definitionFieldSet => { definitionSection?.fieldSets?.forEach(definitionFieldSet => {
const fieldSetResult = this.calculateFieldSetProperties(definitionFieldSet, item); const fieldSetResult = this.calculateFieldSetProperties(definitionFieldSet, item, descriptionReferences);
if (fieldSetResult != null) { if (fieldSetResult != null) {
result.set(definitionFieldSet.id, fieldSetResult); result.set(definitionFieldSet.id, fieldSetResult);
} }
@ -165,7 +166,7 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
if (definitionSection.sections != null && definitionSection.sections?.length > 0) { if (definitionSection.sections != null && definitionSection.sections?.length > 0) {
definitionSection.sections.forEach(nestedDefinitionSection => { definitionSection.sections.forEach(nestedDefinitionSection => {
const nestedSectionResult = this.calculateSectionProperties(nestedDefinitionSection, item); const nestedSectionResult = this.calculateSectionProperties(nestedDefinitionSection, item, descriptionReferences);
if (nestedSectionResult != null) { if (nestedSectionResult != null) {
result = new Map([...result, ...nestedSectionResult]); result = new Map([...result, ...nestedSectionResult]);
} }
@ -175,7 +176,7 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
return result; return result;
} }
public calculateFieldSetProperties(definitionFieldSet: DescriptionTemplateFieldSet, item: DescriptionPropertyDefinition): DescriptionPropertyDefinitionFieldSetEditorModel { public calculateFieldSetProperties(definitionFieldSet: DescriptionTemplateFieldSet, item: DescriptionPropertyDefinition, descriptionReferences: DescriptionReference[]): DescriptionPropertyDefinitionFieldSetEditorModel {
if (definitionFieldSet == null) return null; if (definitionFieldSet == null) return null;
// current saved values // current saved values
@ -186,14 +187,19 @@ export class DescriptionPropertyDefinitionEditorModel implements DescriptionProp
const fields = new Map<string, DescriptionField>(); const fields = new Map<string, DescriptionField>();
definitionFieldSet.fields.forEach(definitionField => { definitionFieldSet.fields.forEach(definitionField => {
fields.set(definitionField.id, { value: undefined }); fields.set(definitionField.id, {
textValue: undefined,
textListValue: undefined,
dateValue: undefined,
externalIdentifier: undefined,
});
}) })
fieldSetValue.items = [{ fieldSetValue.items = [{
fields: fields fields: fields
} as DescriptionPropertyDefinitionFieldSetItem] } as DescriptionPropertyDefinitionFieldSetItem]
} }
return new DescriptionPropertyDefinitionFieldSetEditorModel().fromModel(fieldSetValue); return new DescriptionPropertyDefinitionFieldSetEditorModel().fromModel(fieldSetValue, descriptionReferences, definitionFieldSet);
} }
} }
@ -206,9 +212,9 @@ export class DescriptionPropertyDefinitionFieldSetEditorModel implements Descrip
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { } ) { }
public fromModel(item: DescriptionPropertyDefinitionFieldSet): DescriptionPropertyDefinitionFieldSetEditorModel { public fromModel(item: DescriptionPropertyDefinitionFieldSet, descriptionReferences: DescriptionReference[], definitionFieldSet: DescriptionTemplateFieldSet): DescriptionPropertyDefinitionFieldSetEditorModel {
if (item) { if (item) {
if (item.items) { item.items.map(x => this.items.push(new DescriptionPropertyDefinitionFieldSetItemEditorModel().fromModel(x))); } if (item.items) { item.items.map(x => this.items.push(new DescriptionPropertyDefinitionFieldSetItemEditorModel().fromModel(x, descriptionReferences, definitionFieldSet))); }
} }
return this; return this;
} }
@ -263,11 +269,11 @@ export class DescriptionPropertyDefinitionFieldSetItemEditorModel implements Des
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { } ) { }
public fromModel(item: DescriptionPropertyDefinitionFieldSetItem): DescriptionPropertyDefinitionFieldSetItemEditorModel { public fromModel(item: DescriptionPropertyDefinitionFieldSetItem, descriptionReferences: DescriptionReference[], definitionFieldSet: DescriptionTemplateFieldSet): DescriptionPropertyDefinitionFieldSetItemEditorModel {
if (item) { if (item) {
this.comment = item.comment; this.comment = item.comment;
this.ordinal = item.ordinal; this.ordinal = item.ordinal;
if (item.fields) { item.fields?.forEach((value, key) => this.fields.set(key, new DescriptionFieldEditorModel().fromModel(value))); } if (item.fields) { item.fields?.forEach((value, key) => this.fields.set(key, new DescriptionFieldEditorModel().fromModel(value, definitionFieldSet?.fields?.find(x => x.id == key), descriptionReferences))); }
} }
return this; return this;
} }
@ -319,7 +325,12 @@ export class DescriptionPropertyDefinitionFieldSetItemEditorModel implements Des
} }
export class DescriptionFieldEditorModel implements DescriptionFieldPersist { export class DescriptionFieldEditorModel implements DescriptionFieldPersist {
value: string; textValue: string;
textListValue: string[];
dateValue: Date;
references: ReferencePersist[];
reference: ReferencePersist;
externalIdentifier?: DescriptionExternalIdentifierEditorModel;
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder(); protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
@ -327,9 +338,14 @@ export class DescriptionFieldEditorModel implements DescriptionFieldPersist {
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel() public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { } ) { }
public fromModel(item: DescriptionField): DescriptionFieldEditorModel { public fromModel(item: DescriptionField, descriptionTemplateField: DescriptionTemplateField, descriptionReferences: DescriptionReference[]): DescriptionFieldEditorModel {
if (item) { if (item) {
this.value = item.value; this.textValue = item.textValue;
this.textListValue = item.textListValue;
this.dateValue = item.dateValue;
this.references = descriptionReferences?.filter(x => x.data?.fieldId == descriptionTemplateField?.id && x.isActive == IsActive.Active).map(x => x.reference);
this.reference = descriptionReferences?.find(x => x.data?.fieldId == descriptionTemplateField?.id && x.isActive == IsActive.Active)?.reference;
this.externalIdentifier = new DescriptionExternalIdentifierEditorModel().fromModel(item.externalIdentifier);
} }
return this; return this;
} }
@ -348,7 +364,11 @@ export class DescriptionFieldEditorModel implements DescriptionFieldPersist {
} }
return this.formBuilder.group({ return this.formBuilder.group({
value: [{ value: this.value, disabled: disabled }, context.getValidation('value').validators] textValue: [{ value: this.textValue, disabled: disabled }, context.getValidation('textValue').validators],
textListValue: [{ value: this.textListValue, disabled: disabled }, context.getValidation('textListValue').validators],
dateValue: [{ value: this.dateValue, disabled: disabled }, context.getValidation('dateValue').validators],
references: [{ value: this.references, disabled: disabled }, context.getValidation('references').validators],
reference: [{ value: this.reference, disabled: disabled }, context.getValidation('reference').validators]
}); });
} }
@ -360,11 +380,66 @@ export class DescriptionFieldEditorModel implements DescriptionFieldPersist {
const baseContext: ValidationContext = new ValidationContext(); const baseContext: ValidationContext = new ValidationContext();
const baseValidationArray: Validation[] = new Array<Validation>(); const baseValidationArray: Validation[] = new Array<Validation>();
baseValidationArray.push({ key: 'value', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}value`)] }); baseValidationArray.push({ key: 'textValue', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}textValue`)] });
baseValidationArray.push({ key: 'textListValue', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}textListValue`)] });
baseValidationArray.push({ key: 'dateValue', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}dateValue`)] });
baseValidationArray.push({ key: 'references', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}references`)] });
baseValidationArray.push({ key: 'reference', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}references`)] });
baseContext.validation = baseValidationArray; baseContext.validation = baseValidationArray;
return baseContext; return baseContext;
} }
}
export class DescriptionExternalIdentifierEditorModel implements DescriptionExternalIdentifierPersist {
identifier: string;
type: string;
protected formBuilder: UntypedFormBuilder = new UntypedFormBuilder();
constructor(
public validationErrorModel: ValidationErrorModel = new ValidationErrorModel()
) { }
public fromModel(item: DescriptionExternalIdentifier): DescriptionExternalIdentifierEditorModel {
if (item) {
this.identifier = item.identifier;
this.type = item.type;
}
return this;
}
buildForm(params?: {
context?: ValidationContext,
disabled?: boolean,
rootPath?: string
}): UntypedFormGroup {
let { context = null, disabled = false, rootPath } = params ?? {}
if (context == null) {
context = DescriptionExternalIdentifierEditorModel.createValidationContext({
validationErrorModel: this.validationErrorModel,
rootPath
});
}
return this.formBuilder.group({
identifier: [{ value: this.identifier, disabled: disabled }, context.getValidation('identifier').validators],
type: [{ value: this.type, disabled: disabled }, context.getValidation('type').validators],
});
}
static createValidationContext(params: {
rootPath?: string,
validationErrorModel: ValidationErrorModel
}): ValidationContext {
const { rootPath = '', validationErrorModel } = params;
const baseContext: ValidationContext = new ValidationContext();
const baseValidationArray: Validation[] = new Array<Validation>();
baseValidationArray.push({ key: 'identifier', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}identifier`)] });
baseValidationArray.push({ key: 'type', validators: [Validators.required, BackendErrorValidator(validationErrorModel, `${rootPath}type`)] });
baseContext.validation = baseValidationArray;
return baseContext;
}
} }
export class DescriptionReferenceEditorModel implements DescriptionReferencePersist { export class DescriptionReferenceEditorModel implements DescriptionReferencePersist {
@ -422,371 +497,3 @@ export class DescriptionReferenceEditorModel implements DescriptionReferencePers
return baseContext; return baseContext;
} }
} }
// export class DescriptionEditorModel {
// public id: string;
// public label: string;
// public profile: DescriptionProfileModel;
// public uri: String;
// public status: number;
// public description: String;
// public services: ExternalServiceEditorModel[] = [];
// public registries: ExternalRegistryEditorModel[] = [];
// public dataRepositories: ExternalDataRepositoryEditorModel[] = [];
// public tags: ExternalTagEditorModel[] = [];
// public externalDescriptions: ExternalDescriptionEditorModel[] = [];
// public dmp: DmpModel;
// public dmpSectionIndex: number;
// public descriptionProfileDefinition: DescriptionDescriptionFormEditorModel;
// public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
// public isProfileLatestVersion: Boolean;
// public modified: Date;
// fromModel(item: DescriptionModel): DescriptionEditorModel {
// this.id = item.id;
// this.label = item.label;
// this.profile = item.profile;
// this.uri = item.uri;
// this.status = item.status;
// this.description = item.description;
// if (item.services) { this.services = item.services.map(x => new ExternalServiceEditorModel().fromModel(x)); }
// if (item.registries) { this.registries = item.registries.map(x => new ExternalRegistryEditorModel().fromModel(x)); }
// if (item.dataRepositories) { this.dataRepositories = item.dataRepositories.map(x => new ExternalDataRepositoryEditorModel().fromModel(x)); }
// if (item.externalDescriptions) { this.externalDescriptions = item.externalDescriptions.map(x => new ExternalDescriptionEditorModel().fromModel(x)); }
// this.dmp = item.dmp;
// this.dmpSectionIndex = item.dmpSectionIndex;
// if (item.descriptionProfileDefinition) { this.descriptionProfileDefinition = new DescriptionDescriptionFormEditorModel().fromModel(item.descriptionProfileDefinition); }
// if (item.tags) { this.tags = item.tags.map(x => new ExternalTagEditorModel().fromModel(x)); }
// this.isProfileLatestVersion = item.isProfileLatestVersion;
// this.modified = new Date(item.modified);
// return this;
// }
// buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
// if (context == null) { context = this.createValidationContext(); }
// const formBuilder = new UntypedFormBuilder();
// const formGroup = formBuilder.group({
// id: [{ value: this.id, disabled: disabled }, context.getValidation('id').validators],
// label: [{ value: this.label, disabled: disabled }, context.getValidation('label').validators],
// uri: [{ value: this.uri, disabled: disabled }, context.getValidation('uri').validators],
// status: [{ value: this.status, disabled: disabled }, context.getValidation('status').validators],
// description: [{ value: this.description, disabled: disabled }, context.getValidation('description').validators],
// dmp: [{ value: this.dmp, disabled: disabled }, context.getValidation('dmp').validators],
// dmpSectionIndex: [{ value: this.dmpSectionIndex, disabled: disabled }, context.getValidation('dmpSectionIndex').validators],
// //externalDescriptions: [{ value: this.externalDescriptions, disabled: disabled }, context.getValidation('externalDescriptions').validators],
// tags: [{ value: this.tags, disabled: disabled }, context.getValidation('tags').validators],
// //registries: [{ value: this.registries, disabled: disabled }, context.getValidation('registries').validators],
// //dataRepositories: [{ value: this.dataRepositories, disabled: disabled }, context.getValidation('dataRepositories').validators],
// //services: [{ value: this.services, disabled: disabled }, context.getValidation('services').validators],
// profile: [{ value: this.profile, disabled: disabled }, context.getValidation('profile').validators],
// modified: [{value: this.modified, disabled: disabled}, context.getValidation('modified').validators]
// });
// const externalDescriptionsFormArray = new Array<UntypedFormGroup>();
// //if (this.externalDescriptions && this.externalDescriptions.length > 0) {
// this.externalDescriptions.forEach(item => {
// externalDescriptionsFormArray.push(item.buildForm(context.getValidation('externalDescriptions').descendantValidations, disabled));
// });
// // } else {
// // //externalDescriptionsFormArray.push(new ExternalDescriptionModel().buildForm(context.getValidation('externalDescriptions').descendantValidations, disabled));
// // }
// formGroup.addControl('externalDescriptions', formBuilder.array(externalDescriptionsFormArray));
// // const tagsFormArray = new Array<FormGroup>();
// // if (this.tags && this.tags.length > 0) {
// // this.tags.forEach(item => {
// // tagsFormArray.push(item.buildForm(context.getValidation('tags').descendantValidations, disabled));
// // });
// // } else {
// // //externalDescriptionsFormArray.push(new ExternalDescriptionModel().buildForm(context.getValidation('externalDescriptions').descendantValidations, disabled));
// // }
// // formGroup.addControl('tags', formBuilder.array(tagsFormArray));
// const registriesFormArray = new Array<UntypedFormGroup>();
// //if (this.registries && this.registries.length > 0) {
// this.registries.forEach(item => {
// registriesFormArray.push(item.buildForm(context.getValidation('registries').descendantValidations, disabled));
// });
// // } else {
// // //externalDescriptionsFormArray.push(new ExternalDescriptionModel().buildForm(context.getValidation('externalDescriptions').descendantValidations, disabled));
// // }
// formGroup.addControl('registries', formBuilder.array(registriesFormArray));
// const dataRepositoriesFormArray = new Array<UntypedFormGroup>();
// //if (this.dataRepositories && this.dataRepositories.length > 0) {
// this.dataRepositories.forEach(item => {
// dataRepositoriesFormArray.push(item.buildForm(context.getValidation('dataRepositories').descendantValidations, disabled));
// });
// // } else {
// // //externalDescriptionsFormArray.push(new ExternalDescriptionModel().buildForm(context.getValidation('externalDescriptions').descendantValidations, disabled));
// // }
// formGroup.addControl('dataRepositories', formBuilder.array(dataRepositoriesFormArray));
// const servicesFormArray = new Array<UntypedFormGroup>();
// // if (this.services && this.services.length > 0) {
// this.services.forEach(item => {
// servicesFormArray.push(item.buildForm(context.getValidation('services').descendantValidations, disabled));
// });
// // } else {
// // //externalDescriptionsFormArray.push(new ExternalDescriptionModel().buildForm(context.getValidation('externalDescriptions').descendantValidations, disabled));
// // }
// formGroup.addControl('services', formBuilder.array(servicesFormArray));
// // const tagsFormArray = new Array<FormGroup>();
// // this.tags.forEach(item => {
// // tagsFormArray.push(item.buildForm(context.getValidation('tags').descendantValidations, disabled));
// // });
// // formGroup.addControl('tags', formBuilder.array(tagsFormArray));
// if (this.descriptionProfileDefinition) { formGroup.addControl('descriptionProfileDefinition', this.descriptionProfileDefinition.buildForm()); }
// // formGroup.addControl('profile', this.profile.buildForm());
// return formGroup;
// }
// createValidationContext(): ValidationContext {
// const baseContext: ValidationContext = new ValidationContext();
// baseContext.validation.push({ key: 'id', validators: [BackendErrorValidator(this.validationErrorModel, 'id')] });
// baseContext.validation.push({ key: 'label', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'label')] });
// baseContext.validation.push({ key: 'profile', validators: [Validators.required, BackendErrorValidator(this.validationErrorModel, 'profile')] });
// baseContext.validation.push({ key: 'uri', validators: [BackendErrorValidator(this.validationErrorModel, 'uri')] });
// baseContext.validation.push({ key: 'status', validators: [BackendErrorValidator(this.validationErrorModel, 'status')] });
// baseContext.validation.push({ key: 'description', validators: [BackendErrorValidator(this.validationErrorModel, 'description')] });
// baseContext.validation.push({ key: 'services', validators: [BackendErrorValidator(this.validationErrorModel, 'services')] });
// baseContext.validation.push({ key: 'registries', validators: [BackendErrorValidator(this.validationErrorModel, 'registries')] });
// baseContext.validation.push({ key: 'dataRepositories', validators: [BackendErrorValidator(this.validationErrorModel, 'dataRepositories')] });
// baseContext.validation.push({ key: 'externalDescriptions', validators: [BackendErrorValidator(this.validationErrorModel, 'externalDescriptions')] });
// baseContext.validation.push({ key: 'dmp', validators: [BackendErrorValidator(this.validationErrorModel, 'dmp')] });
// baseContext.validation.push({ key: 'dmpSectionIndex', validators: [BackendErrorValidator(this.validationErrorModel, 'dmpSectionIndex')] });
// baseContext.validation.push({ key: 'descriptionProfileDefinition', validators: [BackendErrorValidator(this.validationErrorModel, 'descriptionProfileDefinition')] });
// baseContext.validation.push({ key: 'tags', validators: [BackendErrorValidator(this.validationErrorModel, 'descriptionProfileDefinition')] });
// baseContext.validation.push({ key: 'modified', validators: []});
// return baseContext;
// }
// }
// export class ExternalTagEditorModel {
// public abbreviation: String;
// public definition: String;
// public id: String;
// public name: String;
// public reference: String;
// public uri: String;
// constructor(id?: String, name?: String) {
// this.id = id;
// this.name = name;
// }
// fromModel(item: TagModel): ExternalTagEditorModel {
// this.id = item.id;
// this.name = item.name;
// return this;
// }
// buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
// return new UntypedFormBuilder().group({
// id: [this.id],
// name: [this.name]
// });
// }
// }
// export class ExternalServiceEditorModel {
// public id: String;
// public abbreviation: String;
// public definition: String;
// public uri: String;
// public label: String;
// public reference: String;
// public source: String;
// constructor(abbreviation?: String, definition?: String, id?: String, label?: String, reference?: String, uri?: String, source?: String) {
// this.id = id;
// this.abbreviation = abbreviation;
// this.definition = definition;
// this.uri = uri;
// this.label = label;
// this.reference = reference;
// this.source = source;
// }
// fromModel(item: ServiceModel): ExternalServiceEditorModel {
// this.id = item.id;
// this.abbreviation = item.abbreviation;
// this.definition = item.definition;
// this.uri = item.uri;
// this.label = item.label;
// this.reference = item.reference;
// this.source = item.source;
// return this;
// }
// buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
// return new UntypedFormBuilder().group({
// id: [this.id],
// abbreviation: [this.abbreviation],
// label: [this.label, Validators.required],
// reference: [this.reference],
// uri: [this.uri, Validators.required],
// definition: [this.definition],
// source: [this.source]
// });
// }
// }
// export class ExternalRegistryEditorModel {
// public abbreviation: String;
// public definition: String;
// public id: String;
// public label: String;
// public reference: String;
// public uri: String;
// public source: String
// constructor(abbreviation?: String, definition?: String, id?: String, label?: String, reference?: String, uri?: String, source?: String) {
// this.abbreviation = abbreviation;
// this.definition = definition;
// this.id = id;
// this.label = label;
// this.reference = reference;
// this.uri = uri;
// this.source = source;
// }
// fromModel(item: RegistryModel): ExternalRegistryEditorModel {
// this.abbreviation = item.abbreviation;
// this.definition = item.definition;
// this.id = item.id;
// this.label = item.label;
// this.reference = item.pid ? item.pid : item.reference;
// this.uri = item.uri;
// this.source = item.source
// return this;
// }
// buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
// return new UntypedFormBuilder().group({
// id: [this.id],
// abbreviation: [this.abbreviation],
// label: [this.label, Validators.required],
// reference: [this.reference],
// uri: [this.uri, Validators.required],
// definition: [this.definition],
// source: [this.source]
// });
// }
// }
// export class ExternalDescriptionEditorModel {
// public abbreviation: String;
// public id: String;
// public name: String;
// public reference: String;
// public type: ExternalDescriptionType;
// public info: String;
// public validationErrorModel: ValidationErrorModel = new ValidationErrorModel();
// public source: String;
// constructor(id?: string, abbreviation?: string, name?: string, reference?: string, source?: String, info?: string, type?: ExternalDescriptionType) {
// this.id = id;
// this.name = name;
// this.abbreviation = abbreviation;
// this.reference = reference;
// this.info = info;
// this.type = type;
// this.source = source;
// }
// fromModel(item: ExternalDescriptionModel): ExternalDescriptionEditorModel {
// this.abbreviation = item.abbreviation;
// this.id = item.id;
// this.name = item.name;
// this.reference = item.reference;
// this.type = item.type;
// this.info = item.info;
// this.source = item.source;
// return this;
// }
// buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
// return new UntypedFormBuilder().group({
// id: [this.id],
// abbreviation: [this.abbreviation],
// name: [this.name, Validators.required],
// reference: [this.reference],
// type: [this.type],
// info: [this.info],
// source: [this.source]
// });
// }
// }
// export class ExternalDataRepositoryEditorModel {
// public id: string;
// public name: string;
// public abbreviation: string;
// public uri: string;
// public reference: string;
// public info: string;
// public created: Date;
// public modified: Date;
// public source: string;
// constructor(id?: string, name?: string, abbreviation?: string, uri?: string, reference?: string, source?: string) {
// this.id = id;
// this.name = name;
// this.abbreviation = abbreviation;
// this.uri = uri;
// this.reference = reference;
// this.source = source;
// }
// fromModel(item: DataRepositoryModel): ExternalDataRepositoryEditorModel {
// this.id = item.id;
// this.name = item.name;
// this.abbreviation = item.abbreviation;
// this.uri = item.uri;
// this.info = item.info;
// this.reference = item.pid;
// this.source = item.source;
// return this;
// }
// buildForm(context: ValidationContext = null, disabled: boolean = false): UntypedFormGroup {
// return new UntypedFormBuilder().group({
// id: [this.id],
// name: [this.name, [Validators.required]],
// abbreviation: [this.abbreviation],
// uri: [this.uri, [Validators.required]],
// info: [this.info],
// reference: [this.reference],
// source: [this.source]
// });
// }
// }
// // export class TagModel implements Serializable<TagModel> {
// // public id: string;
// // public name: string;
// // constructor(id?: string, name?: string) {
// // this.id = id;
// // this.name = name;
// // }
// // fromJSONObject(item: any): TagModel {
// // this.id = item.id;
// // this.name = item.name;
// // return this;
// // }
// // buildForm(context: ValidationContext = null, disabled: boolean = false): FormGroup {
// // return new FormBuilder().group({
// // id: [this.id],
// // name: [this.name]
// // });
// // }
// // }

View File

@ -1,7 +1,7 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateDefinition, DescriptionTemplateExternalDatasetData, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateMultiplicity, DescriptionTemplatePage, DescriptionTemplateRule, DescriptionTemplateSection, DescriptionTemplateSelectData, DescriptionTemplateSelectOption, DescriptionTemplateUploadData, DescriptionTemplateUploadOption } from '@app/core/model/description-template/description-template'; import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateDefinition, DescriptionTemplateExternalDatasetData, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateMultiplicity, DescriptionTemplatePage, DescriptionTemplateRule, DescriptionTemplateSection, DescriptionTemplateSelectData, DescriptionTemplateSelectOption, DescriptionTemplateUploadData, DescriptionTemplateUploadOption } from '@app/core/model/description-template/description-template';
import { Description, DescriptionField, DescriptionPropertyDefinition, DescriptionPropertyDefinitionFieldSet, DescriptionPropertyDefinitionFieldSetItem, DescriptionReference, DescriptionTag } from '@app/core/model/description/description'; import { Description, DescriptionExternalIdentifier, DescriptionField, DescriptionPropertyDefinition, DescriptionPropertyDefinitionFieldSet, DescriptionPropertyDefinitionFieldSetItem, DescriptionReference, DescriptionTag } from '@app/core/model/description/description';
import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint'; import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint';
import { Dmp, DmpDescriptionTemplate } from '@app/core/model/dmp/dmp'; import { Dmp, DmpDescriptionTemplate } from '@app/core/model/dmp/dmp';
import { Reference } from '@app/core/model/reference/reference'; import { Reference } from '@app/core/model/reference/reference';
@ -43,7 +43,11 @@ export class DescriptionEditorResolver extends BaseEditorResolver {
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.comment)].join('.'), [nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.comment)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.ordinal)].join('.'), [nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.ordinal)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.value)].join('.'), [nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.textValue)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.textListValue)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.dateValue)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.externalIdentifier), nameof<DescriptionExternalIdentifier>(x => x.identifier)].join('.'),
[nameof<Description>(x => x.properties), nameof<DescriptionPropertyDefinition>(x => x.fieldSets), nameof<DescriptionPropertyDefinitionFieldSet>(x => x.items), nameof<DescriptionPropertyDefinitionFieldSetItem>(x => x.fields), nameof<DescriptionField>(x => x.externalIdentifier), nameof<DescriptionExternalIdentifier>(x => x.type)].join('.'),
[nameof<Description>(x => x.descriptionTags), nameof<DescriptionTag>(x => x.id),].join('.'), [nameof<Description>(x => x.descriptionTags), nameof<DescriptionTag>(x => x.id),].join('.'),
[nameof<Description>(x => x.descriptionTags), nameof<DescriptionTag>(x => x.tag), nameof<Tag>(x => x.label)].join('.'), [nameof<Description>(x => x.descriptionTags), nameof<DescriptionTag>(x => x.tag), nameof<Tag>(x => x.label)].join('.'),

View File

@ -72,7 +72,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent {
return; return;
} }
const item: DescriptionPropertyDefinitionFieldSetEditorModel = new DescriptionPropertyDefinitionEditorModel().calculateFieldSetProperties(this.fieldSet, null); const item: DescriptionPropertyDefinitionFieldSetEditorModel = new DescriptionPropertyDefinitionEditorModel().calculateFieldSetProperties(this.fieldSet, null, null);
//TODO: akis //TODO: akis
formArray.push((item.buildForm().get('items') as UntypedFormArray).at(0)); formArray.push((item.buildForm().get('items') as UntypedFormArray).at(0));
} }

View File

@ -8,24 +8,24 @@
<i>{{fieldSet.extendedDescription}}</i> <i>{{fieldSet.extendedDescription}}</i>
</h5> </h5>
<mat-form-field *ngSwitchCase="descriptionTemplateFieldTypeEnum.FREE_TEXT" class="col-12"> <mat-form-field *ngSwitchCase="descriptionTemplateFieldTypeEnum.FREE_TEXT" class="col-12">
<input matInput [formControl]="propertiesFormGroup?.get(field.id).get('value')" placeholder="{{(field.data.label) + (isRequired? ' *': '')}}" [required]="isRequired"> <input matInput [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" placeholder="{{(field.data.label) + (isRequired? ' *': '')}}" [required]="isRequired">
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('pattern')">{{'GENERAL.VALIDATION.URL.MESSAGE' | translate}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('pattern')">{{'GENERAL.VALIDATION.URL.MESSAGE' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.EXTERNAL_SELECT" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.EXTERNAL_SELECT" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '')}}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="multipleAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '')}}" [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" [configuration]="multipleAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '')}}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '')}}" [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -33,12 +33,20 @@
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.SELECT" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.SELECT" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<mat-select [formControl]="propertiesFormGroup?.get(field.id).get('value')" placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [required]="isRequired" [multiple]="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<mat-select [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [required]="isRequired" [multiple]="field.data.multipleSelect">
<mat-option *ngFor="let opt of field.data.options" [value]="opt.value">{{opt.label}} <mat-option *ngFor="let opt of field.data.options" [value]="opt.value">{{opt.label}}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-error> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)">
<mat-select [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [required]="isRequired" [multiple]="field.data.multipleSelect">
<mat-option *ngFor="let opt of field.data.options" [value]="opt.value">{{opt.label}}
</mat-option>
</mat-select>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -46,32 +54,32 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="multipleAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" [configuration]="multipleAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_DMP_ENTRIES_DATASETS" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.INTERNAL_ENTRIES_DESCRIPTIONS" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="multipleAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" [configuration]="multipleAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -80,84 +88,84 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="multipleAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" [configuration]="multipleAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [configuration]="singleAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.CHECK_BOX" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.CHECK_BOX" class="col-12">
<mat-checkbox [formControl]="propertiesFormGroup?.get(field.id).get('value')" [required]="isRequired"> <mat-checkbox [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [required]="isRequired">
{{field.data.label}}</mat-checkbox> {{field.data.label}}</mat-checkbox>
</div> </div>
<mat-form-field *ngSwitchCase="descriptionTemplateFieldTypeEnum.TEXT_AREA" class="col-12"> <mat-form-field *ngSwitchCase="descriptionTemplateFieldTypeEnum.TEXT_AREA" class="col-12">
<textarea matInput class="text-area" [formControl]="propertiesFormGroup?.get(field.id).get('value')" matTextareaAutosize matAutosizeMinRows="3" matAutosizeMaxRows="15" [required]="isRequired" placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}"></textarea> <textarea matInput class="text-area" [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" matTextareaAutosize matAutosizeMinRows="3" matAutosizeMaxRows="15" [required]="isRequired" placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}"></textarea>
<button mat-icon-button type="button" *ngIf="!propertiesFormGroup?.get(field.id).get('value').disabled && propertiesFormGroup?.get(field.id).get('value').value" matSuffix aria-label="Clear" (click)="this.propertiesFormGroup?.get(field.id).get('value').patchValue('')"> <button mat-icon-button type="button" *ngIf="!propertiesFormGroup?.get(field.id).get('textValue').disabled && propertiesFormGroup?.get(field.id).get('textValue').value" matSuffix aria-label="Clear" (click)="this.propertiesFormGroup?.get(field.id).get('textValue').patchValue('')">
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
</button> </button>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value')['errors'] && propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue')['errors'] && propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
<ng-container *ngSwitchCase="descriptionTemplateFieldTypeEnum.RICH_TEXT_AREA"> <ng-container *ngSwitchCase="descriptionTemplateFieldTypeEnum.RICH_TEXT_AREA">
<rich-text-editor-component class="col-12" [form]="propertiesFormGroup?.get(field.id).get('value')" [placeholder]="field.data.label" [required]="isRequired" [wrapperClasses]="'full-width editor ' + <rich-text-editor-component class="col-12" [form]="propertiesFormGroup?.get(field.id).get('textValue')" [placeholder]="field.data.label" [required]="isRequired" [wrapperClasses]="'full-width editor ' +
((isRequired && propertiesFormGroup?.get(field.id).get('value').touched && propertiesFormGroup?.get(field.id).get('value').hasError('required')) ? 'required' : '')" [editable]="!propertiesFormGroup?.get(field.id).get('value').disabled"> ((isRequired && propertiesFormGroup?.get(field.id).get('textValue').touched && propertiesFormGroup?.get(field.id).get('textValue').hasError('required')) ? 'required' : '')" [editable]="!propertiesFormGroup?.get(field.id).get('textValue').disabled">
</rich-text-editor-component> </rich-text-editor-component>
<div [class]="(propertiesFormGroup?.get(field.id).get('value')['errors'] && propertiesFormGroup?.get(field.id).get('value').hasError('required') && propertiesFormGroup?.get(field.id).get('value').touched) ? 'visible' : 'invisible'" class="col-12"> <div [class]="(propertiesFormGroup?.get(field.id).get('textValue')['errors'] && propertiesFormGroup?.get(field.id).get('textValue').hasError('required') && propertiesFormGroup?.get(field.id).get('textValue').touched) ? 'visible' : 'invisible'" class="col-12">
<div class="mat-form-field form-field-subscript-wrapper"> <div class="mat-form-field form-field-subscript-wrapper">
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value')['errors'] && propertiesFormGroup?.get(field.id).get('value').hasError('required') && propertiesFormGroup?.get(field.id).get('value').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue')['errors'] && propertiesFormGroup?.get(field.id).get('textValue').hasError('required') && propertiesFormGroup?.get(field.id).get('textValue').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</div> </div>
</div> </div>
</ng-container> </ng-container>
<ng-container *ngSwitchCase="descriptionTemplateFieldTypeEnum.UPLOAD"> <ng-container *ngSwitchCase="descriptionTemplateFieldTypeEnum.UPLOAD">
<div class="col-12 d-flex justify-content-center"> <div class="col-12 d-flex justify-content-center">
<ngx-dropzone #drop class="drop-file col-12" (change)="fileChangeEvent($event, true)" [multiple]="false" [accept]="typesToString()" [disabled]="propertiesFormGroup?.get(field.id).get('value').disabled"> <ngx-dropzone #drop class="drop-file col-12" (change)="fileChangeEvent($event, true)" [multiple]="false" [accept]="typesToString()" [disabled]="propertiesFormGroup?.get(field.id).get('textValue').disabled">
<ngx-dropzone-preview *ngIf="propertiesFormGroup?.get(field.id).get('value').value && propertiesFormGroup?.get(field.id).get('value').value.name" class="file-preview" [removable]="true" (removed)="onRemove()"> <ngx-dropzone-preview *ngIf="propertiesFormGroup?.get(field.id).get('textValue').value && propertiesFormGroup?.get(field.id).get('textValue').value.name" class="file-preview" [removable]="true" (removed)="onRemove()">
<ngx-dropzone-label class="file-label">{{ propertiesFormGroup?.get(field.id).get('value').value.name }}</ngx-dropzone-label> <ngx-dropzone-label class="file-label">{{ propertiesFormGroup?.get(field.id).get('textValue').value.name }}</ngx-dropzone-label>
</ngx-dropzone-preview> </ngx-dropzone-preview>
</ngx-dropzone> </ngx-dropzone>
</div> </div>
<div class="col-12 d-flex justify-content-center attach-btn"> <div class="col-12 d-flex justify-content-center attach-btn">
<button *ngIf="!propertiesFormGroup?.get(field.id).get('value').value || filesToUpload" mat-button (click)="drop.showFileSelector()" type="button" class="attach-file-btn" [disabled]="!!propertiesFormGroup?.get(field.id).get('value').value || propertiesFormGroup?.get(field.id).get('value').disabled"> <button *ngIf="!propertiesFormGroup?.get(field.id).get('textValue').value || filesToUpload" mat-button (click)="drop.showFileSelector()" type="button" class="attach-file-btn" [disabled]="!!propertiesFormGroup?.get(field.id).get('textValue').value || propertiesFormGroup?.get(field.id).get('textValue').disabled">
<mat-icon class="mr-2">upload</mat-icon> <mat-icon class="mr-2">upload</mat-icon>
<mat-label>{{ (field.data.label | translate)}}</mat-label> <mat-label>{{ (field.data.label | translate)}}</mat-label>
</button> </button>
<button *ngIf="propertiesFormGroup?.get(field.id).get('value').value && !filesToUpload" mat-button (click)="download()" type="button" class="attach-file-btn" [disabled]="propertiesFormGroup?.get(field.id).get('value').disabled"> <button *ngIf="propertiesFormGroup?.get(field.id).get('textValue').value && !filesToUpload" mat-button (click)="download()" type="button" class="attach-file-btn" [disabled]="propertiesFormGroup?.get(field.id).get('textValue').disabled">
<mat-icon class="mr-2">download</mat-icon> <mat-icon class="mr-2">download</mat-icon>
<mat-label>{{ "TYPES.DATASET-PROFILE-UPLOAD-TYPE.DOWNLOAD" | translate }}</mat-label> <mat-label>{{ "TYPES.DATASET-PROFILE-UPLOAD-TYPE.DOWNLOAD" | translate }}</mat-label>
</button> </button>
</div> </div>
</ng-container> </ng-container>
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.BOOLEAN_DECISION" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.BOOLEAN_DECISION" class="col-12">
<mat-radio-group [formControl]="propertiesFormGroup?.get(field.id).get('value')" [required]="isRequired"> <mat-radio-group [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [required]="isRequired">
<mat-radio-button class="radio-button-item" name="{{propertiesFormGroup?.get(field.id).value}}" value="true">{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.ACTIONS.YES" | translate }}</mat-radio-button> <mat-radio-button class="radio-button-item" name="{{propertiesFormGroup?.get(field.id).value}}" value="true">{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.ACTIONS.YES" | translate }}</mat-radio-button>
<mat-radio-button class="radio-button-item" name="{{propertiesFormGroup?.get(field.id).value}}" value="false">{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.ACTIONS.NO" | translate }}</mat-radio-button> <mat-radio-button class="radio-button-item" name="{{propertiesFormGroup?.get(field.id).value}}" value="false">{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.ACTIONS.NO" | translate }}</mat-radio-button>
</mat-radio-group> </mat-radio-group>
<small class="text-danger d-block" *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required') && propertiesFormGroup?.get(field.id).get('value').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <small class="text-danger d-block" *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required') && propertiesFormGroup?.get(field.id).get('textValue').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</small> </small>
<small class="text-muted d-inline-block" *ngIf="(isRequired) && !propertiesFormGroup?.get(field.id).get('value').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</small> <small class="text-muted d-inline-block" *ngIf="(isRequired) && !propertiesFormGroup?.get(field.id).get('textValue').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</small>
</div> </div>
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.RADIO_BOX" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.RADIO_BOX" class="col-12">
<mat-radio-group [formControl]="propertiesFormGroup?.get(field.id).get('value')" [required]="isRequired"> <mat-radio-group [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [required]="isRequired">
<mat-radio-button *ngFor="let option of field.data.options let index = index" class="radio-button-item" [value]="option.value">{{option.label}}</mat-radio-button> <mat-radio-button *ngFor="let option of field.data.options let index = index" class="radio-button-item" [value]="option.value">{{option.label}}</mat-radio-button>
</mat-radio-group> </mat-radio-group>
<small class="text-danger d-block" *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required') && propertiesFormGroup?.get(field.id).get('value').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <small class="text-danger d-block" *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required') && propertiesFormGroup?.get(field.id).get('textValue').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</small> </small>
<small class="text-muted d-inline-block" *ngIf="(isRequired) && !propertiesFormGroup?.get(field.id).get('value').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}} *</small> <small class="text-muted d-inline-block" *ngIf="(isRequired) && !propertiesFormGroup?.get(field.id).get('textValue').touched">{{'GENERAL.VALIDATION.REQUIRED' | translate}} *</small>
</div> </div>
<mat-form-field *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATE_PICKER" class="col-12"> <mat-form-field *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATE_PICKER" class="col-12">
<input matInput placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" class="table-input" [matDatepicker]="date" [required]="isRequired" [formControl]="propertiesFormGroup?.get(field.id).get('value')"> <input matInput placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" class="table-input" [matDatepicker]="date" [required]="isRequired" [formControl]="propertiesFormGroup?.get(field.id).get('dateValue')">
<mat-datepicker-toggle matSuffix [for]="date"></mat-datepicker-toggle> <mat-datepicker-toggle matSuffix [for]="date"></mat-datepicker-toggle>
<mat-datepicker #date></mat-datepicker> <mat-datepicker #date></mat-datepicker>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')"> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('dateValue').hasError('required')">
{{'GENERAL.VALIDATION.REQUIRED' | translate}} {{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
@ -166,15 +174,15 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="externalDatasetAutoCompleteConfiguration" [required]="isRequired"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="externalDatasetAutoCompleteConfiguration" [required]="isRequired">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="externalDatasetAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="externalDatasetAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -184,15 +192,15 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="dataRepositoriesAutoCompleteConfiguration" [required]="isRequired"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="dataRepositoriesAutoCompleteConfiguration" [required]="isRequired">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="dataRepositoriesAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="dataRepositoriesAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -201,15 +209,15 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="pubRepositoriesAutoCompleteConfiguration" [required]="isRequired"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="pubRepositoriesAutoCompleteConfiguration" [required]="isRequired">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="pubRepositoriesAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="pubRepositoriesAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -218,15 +226,15 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="journalRepositoriesAutoCompleteConfiguration" [required]="isRequired"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="journalRepositoriesAutoCompleteConfiguration" [required]="isRequired">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="journalRepositoriesAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="journalRepositoriesAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
</ng-container> <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} </ng-container>\
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -236,15 +244,15 @@
<div *ngIf="field.data" class="row"> <div *ngIf="field.data" class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="taxonomiesAutoCompleteConfiguration" [required]="isRequired"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="taxonomiesAutoCompleteConfiguration" [required]="isRequired">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="taxonomiesAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="taxonomiesAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -254,15 +262,15 @@
<div *ngIf="field.data" class="row"> <div *ngIf="field.data" class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="licensesAutoCompleteConfiguration" [required]="isRequired"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="licensesAutoCompleteConfiguration" [required]="isRequired">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="licensesAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="licensesAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -272,15 +280,15 @@
<div *ngIf="field.data" class="row"> <div *ngIf="field.data" class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="publicationsAutoCompleteConfiguration" [required]="isRequired"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="publicationsAutoCompleteConfiguration" [required]="isRequired">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="publicationsAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="publicationsAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -290,15 +298,15 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="registriesAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="registriesAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="registriesAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="registriesAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -308,15 +316,15 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="servicesAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="servicesAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="servicesAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="servicesAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -325,7 +333,8 @@
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.TAGS" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.TAGS" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<app-multiple-auto-complete [configuration]="tagsAutoCompleteConfiguration" [formControl]="propertiesFormGroup?.get(field.id).get('value')" placeholder="{{('DATASET-EDITOR.FIELDS.TAGS' | translate) + (isRequired? ' *': '')}}"></app-multiple-auto-complete> <app-multiple-auto-complete [configuration]="tagsAutoCompleteConfiguration" [formControl]="propertiesFormGroup?.get(field.id).get('textListValue')" placeholder="{{('DATASET-EDITOR.FIELDS.TAGS' | translate) + (isRequired? ' *': '')}}"></app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textListValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
</div> </div>
@ -334,15 +343,15 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="researchersAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="researchersAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="researchersAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="researchersAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error>
<mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint> <mat-hint>{{ "TYPES.DATASET-PROFILE-COMBO-BOX-TYPE.EXTERNAL-SOURCE-HINT" | translate }}</mat-hint>
</mat-form-field> </mat-form-field>
</div> </div>
@ -352,13 +361,14 @@
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<ng-container *ngIf="field.data.multipleSelect"> <ng-container *ngIf="field.data.multipleSelect">
<app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="organisationsAutoCompleteConfiguration"> <app-multiple-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('references')" [configuration]="organisationsAutoCompleteConfiguration">
</app-multiple-auto-complete> </app-multiple-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('references').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}</mat-error>
</ng-container> </ng-container>
<ng-container *ngIf="!(field.data.multipleSelect)"> <ng-container *ngIf="!(field.data.multipleSelect)">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="organisationsAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('reference')" [configuration]="organisationsAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('reference').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</ng-container> </ng-container>
@ -370,17 +380,17 @@
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATASET_IDENTIFIER" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.DATASET_IDENTIFIER" class="col-12">
<div class="row" *ngIf="datasetIdInitialized"> <div class="row" *ngIf="datasetIdInitialized">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<input matInput class="col-md-12" [formControl]="getDatasetIdControl('identifier')" placeholder="{{(field.data.label) + (isRequired? ' *': '')}}" [required]="isRequired" [disabled]="propertiesFormGroup?.get(field.id).get('value').disabled"> <input matInput class="col-md-12" [formControl]="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('identifier')" placeholder="{{(field.data.label) + (isRequired? ' *': '')}}" [required]="isRequired" [disabled]="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('identifier').disabled">
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('identifier').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<mat-select class="col-md-12" [formControl]="getDatasetIdControl('type')" [placeholder]="('TYPES.DATASET-PROFILE-IDENTIFIER.IDENTIFIER-TYPE' | translate) + (isRequired? ' *': '')" [disabled]="propertiesFormGroup?.get(field.id).get('value').disabled"> <mat-select class="col-md-12" [formControl]="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('type')" [placeholder]="('TYPES.DATASET-PROFILE-IDENTIFIER.IDENTIFIER-TYPE' | translate) + (isRequired? ' *': '')" [disabled]="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('type').disabled">
<mat-option *ngFor="let type of datasetIdTypes" [value]="type.value"> <mat-option *ngFor="let type of datasetIdTypes" [value]="type.value">
{{ type.name }} {{ type.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('type').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -389,9 +399,9 @@
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.CURRENCY" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.CURRENCY" class="col-12">
<div class="row"> <div class="row">
<mat-form-field class="col-md-12"> <mat-form-field class="col-md-12">
<app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('value')" [configuration]="currencyAutoCompleteConfiguration" [required]="isRequired"> <app-single-auto-complete placeholder="{{ (field.data.label | translate) + (isRequired? ' *': '') }}" [formControl]="propertiesFormGroup?.get(field.id).get('textValue')" [configuration]="currencyAutoCompleteConfiguration" [required]="isRequired">
</app-single-auto-complete> </app-single-auto-complete>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('textValue').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
</div> </div>
@ -400,22 +410,22 @@
<div *ngSwitchCase="descriptionTemplateFieldTypeEnum.VALIDATION" class="col-12"> <div *ngSwitchCase="descriptionTemplateFieldTypeEnum.VALIDATION" class="col-12">
<div class="row align-items-baseline"> <div class="row align-items-baseline">
<mat-form-field class="col-md-4"> <mat-form-field class="col-md-4">
<input matInput class="col-md-12" [formControl]="getDatasetIdControl('identifier')" placeholder="{{(field.data.label) + (isRequired? ' *': '')}}" [required]="isRequired"> <input matInput class="col-md-12" [formControl]="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('identifier')" placeholder="{{(field.data.label) + (isRequired? ' *': '')}}" [required]="isRequired">
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('identifier').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<mat-form-field class="col-md-4"> <mat-form-field class="col-md-4">
<mat-select class="col-md-12" [formControl]="getDatasetIdControl('type')" [placeholder]="('TYPES.DATASET-PROFILE-VALIDATOR.REPOSITORIES-PLACEHOLDER' | translate) + (isRequired? ' *': '')"> <mat-select class="col-md-12" [formControl]="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('type')" [placeholder]="('TYPES.DATASET-PROFILE-VALIDATOR.REPOSITORIES-PLACEHOLDER' | translate) + (isRequired? ' *': '')">
<mat-option *ngFor="let type of validationTypes" [value]="type.value"> <mat-option *ngFor="let type of validationTypes" [value]="type.value">
{{ type.name }} {{ type.name }}
</mat-option> </mat-option>
</mat-select> </mat-select>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('type').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</mat-form-field> </mat-form-field>
<div class="col-md-2"> <div class="col-md-2">
<button type="button" mat-button class="lightblue-btn" (click)="validateId()" [disabled]="propertiesFormGroup?.get(field.id).get('value').disabled">{{ "TYPES.DATASET-PROFILE-VALIDATOR.ACTION" | translate }}</button> <button type="button" mat-button class="lightblue-btn" (click)="validateId()" [disabled]="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('identifier').disabled">{{ "TYPES.DATASET-PROFILE-VALIDATOR.ACTION" | translate }}</button>
<mat-error *ngIf="propertiesFormGroup?.get(field.id).get('value').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}} <mat-error *ngIf="propertiesFormGroup?.get(field.id).get('externalIdentifier')?.get('identifier').hasError('required')">{{'GENERAL.VALIDATION.REQUIRED' | translate}}
</mat-error> </mat-error>
</div> </div>
<div class="col-md-1"> <div class="col-md-1">

View File

@ -335,7 +335,7 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_RESEARCHERS:
this.makeAutocompleteConfiguration(this.searchResearchers.bind(this), "name", "tag"); this.makeAutocompleteConfiguration(this.searchResearchers.bind(this), "name", "tag");
break; break;
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DATASETS: case DescriptionTemplateFieldType.INTERNAL_ENTRIES_DESCRIPTIONS:
this.makeAutocompleteConfiguration(this.searchDatasets.bind(this), "label"); this.makeAutocompleteConfiguration(this.searchDatasets.bind(this), "label");
break; break;
case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: case DescriptionTemplateFieldType.INTERNAL_DMP_ENTRIES_DMPS: