From cf5acb2656390d4181c0ded88f5f3edac3487e84 Mon Sep 17 00:00:00 2001 From: Thomas Georgios Giannos Date: Wed, 13 Mar 2024 15:01:56 +0200 Subject: [PATCH] Annotation dialog ui update --- .../annotation-dialog.component.html | 8 +++---- .../annotation-dialog.component.scss | 4 ++-- .../annotation-dialog.component.ts | 5 +++++ .../form-field-set.component.ts | 3 ++- dmp-frontend/src/assets/i18n/en.json | 22 +++++++++++++++++++ 5 files changed, 35 insertions(+), 7 deletions(-) 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 babd1d0bb..27fe99d60 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 @@ -10,12 +10,12 @@
- + {{threadFormGroup.get('text').getError('backendError')?.message}} {{'COMMONS.VALIDATION.REQUIRED' | translate}} - + {{'ANNOTATION-DIALOG.THREADS.PROTECTION.TITLE' | translate}} {{enumUtils.toAnnotationProtectionTypeString(enumValue)}} @@ -44,8 +44,8 @@
{{thread.timeStamp | date:'EEEE, MMMM d, y, h:mm a'}}
-
{{getAnnotationProtectionType(thread)}}
-
{{getAnnotationProtectionType(thread)}}
+
{{getAnnotationProtectionType(thread)}}
+
{{getAnnotationProtectionType(thread)}}
{{thread.payload}}
{{'ANNOTATION-DIALOG.THREADS.FROM-USER' | translate}} {{thread.author.name}} diff --git a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.scss b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.scss index d59032e36..628a0b7e1 100644 --- a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.scss +++ b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.scss @@ -3,9 +3,9 @@ } .form-container { - width: 33rem; + width: 100%; min-height: 14rem; - padding: 0.28rem 0.34rem 0.875rem 0.625rem; + padding: 1rem; } .logo { diff --git a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts index e141ab47e..0ab4da412 100644 --- a/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts +++ b/dmp-frontend/src/app/ui/annotations/annotation-dialog-component/annotation-dialog.component.ts @@ -191,6 +191,11 @@ export class AnnotationDialogComponent extends BaseComponent { } + getAnnotationProtectionType(thread: Annotation): string { + return this.enumUtils.toAnnotationProtectionTypeString(thread.protectionType); + } + + cancel() { this.dialogRef.close(); } 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 68d735d1e..fff43d34b 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 @@ -125,7 +125,8 @@ export class DescriptionFormFieldSetComponent extends BaseComponent { // showAnnotations(fieldSetId: string) { const dialogRef = this.dialog.open(AnnotationDialogComponent, { - width: '528px', + width: '40rem', + maxWidth: '90vw', data: { entityId: this.descriptionId, anchor: fieldSetId, diff --git a/dmp-frontend/src/assets/i18n/en.json b/dmp-frontend/src/assets/i18n/en.json index fc544de4f..51d493277 100644 --- a/dmp-frontend/src/assets/i18n/en.json +++ b/dmp-frontend/src/assets/i18n/en.json @@ -202,6 +202,9 @@ "NO-DATA-TO-DISPLAY": "No data to display" }, "COMMONS": { + "VALIDATION": { + "REQUIRED": "Required" + }, "LISTING-COMPONENT": { "SEARCH-FILTER-BTN": "Filter Results", "CLEAR-ALL-FILTERS": "clear all filters", @@ -373,6 +376,21 @@ "NOTIFICATIONS":"Notifications", "PREFILLING-SOURCES":"Prefilling Sources" }, + "ANNOTATION-DIALOG": { + "TITLE": "Comments", + "THREADS": { + "NEW-THREAD": "New comment", + "FROM-USER": "From", + "SEND": "Send comment", + "PROTECTION": { + "TITLE": "Visibility" + } + }, + "PROTECTION": { + "ENTITY-ACCESSORS": "Visible", + "PRIVATE": "Hidden" + } + }, "DESCRIPTION-TEMPLATE-EDITOR": { "TITLE": { "NEW": "New API Client", @@ -2241,6 +2259,10 @@ "INTERNAL-SOURCE": "Not bind with source" }, "TYPES": { + "ANNOTATION-PROTECTION-TYPE": { + "PRIVATE": "Hidden", + "ENTITY-ACCESSORS": "Visible" + }, "APP-ROLE": { "ADMIN": "Admin", "USER": "User",