diff --git a/dmp-backend/core/src/main/java/eu/eudat/model/builder/DmpDescriptionTemplateBuilder.java b/dmp-backend/core/src/main/java/eu/eudat/model/builder/DmpDescriptionTemplateBuilder.java index be0652c44..7bfcb82c9 100644 --- a/dmp-backend/core/src/main/java/eu/eudat/model/builder/DmpDescriptionTemplateBuilder.java +++ b/dmp-backend/core/src/main/java/eu/eudat/model/builder/DmpDescriptionTemplateBuilder.java @@ -146,7 +146,7 @@ public class DmpDescriptionTemplateBuilder extends BaseBuilder !this.isNull(item.getSections())) .failOn(DefinitionPersist._sections).failWith(messageSource.getMessage("Validation_Required", new Object[]{DefinitionPersist._sections}, LocaleContextHolder.getLocale())), - this.refSpec() + this.navSpec() .iff(() -> !this.isNull(item.getSections())) .on(DefinitionPersist._sections) .over(item.getSections()) @@ -75,7 +75,7 @@ public class DefinitionPersist { this.spec() .must(() -> !this.isNull(item.getPages())) .failOn(DefinitionPersist._pages).failWith(messageSource.getMessage("Validation_Required", new Object[]{DefinitionPersist._pages}, LocaleContextHolder.getLocale())), - this.refSpec() + this.navSpec() .iff(() -> !this.isNull(item.getPages())) .on(DefinitionPersist._pages) .over(item.getPages()) 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 062a1b669..343a68a21 100644 --- a/dmp-frontend/src/app/core/model/lock/lock.model.ts +++ b/dmp-frontend/src/app/core/model/lock/lock.model.ts @@ -1,6 +1,7 @@ import { LockTargetType } from '@app/core/common/enum/lock-target-type'; import { Guid } from '@common/types/guid'; import { User } from '../user/user'; +import { BaseEntityPersist } from '@common/base/base-entity.model'; export interface Lock { id: Guid; @@ -14,10 +15,8 @@ export interface Lock { // Persist -export interface LockPersist { - id: Guid; +export interface LockPersist extends BaseEntityPersist { target: Guid; targetType: LockTargetType; - lockedBy: User; - hash: String; + lockedBy: Guid; } diff --git a/dmp-frontend/src/app/core/services/auth/auth.service.ts b/dmp-frontend/src/app/core/services/auth/auth.service.ts index be4e7ebfc..fce7ca3e7 100644 --- a/dmp-frontend/src/app/core/services/auth/auth.service.ts +++ b/dmp-frontend/src/app/core/services/auth/auth.service.ts @@ -242,7 +242,6 @@ export class AuthService extends BaseService { scope: this.installationConfiguration.keycloak.scope, }) .then(() => { - console.log('Keycloak Login'); this.keycloakService.keycloakEvents$.subscribe({ next: (e) => { if ( diff --git a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts index 097038de2..eb13bb02c 100644 --- a/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts +++ b/dmp-frontend/src/app/library/rich-text-editor/rich-text-editor.component.ts @@ -1,15 +1,20 @@ import { ChangeDetectionStrategy, Component, Input } from "@angular/core"; +import { FormControl } from "@angular/forms"; import { AngularEditorConfig } from "@kolkov/angular-editor"; @Component({ selector: 'rich-text-editor-component', template: ` -
- + + + {{(placeholder? (placeholder | translate) : '') + (required ? ' *': '')}} + +
`, styleUrls: ['./rich-text-editor.component.scss'], @@ -17,8 +22,7 @@ import { AngularEditorConfig } from "@kolkov/angular-editor"; changeDetection: ChangeDetectionStrategy.OnPush }) export class RichTextEditorComponent { - @Input() parentFormGroup; - @Input() controlName; + @Input() form: FormControl; @Input() id: string = "editor1"; @Input() placeholder: string = "Enter text"; @Input() required: boolean = false; 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 89762f754..37cc9e43a 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 @@ -14,12 +14,12 @@
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.DESCRIPTION' | translate}}
- +
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.FORM.COMPOSITE-FIELD.FIELDS.EXTENDED-DESCRIPTION' | translate}}
- +
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/components/section/description-template-editor-section.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/components/section/description-template-editor-section.component.html index d4465b1f4..d837f2290 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/components/section/description-template-editor-section.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/components/section/description-template-editor-section.component.html @@ -10,7 +10,7 @@
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.SECTION-INFO.SECTION-DESCRIPTION' | translate}}
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.SECTION-INFO.SECTION-DESCRIPTION-HINT' | translate}}
-
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html index 59aadb1ad..ef090975c 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.component.html @@ -76,7 +76,7 @@
{{'DESCRIPTION-TEMPLATE-EDITOR.STEPS.GENERAL-INFO.DATASET-TEMPLATE-DESCRIPTION-HINT'| translate}}
- +
diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts index d4ea24d40..673ab26af 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.model.ts @@ -31,8 +31,10 @@ export class DescriptionTemplateEditorModel extends BaseEditorModel implements D if (item) { super.fromModel(item); this.label = item.label; - this.status = item.status; this.description = item.description; + this.language = item.language; + this.type = item.type?.id; + this.status = item.status; this.definition = new DescriptionTemplateDefinitionEditorModel().fromModel(item.definition); if (item.users) { item.users.map(x => this.users.push(new UserDescriptionTemplateEditorModel().fromModel(x))); } } diff --git a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts index 8fdee0c57..0d9ad6afe 100644 --- a/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts +++ b/dmp-frontend/src/app/ui/admin/description-template/editor/description-template-editor.resolver.ts @@ -1,5 +1,6 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; +import { DescriptionTemplateType } from '@app/core/model/description-template-type/description-template-type'; import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateDefinition, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplateMultiplicity, DescriptionTemplatePage, DescriptionTemplateRule, DescriptionTemplateSection } from '@app/core/model/description-template/description-template'; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; import { BreadcrumbService } from '@app/ui/misc/breadcrumb/breadcrumb.service'; @@ -22,8 +23,12 @@ export class DescriptionTemplateEditorResolver extends BaseEditorResolver { nameof(x => x.label), nameof(x => x.status), nameof(x => x.description), + nameof(x => x.language), nameof(x => x.status), + [nameof(x => x.type), nameof(x => x.id)].join('.'), + [nameof(x => x.type), nameof(x => x.name)].join('.'), + [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.id)].join('.'), [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.ordinal)].join('.'), [nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.title)].join('.'), diff --git a/dmp-frontend/src/app/ui/admin/reference/editor/reference-editor.component.html b/dmp-frontend/src/app/ui/admin/reference/editor/reference-editor.component.html index f527e3962..b514d918e 100644 --- a/dmp-frontend/src/app/ui/admin/reference/editor/reference-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/reference/editor/reference-editor.component.html @@ -52,7 +52,7 @@

{{'REFERENCE-EDITOR.FIELDS.DESCRIPTION' | translate}}

- +
{{formGroup.get('description').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/admin/tenant/editor/tenant-editor.component.html b/dmp-frontend/src/app/ui/admin/tenant/editor/tenant-editor.component.html index 377ee3ef5..01d1ea236 100644 --- a/dmp-frontend/src/app/ui/admin/tenant/editor/tenant-editor.component.html +++ b/dmp-frontend/src/app/ui/admin/tenant/editor/tenant-editor.component.html @@ -47,7 +47,7 @@

{{'TENANT-EDITOR.FIELDS.DESCRIPTION' | translate}}

- +
{{formGroup.get('description').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.html b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.html index f5a0a48fc..42892b5bd 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.html @@ -49,10 +49,9 @@
- -
- {{descriptionTemplate.label}} -
+ +
{{descriptionTemplate.label}}
+
{{'DESCRIPTION-EDITOR.BASE-INFO.FIELDS.DESCRIPTION-TEMPLATE-VERSION'| translate}} {{descriptionTemplate.version}}
{{formGroup.get('descriptionTemplateId').getError('backendError').message}} diff --git a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss index 76fe2f2df..099fc0049 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss +++ b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.scss @@ -1,117 +1,123 @@ .description-base-fields-editor { - .intro { - text-align: left; - font-weight: 400; - letter-spacing: 0px; - color: #212121; - opacity: 1; - margin: 3rem 0rem 3rem 0rem; - } - .heading { - text-align: left; - font-weight: 700; - font-size: 18px; - letter-spacing: 0px; - color: #212121; - opacity: 0.81; - margin-top: 1.625rem; - margin-bottom: 0.625rem; - } + .intro { + text-align: left; + font-weight: 400; + letter-spacing: 0px; + color: #212121; + opacity: 1; + margin: 3rem 0rem 3rem 0rem; + } - .hint { - text-align: left; - font-weight: 400; - font-size: 16px; - letter-spacing: 0px; - color: #212121; - opacity: 0.81; - margin-bottom: 2.125rem; - } + .heading { + text-align: left; + font-weight: 700; + font-size: 18px; + letter-spacing: 0px; + color: #212121; + opacity: 0.81; + margin-top: 1.625rem; + margin-bottom: 0.625rem; + } - .title-form, - .description-form, - .profile-form { - text-align: left; - font-weight: 400; - font-size: 16px; - letter-spacing: 0.15px; - color: #7d7d7d; - opacity: 1; - margin-bottom: 1rem; - } + .hint { + text-align: left; + font-weight: 400; + font-size: 16px; + letter-spacing: 0px; + color: #212121; + opacity: 0.81; + margin-bottom: 2.125rem; + } - // textarea::placeholder { - // font-style: oblique; - // } + .title-form, + .description-form, + .profile-form { + text-align: left; + font-weight: 400; + font-size: 16px; + letter-spacing: 0.15px; + color: #7d7d7d; + opacity: 1; + margin-bottom: 1rem; + } - .input-btn { - border: none; - color: #aaaaaa; - background-color: #ffffff00; - cursor: pointer; - } + // textarea::placeholder { + // font-style: oblique; + // } - .input-btn :hover { - color: var(--primary-color-3) !important; - } + .input-btn { + border: none; + color: #aaaaaa; + background-color: #ffffff00; + cursor: pointer; + } - .dmp-link { - color: #3fafac; - font-weight: 400; - font-size: 16px; - cursor: pointer; - } + .input-btn :hover { + color: var(--primary-color-3) !important; + } - .dmp-link:hover { - text-decoration: underline; - } + .dmp-link { + color: #3fafac; + font-weight: 400; + font-size: 16px; + cursor: pointer; + } + + .dmp-link:hover { + text-decoration: underline; + } +} + +.multiline-mat-option.mat-option { + white-space: normal; + line-height: normal; } ::ng-deep .title-form .mat-form-field-appearance-outline .mat-form-field-outline { - background: #fafafa !important; + background: #fafafa !important; } ::ng-deep .description-form .mat-form-field-appearance-outline .mat-form-field-outline { - background: #fafafa !important; + background: #fafafa !important; } ::ng-deep .uri-form .mat-form-field-appearance-outline .mat-form-field-outline { - background: #fafafa !important; + background: #fafafa !important; } ::ng-deep .tags-form .mat-form-field-appearance-outline .mat-form-field-outline { - background: #fafafa !important; + background: #fafafa !important; } ::ng-deep .profile-form .mat-form-field-appearance-outline .mat-form-field-outline { - background: #fafafa !important; + background: #fafafa !important; } ::ng-deep .title-form .mat-form-field-appearance-outline .mat-form-field-infix { - font-size: 1rem; - padding: 0.6em 0 1em 0 !important; + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; } ::ng-deep .description-form .mat-form-field-appearance-outline .mat-form-field-infix { - // font-size: 1rem; - padding: 0.6em 0 1em 0 !important; + // font-size: 1rem; + padding: 0.6em 0 1em 0 !important; } ::ng-deep .uri-form .mat-form-field-appearance-outline .mat-form-field-infix { - font-size: 1rem; - padding: 0.6em 0 1em 0 !important; + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; } ::ng-deep .tags-form .mat-form-field-appearance-outline .mat-form-field-infix { - font-size: 1rem; - padding: 0.6em 0 1em 0 !important; + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; } ::ng-deep .profile-form .mat-form-field-appearance-outline .mat-form-field-infix { - font-size: 1rem; - padding: 0.6em 0 1em 0 !important; + font-size: 1rem; + padding: 0.6em 0 1em 0 !important; } diff --git a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.ts b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.ts index af3fab1f2..f1c56520a 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-base-fields-editor/description-base-fields-editor.component.ts @@ -3,7 +3,7 @@ import { UntypedFormGroup } from '@angular/forms'; import { DescriptionTemplate } from '@app/core/model/description-template/description-template'; import { Description } from '@app/core/model/description/description'; import { DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint'; -import { Dmp } from '@app/core/model/dmp/dmp'; +import { Dmp, DmpDescriptionTemplate } from '@app/core/model/dmp/dmp'; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; import { DescriptionService } from '@app/core/services/description/description.service'; import { DmpBlueprintService } from '@app/core/services/dmp/dmp-blueprint.service'; @@ -18,24 +18,21 @@ import { takeUntil } from 'rxjs/operators'; export class DescriptionBaseFieldsEditorComponent extends BaseComponent { @Input() formGroup: UntypedFormGroup; - @Input() availableDescriptionTemplates: DescriptionTemplate[] = []; @Input() description: Description; + availableDescriptionTemplates: DescriptionTemplate[] = []; viewOnly = false; //TODO: not used. constructor( - private dmpBlueprintService: DmpBlueprintService, - private descriptionTemplateService: DescriptionTemplateService, ) { super(); } ngOnInit() { - const section: DmpBlueprintDefinitionSection = this.dmpBlueprintService.getSection(this.description.dmp.blueprint, this.description.dmpDescriptionTemplate.sectionId); - const descriptionTemplateIds = section ? section.descriptionTemplates.map(x => x.descriptionTemplateId) : []; - if (descriptionTemplateIds && descriptionTemplateIds.length > 0) { - this.descriptionTemplateService.query(this.descriptionTemplateService.buildAutocompleteLookup(null, null, descriptionTemplateIds)) - .pipe(takeUntil(this._destroyed)).subscribe(queryResult => { - this.availableDescriptionTemplates = queryResult.items; - }); + const dmpDescriptionTemplates: DmpDescriptionTemplate[] = this.description.dmp.dmpDescriptionTemplates.filter(x => x.sectionId === this.description.dmpDescriptionTemplate.sectionId); + const currentVersionsOfDescriptionTemplates = dmpDescriptionTemplates.map(x => x.currentDescriptionTemplate); + //Check if the used tempalte in included in the current list. If not add it. + if (currentVersionsOfDescriptionTemplates.find(x => x.id === this.description.descriptionTemplate.id) == null) { + this.availableDescriptionTemplates.push(this.description.descriptionTemplate) } + this.availableDescriptionTemplates.push(...currentVersionsOfDescriptionTemplates); } public compareWith(object1: any, object2: any) { diff --git a/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts b/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts index 87c1c6fda..0d2478628 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-editor.resolver.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router'; -import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateDefinition, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplatePage, DescriptionTemplateRule, DescriptionTemplateSection } from '@app/core/model/description-template/description-template'; +import { DescriptionTemplate, DescriptionTemplateBaseFieldData, DescriptionTemplateComboBoxOption, DescriptionTemplateDefinition, DescriptionTemplateField, DescriptionTemplateFieldSet, DescriptionTemplatePage, DescriptionTemplateRule, DescriptionTemplateSection, DescriptionTemplateWordListData } from '@app/core/model/description-template/description-template'; import { Description, DescriptionField, DescriptionReference, DescriptionTag, PropertyDefinition } from '@app/core/model/description/description'; import { DescriptionTemplatesInSection, DmpBlueprint, DmpBlueprintDefinition, DmpBlueprintDefinitionSection } from '@app/core/model/dmp-blueprint/dmp-blueprint'; import { Dmp, DmpDescriptionTemplate } from '@app/core/model/dmp/dmp'; @@ -43,10 +43,19 @@ export class DescriptionEditorResolver extends BaseEditorResolver { // [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.descriptionTemplates), nameof(x => x.minMultiplicity)].join('.'), // [nameof(x => x.dmp), nameof(x => x.blueprint), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.descriptionTemplates), nameof(x => x.maxMultiplicity)].join('.'), + [nameof(x => x.dmp), nameof(x => x.dmpDescriptionTemplates), nameof(x => x.sectionId)].join('.'), + [nameof(x => x.dmp), nameof(x => x.dmpDescriptionTemplates), nameof(x => x.descriptionTemplateGroupId)].join('.'), + [nameof(x => x.dmp), nameof(x => x.dmpDescriptionTemplates), nameof(x => x.currentDescriptionTemplate), nameof(x => x.id)].join('.'), + [nameof(x => x.dmp), nameof(x => x.dmpDescriptionTemplates), nameof(x => x.currentDescriptionTemplate), nameof(x => x.label)].join('.'), + [nameof(x => x.dmp), nameof(x => x.dmpDescriptionTemplates), nameof(x => x.currentDescriptionTemplate), nameof(x => x.version)].join('.'), + + [nameof(x => x.dmpDescriptionTemplate), nameof(x => x.id)].join('.'), [nameof(x => x.dmpDescriptionTemplate), nameof(x => x.sectionId)].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.id)].join('.'), + [nameof(x => x.descriptionTemplate), nameof(x => x.label)].join('.'), + [nameof(x => x.descriptionTemplate), nameof(x => x.version)].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.id)].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.ordinal)].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.pages), nameof(x => x.title)].join('.'), @@ -89,6 +98,10 @@ export class DescriptionEditorResolver extends BaseEditorResolver { [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.fields), nameof(x => x.visibilityRules), nameof(x => x.value)].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.fields), nameof(x => x.data), nameof(x => x.label)].join('.'), [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.fields), nameof(x => x.data), nameof(x => x.fieldType)].join('.'), + [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.fields), nameof(x => x.data), nameof(x => x.options)].join('.'), + [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.fields), nameof(x => x.data), nameof(x => x.options), nameof(x => x.label)].join('.'), + [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.fields), nameof(x => x.data), nameof(x => x.options), nameof(x => x.value)].join('.'), + [nameof(x => x.descriptionTemplate), nameof(x => x.definition), nameof(x => x.sections), nameof(x => x.fieldSets), nameof(x => x.fields), nameof(x => x.data), nameof(x => x.multiList)].join('.'), [nameof(x => x.properties), nameof(x => x.fields), nameof(x => x.key)].join('.'), diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html index 0670dcec6..2e15e615a 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.html @@ -1,5 +1,7 @@ -
-
+ +
+ +
@@ -23,7 +25,8 @@
- + +
{{field.label}}
@@ -38,6 +41,9 @@
+
+ +
@@ -52,4 +58,4 @@ delete - \ No newline at end of file + diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts index d6c477e10..9048e3b6d 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field-set/form-field-set.component.ts @@ -40,7 +40,7 @@ export class DescriptionFormFieldSetComponent extends BaseComponent { ngOnInit() { this.visibilityRulesService.getElementVisibilityMapObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { - console.log('getElementVisibilityMapObservable form field'); + // console.log('getElementVisibilityMapObservable form field'); if (x[this.fieldSet.id]) { this.isVisibleByVisibilityService = x[this.fieldSet.id]; // this.changeDetector.markForCheck(); diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html index 77e01051a..f0639190b 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.html @@ -1,5 +1,6 @@
+ {{field.id | json}} info diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts index 74f2dc6bb..584c0e953 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-field/form-field.component.ts @@ -113,7 +113,7 @@ export class DescriptionFormFieldComponent extends BaseComponent implements OnIn ngOnInit() { this.visibilityRulesService.getElementVisibilityMapObservable().pipe(takeUntil(this._destroyed)).subscribe(x => { - console.log('getElementVisibilityMapObservable form field set'); + // console.log('getElementVisibilityMapObservable form field set'); if (x[this.field.id]) { this.visible = x[this.field.id]; diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html index 2243510e0..d5fc9a951 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html +++ b/dmp-frontend/src/app/ui/description/editor/description-form/components/form-section/form-section.component.html @@ -72,7 +72,6 @@
--> -
diff --git a/dmp-frontend/src/app/ui/description/editor/description-form/visibility-rules/visibility-rules.service.ts b/dmp-frontend/src/app/ui/description/editor/description-form/visibility-rules/visibility-rules.service.ts index 1e372bb0d..1424d3c53 100644 --- a/dmp-frontend/src/app/ui/description/editor/description-form/visibility-rules/visibility-rules.service.ts +++ b/dmp-frontend/src/app/ui/description/editor/description-form/visibility-rules/visibility-rules.service.ts @@ -44,7 +44,7 @@ export class VisibilityRulesService { } public checkElementVisibility(id: string): boolean { - console.log('checkElementVisibility: ' + id); + //console.log('checkElementVisibility: ' + id); return true; // if (this.visibilityRuleContext.rules.filter(item => item.targetControlId === id).length === 0) { return true; } // console.log(this.elementVisibilityMap.has(id) ? this.elementVisibilityMap.get(id) : false); @@ -59,7 +59,7 @@ export class VisibilityRulesService { } public updateValueAndVisibility(id: string, value: any) { - console.log('updateValueAndVisibility: ' + id + ' value: ' + value); + //console.log('updateValueAndVisibility: ' + id + ' value: ' + value); const visibilityRules = this.visibilityRuleContext.rules.filter(item => item.sourceVisibilityRules.filter(source => source.sourceControlId === id).length > 0); if (visibilityRules.length > 0) { visibilityRules.forEach(item => this.evaluateVisibility(item, value, id)); @@ -68,7 +68,7 @@ export class VisibilityRulesService { } private evaluateVisibility(visibilityRule: VisibilityRule, value: any, sourceId: string) {// source controlId is the same - console.log('evaluateVisibility: ' + visibilityRule + ' value: ' + value + ' sourceId: ' + sourceId); + //console.log('evaluateVisibility: ' + visibilityRule + ' value: ' + value + ' sourceId: ' + sourceId); const targetId = visibilityRule.targetControlId; const visibilityMap = this.elementComputationalMap.get(targetId) ? this.elementComputationalMap.get(targetId) : new Map(); @@ -133,7 +133,7 @@ export class VisibilityRulesService { private _computeVisibility(targetId: string): boolean { - console.log('_computeVisibility: ' + targetId); + //console.log('_computeVisibility: ' + targetId); const visibilityMap = this.elementComputationalMap.get(targetId); const values = visibilityMap.values(); @@ -159,7 +159,7 @@ export class VisibilityRulesService { } private resetVisibilityRules() { - console.log('resetVisibilityRules: '); + //console.log('resetVisibilityRules: '); this.isVisibleMap = {}; this.elementComputationalMap.clear(); @@ -169,7 +169,7 @@ export class VisibilityRulesService { } private _populateComputationMap(): void { - console.log('_populateComputationMap: '); + //console.log('_populateComputationMap: '); // this.visibilityRuleContext.rules.forEach(rule => { // const targetId = rule.targetControlId; // const visibilityMap = this.elementComputationalMap.get(targetId) ? this.elementComputationalMap.get(targetId) : new Map(); @@ -232,7 +232,7 @@ export class VisibilityRulesService { } private resetControlWithId(formControl: AbstractControl, id: string) { - console.log('resetControlWithId: ' + id); + //'resetControlWithId: ' + id); //TODO: implement this // if (formControl instanceof UntypedFormGroup) { // if ((formControl as UntypedFormGroup).contains('id') && (formControl as UntypedFormGroup).contains('value') && (formControl as UntypedFormGroup).get('id').value === id) { @@ -253,7 +253,7 @@ export class VisibilityRulesService { } private resetFieldFormGroup(formGroup: UntypedFormGroup) { - console.log('resetFieldFormGroup: ' + formGroup); + //console.log('resetFieldFormGroup: ' + formGroup); //TODO: implement this // const renderStyle = formGroup.getRawValue().viewStyle.renderStyle; // if (renderStyle === DatasetProfileFieldViewStyle.Validation || renderStyle === DatasetProfileFieldViewStyle.DatasetIdentifier) { @@ -265,7 +265,7 @@ export class VisibilityRulesService { } private resetCompositeFieldFormGroup(formGroup: UntypedFormGroup) { - console.log('resetCompositeFieldFormGroup: ' + formGroup); + //console.log('resetCompositeFieldFormGroup: ' + formGroup); //TODO: implement this // (formGroup.get('fields') as UntypedFormArray).controls.forEach((element: UntypedFormGroup) => { // this.resetFieldFormGroup(element); @@ -285,7 +285,7 @@ export class VisibilityRulesService { return this._changeMade$.asObservable(); } public getVisibilityDependency(targetId: string): VisibilityRuleSource[] | null { - console.log('getVisibilityDependency: ' + targetId); + //console.log('getVisibilityDependency: ' + targetId); return this.visibilityRuleContext.rules.reduce((hasDependency, rule) => { if (hasDependency) return hasDependency; @@ -323,7 +323,7 @@ export class VisibilityRulesService { //removes rule that has the specific id either as a source either as a target public removeAllIdReferences(id: string): void { - console.log('removeAllIdReferences: ' + id); + //console.log('removeAllIdReferences: ' + id); // * Remove from visibility rues and visibility rules context @@ -376,7 +376,7 @@ export class VisibilityRulesService { public addNewRule(rule: Rule, currentVisibility = this.DEFAULTVISIBILITY): void { - console.log('addNewRule: ' + rule + ' currentVisibility: ' + currentVisibility); + //console.log('addNewRule: ' + rule + ' currentVisibility: ' + currentVisibility); const targetId = rule.targetField; const sourceId = rule.sourceField; @@ -404,7 +404,7 @@ export class VisibilityRulesService { * return true if no rule found */ public checkTargetVisibilityProvidedBySource(sourceId: string, targetId: string): boolean { - console.log('checkTargetVisibilityProvidedBySource: ' + sourceId + ' targetId: ' + targetId); + //console.log('checkTargetVisibilityProvidedBySource: ' + sourceId + ' targetId: ' + targetId); const computationalMap = this.elementComputationalMap.get(targetId); if (computationalMap) { @@ -415,13 +415,13 @@ export class VisibilityRulesService { } public getVisibilityRulesFromDescriptionTempalte(descriptionTemplate: DescriptionTemplate): Rule[] { - console.log('getVisibilityRulesFromDescriptionTempalte: ' + descriptionTemplate); + //console.log('getVisibilityRulesFromDescriptionTempalte: ' + descriptionTemplate); const result: Rule[] = this.getVisibilityRulesFromDescriptionTempalteSections(descriptionTemplate?.definition?.sections); return result; } public getVisibilityRulesFromDescriptionTempalteSections(sections: DescriptionTemplateSection[]): Rule[] { - console.log('getVisibilityRulesFromDescriptionTempalteSections: ' + sections); + //console.log('getVisibilityRulesFromDescriptionTempalteSections: ' + sections); const result: Rule[] = []; sections.forEach(section => { @@ -444,7 +444,7 @@ export class VisibilityRulesService { class MapWithDefault extends Map { get(key) { - console.log('MapWithDefault'); + //console.log('MapWithDefault'); if (!this.has(key)) { this.set(key, true); } diff --git a/dmp-frontend/src/app/ui/dmp/clone-dialog/dmp-clone-dialog.component.html b/dmp-frontend/src/app/ui/dmp/clone-dialog/dmp-clone-dialog.component.html index 8b33f023b..840799134 100644 --- a/dmp-frontend/src/app/ui/dmp/clone-dialog/dmp-clone-dialog.component.html +++ b/dmp-frontend/src/app/ui/dmp/clone-dialog/dmp-clone-dialog.component.html @@ -23,7 +23,7 @@
{{'DMP-CLONE-DIALOG.FIELDS.DESCRIPTION-HINT' | translate}}
- +
diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html index 347d0430a..f24cf92c3 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html @@ -47,7 +47,7 @@
{{'DMP-EDITOR.FIELDS.DESCRIPTION' | translate}} *
- +
@@ -146,7 +146,7 @@
- +
@@ -216,7 +216,7 @@ - + diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts index 5194df77f..59ec2db22 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts @@ -40,6 +40,8 @@ import { DmpAccessType } from '@app/core/common/enum/dmp-access-type'; import { EnumUtils } from '@app/core/services/utilities/enum-utils.service'; import { UntypedFormArray, UntypedFormGroup } from '@angular/forms'; import { DescriptionTemplateService } from '@app/core/services/description-template/description-template.service'; +import { LockPersist } from '@app/core/model/lock/lock.model'; +import { LockTargetType } from '@app/core/common/enum/lock-target-type'; @Component({ selector: 'app-dmp-editor', @@ -126,7 +128,6 @@ export class DmpEditorComponent extends BaseEditor implemen this.lockStatus = lockStatus; if (this.item.status === DmpStatus.Finalized || lockStatus) { this.formGroup.disable(); - // this.viewOnly = true; } if (lockStatus) { this.dialog.open(PopupNotificationDialogComponent, { @@ -139,22 +140,16 @@ export class DmpEditorComponent extends BaseEditor implemen if (!lockStatus && !isNullOrUndefined(this.authService.currentAccountIsAuthenticated())) { // TODO: lock it. - // const lockedBy: UserInfoListingModel = { - // email: this.authService.getUserProfileEmail(), - // id: this.authService.userId()?.toString(), - // name: this.authService.getPrincipalName(), - // role: 0 //TODO - // //role: this.authService.getRoles()?.at(0) + // const lockPersist: LockPersist = { + // target: itemId, + // targetType: LockTargetType.Dmp, + // lockedBy: this.authService.userId() // } - // this.lock = new LockModel(data.id, lockedBy); - - // this.lockService.createOrUpdate(this.lock).pipe(takeUntil(this._destroyed)).subscribe(async result => { + // this.lockService.persist(lockPersist).pipe(takeUntil(this._destroyed)).subscribe(async result => { // this.lock.id = Guid.parse(result); // interval(this.configurationService.lockInterval).pipe(takeUntil(this._destroyed)).subscribe(() => this.pumpLock()); // }); } - // this.loadDescriptionProfiles(); - // this.registerFormListeners(); }); } }); diff --git a/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.html b/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.html index 5a16f71b9..385879fe2 100644 --- a/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.html +++ b/dmp-frontend/src/app/ui/dmp/new-version-dialog/dmp-new-version-dialog.component.html @@ -23,7 +23,7 @@
{{'DMP-NEW-VERSION-DIALOG.FIELDS.DESCRIPTION-HINT' | translate}}
- +
diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index e71d5dec5..5e5add88c 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -1042,7 +1042,8 @@ "TAGS-PLACEHOLDER": "New Tag...", "DESCRIPTION-HINT": "Briefly describe the context and purpose of the Description", "DESCRIPTION-TEMPLATE": "Template", - "DESCRIPTION-TEMPLATE-PLACEHOLDER": "Description Template" + "DESCRIPTION-TEMPLATE-PLACEHOLDER": "Description Template", + "DESCRIPTION-TEMPLATE-VERSION": "Version" } }, "ACTIONS": {