From 674ce60a29a90339c8ad39e7dbd890c18f7e9d5d Mon Sep 17 00:00:00 2001 From: Diamantis Tziotzios Date: Wed, 20 Mar 2024 12:35:55 +0200 Subject: [PATCH] ui fixes --- .../eu/eudat/model/persist/LockPersist.java | 19 +- .../src/main/resources/config/transformer.yml | 1 + .../description-template.ts | 42 +- .../src/app/core/model/lock/lock.model.ts | 1 - .../app/core/services/lock/lock.service.ts | 5 + .../description-template.module.ts | 8 +- ...late-editor-composite-field.component.html | 9 +- ...mplate-editor-composite-field.component.ts | 163 +- ...ditor-external-select-field.component.html | 1 - .../final-preview/final-preview.component.ts | 5 +- .../description-template-editor.component.ts | 652 +------- .../prefilling-source-field.component.html | 44 +- .../prefilling-source-editor.component.html | 29 +- .../annotation-dialog.component.html | 1 - .../editor/description-editor.component.html | 1 - .../form-field-set.component.html | 6 +- .../form-field-set.component.ts | 18 +- .../form-field/form-field.component.html | 4 - .../form-field/form-field.component.ts | 16 +- .../description-form.module.ts | 3 +- .../table-of-contents.component.html | 1 - .../dmp-editor.component.html | 3 +- .../dmp-editor.component.ts | 1372 ++--------------- .../dmp-editor.resolver.ts | 5 - .../dmp-editor.routing.ts | 20 +- .../external-fetcher-source.component.html | 272 ++-- .../src/app/ui/sidebar/sidebar.component.html | 2 +- .../src/app/ui/sidebar/sidebar.component.scss | 4 + dmp-frontend/src/assets/config/config.json | 10 +- 29 files changed, 501 insertions(+), 2216 deletions(-) diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/persist/LockPersist.java b/dmp-backend/core/src/main/java/eu/eudat/model/persist/LockPersist.java index 2326a3c0b..e51949739 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/persist/LockPersist.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/persist/LockPersist.java @@ -27,10 +27,6 @@ public class LockPersist { public static final String _targetType = "targetType"; - private UUID lockedBy; - - public static final String _lockedBy = "lockedBy"; - private String hash; public static final String _hash = "hash"; @@ -59,14 +55,6 @@ public class LockPersist { this.targetType = targetType; } - public UUID getLockedBy() { - return lockedBy; - } - - public void setLockedBy(UUID lockedBy) { - this.lockedBy = lockedBy; - } - public String getHash() { return hash; } @@ -109,11 +97,8 @@ public class LockPersist { .failOn(LockPersist._target).failWith(messageSource.getMessage("Validation_Required", new Object[]{LockPersist._target}, LocaleContextHolder.getLocale())), this.spec() .must(() -> !this.isNull(item.getTargetType())) - .failOn(LockPersist._targetType).failWith(messageSource.getMessage("Validation_Required", new Object[]{LockPersist._targetType}, LocaleContextHolder.getLocale())), - this.spec() - .must(() -> this.isValidGuid(item.getLockedBy())) - .failOn(LockPersist._lockedBy).failWith(messageSource.getMessage("Validation_Required", new Object[]{LockPersist._lockedBy}, LocaleContextHolder.getLocale())) - ); + .failOn(LockPersist._targetType).failWith(messageSource.getMessage("Validation_Required", new Object[]{LockPersist._targetType}, LocaleContextHolder.getLocale())) + ); } } diff --git a/dmp-backend/web/src/main/resources/config/transformer.yml b/dmp-backend/web/src/main/resources/config/transformer.yml index 0b7659490..b61a20c69 100644 --- a/dmp-backend/web/src/main/resources/config/transformer.yml +++ b/dmp-backend/web/src/main/resources/config/transformer.yml @@ -3,6 +3,7 @@ transformer: - url: http://dev04.local.cite.gr:55330/file/docx transformerId: docx-file-transformer codes: [ docx, pdf ] + available-exports: [ docx, pdf ] issuer-url: ${IDP_ISSUER_URI_TOKEN:} client-id: ${IDP_APIKEY_CLIENT_ID:} client-secret: ${IDP_APIKEY_CLIENT_SECRET:} diff --git a/dmp-frontend/src/app/core/model/description-template/description-template.ts b/dmp-frontend/src/app/core/model/description-template/description-template.ts index 3a907b621..c927b4a89 100644 --- a/dmp-frontend/src/app/core/model/description-template/description-template.ts +++ b/dmp-frontend/src/app/core/model/description-template/description-template.ts @@ -11,15 +11,15 @@ import { User } from "../user/user"; export interface DescriptionTemplate extends BaseEntity { - label: string; - description: string; - groupId: Guid; - version: string; - language: string; - type: DescriptionTemplateType; - status: DescriptionTemplateStatus; - definition: DescriptionTemplateDefinition; - users: UserDescriptionTemplate[]; + label?: string; + description?: string; + groupId?: Guid; + version?: string; + language?: string; + type?: DescriptionTemplateType; + status?: DescriptionTemplateStatus; + definition?: DescriptionTemplateDefinition; + users?: UserDescriptionTemplate[]; } export interface UserDescriptionTemplate extends BaseEntity { @@ -34,21 +34,21 @@ export interface DescriptionTemplateDefinition { export interface DescriptionTemplatePage { - id: string; - ordinal: number; - title: string; - sections: DescriptionTemplateSection[]; + id?: string; + ordinal?: number; + title?: string; + sections?: DescriptionTemplateSection[]; } export interface DescriptionTemplateSection { - id: string; - ordinal: number; - defaultVisibility: boolean; - multiplicity: boolean; - title: string; - description: string; - sections: DescriptionTemplateSection[]; - fieldSets: DescriptionTemplateFieldSet[]; + id?: string; + ordinal?: number; + defaultVisibility?: boolean; + multiplicity?: boolean; + title?: string; + description?: string; + sections?: DescriptionTemplateSection[]; + fieldSets?: DescriptionTemplateFieldSet[]; } export interface DescriptionTemplateFieldSet { diff --git a/dmp-frontend/src/app/core/model/lock/lock.model.ts b/dmp-frontend/src/app/core/model/lock/lock.model.ts index 343a68a21..3a2443caf 100644 --- a/dmp-frontend/src/app/core/model/lock/lock.model.ts +++ b/dmp-frontend/src/app/core/model/lock/lock.model.ts @@ -18,5 +18,4 @@ export interface Lock { export interface LockPersist extends BaseEntityPersist { target: Guid; targetType: LockTargetType; - lockedBy: Guid; } diff --git a/dmp-frontend/src/app/core/services/lock/lock.service.ts b/dmp-frontend/src/app/core/services/lock/lock.service.ts index 742c73d08..a744475e0 100644 --- a/dmp-frontend/src/app/core/services/lock/lock.service.ts +++ b/dmp-frontend/src/app/core/services/lock/lock.service.ts @@ -55,6 +55,11 @@ export class LockService { .pipe(catchError((error: any) => throwError(error))); } + touchLock(targetId: Guid): Observable { + return this.http.get(`${this.apiBase}/touch/${targetId}`) + .pipe(catchError((error: any) => throwError(error))); + } + unlockTarget(targetId: Guid): Observable { return this.http.delete(`${this.apiBase}/target/unlock/${targetId}`) .pipe(catchError((error: any) => throwError(error))); diff --git a/dmp-frontend/src/app/ui/admin/description-template/description-template.module.ts b/dmp-frontend/src/app/ui/admin/description-template/description-template.module.ts index 2cce04d94..a054fab17 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/description-template.module.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/description-template.module.ts @@ -30,6 +30,7 @@ import { DescriptionTemplateListingComponent } from './listing/description-templ import { DescriptionTemplateListingFiltersComponent } from "./listing/filters/description-template-listing-filters.component"; import { ImportDescriptionTemplateDialogComponent } from './listing/import-description-template/import-description-template.dialog.component'; import { DescriptionTemplateEditorReferenceTypeFieldComponent } from './editor/components/field-type/reference-type/description-template-editor-reference-type-field.component'; +import { DescriptionFormModule } from '@app/ui/description/editor/description-form/description-form.module'; @NgModule({ imports: [ @@ -46,12 +47,7 @@ import { DescriptionTemplateEditorReferenceTypeFieldComponent } from './editor/c CommonFormattingModule, RichTextEditorModule, - // FormattingModule, - // FormProgressIndicationModule, - // AngularStickyThingsModule, - // MatBadgeModule, - // DragulaModule, - // TransitionGroupModule, + DescriptionFormModule ], declarations: [ DescriptionTemplateEditorComponent, diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html index bc4583082..b7c7ce634 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.html @@ -83,7 +83,6 @@ - {{firstField?.value | json}}
{{'DESCRIPTION-TEMPLATE-EDITOR.ACTIONS.FIELD.PREVIEW' | translate}} @@ -97,10 +96,10 @@
-
- - +
+
+ +
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts index 82911a008..97fbbce9b 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/composite-field/description-template-editor-composite-field.component.ts @@ -1,25 +1,27 @@ -import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core'; +import { Component, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core'; import { AbstractControl, UntypedFormArray, UntypedFormControl, UntypedFormGroup } from '@angular/forms'; import { MatCheckboxChange } from '@angular/material/checkbox'; import { MatDialog } from '@angular/material/dialog'; import { DescriptionTemplateFieldType } from '@app/core/common/enum/description-template-field-type'; import { ValidationType } from '@app/core/common/enum/validation-type'; import { - DescriptionTemplateSelectOption, DescriptionTemplateExternalDatasetData, DescriptionTemplateField, - DescriptionTemplateRadioBoxData, - DescriptionTemplateUploadData, - DescriptionTemplateSelectData, - DescriptionTemplateLabelData, + DescriptionTemplateFieldSet, DescriptionTemplateLabelAndMultiplicityData, - DescriptionTemplateReferenceTypeData + DescriptionTemplateLabelData, + DescriptionTemplateRadioBoxData, + DescriptionTemplateReferenceTypeData, + DescriptionTemplateSelectData, + DescriptionTemplateSelectOption, + DescriptionTemplateUploadData } from '@app/core/model/description-template/description-template'; import { ConfigurationService } from "@app/core/services/configuration/configuration.service"; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { TransitionGroupComponent } from "@app/ui/transition-group/transition-group.component"; import { BaseComponent } from '@common/base/base.component'; +import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component'; import { Guid } from '@common/types/guid'; import { TranslateService } from '@ngx-translate/core'; @@ -28,7 +30,10 @@ import { debounceTime, delay, map, takeUntil, tap } from 'rxjs/operators'; import { GENERAL_ANIMATIONS } from '../../animations/animations'; import { EditorCustomValidators } from '../../custom-validators/editor-custom-validators'; import { DescriptionTemplateFieldEditorModel, DescriptionTemplateRuleEditorModel, DescriptionTemplateSectionEditorModel } from '../../description-template-editor.model'; -import { ValidationErrorModel } from '@common/forms/validation/error-model/validation-error-model'; +import { DescriptionTemplateFieldSetPersist } from '@app/core/model/description-template/description-template-persist'; +import { DescriptionEditorModel, DescriptionPropertyDefinitionEditorModel } from '@app/ui/description/editor/description-editor.model'; +import { Description } from '@app/core/model/description/description'; +import { VisibilityRulesService } from '@app/ui/description/editor/description-form/visibility-rules/visibility-rules.service'; @Component({ selector: 'app-description-template-editor-composite-field-component', @@ -57,7 +62,9 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon showAdditionalInfo: boolean = false; showExtendedDescription: boolean = false; - previewForm: UntypedFormGroup = null; + //Preview + previewFieldSet: DescriptionTemplateFieldSet = null; + previewPropertiesFormGroup: UntypedFormGroup = null; // isComposite = false; // isMultiplicityEnabled = false; descriptionTemplateFieldTypeEnum = DescriptionTemplateFieldType; @@ -71,7 +78,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon private language: TranslateService, public enumUtils: EnumUtils, public datasetProfileService: DescriptionTemplateService, - private configurationService: ConfigurationService + private configurationService: ConfigurationService, ) { super(); } @@ -153,7 +160,7 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon } this.showPreview = false; this.previewDirty = true; - this.previewForm = updatedForm; + // this.previewForm = updatedForm; return previewContainer; }), delay(100), @@ -182,81 +189,95 @@ export class DescriptionTemplateEditorCompositeFieldComponent extends BaseCompon if (this.previewDirty) return ''; else return 'updated'; } - private reloadPreview(updatedForm: UntypedFormGroup) { - setTimeout(() => { + // private reloadPreview(updatedForm: UntypedFormGroup) { + // setTimeout(() => { - const previewContainer = document.getElementById('preview_container' + this.form.get('id').value); - // let clientHeight = -1; - if (previewContainer) { - // console.log(previewContainer); - const clientHeight = previewContainer.clientHeight; - // console.log(clientHeight); + // const previewContainer = document.getElementById('preview_container' + this.form.get('id').value); + // // let clientHeight = -1; + // if (previewContainer) { + // // console.log(previewContainer); + // const clientHeight = previewContainer.clientHeight; + // // console.log(clientHeight); - if (clientHeight) { - previewContainer.style.height = clientHeight.toString() + 'px'; + // if (clientHeight) { + // previewContainer.style.height = clientHeight.toString() + 'px'; - // console.log('height:' ,previewContainer.style.height); - } - } - this.showPreview = false; - this.previewDirty = true; - this.previewForm = updatedForm; + // // console.log('height:' ,previewContainer.style.height); + // } + // } + // this.showPreview = false; + // this.previewDirty = true; + // this.previewForm = updatedForm; - setTimeout(() => { + // setTimeout(() => { - this.showPreview = true; - this.previewDirty = false; + // this.showPreview = true; + // this.previewDirty = false; - if (previewContainer) { - setTimeout(() => { - if (previewContainer) { - previewContainer.style.height = 'auto'; - } - }); - } - }); - }); - } + // if (previewContainer) { + // setTimeout(() => { + // if (previewContainer) { + // previewContainer.style.height = 'auto'; + // } + // }); + // } + // }); + // }); + // } previewSubject$: Subject = new Subject(); private generatePreviewForm() { - // const formValue: DescriptionTemplateFieldSet = this.form.getRawValue(); - // const fields: FieldDefinition[] = formValue.fields.map(editorField => this._fieldToFieldDefinition(editorField)); + const formValue: DescriptionTemplateFieldSetPersist = this.form.getRawValue(); + const fields: DescriptionTemplateField[] = formValue.fields.map(editorField => { + return { + id: editorField.id, + ordinal: editorField.ordinal, + numbering: '', + schematics: editorField.schematics, + defaultValue: editorField.defaultValue, + visibilityRules: editorField.visibilityRules, + validations: editorField.validations, + includeInExport: editorField.includeInExport, + data: editorField.data + } + }); - // const compositeField: CompositeField = { - // id: formValue.id, - // additionalInformation: formValue.additionalInformation, - // extendedDescription: formValue.extendedDescription, - // numbering: '', - // title: formValue.title, - // ordinal: formValue.ordinal, - // description: formValue.description, - // hasCommentField: formValue.hasCommentField, - // commentFieldValue: '', - // multiplicity: { - // max: formValue.multiplicity.max, min: formValue.multiplicity.min, - // placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView - // }, - // multiplicityItems: null, - // fields: fields.map(editorField => { - // const model = new DatasetDescriptionFieldEditorModel().fromModel(editorField); - // if (model.data.fieldType === DescriptionTemplateFieldType.CheckBox) { - // model.value = model.value ? "true" : "false";//patch - // } - // return model; - // }) - // } + const fieldSet: DescriptionTemplateFieldSet = { + id: formValue.id, + ordinal: formValue.ordinal, + numbering: '', + title: formValue.title, + description: formValue.description, + extendedDescription: formValue.extendedDescription, + additionalInformation: formValue.additionalInformation, + multiplicity: { + max: formValue.multiplicity.max, min: formValue.multiplicity.min, + placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView + }, + hasCommentField: formValue.hasCommentField, + fields: fields + } + const mockDescription: Description = { + descriptionTemplate: { + definition: { + pages: [ + { + sections: [{ + fieldSets: [fieldSet] + }] + } + ] + } + } + } - // const section = new DatasetDescriptionSectionEditorModel(); - // section.title = ''; - // section.numbering = ''; - - // const compositeForm = new DatasetDescriptionCompositeFieldEditorModel().fromModel(compositeField) - // section.compositeFields = [compositeForm]; + const descriptionEditorModel = new DescriptionEditorModel().fromModel(mockDescription, mockDescription.descriptionTemplate); + this.previewPropertiesFormGroup = descriptionEditorModel.properties.fieldSets.get(fieldSet.id).buildForm() as UntypedFormGroup; + this.previewFieldSet = fieldSet; // this.previewSubject$.next(section); } diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-type/external-select/description-template-editor-external-select-field.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-type/external-select/description-template-editor-external-select-field.component.html index 319cf0202..8dd795e67 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-type/external-select/description-template-editor-external-select-field.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/field-type/external-select/description-template-editor-external-select-field.component.html @@ -26,7 +26,6 @@
-{{this.form.get('data').get('sources').value | json}}
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.FIELD.FIELDS.FIELD-AUTOCOMPLETE-AUTH-METHOD' | translate}} diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts index 3b9cdbda6..b73a1231b 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/final-preview/final-preview.component.ts @@ -13,8 +13,11 @@ import { VisibilityRulesService } from '@app/ui/description/editor/description-f export class FinalPreviewComponent implements OnInit { + @Input() descriptionTempaltePersist = null; + + visibilityRules: Rule[] = []; @Input() formGroup = null; - @Input() visibilityRules: Rule[] = []; + constructor(private visibilityRulesService: VisibilityRulesService) { } diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts index 379ea9de0..82efc836e 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.ts @@ -71,22 +71,9 @@ export class DescriptionTemplateEditorComponent extends BaseEditor = new Map(); userFormControl = new FormControl(); - - // selectedSystemFields: Array = []; - // descriptionTemplateSectionFieldCategory = DescriptionTemplateSectionFieldCategory; - // descriptionTemplateSystemFieldType = DescriptionTemplateSystemFieldType; - // public descriptionTemplateSystemFieldTypeEnum = this.enumUtils.getEnumValues(DescriptionTemplateSystemFieldType); - // descriptionTemplateExtraFieldDataType = DescriptionTemplateExtraFieldDataType; - // public descriptionTemplateExtraFieldDataTypeEnum = this.enumUtils.getEnumValues(DescriptionTemplateExtraFieldDataType); - - // blueprintsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration = { - // filterFn: this.filterDescriptionTempaltes.bind(this), - // initialItems: (excludedItems: any[]) => this.filterDescriptionTempaltes('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - // displayFn: (item: DatasetProfileModel) => item.label, - // titleFn: (item: DatasetProfileModel) => item.label, - // subtitleFn: (item: DatasetProfileModel) => item.description, - // popupItemActionIcon: 'visibility' - // }; + //Preview + previewFieldSet: DescriptionTemplate = null; + previewPropertiesFormGroup: UntypedFormGroup = null; protected get canDelete(): boolean { return !this.isDeleted && !this.isNew && this.hasPermission(this.authService.permissionEnum.DeleteDescriptionTemplate); @@ -185,12 +172,7 @@ export class DescriptionTemplateEditorComponent extends BaseEditor { + // return { + // id: editorField.id, + // ordinal: editorField.ordinal, + // numbering: '', + // schematics: editorField.schematics, + // defaultValue: editorField.defaultValue, + // visibilityRules: editorField.visibilityRules, + // validations: editorField.validations, + // includeInExport: editorField.includeInExport, + // data: editorField.data + // } + // }); + + // const fieldSet: DescriptionTemplateFieldSet = { + // id: formValue.id, + // ordinal: formValue.ordinal, + // numbering: '', + // title: formValue.title, + // description: formValue.description, + // extendedDescription: formValue.extendedDescription, + // additionalInformation: formValue.additionalInformation, + // multiplicity: { + // max: formValue.multiplicity.max, min: formValue.multiplicity.min, + // placeholder: formValue.multiplicity.placeholder, tableView: formValue.multiplicity.tableView + // }, + // hasCommentField: formValue.hasCommentField, + // fields: fields + // } + + // const mockDescription: Description = { + // descriptionTemplate: { + // definition: { + // pages: [ + // { + // sections: [{ + // fieldSets: [fieldSet] + // }] + // } + // ] + // } + // } + // } + + // const descriptionEditorModel = new DescriptionEditorModel().fromModel(mockDescription, mockDescription.descriptionTemplate); + // this.previewPropertiesFormGroup = descriptionEditorModel.properties.fieldSets.get(fieldSet.id).buildForm() as UntypedFormGroup; + // this.previewFieldSet = fieldSet; + // let data = this.form.getRawValue(); + // this.datasetProfileService.preview(data).subscribe(x => { + // this.datasetWizardModel = new DatasetWizardEditorModel().fromModel({ + // datasetProfileDefinition: x + // }); + // this.updateVisibilityRules(); + // this.formGroup = this.datasetWizardModel.buildForm().get('datasetProfileDefinition'); + // }); + } + // // // Table of Contents @@ -1207,7 +1253,6 @@ export class DescriptionTemplateEditorComponent extends BaseEditor { - // section.get('ordinal').setValue(index + 1); - // }); - // } - - // dropSections(event: CdkDragDrop) { - // const sectionsFormArray = (this.formGroup.get('definition').get('sections') as FormArray); - - // moveItemInArray(sectionsFormArray.controls, event.previousIndex, event.currentIndex); - // sectionsFormArray.updateValueAndValidity(); - // sectionsFormArray.controls.forEach((section, index) => { - // section.get('ordinal').setValue(index + 1); - // }); - // } - - - // // - // // - // // Fields - // // - // // - // systemFieldDisabled(systemField: DescriptionTemplateSystemFieldType) { - // return (this.formGroup.get('definition').get('sections') as FormArray)?.controls.some(x => (x.get('fields') as FormArray).controls.some(y => (y as UntypedFormGroup).get('systemFieldType')?.value === systemField)); - // // for (let section in (this.formGroup.get('definition').get('sections')as FormArray)?.controls) { - // // if (i != sectionIndex) { - // // for (let f of this.fieldsArray(i).controls) { - // // if ((f.get('category').value == FieldCategory.System || f.get('category').value == DescriptionTemplateSectionFieldCategory.System) && f.get('type').value == systemField) { - // // return true; - // // } - // // } - // // } - // // i++; - // // } - // // return false; - // } - - // selectedSystemFieldDisabled(): Array { - // return (this.formGroup.get('definition').get('sections') as FormArray)?.controls.flatMap(x => (x.get('fields') as FormArray).controls.map(y => (y as UntypedFormGroup).get('systemFieldType')?.value as DescriptionTemplateSystemFieldType)); - // } - - // addSystemField(sectionIndex: number, systemFieldType: DescriptionTemplateSystemFieldType): void { - // const field: FieldInSectionEditorModel = new FieldInSectionEditorModel(); - // field.id = Guid.create(); - // field.ordinal = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).length + 1; - // field.category = DescriptionTemplateSectionFieldCategory.System; - // field.systemFieldType = systemFieldType; - // field.required = (systemFieldType == DescriptionTemplateSystemFieldType.TEXT || systemFieldType == DescriptionTemplateSystemFieldType.Description) ? true : false; - // ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).push(field.buildForm()); //TODO: dtziotzios validation path - // } - - // removeSystemField(sectionIndex: number, fieldIndex: number): void { - // const formArray = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray); - // formArray.removeAt(fieldIndex); - // formArray.controls.forEach((section, index) => { - // section.get('ordinal').setValue(index + 1); - // }); - // } - - // addExtraField(sectionIndex: number): void { - // const field: FieldInSectionEditorModel = new FieldInSectionEditorModel(); - // field.id = Guid.create(); - // field.ordinal = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).length + 1; - // field.category = DescriptionTemplateSectionFieldCategory.Extra; - // ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray).push(field.buildForm()); //TODO: dtziotzios validation path - // } - - // removeExtraField(sectionIndex: number, fieldIndex: number): void { - // const formArray = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray); - // formArray.removeAt(fieldIndex); - // formArray.controls.forEach((section, index) => { - // section.get('ordinal').setValue(index + 1); - // }); - // } - - - // dropFields(event: CdkDragDrop, sectionIndex: number) { - // const fieldsFormArray = ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('fields') as FormArray); - - // moveItemInArray(fieldsFormArray.controls, event.previousIndex, event.currentIndex); - // fieldsFormArray.updateValueAndValidity(); - // fieldsFormArray.controls.forEach((section, index) => { - // section.get('ordinal').setValue(index + 1); - // }); - // } - - // // - // // - // // Autocomplete configuration - // // - // // - - // filterDescriptionTempaltes(value: string): Observable { - // const request = new DataTableRequest(null, null, { fields: ['+label'] }); - // const criteria = new DatasetProfileCriteria(); - // criteria.like = value; - // request.criteria = criteria; - // return this.dmpService.searchDescriptionTemplates(request); - // } - - // onRemoveDescritionTemplate(event, sectionIndex: number) { - // const descriptionTemplateFormArray = (this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('descriptionTemplates') as FormArray; - // const foundIndex = descriptionTemplateFormArray.controls.findIndex(blueprint => blueprint.get('descriptionTemplateId').value === event.id); - // if (foundIndex !== -1) { - // descriptionTemplateFormArray.removeAt(foundIndex); - // } - // } - - // onSelectDescritionTemplate(item, sectionIndex) { - // const descriptionTemplate: DescriptionTemplatesInSectionEditorModel = new DescriptionTemplatesInSectionEditorModel(); - // descriptionTemplate.id = Guid.create(); - // descriptionTemplate.descriptionTemplateId = item.id; - // descriptionTemplate.label = item.label; - // ((this.formGroup.get('definition').get('sections') as FormArray).at(sectionIndex).get('descriptionTemplates') as FormArray).push(descriptionTemplate.buildForm()); //TODO: dtziotzios validation path - // } - - // ngAfterViewInit() { - - - - // this.route.params - // .pipe(takeUntil(this._destroyed)) - // .subscribe((params: Params) => { - // this.descriptionTemplateId = params['id']; - // const cloneId = params['cloneid']; - - // if (this.descriptionTemplateId != null) { - // this.isNew = false; - // this.descriptionTemplateService.getSingleBlueprint(this.descriptionTemplateId).pipe(map(data => data as any)) - // .pipe(takeUntil(this._destroyed)) - // .subscribe(data => { - // this.descriptionTemplateEditor = new DescriptionTemplateEditor().fromModel(data); - // this.formGroup = this.descriptionTemplateEditor.buildForm(); - // this.buildSystemFields(); - // this.fillDescriptionTemplatesInMultAutocomplete(); - // if (this.descriptionTemplateEditor.status == DescriptionTemplateStatus.Finalized) { - // this.formGroup.disable(); - // this.viewOnly = true - // } - // // this.breadCrumbs = observableOf([{ - // // parentComponentName: 'DescriptionTemplateListingComponent', - // // label: this.language.instant('NAV-BAR.TEMPLATE'), - // // url: '/description-templates/' + this.descriptionTemplateId - // // }]); - // }); - // } else if (cloneId != null) { - // this.isClone = true; - // this.descriptionTemplateService.clone(cloneId).pipe(map(data => data as any), takeUntil(this._destroyed)) - // .subscribe( - // data => { - // this.descriptionTemplateEditor = new DescriptionTemplateEditor().fromModel(data); - // this.descriptionTemplateEditor.id = null; - // this.descriptionTemplateEditor.status = DescriptionTemplateStatus.Draft; - // this.formGroup = this.descriptionTemplateEditor.buildForm(); - // this.buildSystemFields(); - // this.fillDescriptionTemplatesInMultAutocomplete(); - // }, - // error => this.onCallbackError(error) - // ); - // } else { - // this.descriptionTemplateEditorModel = new DescriptionTemplateEditorModel(); - // this.descriptionTemplateEditor = new DescriptionTemplateEditor(); - // setTimeout(() => { - // // this.formGroup = this.descriptionTemplateModel.buildForm(); - // // this.addField(); - // this.descriptionTemplateEditor.status = DescriptionTemplateStatus.Draft; - // this.formGroup = this.descriptionTemplateEditor.buildForm(); - // }); - // // this.breadCrumbs = observableOf([{ - // // parentComponentName: 'DescriptionTemplateListingComponent', - // // label: this.language.instant('NAV-BAR.TEMPLATE'), - // // url: '/description-templates/' + this.descriptionTemplateId - // // }]); - // } - // }); - - // } - - // buildSystemFields() { - // const sections = this.sectionsArray().controls.length; - // for (let i = 0; i < sections; i++) { - // let systemFieldsInSection = new Array(); - // this.fieldsArray(i).controls.forEach((field) => { - // if ((field.get('category').value == FieldCategory.System || field.get('category').value == DescriptionTemplateSectionFieldCategory.System)) { - // systemFieldsInSection.push(this.fieldList.find(f => f.type == field.get('type').value).type); - // } - // }) - // this.systemFieldListPerSection.push(systemFieldsInSection); - // } - // } - - // fillDescriptionTemplatesInMultAutocomplete() { - // const sections = this.sectionsArray().controls.length; - // for (let i = 0; i < sections; i++) { - // let descriptionTemplatesInSection = new Array(); - // this.descriptionTemplatesArray(i).controls.forEach((template) => { - // descriptionTemplatesInSection.push({ id: template.value.descriptionTemplateId, label: template.value.label, description: "" }); - // }) - // this.descriptionTemplatesPerSection.push(descriptionTemplatesInSection); - // } - // } - - // checkForProfiles(event, sectionIndex: number) { - // if (event.checked === false) { - // this.descriptionTemplatesPerSection[sectionIndex] = new Array(); - // this.descriptionTemplatesArray(sectionIndex).clear(); - // } - // } - - - - // sectionsArray(): UntypedFormArray { - // //return this.descriptionTemplatesFormGroup.get('sections') as FormArray; - // return this.formGroup.get('definition').get('sections') as UntypedFormArray; - // } - - - // fieldsArray(sectionIndex: number): UntypedFormArray { - // return this.sectionsArray().at(sectionIndex).get('fields') as UntypedFormArray; - // } - - - - // removeField(sectionIndex: number, fieldIndex: number): void { - // this.fieldsArray(sectionIndex).removeAt(fieldIndex); - // } - - // systemFieldsArray(sectionIndex: number): UntypedFormArray { - // return this.sectionsArray().at(sectionIndex).get('systemFields') as UntypedFormArray; - // } - - // initSystemField(systemField?: SystemFieldType): UntypedFormGroup { - // return this.fb.group({ - // id: this.fb.control(Guid.create().toString()), - // type: this.fb.control(systemField), - // label: this.fb.control(''), - // placeholder: this.fb.control(''), - // description: this.fb.control(''), - // required: this.fb.control(true), - // ordinal: this.fb.control('') - // }); - // } - - // addSystemField(sectionIndex: number, systemField?: SystemFieldType): void { - // this.addField(sectionIndex, FieldCategory.System, systemField); - // } - - // transfromEnumToString(type: SystemFieldType): string { - // return this.fieldList.find(f => f.type == type).label; - // } - - // selectedFieldType(type: SystemFieldType, sectionIndex: number): void { - // let index = this.systemFieldListPerSection[sectionIndex].indexOf(type); - // if (index == -1) { - // this.systemFieldListPerSection[sectionIndex].push(type); - // this.addSystemField(sectionIndex, type); - // } - // else { - // this.systemFieldListPerSection[sectionIndex].splice(index, 1); - // this.removeSystemField(sectionIndex, type); - // } - // } - - - - // descriptionTemplatesArray(sectionIndex: number): UntypedFormArray { - // return this.sectionsArray().at(sectionIndex).get('descriptionTemplates') as UntypedFormArray; - // } - - // addDescriptionTemplate(descriptionTemplate, sectionIndex: number): void { - // this.descriptionTemplatesArray(sectionIndex).push(this.fb.group({ - // label: this.fb.control(descriptionTemplate.value) - // })); - // } - - // removeDescriptionTemplate(sectionIndex: number, templateIndex: number): void { - // this.descriptionTemplatesArray(sectionIndex).removeAt(templateIndex); - // } - - // extraFieldsArray(sectionIndex: number): UntypedFormArray { - // return this.sectionsArray().at(sectionIndex).get('extraFields') as UntypedFormArray; - // } - - - - - - - - // getExtraFieldTypes(): Number[] { - // let keys: string[] = Object.keys(ExtraFieldType); - // keys = keys.slice(0, keys.length / 2); - // const values: Number[] = keys.map(Number); - // return values; - // } - - // getExtraFieldTypeValue(extraFieldType: ExtraFieldType): string { - // switch (extraFieldType) { - // case ExtraFieldType.TEXT: return 'Text'; - // case ExtraFieldType.RICH_TEXT: return 'Rich Text'; - // case ExtraFieldType.DATE: return 'Date'; - // case ExtraFieldType.NUMBER: return 'Number'; - // } - // } - - - - // moveItemInFormArray(formArray: UntypedFormArray, fromIndex: number, toIndex: number): void { - // const dir = toIndex > fromIndex ? 1 : -1; - - // const item = formArray.at(fromIndex); - // for (let i = fromIndex; i * dir < toIndex * dir; i = i + dir) { - // const current = formArray.at(i + dir); - // formArray.setControl(i, current); - // } - // formArray.setControl(toIndex, item); - // } - - // // clearForm(): void{ - // // this.descriptionTemplatesFormGroup.reset(); - // // } - - - - // // onPreviewTemplate(event, sectionIndex: number) { - // // const dialogRef = this.dialog.open(DatasetPreviewDialogComponent, { - // // width: '590px', - // // minHeight: '200px', - // // restoreFocus: false, - // // data: { - // // template: event - // // }, - // // panelClass: 'custom-modalbox' - // // }); - // // dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { - // // if (result) { - // // let blueprints = this.sectionsArray().at(sectionIndex).get('descriptionTemplates').value;//this.formGroup.get('blueprints').value; - // // const blueprint: DescriptionTemplatesInSectionEditor = new DescriptionTemplatesInSectionEditor(); - // // blueprint.id = Guid.create().toString(); - // // blueprint.descriptionTemplateId = event.id; - // // blueprint.label = event.label; - // // blueprints.push(blueprint.buildForm()); - // // this.sectionsArray().at(sectionIndex).get('descriptionTemplates').setValue(blueprints);//this.formGroup.get('blueprints').setValue(blueprints); - // // this.blueprintsAutoCompleteConfiguration = { - // // filterFn: this.filterProfiles.bind(this), - // // initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - // // displayFn: (item) => item['label'], - // // titleFn: (item) => item['label'], - // // subtitleFn: (item) => item['description'], - // // popupItemActionIcon: 'visibility' - // // }; - // // } - // // }); - // // } - - - - // checkValidity() { - // this.formService.touchAllFormFields(this.formGroup); - // if (!this.isFormValid()) { return false; } - // let errorMessages = []; - // if (!this.hasTitle()) { - // errorMessages.push("Title should be set."); - // } - // if (!this.hasDescription()) { - // errorMessages.push("Description should be set."); - // } - // if (!this.hasDescriptionTemplates()) { - // errorMessages.push("At least one section should have description templates."); - // } - // if (errorMessages.length > 0) { - // this.showValidationErrorsDialog(undefined, errorMessages); - // return false; - // } - // return true; - // } - - // formSubmit(): void { - // if (this.checkValidity()) - // this.onSubmit(); - // } - - // public isFormValid() { - // return this.formGroup.valid; - // } - - // hasTitle(): boolean { - // const descriptionTemplate: DescriptionTemplatePersist = this.formGroup.value; - // return descriptionTemplate.definition.sections.some(section => section.fields.some(field => (field.category === DescriptionTemplateSectionFieldCategory.System || field.category as unknown === DescriptionTemplateSectionFieldCategory.System) && field.systemFieldType === DescriptionTemplateSystemFieldType.TEXT)); - // } - - // hasDescription(): boolean { - // const descriptionTemplate: DescriptionTemplatePersist = this.formGroup.value; - // return descriptionTemplate.definition.sections.some(section => section.fields.some(field => (field.category === DescriptionTemplateSectionFieldCategory.System || field.category as unknown === DescriptionTemplateSectionFieldCategory.System) && field.systemFieldType === DescriptionTemplateSystemFieldType.Description)); - // } - - // hasDescriptionTemplates(): boolean { - // const descriptionTemplate: DescriptionTemplatePersist = this.formGroup.value; - // return descriptionTemplate.definition.sections.some(section => section.hasTemplates == true); - // } - - // private showValidationErrorsDialog(projectOnly?: boolean, errmess?: string[]) { - - // const dialogRef = this.dialog.open(FormValidationErrorsDialogComponent, { - // disableClose: true, - // autoFocus: false, - // restoreFocus: false, - // data: { - // errorMessages: errmess, - // projectOnly: projectOnly - // }, - // }); - - // } - - // onSubmit(): void { - // this.descriptionTemplateService.createBlueprint(this.formGroup.value) - // .pipe(takeUntil(this._destroyed)) - // .subscribe( - // complete => this.onCallbackSuccess(), - // error => this.onCallbackError(error) - // ); - // } - - // onCallbackSuccess(): void { - // this.uiNotificationService.snackBarNotification(this.isNew ? this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-CREATION') : this.language.instant('GENERAL.SNACK-BAR.SUCCESSFUL-UPDATE'), SnackBarNotificationLevel.Success); - // this.router.navigate(['/description-templates']); - // } - - // onCallbackError(errorResponse: any) { - // this.setErrorModel(errorResponse.error); - // this.formService.validateAllFormFields(this.formGroup); - // } - - // public setErrorModel(validationErrorModel: ValidationErrorModel) { - // Object.keys(validationErrorModel).forEach(item => { - // (this.descriptionTemplateEditor.validationErrorModel)[item] = (validationErrorModel)[item]; - // }); - // } public cancel(): void { this.router.navigate(['/description-templates']); } - - // // addField() { - // // (this.formGroup.get('definition').get('fields')).push(new DescriptionTemplateFieldEditorModel().buildForm()); - // // } - - // // removeField(index: number) { - // // (this.formGroup.get('definition').get('fields')).controls.splice(index, 1); - // // } - - // getDescriptionTemplateFieldDataTypeValues(): Number[] { - // let keys: string[] = Object.keys(DescriptionTemplateFieldDataType); - // keys = keys.slice(0, keys.length / 2); - // const values: Number[] = keys.map(Number); - // return values; - // } - - // getDescriptionTemplateFieldDataTypeWithLanguage(fieldType: DescriptionTemplateFieldDataType): string { - // let result = ''; - // this.language.get(this.enumUtils.toDescriptionTemplateFieldDataTypeString(fieldType)) - // .pipe(takeUntil(this._destroyed)) - // .subscribe((value: string) => { - // result = value; - // }); - // return result; - // } - - // getDescriptionTemplateFieldTypeValues(): Number[] { - // let keys: string[] = Object.keys(DescriptionTemplateType); - // keys = keys.slice(0, keys.length / 2); - // const values: Number[] = keys.map(Number); - // return values; - // } - - // getDescriptionTemplateFieldTypeWithLanguage(blueprintType: DescriptionTemplateType): string { - // let result = ''; - // this.language.get(this.enumUtils.toDescriptionTemplateTypeString(blueprintType)) - // .pipe(takeUntil(this._destroyed)) - // .subscribe((value: string) => { - // result = value; - // }); - // return result; - // } - - // delete() { - // this.dialog.open(ConfirmationDialogComponent, { - // data: { - // isDeleteConfirmation: true, - // confirmButton: this.language.instant('DESCRIPTION-TEMPLATE-EDITOR.CONFIRM-DELETE-DIALOG.CONFIRM-BUTTON'), - // cancelButton: this.language.instant("DESCRIPTION-TEMPLATE-EDITOR.CONFIRM-DELETE-DIALOG.CANCEL-BUTTON"), - // message: this.language.instant("DESCRIPTION-TEMPLATE-EDITOR.CONFIRM-DELETE-DIALOG.MESSAGE") - // } - // }) - // .afterClosed() - // .subscribe( - // confirmed => { - // if (confirmed) { - // if (this.formGroup.get('status').value == DescriptionTemplateStatus.Draft) { - // // this.formGroup.get('status').setValue(DescriptionTemplateStatus.Deleted); - // this.descriptionTemplateService.createBlueprint(this.formGroup.value) - // .pipe(takeUntil(this._destroyed)) - // .subscribe( - // complete => this.onCallbackSuccess(), - // error => this.onCallbackError(error) - // ); - // } - // else { - // // this.descriptionTemplateService.delete(this.descriptionTemplateId) - // // .pipe(takeUntil(this._destroyed)) - // // .subscribe( - // // complete => this.onCallbackSuccess(), - // // error => { - // // if (error.error.statusCode == 674) { - // // this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DESCRIPTION-TEMPLATE-DELETE'), SnackBarNotificationLevel.Error); - // // } else { - // // this.uiNotificationService.snackBarNotification(this.language.instant(error.message), SnackBarNotificationLevel.Error); - // // } - // // } - // // ); - // } - // } - // } - // ) - - // } - - // finalize() { - // if (this.checkValidity()) { - // this.formGroup.get('status').setValue(DescriptionTemplateStatus.Finalized); - // this.formSubmit(); - // } - // } - - // downloadXML(): void { - // const blueprintId = this.formGroup.get('id').value; - // if (blueprintId == null) return; - // this.descriptionTemplateService.downloadXML(blueprintId) - // .pipe(takeUntil(this._destroyed)) - // .subscribe(response => { - // const blob = new Blob([response.body], { type: 'application/xml' }); - // const filename = this.fileUtils.getFilenameFromContentDispositionHeader(response.headers.get('Content-Disposition')); - - // FileSaver.saveAs(blob, filename); - // }); - // } } diff --git a/dmp-frontend/src/app/ui/admin/prefilling-source/editor/field/prefilling-source-field.component.html b/dmp-frontend/src/app/ui/admin/prefilling-source/editor/field/prefilling-source-field.component.html index c0ea39d7b..f40597ab3 100644 --- a/dmp-frontend/src/app/ui/admin/prefilling-source/editor/field/prefilling-source-field.component.html +++ b/dmp-frontend/src/app/ui/admin/prefilling-source/editor/field/prefilling-source-field.component.html @@ -1,25 +1,27 @@ -
- - {{'PREFILLING-SOURCE-EDITOR.FIELDS.SYSTEM-TARGET' | translate}} +
+
+ + {{'PREFILLING-SOURCE-EDITOR.FIELDS.SYSTEM-TARGET' | translate}} {{enumUtils.toPrefillingSourceSystemTargetTypeString(systemFieldTarget)}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'PREFILLING-SOURCE-EDITOR.FIELDS.SEMANTIC-TARGET' | translate}} - - {{formGroup.get('semanticTarget').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'PREFILLING-SOURCE-EDITOR.FIELDS.TRIM-REGEX' | translate}} - - {{formGroup.get('trimRegex').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'PREFILLING-SOURCE-EDITOR.FIELDS.SEMANTIC-TARGET' | translate}} + + {{formGroup.get('semanticTarget').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'PREFILLING-SOURCE-EDITOR.FIELDS.TRIM-REGEX' | translate}} + + {{formGroup.get('trimRegex').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
\ No newline at end of file diff --git a/dmp-frontend/src/app/ui/admin/prefilling-source/editor/prefilling-source-editor.component.html b/dmp-frontend/src/app/ui/admin/prefilling-source/editor/prefilling-source-editor.component.html index acadd6791..cd8b0001b 100644 --- a/dmp-frontend/src/app/ui/admin/prefilling-source/editor/prefilling-source-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/prefilling-source/editor/prefilling-source-editor.component.html @@ -1,5 +1,5 @@
-
+
@@ -61,9 +61,11 @@
-
- -
+
+
+ +
+
{{'PREFILLING-SOURCE-EDITOR.FIELDS.FIXED-VALUE' | translate}} @@ -74,7 +76,7 @@
- +
@@ -98,8 +100,8 @@
-
-
+
+
{{'PREFILLING-SOURCE-EDITOR.FIELDS.CODE' | translate}} @@ -107,20 +109,21 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
- +
+ +
- - + +
- {{'PREFILLING-SOURCE-EDITOR.FIELDS.SOURCE-CONFIGURATION' | translate}} + {{'PREFILLING-SOURCE-EDITOR.FIELDS.SOURCE-CONFIGURATION' | translate}} @@ -136,7 +139,7 @@ - {{'PREFILLING-SOURCE-EDITOR.FIELDS.GET-SOURCE-CONFIGURATION' | translate}} + {{'PREFILLING-SOURCE-EDITOR.FIELDS.GET-SOURCE-CONFIGURATION' | translate}} diff --git a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html index ae04b93c5..a6df6ac97 100644 --- a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html +++ b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.html @@ -104,7 +104,6 @@
${index + 1}`)); - // }); - - // } - - // } - - // return errmess; - // } - - // private _getErrorMessage(formControl: AbstractControl, name: string): string[] { - // const errors: string[] = []; - // Object.keys(formControl.errors).forEach(key => { - // if (key === 'required') { errors.push(this.language.instant(name + ": " + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED'))); } - // // if (key === 'required') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + this.getPlaceHolder(formControl) + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.REQUIRED')); } - // else if (key === 'email') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.EMAIL')); } - // else if (key === 'min') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MIN-VALUE', { 'min': formControl.getError('min').min })); } - // else if (key === 'max') { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.MAX-VALUE', { 'max': formControl.getError('max').max })); } - // else { errors.push(this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.THIS-FIELD') + ' "' + name + '" ' + this.language.instant('GENERAL.FORM-VALIDATION-DISPLAY-DIALOG.HAS-ERROR') + ', ' + formControl.errors[key].message); } - // }); - // return errors; - // } - - // private _getPlaceHolder(formControl: any): string { - // if (formControl.nativeElement.localName === 'input' || formControl.nativeElement.localName === 'textarea' - // || formControl.nativeElement.localName === 'richTextarea') { - // return formControl.nativeElement.getAttribute('placeholder'); - // } else if (formControl.nativeElement.localName === 'mat-select') { - // return formControl.nativeElement.getAttribute('placeholder'); - // } else if (formControl.nativeElement.localName === 'app-single-auto-complete') { - // return (Array.from(formControl.nativeElement.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder'); - // } else if (formControl.nativeElement.localName === 'app-multiple-auto-complete') { - // return (Array.from(formControl.nativeElement.firstChild.firstChild.firstChild.children).filter((x: any) => x.localName === 'input')[0] as any).getAttribute('placeholder'); - // } - // } - - // filterProfiles(value: string): Observable { - // const request = new DataTableRequest(null, null, { fields: ['+label'] }); - // const criteria = new DatasetProfileCriteria(); - // criteria.like = value; - // request.criteria = criteria; - // return this.dmpService.searchDmpBlueprints(request); - // } - - // private getSingle(blueprintId: Guid, successFunction) { - // this.dmpBlueprintService.getSingle(blueprintId, [ - // nameof(x => x.id), - // nameof(x => x.label), - // nameof(x => x.status), - // nameof(x => x.description), - // nameof(x => x.status), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.id)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.label)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.description)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.ordinal)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.hasTemplates)].join('.'), - - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.id)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.category)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.dataType)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.systemFieldType)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.label)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.placeholder)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.description)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.required)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fields), nameof(x => x.ordinal)].join('.'), - - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.descriptionTemplates), nameof(x => x.id)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.descriptionTemplates), nameof(x => x.descriptionTemplateId)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.descriptionTemplates), nameof(x => x.label)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.descriptionTemplates), nameof(x => x.minMultiplicity)].join('.'), - // [nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.descriptionTemplates), nameof(x => x.maxMultiplicity)].join('.'), - // nameof(x => x.createdAt), - // nameof(x => x.hash), - // nameof(x => x.isActive) - // ] - // ) - // .pipe(map(data => data as DmpBlueprint), takeUntil(this._destroyed)) - // .subscribe( - // data => successFunction(data), - // error => this.onCallbackError(error) - // ); - // } - - // registerFormEventsForDmpBlueprint(): void { - // this.formGroup.get('profile').valueChanges - // .pipe( - // takeUntil(this._destroyed)) - // .subscribe(blueprintIdString => { - // const blueprintId = Guid.parse(blueprintIdString); - // if (blueprintId) { - // this.getSingle(blueprintId, data => { - // this.selectedDmpBlueprintDefinition = data.definition; - // this.checkForGrant(); - // this.checkForFunder(); - // this.checkForProject(); - // this.buildExtraFields(); - // this.addProfiles(); - // }); - // } - // else { - // this.selectedDmpBlueprintDefinition = null; - // } - // }) - // } - - // private buildExtraFields(): void { - // const extraFields = new Array(); - // this.selectedDmpBlueprintDefinition.sections.forEach(section => section.fields.forEach(field => { - // if (field.category as unknown == DmpBlueprintFieldCategory.Extra) { - // let extraField = new DmpExtraFieldEditorModel(); - // extraField.id = field.id.toString(); - // if (!isNullOrUndefined(this.dmp.extraFields)) { - // let found = this.dmp.extraFields.find(f => Guid.parse(f.id) === field.id); - // if (found !== undefined) { - // extraField.value = found.value; - // } - // } - // extraFields.push(extraField.buildForm()); - // } - // })); - // this.formGroup.setControl('extraFields', new UntypedFormBuilder().array(extraFields)); - // } - - // getExtraFieldIndex(id: string): string { - // let foundFieldIndex: number; - // (this.formGroup.get('extraFields') as UntypedFormArray).controls.forEach((element, index) => { - // if (element.value.id === id) { - // foundFieldIndex = index; - // } - // }); - // return foundFieldIndex.toString(); - // } - - // private checkForGrant() { - // let hasGrant = false; - // this.selectedDmpBlueprintDefinition.sections.forEach(section => section.fields.forEach( - // field => { - // if (field.category as unknown === DmpBlueprintFieldCategory.System && field.systemFieldType === DmpBlueprintSystemFieldType.GRANT) { - // hasGrant = true; - // } - // } - // )); - // if (!hasGrant) { - // this.formGroup.removeControl('grant'); - // } - // } - - // private checkForFunder() { - // let hasFunder = false; - // this.selectedDmpBlueprintDefinition.sections.forEach(section => section.fields.forEach( - // field => { - // if (field.category as unknown === DmpBlueprintFieldCategory.System && field.systemFieldType === DmpBlueprintSystemFieldType.FUNDER) { - // hasFunder = true; - // } - // } - // )); - // if (!hasFunder) { - // this.formGroup.removeControl('funder'); - // } - // } - - // private checkForProject() { - // let hasProject = false; - // this.selectedDmpBlueprintDefinition.sections.forEach(section => section.fields.forEach( - // field => { - // if (field.category as unknown === DmpBlueprintFieldCategory.System && field.systemFieldType === DmpBlueprintSystemFieldType.PROJECT) { - // hasProject = true; - // } - // } - // )); - // if (!hasProject) { - // this.formGroup.removeControl('project'); - // } - // } - - // private addProfiles(profiles?: DmpDatasetProfile[]) { - // for (let i = 0; i < this.selectedDmpBlueprintDefinition.sections.length; i++) { - // this.sectionTemplates.push(new Array()); - // } - // const templates: Array = new Array(); - // this.selectedDmpBlueprintDefinition.sections.forEach(section => { - // if (profiles !== undefined) { - // profiles.filter(profile => profile.data.dmpSectionIndex.includes(section.ordinal - 1)).forEach(profile => this.sectionTemplates[section.ordinal - 1].push({ id: profile.descriptionTemplateId, label: profile.label, description: "" })); - // } - // else { - // section.descriptionTemplates.forEach(template => { - // this.sectionTemplates[section.ordinal - 1].push({ id: template.descriptionTemplateId.toString(), label: template.label, description: "" }) - // let found: DmpDatasetProfile = templates.find(dmpDatasetProfile => Guid.parse(dmpDatasetProfile.descriptionTemplateId) == template.descriptionTemplateId); - // if (found === undefined) { - // let data: DmpDatasetProfileSectionsFormModel = new DmpDatasetProfileSectionsFormModel(); - // data.dmpSectionIndex.push(section.ordinal - 1); - // let id = null; - // if (profiles !== undefined) { - // let existedProfile = profiles.find(profile => Guid.parse(profile.descriptionTemplateId) == template.descriptionTemplateId); - // if (existedProfile !== undefined) { - // id = existedProfile.id; - // } - // } - // let profile: DmpDatasetProfile = { - // id: id, - // descriptionTemplateId: template.descriptionTemplateId.toString(), - // label: template.label, - // data: data - // }; - // templates.push(profile); - // } - // else { - // found.data.dmpSectionIndex.push(section.ordinal - 1); - // } - // }); - // } - // }); - // (profiles !== undefined) ? this.formGroup.get('profiles').setValue(profiles) : this.formGroup.get('profiles').setValue(templates); - - // } - - // getLanguageInfos(): LanguageInfo[] { - // return this.languageInfoService.getLanguageInfoValues(); - // } - - // getAssociates(): UserModel[] { - // let associates: UserModel[]; - // if (this.formGroup.get('associatedUsers').value && this.formGroup.get('associatedUsers').value.length > 0) { - // associates = []; - // } else { - // associates = this.associates; - // } - // //associates = (this.formGroup.get('researchers').value as any[]); - // associates = associates.concat(this.formGroup.get('associatedUsers').value); - // return associates; - // } - - - - // // Researchers - // filterResearchers(value: string): Observable { - // //return this.externalSourcesService.searchDMPResearchers({ criteria: { name: value, like: null } }); - // // const lookup = new ReferenceSearchLookup(); - // // lookup.like = value; - // // lookup.key = ''; - // // lookup.type = ReferenceType.Researcher; - // // return this.referenceService.search(lookup); - // const lookup = new ReferenceSearchDefinitionLookup(); - // //lookup.like=''; - // //lookup.page.size = 1; - // lookup.key = ''; - // //from reference type db hardcoded - // lookup.referenceTypeId = Guid.parse('51225b6a-86a6-48ac-9192-f15096dbcb8a'); - // const fields = [ - // ...ReferenceTypeEditorResolver.lookupFields() - // ]; - // lookup.project.fields = fields; - - // return this.referenceService.searchWithDefinition(lookup); - // } - - // addResearcher(event: MouseEvent) { - // event.stopPropagation(); - // const dialogRef = this.dialog.open(AddResearcherComponent, { - // data: this.formGroup.get('researchers') - // }); - // dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { - // if (result) { - // const fullName = result.firstName + " " + result.lastName; - // const newItem = { - // label: null, - // name: fullName, - // id: null, - // status: 0, - // key: "Internal", - // reference: result.reference - // }; - // const researchersArray = this.formGroup.get('researchers').value || []; - // researchersArray.push(newItem); - // this.formGroup.get('researchers').setValue(researchersArray); - // } - // }); - // } - - // // Organizations - // showOrganizationCreator(): boolean { - // return this.configurationService.allowOrganizationCreator; - // } - - // filterOrganisations(value: string): Observable { - // return this.organizationService.searchGeneralOrganisations({ criteria: { labelLike: value } }); - // } - - // cantAddOrganizations(): boolean { - // if (!isNullOrUndefined(this.formGroup.get('organizations'))) { - // return this.formGroup.get('organiztions').disabled; - // } else { - // return false; - // } - // } - - // addOrganization(event: MouseEvent) { - // event.stopPropagation(); - // const dialogRef = this.dialog.open(AddOrganizationComponent, { - // data: this.formGroup.get('organisations') - // }); - // dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { - // if (result) { - // const fullName = result.name; - // const newItem = { - // label: null, - // name: fullName, - // id: null, - // status: 0, - // key: "Internal", - // reference: result.reference - // }; - // const organizationsArray = this.formGroup.get('organisations').value || []; - // organizationsArray.push(newItem); - // this.formGroup.get('organisations').setValue(organizationsArray); - // } - // }); - // } - - // showToggleButton() { - // return (!this.isFinalized && this.isUserOwner) || this.isClone; - // } - - // allAvailableProfiles(event: MouseEvent) { - // event.stopPropagation(); - // const dialogRef = this.dialog.open(AvailableProfilesComponent, { - // data: { - // profiles: this.formGroup.get('profiles') - // } - // }); - - // return false; - // } - - // onRemoveTemplate(event, sectionIndex: number) { - // let found = false; - // let profiles = this.formGroup.get('profiles').value as DmpDatasetProfile[]; - // this.formGroup.get('datasets')['controls'].forEach(element => { - // if ((element.get('profile').value.id === event.id) && (element.get('dmpSectionIndex').value === sectionIndex)) { - // found = true; - // this.uiNotificationService.snackBarNotification(this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-REMOVE-TEMPLATE'), SnackBarNotificationLevel.Success); - // } - // }); - // if (found) { - // this.formGroup.get('profiles').setValue(profiles); - // this.profilesAutoCompleteConfiguration = { - // filterFn: this.filterProfiles.bind(this), - // initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - // displayFn: (item) => item['label'], - // titleFn: (item) => item['label'], - // subtitleFn: (item) => item['description'], - // popupItemActionIcon: 'visibility' - // }; - - // } - // else { - // this.sectionTemplates[sectionIndex] = this.sectionTemplates[sectionIndex].filter(sectionProfile => sectionProfile.id !== event.id); - // profiles = profiles.filter(sectionProfile => sectionProfile.descriptionTemplateId !== event.id); - // this.formGroup.get('profiles').setValue(profiles); - // } - // } - - // addProfile(event, sectionIndex: number) { - // const profiles = this.formGroup.get('profiles').value as DmpDatasetProfile[]; - // let found = profiles.find((value) => value.id === event.id); - // if (found !== undefined) { - // if (found.data.dmpSectionIndex.indexOf(sectionIndex) === -1) { - // found.data.dmpSectionIndex.push(sectionIndex); - // } - // else { - // this.sectionTemplates[sectionIndex].pop(); - // } - // } - // else { - // let dmpDatasetProfileSection: DmpDatasetProfileSectionsFormModel = new DmpDatasetProfileSectionsFormModel(); - // dmpDatasetProfileSection.dmpSectionIndex = [sectionIndex]; - // profiles.push({ id: null, descriptionTemplateId: event.id, label: event.label, data: dmpDatasetProfileSection }); - // } - // this.formGroup.get('profiles').setValue(profiles); - // } - - // onPreviewDescriptionTemplate(event, sectionIndex: number) { - // const dialogRef = this.dialog.open(DatasetPreviewDialogComponent, { - // width: '590px', - // minHeight: '200px', - // restoreFocus: false, - // data: { - // template: event - // }, - // panelClass: 'custom-modalbox' - // }); - // dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => { - // if (result) { - // this.addProfile(event, sectionIndex); - // this.profilesAutoCompleteConfiguration = { - // filterFn: this.filterProfiles.bind(this), - // initialItems: (excludedItems: any[]) => this.filterProfiles('').pipe(map(result => result.filter(resultItem => (excludedItems || []).map(x => x.id).indexOf(resultItem.id) === -1))), - // displayFn: (item) => item['label'], - // titleFn: (item) => item['label'], - // subtitleFn: (item) => item['description'], - // popupItemActionIcon: 'visibility' - // }; - // } - // }); - // } - // onOptionSelected(event, sectionIndex: number) { - // try { - // this.addProfile(event, sectionIndex); - // // const profileCounts: Map = new Map(); - // // profiles.forEach((value) => profileCounts.set(value.id, (profileCounts.get(value.id) !== undefined ? profileCounts.get(value.id): 0 ) + 1)); - // // const duplicateProfiles = profiles.filter((value) => { - // // let isOk = profileCounts.get(value.id) > 1; - // // if (isOk) { - // // profileCounts.set(value.id, 0); - // // } - // // return isOk; - // // }); - // // duplicateProfiles.forEach((value) => profiles.splice(profiles.lastIndexOf(value), 1)); - // // profiles.sort((a,b)=> a.label.localeCompare(b.label)); - // } catch { - // console.info('Could not sort Dataset Templates') - // } - // } - } diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.resolver.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.resolver.ts index 2057688b5..e1d32b5b2 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.resolver.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.resolver.ts @@ -124,13 +124,8 @@ export class DmpEditorResolver extends BaseEditorResolver { ...DmpEditorResolver.lookupFields() ]; const id = route.paramMap.get('id'); - // const cloneid = route.paramMap.get('cloneid'); if (id != null) { return this.descriptionService.getSingle(Guid.parse(id), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed)); } - //TODO: check this - // else if (cloneid != null) { - // return this.descriptionService.clone(Guid.parse(cloneid), fields).pipe(tap(x => this.breadcrumbService.addIdResolvedValue(x.id?.toString(), x.label)), takeUntil(this._destroyed)); - // } } } diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.routing.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.routing.ts index 1e2c38c97..3cb253358 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.routing.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.routing.ts @@ -4,10 +4,10 @@ import { RouterModule, Routes } from '@angular/router'; import { AppPermission } from '@app/core/common/enum/permission.enum'; import { PendingChangesGuard } from '@common/forms/pending-form-changes/pending-form-changes-guard.service'; // import { DmpOverviewComponent } from './overview/description-overview.component'; -import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; import { AuthGuard } from '@app/core/auth-guard.service'; -import { DmpEditorResolver } from './dmp-editor.resolver'; +import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; import { DmpEditorComponent } from './dmp-editor.component'; +import { DmpEditorResolver } from './dmp-editor.resolver'; const routes: Routes = [ { @@ -36,22 +36,8 @@ const routes: Routes = [ ...BreadcrumbService.generateRouteDataConfiguration({ title: 'BREADCRUMBS.EDIT-DMP' }) - // , - // authContext: { - // permissions: [AppPermission.EditDmp] - // } } - }, - - // { - // path: 'edit/:id', - // component: DmpEditorBlueprintComponent, - // data: { - // breadcrumb: true, - // title: 'GENERAL.TITLES.DMP-EDIT' - // }, - // canDeactivate: [CanDeactivateGuard] - // }, + } ]; diff --git a/dmp-frontend/src/app/ui/external-fetcher/external-fetcher-source.component.html b/dmp-frontend/src/app/ui/external-fetcher/external-fetcher-source.component.html index 9388813ba..e27d9eef5 100644 --- a/dmp-frontend/src/app/ui/external-fetcher/external-fetcher-source.component.html +++ b/dmp-frontend/src/app/ui/external-fetcher/external-fetcher-source.component.html @@ -1,53 +1,53 @@ -
-
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.KEY' | translate}} - - {{formGroup.get('key').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.LABEL' | translate}} - - {{formGroup.get('label').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.ORDINAL' | translate}} - - {{formGroup.get('ordinal').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.DEPENDENCIES' | translate}} - - {{referenceType.name}} - - {{formGroup.get('referenceTypeDependencyIds').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.SOURCE-TYPE' | translate}} - - - {{enumUtils.toExternalFetcherSourceTypeString(sourceType)}} - - - {{formGroup.get('type').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
+
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.KEY' | translate}} + + {{formGroup.get('key').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.LABEL' | translate}} + + {{formGroup.get('label').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.ORDINAL' | translate}} + + {{formGroup.get('ordinal').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.DEPENDENCIES' | translate}} + + {{referenceType.name}} + + {{formGroup.get('referenceTypeDependencyIds').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.SOURCE-TYPE' | translate}} + + + {{enumUtils.toExternalFetcherSourceTypeString(sourceType)}} + + + {{formGroup.get('type').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
-
+
+
{{'REFERENCE-TYPE-EDITOR.FIELDS.URL' | translate}} @@ -92,7 +92,7 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}}
-
+
{{'REFERENCE-TYPE-EDITOR.FIELDS.REQUEST-BODY' | translate}} @@ -107,7 +107,7 @@ {{formGroup.get('filterType').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} -
+

{{'REFERENCE-TYPE-EDITOR.FIELDS.RESULTS' | translate}}

@@ -117,7 +117,7 @@ {{formGroup.get('results').get('resultsArrayPath').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} -
+
@@ -149,57 +149,59 @@
-
+

{{'REFERENCE-TYPE-EDITOR.FIELDS.AUTHENTICATION' | translate}} - +

-
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.URL' | translate}} - - {{formGroup.get('auth').get('authUrl').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.HTTP-METHOD' | translate}} - - - {{enumUtils.toExternalFetcherApiHTTPMethodTypeString(httpMethod)}} - - - {{formGroup.get('auth').get('authMethod').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.TOKEN-PATH' | translate}} - - {{formGroup.get('auth').get('authTokenPath').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.REQUEST-BODY' | translate}} - - {{formGroup.get('auth').get('authRequestBody').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.TYPE' | translate}} - - {{formGroup.get('auth').get('type').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - +
+
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.URL' | translate}} + + {{formGroup.get('auth').get('authUrl').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.HTTP-METHOD' | translate}} + + + {{enumUtils.toExternalFetcherApiHTTPMethodTypeString(httpMethod)}} + + + {{formGroup.get('auth').get('authMethod').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.TOKEN-PATH' | translate}} + + {{formGroup.get('auth').get('authTokenPath').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.REQUEST-BODY' | translate}} + + {{formGroup.get('auth').get('authRequestBody').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.TYPE' | translate}} + + {{formGroup.get('auth').get('type').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
@@ -285,7 +287,7 @@ {{case.get('value').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} -
+
{{'REFERENCE-TYPE-EDITOR.FIELDS.DEPENDENCY' | translate}} @@ -301,7 +303,7 @@
{{'REFERENCE-TYPE-EDITOR.FIELDS.SOURCE-KEY' | translate}} - + {{sourceKey}} @@ -316,43 +318,43 @@
- - -
-
-

{{'REFERENCE-TYPE-EDITOR.FIELDS.OPTIONS' | translate}}

-
-
- -
-
-

{{'REFERENCE-TYPE-EDITOR.FIELDS.OPTION' | translate}} {{optionsIndex + 1}}

-
+
+
+ +
+
+

{{'REFERENCE-TYPE-EDITOR.FIELDS.OPTIONS' | translate}}

+
+
+ +
+
+

{{'REFERENCE-TYPE-EDITOR.FIELDS.OPTION' | translate}} {{optionsIndex + 1}}

- - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.CODE' | translate}} - - {{option.get('code').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
-
- - {{'REFERENCE-TYPE-EDITOR.FIELDS.VALUE' | translate}} - - {{option.get('value').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} - -
+
+ + +
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.CODE' | translate}} + + {{option.get('code').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} +
- -
+
+ + {{'REFERENCE-TYPE-EDITOR.FIELDS.VALUE' | translate}} + + {{option.get('value').getError('backendError').message}} + {{'GENERAL.VALIDATION.REQUIRED' | translate}} + +
+
+
-
-
+
+
\ No newline at end of file diff --git a/dmp-frontend/src/app/ui/sidebar/sidebar.component.html b/dmp-frontend/src/app/ui/sidebar/sidebar.component.html index abd67f8e2..761a43cc0 100644 --- a/dmp-frontend/src/app/ui/sidebar/sidebar.component.html +++ b/dmp-frontend/src/app/ui/sidebar/sidebar.component.html @@ -1,6 +1,6 @@