From bd5a080ac9037b9f82f7d3548440dbd3d4dfdcc4 Mon Sep 17 00:00:00 2001 From: FaizanMohammed326 Date: Wed, 2 Aug 2023 15:15:10 +0530 Subject: [PATCH] tooltip fixes --- src/app/core/services/wrapper.service.ts | 7 +++++-- .../buttons/download-button/download-button.component.ts | 3 ++- .../components/maps/leaflet-map/leaflet-map.component.scss | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/app/core/services/wrapper.service.ts b/src/app/core/services/wrapper.service.ts index 8b475376..33e00d27 100644 --- a/src/app/core/services/wrapper.service.ts +++ b/src/app/core/services/wrapper.service.ts @@ -198,7 +198,7 @@ export class WrapperService { }); selectedMetricValue.forEach((axis: any) => { if(axis?.value) { - tooltip.push(axis.name + ': ' + (isNaN(row[axis.axis]) ? row[axis.axis] : Number(row[axis.axis])).toLocaleString() + valueSuffix) + tooltip.push(axis.value + ': ' + (isNaN(row[axis.axis]) ? row[axis.axis] : Number(row[axis.axis])).toLocaleString() + valueSuffix) } }) return tooltip @@ -208,7 +208,10 @@ export class WrapperService { if (row[metric.value] !== undefined && row[metric.value] !== null) { const value = isNaN(row[metric.value]) ? row[metric.value] : Number(row[metric.value]); const formattedValue = value.toLocaleString(); - + if(metric.valuePrefix.indexOf('_') > -1) { + // console.log(metric.valuePrefix.split(/[_|\s]/)) + metric.valuePrefix = metric.valuePrefix.split('_').map(word => word[0]?.toUpperCase() + word?.substring(1).toLowerCase()).join(' ') + } if (metric.value === selectedMetricValue) { tooltip += '' + metric.valuePrefix.replace(/\n/g, '
') + formattedValue + metric.valueSuffix.replace(/\n/g, '
') + '
'; } else { diff --git a/src/app/shared/components/buttons/download-button/download-button.component.ts b/src/app/shared/components/buttons/download-button/download-button.component.ts index 012b3fb3..7ed96136 100644 --- a/src/app/shared/components/buttons/download-button/download-button.component.ts +++ b/src/app/shared/components/buttons/download-button/download-button.component.ts @@ -154,7 +154,8 @@ export class DownloadButtonComponent implements OnInit { if (this.isVisible) { return; } - this.isVisible = true; + // this.isVisible = true; + alert('No data available to download') setTimeout(() => this.isVisible = false, 2500) } else { for (let i = 0; i < reportInputs.length; i++) { diff --git a/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss b/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss index 96067908..b6aeaa8a 100644 --- a/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss +++ b/src/app/shared/components/maps/leaflet-map/leaflet-map.component.scss @@ -13,8 +13,8 @@ // } ::ng-deep { .leaflet-popup { - word-break: break-all; - // min-width: fit-content !important; + // word-break: break-all; + word-wrap: break-word; } .leaflet-notification {