From 91556cb6b6766480edeaea98d23472188ea354f0 Mon Sep 17 00:00:00 2001 From: amentis Date: Tue, 21 May 2024 11:22:33 +0300 Subject: [PATCH] dmp user field filter sections changes --- .../ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts | 1 + .../dmp/dmp-user-field/dmp-user-field.component.html | 10 ++++++++-- .../ui/dmp/dmp-user-field/dmp-user-field.component.ts | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts index 0a3236183..177329329 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts @@ -113,6 +113,7 @@ export class DmpEditorModel extends BaseEditorModel implements DmpPersist { // // rootPath: `descriptionTemplates[${index}].` // })), //context.getValidation('descriptionTemplates') // )) + if (disabled) descriptionTemplatesFormGroup.disable(); formGroup.addControl('descriptionTemplates', descriptionTemplatesFormGroup); return formGroup; diff --git a/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.html b/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.html index 5ac28db43..1906960bd 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.html +++ b/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.html @@ -67,15 +67,21 @@ {{'GENERAL.VALIDATION.REQUIRED' | translate}} -
+
{{'DMP-EDITOR.FIELDS.SECTIONS' | translate}} - + {{'DMP-EDITOR.FIELDS.ALL-SECTIONS' | translate}} {{ section.label }} + + {{'DMP-EDITOR.FIELDS.ALL-SECTIONS' | translate}} + + {{ section.label }} + + {{user.get('sectionId').getError('backendError').message}} {{'GENERAL.VALIDATION.REQUIRED' |translate}} diff --git a/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.ts index 6bd2e8126..50365d230 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-user-field/dmp-user-field.component.ts @@ -28,6 +28,7 @@ export class DmpUserFieldComponent extends BaseComponent implements OnInit { @Input() enableSorting: boolean = true; hoveredUser:number = -1; + hasTemplatesSections: DmpBlueprintDefinitionSection[] = null; dmpUserTypeEnum = DmpUserType; dmpUserTypeEnumValues = this.enumUtils.getEnumValues(DmpUserType); @@ -43,7 +44,7 @@ export class DmpUserFieldComponent extends BaseComponent implements OnInit { ) { super(); } ngOnInit() { - this.sections = this.sections?.filter(x => x.hasTemplates) || null; + this.hasTemplatesSections = this.sections?.filter(x => x.hasTemplates) || null; console.log('sorting mode: ', this.enableSorting); if(this.initializeUsers) { this.addUser();