From c8d27f6b57db56ab4d14f2e5fc273838ab3f4cc9 Mon Sep 17 00:00:00 2001 From: Alex Martzios Date: Tue, 2 Aug 2022 16:49:09 +0300 Subject: [PATCH] update tooltip for research products in search --- searchPages/searchUtils/entitiesSelection.component.ts | 2 +- sharedComponents/input/input.component.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/searchPages/searchUtils/entitiesSelection.component.ts b/searchPages/searchUtils/entitiesSelection.component.ts index 6c021616..a6646cb5 100644 --- a/searchPages/searchUtils/entitiesSelection.component.ts +++ b/searchPages/searchUtils/entitiesSelection.component.ts @@ -78,7 +78,7 @@ export class EntitiesSelectionComponent { } if(showPage[this.simpleView ? this.properties.searchLinkToResults : this.properties.searchLinkToAdvancedResults] && (showEntity["publication"] || showEntity["dataset"] || showEntity["software"] || showEntity["orp"])) { - this.entities.push({label: OpenaireEntities.RESULTS, value: 'result', tooltip: OpenaireEntities.PUBLICATIONS+', '+OpenaireEntities.DATASETS+', '+OpenaireEntities.SOFTWARE+', '+OpenaireEntities.OTHER}); + this.entities.push({label: OpenaireEntities.RESULTS, value: 'result', tooltip: OpenaireEntities.RESULTS+' ('+OpenaireEntities.PUBLICATIONS+', '+OpenaireEntities.DATASETS+', '+OpenaireEntities.SOFTWARE+', '+OpenaireEntities.OTHER+')'}); } if(showPage[this.simpleView ? this.properties.searchLinkToProjects : this.properties.searchLinkToAdvancedProjects] && showEntity["project"]) { this.entities.push({label: OpenaireEntities.PROJECTS, value: 'project'}); diff --git a/sharedComponents/input/input.component.ts b/sharedComponents/input/input.component.ts index b9df9bb2..35560870 100644 --- a/sharedComponents/input/input.component.ts +++ b/sharedComponents/input/input.component.ts @@ -59,7 +59,7 @@ declare var UIkit;
+ [attr.uk-tooltip]="(tooltip && formControl.value && !focused && type !== 'chips' && type !== 'textarea')?('title: ' + getTooltip(formControl.value) + '; delay: 500; pos: bottom-left'):null"> @@ -497,6 +497,11 @@ export class InputComponent implements OnInit, OnDestroy, AfterViewInit, OnChang let option = this.optionsArray.find(option => HelperFunctions.equals(option.value, value)); return (option) ? option.label : (value); } + + getTooltip(value: any): string { + let option = this.optionsArray.find(option => HelperFunctions.equals(option.value, value)); + return (option) ? (option.tooltip ? option.tooltip : option.label) : (value); + } focus(value: boolean, event = null) { if (this.focused) {