[Library | develop]: result-preview.component.ts: Added method "isNumber()" | resultLanding.component.html: [Bug fix] Updated view of bip indicators - format the numbers correctly.

This commit is contained in:
Konstantina Galouni 2023-09-19 16:48:08 +03:00
parent 46a8928a20
commit bc514b62d1
2 changed files with 9 additions and 3 deletions

View File

@ -214,7 +214,8 @@
<a class="uk-flex uk-flex-middle uk-link-reset"> <a class="uk-flex uk-flex-middle uk-link-reset">
<icon customClass="bip-icon-hover" [flex]="true" [ratio]="0.7" <icon customClass="bip-icon-hover" [flex]="true" [ratio]="0.7"
[name]="result.measure.bip[0].icon"></icon> [name]="result.measure.bip[0].icon"></icon>
<span class="uk-margin-xsmall-left">{{result.measure.bip[0].value}}</span> <span *ngIf="isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{formatNumber(result.measure.bip[0].value)}}</span>
<span *ngIf="!isNumber(result.measure.bip[0].value)" class="uk-margin-xsmall-left">{{result.measure.bip[0].value}}</span>
</a> </a>
<div uk-drop="pos: top-right" class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small"> <div uk-drop="pos: top-right" class="uk-card uk-card-default uk-border uk-box-no-shadow uk-padding-small">
<table> <table>
@ -223,7 +224,8 @@
<icon [flex]="true" [ratio]="0.7" [name]="metric.icon"></icon> <icon [flex]="true" [ratio]="0.7" [name]="metric.icon"></icon>
</td> </td>
<td class="uk-text-capitalize">{{metric.name}}</td> <td class="uk-text-capitalize">{{metric.name}}</td>
<td class="uk-text-bolder">{{metric.value}}</td> <td *ngIf="isNumber(metric.value)" class="uk-text-bolder">{{metric.value | number}}</td>
<td *ngIf="!isNumber(metric.value)"class="uk-text-bolder">{{metric.value}}</td>
</tr> </tr>
</table> </table>
<div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center"> <div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center">
@ -252,7 +254,7 @@
<div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center"> <div class="uk-margin-top uk-flex uk-flex-middle uk-flex-center">
<span class="uk-text-uppercase">Powered by </span> <span class="uk-text-uppercase">Powered by </span>
<img class="uk-margin-xsmall-left" width="15" src="assets/common-assets/logo-small-usage-counts.png" <img class="uk-margin-xsmall-left" width="15" src="assets/common-assets/logo-small-usage-counts.png"
loading="lazy" alt="BIP!"> loading="lazy" alt="Usage counts">
</div> </div>
</div> </div>
</ng-container> </ng-container>

View File

@ -223,6 +223,10 @@ export class ResultPreviewComponent implements OnInit, OnChanges {
return formatted.number + formatted.size; return formatted.number + formatted.size;
} }
public isNumber(value): boolean {
return typeof value === 'number';
}
public getAccessLabel(accessRight) : string { public getAccessLabel(accessRight) : string {
if(accessRight) { if(accessRight) {
return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access")); return (accessRight + (accessRight.toLowerCase().endsWith(" access") ? "" : " access"));