From 296358935954c71466369aa72d4c9703296516e4 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Mon, 8 May 2023 16:41:42 +0300 Subject: [PATCH] [Library | explore-redesign]: availableOn.component.ts & resultLanding.component & result-preview.component: [Bug fix] Added method "getAccessLabel()" to create label from accessRight. --- landingPages/landing-utils/availableOn.component.ts | 11 +++++++++-- landingPages/result/resultLanding.component.html | 2 +- landingPages/result/resultLanding.component.ts | 7 +++++++ utils/result-preview/result-preview.component.html | 2 +- utils/result-preview/result-preview.component.ts | 7 +++++++ 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/landingPages/landing-utils/availableOn.component.ts b/landingPages/landing-utils/availableOn.component.ts index 186e5ace..abcea652 100644 --- a/landingPages/landing-utils/availableOn.component.ts +++ b/landingPages/landing-utils/availableOn.component.ts @@ -13,7 +13,7 @@ declare var UIkit;
+ uk-tooltip [title]="getAccessLabel(availableOn[0].accessRight)"> @@ -52,7 +52,7 @@ declare var UIkit;
+ uk-tooltip [title]="getAccessLabel(instance.accessRight)">
@@ -130,4 +130,11 @@ export class AvailableOnComponent { this.availableListFsModal.okButton = false; this.availableListFsModal.open(); } + + public getAccessLabel(accessRight) : string { + if(accessRight) { + return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access")); + } + return "Not available access"; + } } diff --git a/landingPages/result/resultLanding.component.html b/landingPages/result/resultLanding.component.html index cb7e2e7b..07f1535b 100644 --- a/landingPages/result/resultLanding.component.html +++ b/landingPages/result/resultLanding.component.html @@ -490,7 +490,7 @@ class="uk-margin-small-bottom uk-flex uk-flex-middle" [ngClass]="(resultLandingInfo.hostedBy_collectedFrom[0].accessRightIcon == 'open_access' ? 'open-access' : 'closed-access')"> - {{(resultLandingInfo.hostedBy_collectedFrom[0].accessRight ? resultLandingInfo.hostedBy_collectedFrom[0].accessRight : 'Not available') + ' access'}} + {{getAccessLabel(resultLandingInfo.hostedBy_collectedFrom[0].accessRight)}}
+ uk-tooltip [title]="getAccessLabel(result.hostedBy_collectedFrom[0].accessRight)">
diff --git a/utils/result-preview/result-preview.component.ts b/utils/result-preview/result-preview.component.ts index d6a88335..6e253824 100644 --- a/utils/result-preview/result-preview.component.ts +++ b/utils/result-preview/result-preview.component.ts @@ -219,4 +219,11 @@ export class ResultPreviewComponent implements OnInit, OnChanges { let formatted = NumberUtils.roundNumber(+num); return formatted.number + formatted.size; } + + public getAccessLabel(accessRight) : string { + if(accessRight) { + return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access")); + } + return "Not available access"; + } }