From e4516ef0ed2df0969f3d6c6daf6298399b1f942e Mon Sep 17 00:00:00 2001 From: Sofia Papacharalampous Date: Tue, 26 Mar 2024 10:34:51 +0200 Subject: [PATCH] dmp-editor ui *contacts > toggle drag_handler icon on hover --- .../dmp-editor.component.html | 12 ++++++------ .../dmp-editor-blueprint/dmp-editor.component.ts | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) 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 168caf60f..81556c080 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 @@ -164,12 +164,12 @@
-
-
- {{contactIndex + 1}} +
+
+ {{contactIndex + 1}} + drag_indicator
-
drag_indicator
-
+
{{enumUtils.toDmpContactTypeString(contactType)}} @@ -214,7 +214,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 e22e02a69..b3ba32856 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 @@ -80,6 +80,8 @@ export class DmpEditorComponent extends BaseEditor implemen permissionPerSection: Map; + hoveredContact: number = -1; + singleAutocompleteBlueprintConfiguration: SingleAutoCompleteConfiguration = { initialItems: (data?: any) => this.dmpBlueprintService.query(this.dmpBlueprintService.buildAutocompleteLookup(null, null, null, [DmpBlueprintStatus.Finalized])).pipe(map(x => x.items)), filterFn: (searchQuery: string, data?: any) => this.dmpBlueprintService.query(this.dmpBlueprintService.buildAutocompleteLookup(searchQuery, null, null, [DmpBlueprintStatus.Finalized])).pipe(map(x => x.items)), @@ -353,6 +355,19 @@ export class DmpEditorComponent extends BaseEditor implemen // Contacts // // + + isContactSelected(contactId: number): boolean { + return this.hoveredContact === contactId; + } + + onContactHover(contactIndex: number): void { + this.hoveredContact = contactIndex; + } + + clearHoveredContact(): void { + this.hoveredContact = -1; + } + addContact(): void { const contactArray = this.formGroup.get('properties').get('contacts') as FormArray; (this.formGroup.get('properties').get('contacts') as FormArray).push(this.editorModel.createChildContact(contactArray.length));