update tooltip for research products in search

This commit is contained in:
Alex Martzios 2022-08-02 16:49:09 +03:00
parent 3f7a9dda90
commit c8d27f6b57
2 changed files with 7 additions and 2 deletions

View File

@ -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'});

View File

@ -59,7 +59,7 @@ declare var UIkit;
<label>{{placeholderInfo.label}} <sup *ngIf="required">*</sup></label>
</div>
<div class="uk-flex" [class.uk-flex-middle]="type !== 'textarea'"
[attr.uk-tooltip]="(tooltip && formControl.value && !focused && type !== 'chips' && type !== 'textarea')?('title: ' + getLabel(formControl.value) + '; delay: 500; pos: bottom-left'):null">
[attr.uk-tooltip]="(tooltip && formControl.value && !focused && type !== 'chips' && type !== 'textarea')?('title: ' + getTooltip(formControl.value) + '; delay: 500; pos: bottom-left'):null">
<ng-template [ngIf]="type === 'text' || type === 'URL' || type === 'logoURL'">
<input #input class="input" [attr.placeholder]="placeholderInfo?.static?placeholderInfo.label:hint"
[formControl]="formAsControl" [class.uk-text-truncate]="!focused">
@ -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) {